2 Replies Latest reply on Oct 28, 2009 9:01 PM by mpatters2004

    SWFloader loads SWF movie within Flex but not when compiled

    mpatters2004

      When I run my app in Flex, SWFLoader loads the SWF okay as a movie clip but as soon as I Export/Release Build, the new app SWF that is generated won't show the movie clip anymore.  If I take another SWF that is an app (not a movie clip) and give it the movie swf name, my compiled app will show the sub app in a frame.  Why would running something within Flex be any different than running a compiled version?

      Here is some of the code:

       

      button1 loads the swf.

      button2 loads a sound and when the sound is loaded, the sound is played and the swf is played in onSoundLoaded();

       

       

       

       

       

       

       

      public

       

       

      function onSoundLoaded(event:Event):void

      {

       

       

      var localSound:Sound = event.target as Sound;

      localSound.play();

       

       

       

      var

      clip:MovieClip = MovieClip(swflodr.content);

      clip.play();

      }

       

      private

       

       

      function button1Handler(event:Event):void {

      Alert.show(

      "test 1");

      swflodr.load(

      "dog.swf");

      Alert.show(

      "test 2");

      }

       

       

       

       

       

       

       

       

       

      private

       

       

       

       

       

       

      function button2Handler(event:Event):void

      {

       

       

       

      var s:Sound = new

      Sound();

      s.addEventListener(Event.COMPLETE, onSoundLoaded);

      var

       

       

       

       

       

       

      req:URLRequest = new URLRequest("test.mp3");

      s.load(req);

      }

       

       

      private function SwfLodrEventHandler(event:Event):void {

       

      var clip:MovieClip = MovieClip(swflodr.content);

      clip.gotoAndStop(1);

       

      Alert.show(

      "The event loader is ready");

      }

       

      thanks, Mike