Targeting Flash Player 11 & AIR 3 Release Candidates in Flash Professional CS5.5

作者: nick 分类: as, flash 发布时间: 2011-09-27 01:59 ė 6没有评论
Post image of Targeting Flash Player 11 & AIR 3 Release Candidates in Flash Professional CS5.5
This post was written before Adobe made the announcement that the Flash Player 11 and AIR 3.0 runtime will be available next month.Although all of my projects are coded in FDT4 I still use Flash Professional on a regular basis that because a great part of those projects have complex timeline animations usually made by the animation artist working in the project so my workflow usually involves the Flash IDE for exporting the final swf, here is a guide on how to set up Your copy of Adobe Flash Professional CS5.5 to target the Flash Player 11 and AIR 3.0 Release Candidates, let’s get started:

Targeting Adobe Flash Player 11 Release Candidate for Desktops.

1.- Download the Flash Player 11 Release Candidate.
First things first go to the Adobe Labs site and download the Adobe Flash Player 11 Release Candidate for Desktops. Download the proper player for Your system ( Is important that You download and install the runtime on Your browser otherwise you won’t be able to test your SWFs as there is no Standalone RC1 version). You need to download the Flash Player 11 Release Candidate Global SWC “playerglobal.swc” as well.

2.- Once You installed Flash Player in the browser and renamed the swc file from flashplayer11_rc1_playerglobal_090611 to “playerglobal.swc” go to “/Applications/Adobe Flash CS5.5/Common/Configuration/ActionScript 3.0″ and create a new folder i named mine FP11_RC1 and copy your playerglobal.swc file inside the folder you just created.

3.- Now You need a new player profile so You can choose the Flash Player 11 RC1 from the available player versions when working with Flash, go to “ /Applications/Adobe Flash CS5.5/Common/Configuration/Players/”  duplicate the FlashPlayer10_2 2.xml and give it a new name to the file You just copy I named mine FlashPlayer11_RC1.xml.

4.- Open that file in a text editor and change the id and version in the player tag for id give it the name You wish to be displayed in the Player panel inside of Flash I named mine “FlashPlayer11_RC1″ and change the version to “13″.

1
2
3
<player id="FlashPlayer11_RC1" version="13" asversion="3">
<name>Flash Player 11_RC1</name>
</player>

5.- In the same file change the path tag so it points to the folder You just created:

1
2
<playerdefinitionpath as2="$(UserConfig)/Classes/FP10;$(UserConfig)/Classes/FP9;$(UserConfig)/Classes/FP8;$(UserConfig)/Classes/FP7" as3="$(AppConfig)/ActionScript 3.0/FP11_RC1/playerglobal.swc">
</playerdefinitionpath>

6.- Save the file open Flash CS5.5 and You’re good to go.

*Note* Remember that there’s no Standalone for Flash Player 11 RC1 so when You test your project in Flash ht command + F12 in order to publish to browser (Where You should have the Flash Player 11 RC1 plugin installed by now.

Targeting Adobe AIR 3 Release Candidate.

1.- Download the AIR 3.0 Release Candidate.
First thing You need is the Adobe AIR 3 SDK Release Candidate.

2.- Unzip Your AIR SDK if You’re on Mac the file will be named ” air3_rc1_sdk_mac_090611.tbz2″

3.- Close Flash Professional CS5.5 and browse o the AIR 2.6 folder, on Mac it will be in the following location
“/Applications/Adobe Flash CS5.5”

4.- Change the AIR2.6 folder name to something like AIR2.6_old.

5.- Rename the folder You previously unzipped to AIR2.6 and place it on the Flash Professional CS5.5 folder “/Applications/Adobe Flash CS5.5”.

6.- Browse to the AIR2.6/frameworks/libs/air/ folder and copy the airglobal.swc.

7.- Paste the SWC file in the folder “/Applications/Adobe Flash CS5.5/Common/Configuration/ActionScript 3.0/AIR2.6” it wil replace your copy of  the airglobal.swf file.

8.- Browse to the “/Applications/Adobe Flash CS5.5/Common/Configuration/Players” folder and open the following files with a text editor:  AdobeAIR2_6.xml, AiriPhone.xml, or Android.xml.

9.- Change the version attribute in the player tag from 11 to 13 and save the files:

On the Android xml file:

1
<player id="android_0" version="13" asversion="3" minasversion="3"></player>

On the AiriPhone xml file:

1
<player id="PFI1_0" version="13" asversion="3" minasversion="3"></player>

On the AdobeAIR2_6 xml file:

1
<player id="AdobeAIR2_6" version="13" asversion="3" minasversion="3"></player>

10.- Browse to the “/Applications/Adobe Flash CS5.5/AIR2.6/samples/” and open the descriptor-sample.xml file.

11.- Change the “http://ns.adobe.com/air/application/2.6” namespace URL to “http://ns.adobe.com/air/application/3.0”.

1
<application xmlns="http://ns.adobe.com/air/application/3.0" minimumpatchlevel="0"></application>

12.- Save the file and open Flash.

Testing time:

In order to see that You’re targeting the RC1 versions of the Flash PLayer 11 and AIR 3.0 here are 2 quick tests:

To test Flash Player 11:
1.- Open the Flash IDE go to File > New > ActionScript 3.0 to create a new flash document in the Player section of the Properties panel select the “Flash Player 11_RC1” as your player version.

2.- With the first frame selected go to Window > Actions to open the ActionScript panel and write the following.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import flash.display.Stage3D;
var stage3d = new Stage3D();
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFF0000;
my_fmt.size = 32;
my_fmt.bold = true;
my_fmt.font  = "Arial";
var textF: TextField = new TextField;
textF.defaultTextFormat = my_fmt;
textF.autoSize = TextFieldAutoSize.LEFT;
textF.text = "Hello Flash Player: " + Capabilities.version + "\n" + stage3d;
addChild(textF);

Here we are importing one of the classes only available to FP11 “Stage3D” and creating a text field to display the version of Flash Player installed in our browser.

3.- Hit Command + F12 to publish to browser if we did everything ok You should see your swf displaying the player version and the Stage3D object.

To test AIR 3.0:

1.- Open the Flash IDE go to File > New > AIR to create a new flash for AIR document in the Player section of the Properties panel select the “AIR 2.6” as your player version.

2.- With the first frame selected go to Window > Actions to open the ActionScript panel and write the following.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import flash.display.Stage3D;
import flash.desktop.NativeApplication;
import flash.text.TextField;
function air3_test(){
var stage3d = new Stage3D();
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFF0000;
my_fmt.size = 32;
my_fmt.bold = true;
my_fmt.font  = "Arial";
var textF: TextField = new TextField;
textF.defaultTextFormat = my_fmt;
textF.autoSize = TextFieldAutoSize.LEFT;
textF.text = "Hello AIR Version No. " + NativeApplication.nativeApplication.runtimeVersion +"\n" + stage3d;
addChild(textF);
trace ( "+ Flash CS5.5.air3_test() - args: " + [stage3d,"AIR Version: " + NativeApplication.nativeApplication.runtimeVersion ] );
}
air3_test();

Here we are importing one of the classes only available to FP11 “Stage3D” and creating a text field to display the version of Flash Player using the “NativeApplication” class.

3.- Go to Debug > Debug Movie > in AIR Debug Launcher(Desktop) to publish our file if we did everything ok You should see your swf displaying the AIR version and the Stage3D object.

And that’s it, thanks for reading and Happy Flashing.

本文出自 传播、沟通、分享,转载时请注明出处及相应链接。

本文永久链接: https://www.nickdd.cn/?p=1750

发表评论

您的电子邮箱地址不会被公开。

Ɣ回顶部