Apache Flex 4.10 Released!

Today the Apache Flex Team has released the latest version to the Flex SDK, we are now at version 4.10.0!

Apache Flex 4.10.0 highlights include:

    • Support for latest versions of Flash Player and AIR runtimes. At the same time, we have made it easier for developers wanting to take advantage of the latest advances in the Flash runtimes by letting them choose the versions during installation. The Apache Flex SDK Installer now allows developers to select various combinations of the Flex SDK, Flash Player and AIR runtimes. All the settings and configurations are taken care of during the installation, so the developer can just start coding!
    • Improved support for older Flash Player versions. Enterprise environments have more stringent requirement in terms of upgrading Flash Player versions. Now, because of our improved backwards compatibility, those customers can safely upgrade to the latest version of the Flex SDK without having to force a Flash Player upgrade on their end users.
    • The new spark components ensure that SDK users can build functionalities quickly and in a more performant way. The need for handling these components in two different architecture styles (mx vs. spark) will be eliminated.
    • “Out of the box” support for Advanced Telemetry allowing developers to easily profile their application and improve performance using Adobe Scout.
    • Better localization for multiple languages. Flex 4.10.0 is better now when trying to make application for multiple countries and languages.
    • Better international support for dates in formatters, validators, and the DateField and DateChooser components.
    • Better for developer productivity – less Run Time Errors (RTEs) and workarounds required in 4.10.0
    • 480 dpi mobile resolution/skin support means that Flex SDK users can now target high resolution devices such as iOS Retina, etc.

Wrong wmode value in Starling

A common issue that occurs when you have not set the wmode attribute in the HTML page is the following message “This application is not correctly embedded (wrong wmode value)”.

The solution is very simple. Set the wmode attribute in the HTML to “direct”. I have included my HTML code below as an example. I have embedded the swf using the swfobject. In the Starling framework in order for Stage 3D and GPU acceleration to work the wmode must to be set to direct. If it is not set to direct you may get a runtime exception when you compile the swf. You will most likely get the Error 3707: Context3D not available.

<!DOCTYPE HTML>
<head>

 <title>Wrong wmode value in Starling</title>

 <script src="swfobject.js"></script> 

 <script>

  var flashvars ={};
  var params = {};
  var attributes = { wmode:"direct" };

  swfobject.embedSWF("main.swf", "flashContent", "550", "400", "11", false, flashvars, params, attributes);

 </script> 

</head> 

<body> 
 <div id="flashContent"></div>
</body> 

</html>

swf versions

Flash -swf-version meaning

It’s getting more and more versions! We can’t remember them all, so here we go!

SWF Version

Compiler Option Flash Player Version AIR version
-swf-version=9 9.0.115.0 N/A
-swf-version=10 10.0, 10.1 1.5, 2.0
-swf-version=11 10.2 2.6
-swf-version=12 10.3 2.7
-swf-version=13 11.0 3
-swf-version=14 11.1 3.1
-swf-version=15 11.2 3.2
-swf-version=16 11.3 3.3
-swf-version=17 11.4 3.4
-swf-version=18 11.5 3.5
-swf-version=19 11.6 3.6
-swf-version=20 11.7 3.7
-swf-version=21 11.8 3.8

 

AIR SDK Path

  • MacOS : /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.348297/AIRSDK

Features

Release notes

Download Flash Player

Download AIR

Labs

Document

Shake your MovieClip

[kml_flashembed publishmethod=”static” fversion=”8.0.0″ movie=”http://johnbarrett.net/wp-content/uploads/2013/03/shake.swf” width=”400″ height=”300″ targetclass=”flashmovie”]

Get Adobe Flash player

[/kml_flashembed]A friends had ask me how did I shake a MovieClip. I told him I would show me.

First step make a MovieClip, mine is an orange square, with a instance name of mcOrangeBox

Then open the actions panel

import flash.display.MovieClip;
import flash.geom.Point;

function shake(mc:MovieClip, frames:int = 10, maxShakeAmount:int = 30) : void {
    if (!mc._shakeTime || mc._shakeTime <= 0) {
        mc.startPosition = new Point(mc.x, mc.y);
        mc._shakeTime = frames;
		mc._maxShakeAmount = maxShakeAmount;
        mc.addEventListener(Event.ENTER_FRAME, handleShakeEnterFrame);
    }
    else {
        mc.startPosition = new Point(mc.x, mc.y);
        mc._shakeTime += frames;
		mc._maxShakeAmount = maxShakeAmount;
    }
}

function handleShakeEnterFrame(event:Event):void {
    var mc:MovieClip = MovieClip(event.currentTarget);
	var shakeAmount:Number = Math.min(mc._maxShakeAmount, mc._shakeTime);
    mc.x = mc.startPosition.x + (-shakeAmount / 2 + Math.random() * shakeAmount);
    mc.y = mc.startPosition.y + (-shakeAmount / 2 + Math.random() * shakeAmount);

    mc._shakeTime--;

    if (mc._shakeTime <= 0) {
        mc._shakeTime = 0;
        mc.removeEventListener(Event.ENTER_FRAME, handleShakeEnterFrame);
    }
}

this should be the top “actions(functions)” on the time line. Now make another actions on the timeline. Now to use this code is very easy, and could be turned into a Document class.

this.shake(mcOrangeBox, 100, 15);

3D Platform

This is for a game that I am doing, it is based in Away 3D, to use it use the arrow keys and take the platform for a spin 😉

[kml_flashembed publishmethod=”static” fversion=”10.0.0″ movie=”http://johnbarrett.net/wp-content/uploads/2013/01/AStar3D1.swf” width=”500″ height=”500″ targetclass=”flashmovie”]

Compare 2 arrays with AS 3

The following function compares the values ​​of two arrays and returns another array with different values​​.

private function checkArrays(array1:Array,array2:Array):Array {
    var array3:Array=new Array();
    var length1:int=array1.length;
    var none:Boolean=false;

    for(var i:int=0;i < length1;i++) {
        var length2:int=array2.length;

        for(var j:int=0;j < length2;j++) {
            if(String(array1[i])==String(array2[j])) {
                none=false;
                break;
            }
            else {
                none=true;
            }
        }
        if(none) {
            array3.push(array1[i])
            none=false;
        }
    }
    return array3;
}


AS3 Drawing Pad Awesomeness

This is another project that I’ve been putting off. It really should have some kind of bitmap merging/drawing going on to allow for a greater number of shapes, but I think it would work just fine for anything a guest would want to spend time on. Just don’t try to recreate the Sistine Chapel ceiling and you’ll be fine 🙂

[kml_flashembed publishmethod=”static” fversion=”8.0.0″ movie=”http://johnbarrett.net/wp-content/uploads/2013/01/DrawingPad.swf” width=”400″ height=”300″ targetclass=”flashmovie”]

Get Adobe Flash player

[/kml_flashembed]

Demand for Flash Developers is way up!

Reading on the Wall Street Journal’s website, it seems like the trend for flash developers & Engineers is way up!

according to the article:

[box] At the same time, the supply of such engineers remains low. It is particularly difficult to find Flash engineers who have both an artistic and computer-science background, say executives.[/box]

Therefore, there are more jobs than flash developers to fill them, so employeers are having troubles finding qualified flash developers to fill their positions! This is great news if you are a flash developer!

read the original post  on WSJ