Accessing Flash Player 10.1 from Flash CS4/5
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:
import flash.ui.Multitouch;
if (Multitouch.supportsTouchEvents) |
**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!
Tags: Flash, Flash Player, FP 10.1

anyone got it working??
@pd
Hey PD. This should work. Make sure you have Flash 10.1 installed in you browser and test there. There is no 10.1 standalone (integrated in Flash IDE) so you should be able to just publish then open in your browser of choice.
Check out the following link for API definitions and usages: http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/ui/Multitouch.html
Best of luck to you.
Hi Antony,
Thanks for the reply.
I have tried exactly the same way you described.Replaced the old swc with newer versions and published it ,opened in the browser.
But came up with the error
ReferenceError: Error #1065: Variable flash.ui::Multitouch is not defined.
at test.com::first$cinit()
at global$init()
Could you zip up the files which could work with CS4 and upload that would be really gr8 and helpful.
Thanks alot
pd.
pd,
You can find working example here.
and the zip here.
Those should work for you. If you have any more questions, feel free to ask.
Hi Antony,
Thanks for the reply.Got it working .
Now I want to access these new Multitouch apis from flex sdk 4.Can anyone tell me how to do this using mxmlc compiler from command line.
I am getting the following error.
Error: Access of undefined property Multitouch
Thanks
pd
You are getting this error due to the same fact that Flash Builder, like CS4, does not have a 10.1 standalone player. There are a couple alternatives.
1. Publish your swf inside an HTML and test in Browser ( like from CS4)
or 2. Compile to an AIR application. Just be sure you have the AIR 2 beta sdk and runtime installed.
Cheers,
Antonio
Hey Antonio,
Thanks for the info, but I am unable to get the test to work. I go to the Adobe site to see what version I have installed, and it says \"You have version 10,1,51,95 installed\"
But when I go to your working example, I am still seeing !gestureEvents and !touchEvents.
I am on a Mac. Is that the issue?
Sounds like you got this working just fine. Multitouch (TouchEvents, TransformGestureEvents) and GestureEvents do not currently work in browser on MACs. See http://www.adobe.com/devnet/flash/articles/multitouch_gestures_03.html and read the comments by JeanPhillipe.
But you can use AIR2.0 beta to access this functionality on the MAC : http://labs.adobe.com/technologies/air2/
Over the last couple of years, Flash has gained a strong foothold in the online video industry. One of the greatest appeals of Flash is that it is compatible across all platforms. All you have to do is install a simple plugin, which usually comes with most browsers anyways. And now, with video becoming so prevalent on the web, the Flash Video format (FLV) is becoming the preferred format. Websites like YouTube.com are now using the FLV format for their videos, because with FLV files, you don’t have the same compatibility issues that you might encounter with AVI, MPEG, or MOV files.
I have Mac OS X 10.5.8 on MBP, 10.1 flash player, changed the swc file. I read on Adobe DevCon that Gesures should work from 10.5.3 with multitouch trackpad. I created a test swf like this, but it writes: !GestureEvents, !TocuhEvents? Do you have any idea why?
i have the brand new 10.1 stand alone version of the final release of 10.1 that was released yesterday. i’ve updated my Flash Players in both Flash /Applications/Adobe Flash CS4/Players and /Applications/Adobe Flash CS4/Players/Debug. i have replaced the playerglobal.swc in the ~/FP10/ folder, restarted Flash, restarted my Mac and i still can not get this to work.
both Chrome with it’s integrated Flash Player 10.1 that was also updated and Safari with the new 10.1 plugin both display !gestureEvents !touchEvents. when launched from with test movie i receive this error: ReferenceError: Error #1065: Variable flash.ui::Multitouch is not defined.
I can’t even get !gestureEvents !touchEvents to show up, even after downloading the “working” .zip file. I have also installed the 10.1 stand alone player. I get the same error: ReferenceError: Error #1065: Variable flash.ui::Multitouch is not defined. I also get: VerifyError: Error #1079: Native methods are not allowed in loaded code.
@TheDarkIn and @cr0ybot,
It seems as though there is some kind of error when using Test Movie. I too am getting the same 1065 error. On the other hand, if you run Debug Movie (shift+cmd(cntrl)+enter) then you do not get the 1065. I will look into this further and if I find any info, I will be sure to update this post.
@e,
Even within the stand alone Flash Player, Gestures and Multitouch will not be read as FP alone (or in the browser) does not have access to the low level api on the MBPs. AIR 2.0, on the other hand, is able to pass Gestures to its wrapped FP.