1 Reply Latest reply on Jul 1, 2010 9:24 PM by BhaskerChari

    Link to a swf

    SiHoop Level 1

      I want to use a swf from a Flash project. The swf is stored inside my Flex project, but I cannot link to it. What am I doing wrong?

       

      <?xml version="1.0" encoding="utf-8"?>

       

      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" click="canvas1_clickHandler(event)"

       

                   creationComplete="init()">

       

          <mx:Script>

       

              <![CDATA[

       

                  import mx.managers.PopUpManager;

       

                  public function init():void{

       

                      var loader:Loader = new Loader;

       

                      loader.load(new URLRequest("expRecord_2_480.swf"));

       

                      this.addChild(loader);

       

                      this.x=stage.stageWidth/2-100;

       

                      this.y=stage.stageHeight/2-100;

       

                     

       

                  }

       

                  protected function canvas1_clickHandler(event:MouseEvent):void{

       

                      PopUpManager.removePopUp(this);

       

                  }

       

              ]]>

       

          </mx:Script>

       

      </mx:Canvas>