Targeting Flash Player 11 & AIR3 for Flash Builder 4.5

Step-by-step for overlaying AIR3 into Flex 4.5.1, and targeting FP11. Unfortunately it’s a little bit complicated at the moment. So here’s what I’ve learnt.

1. First download these:

Adobe AIR3 SDK

PlayerGlobal.swc

 

2. In finder go to “Mac HD > Applications > Adobe Flash Builder 4.5 > sdks” and duplicate “4.5.1”, rename it to “4.5.1-FP11” or something.

3. Create a folder 4.5.1-FP11/frameworks/libs/player/11.0/ and paste the downloaded playerglobal.swc inside (make sure you rename it to playerglobal.swc)

4. Place the Adobe AIR3 sdk .tbz2 file in the root of the sdk: “4.5.1-FP11/air3.tbz2”.

5. Mac OS: In Terminal, cd to the root directory of the new “4.5.1-FP11” and run this command:

1
tar jxvf air3X.tbz2

6. Run Flashbuilder.

7. Create a new ActionScript project, then click “configure flex sdks…” then add your new one targeting FP11.

8. Create a new project, then edit html-template/index.template and add this after line 48:

1
params.wmode ='direct';

9. Right-click on your project in FB navigate to “Properties > ActionScript Compiler”, then add the following compiler argument:

1
-swf-version=13

 

You should be good to go!

 

 

Other resources:
http://kb2.adobe.com/cps/495/cpsid_49532.html

 

Posted in AS3

functionToString: Return function name as String in AS3

As simple as this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import flash.utils.describeType;

function functionToString(target:*, f:Function):String
{
  var functionName:String = "error!";
  var type:XML = describeType(target)
  for each (var node:XML in type..method) {
    if (target[node.@name] == f) {
      functionName = node.@name;
      break;
    }
  }
 
  return functionName;
}


function foo():void {
}

function bar():void {
}

trace(functionToString(this, foo)); // returns "foo"
trace(functionToString(this, bar)); // returns "bar"
Posted in AS3