Flex.org - The Directory for Flex
My Amazon.com Wish List

Importing a SWF into Flex with AS3

Posted by Hilary Bridel on July 4th, 2006

My previous post on this subject mentioned the ability to manipulate imported V8 SWF files via localConnection. I tried the solution mentioned, but I was unable to get it working. For some reason the localConnection would produce an error whenever an atempt was made to interact with the imported SWF.

Fortunatly, Adobe have released  Flash Professional 9 ActionScript 3.0 Preview which allows you to author Actionscript 3 code within the Flash IDE and export as a V9 SWF.

So, I imported my V8 SWF into the Flash 9 alpha IDE, and exported it as a V9 SWF. In Flex 2 I initialy used flash.display.Loader to import the SWF, but I was having a few issues referencing the imported SWF. I then found SWFLoader, which is a better solution for what I required. Why Doesn’t the Class documentation mention SWFLoader in the Loader section?

Anyway, after finding SWFLoader, it was a pretty easy task to import and manipulate the SWF. You can see an example here, and also download the source code from here.

Š


Parse error: parse error, unexpected $end in D:\hshome\bridelor\bridel.org\blog\wp-content\themes\wp-andreas09\comments.php on line 273