1 Reply Latest reply on Oct 31, 2009 2:23 AM by chandu3107

    URLRequest for Loader in flex

    dsaisho Level 1

      Hello, I am very new to flex though have been developing in flash with as3 for about 2 years. I am working with flex so I can play around with adobe's stratus server.

       

      The question I had was how to add a basic swf to the stage. I exported a swf from flash into my src folder for flex.

      then wrote this function:

       

           private var loader:Loader=new Loader()

          private function addbug():void{
                      var url:URLRequest = new URLRequest("bug_mc.swf");
                          loader.addEventListener(Event.COMPLETE, done);
                      loader.load(url);
                 
                  }

          private function done(event:Event):void{
                      this.addChild(loader);   
                  }

       

      This does not work. I have also tried using SWFLoader and it was not working for me.

      What do I need to do to make this work?

       

      thanks.