Advertisement
Guest User

AS2 Swfloader

a guest
May 7th, 2012
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
  3.                        xmlns:s="library://ns.adobe.com/flex/spark"
  4.                        xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="windowedapplication1_creationCompleteHandler(event)">
  5.     <fx:Declarations>
  6.         <!-- Place non-visual elements (e.g., services, value objects) here -->
  7.     </fx:Declarations>
  8.    
  9.     <fx:Script>
  10.         <![CDATA[
  11.             import mx.events.FlexEvent;
  12.            
  13.             protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
  14.             {
  15.                 // TODO Auto-generated method stub
  16.                 var swfLoader:Loader = new Loader();
  17.                 var swfFile:URLRequest = new URLRequest("assets/slide_8.swf");
  18.                 var container:MovieClip= new MovieClip();
  19.                 swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadedHandler);
  20.                 swfLoader.load(swfFile);
  21.                 container.addChild(swfLoader);
  22.                 bc.addChild(container);
  23.             }
  24.            
  25.             protected function swfLoadedHandler(e:Event):void {
  26.                 trace("SWF LOADED");
  27.             }
  28.            
  29.         ]]>
  30.     </fx:Script>
  31.    
  32.     <s:SWFLoader id="bc" width="80%" height="80%"/>
  33.    
  34.    
  35. </s:WindowedApplication>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement