Accessing Flash Player 10.1 from Flash CS4/5

January 15th, 2010

Update 06/30/10: Some links have been updated and some changes have been made to the installation steps. The same installation work for CS5 as well. Just replace CS4 with CS5 and you’re good.

Flash Player 10.1 beta has been out for a little while, but Adobe doesn’t have any information on how to use the API in Flash CS4. They have instructions for Flash/Flex Builder. In fact, even Lee Brimelow had to ask how to use it from the Flash CS4 IDE. So here is how to get it running.

1. Be sure to fully quit out of Flash.

2. Download and install the player plugin for browsers. Also download the StandAlone players and place them here:
Mac: /Applications/Adobe Flash CS4/Players
PC: C:\Program Files\Adobe\Adobe Flash CS4\Players

3. Scroll to the bottom of the download page, you will need to also download and unzip the Player Global SWC.
**The Player Global SWC is no longer available as a direct download (although it should be). You will need to download the Flex 4.1 SDK. Once you do, unzip the package and browse to: flex_sdk_4.1/frameworks/libs/player/10.1/. Copy the playerglobal.swc.

4. Back up the FP 10 playerglobal.swc and replace it with the new 10.1 version.
You can find it here on Mac: /Applications/Adobe Flash CS4/Common/Configuration/ActionScript 3.0/FP10
And here on PC: C:\Program Files\Adobe\Adobe Flash CS4\Common\Configuration\ActionScript 3.0\FP10

Now let’s make sure it works.

1. Start Flash CS4 and create a new AS3 .fla.

2. Create 2 new Dynamic text fields, and give them instance names of text1 and text2.

3. We need some code. A topic of discussion lately has been Multitouch, and since the multitouch API is FP 10.1 specific, let’s use that. Open the Actions panel (opt+)F9 and copy/paste the following code:

<span style="color: #7f0055;"> </span><span style="color: #7f0055;"><strong>import </strong></span><span style="color: #000000;">flash.ui.Multitouch;</span>
<span style="color: #7f0055;"><strong>

if (Multitouch.supportsGestureEvents)
text1.text =“gestureEvents work”;
} else {
text1.text = “!gestureEvents”;

if (Multitouch.supportsTouchEvents)
text2.text = “touchEvents work”;
} else {
text2.text = “!touchEvents”;

**Previously I had extraneous code. It has now been removed.

Test Movie will throw errors because CS4 doesn’t have a standalone version of FP 10.1 (there isn’t one publicly available yet), well, because the IDE has issues. But you installed FP 10.1 earlier can use Debug Movie (cmd(cntrl)+shift+enter) to test. Or you can Publish and Run (cmd/cntrl+F12) in the Browser. Text1 and 2 should report back if GestureEvents and TouchEvents work on your computer.

Check Christian Cantrell‘s Adobe Dev Center post about Multitouch if you are unsure if your system supports it.

Have Fun!

Leave a Reply

Security Code: