0 Replies Latest reply on Jun 19, 2007 12:16 PM by jorisbleys

    stopping an external swf

    jorisbleys
      Hi all,

      I'm trying to load a .swf file in the background, but the problem is the movie starts before I instruct it to and I don't know how to stop it. I've written a preloader before using the same code but it didn't have the same problem.

      Any advice is welcome!

      Best,

      Joris

      var finaleMovieLoaded:Boolean = false;
      var finaleMovieLoader:Loader = new Loader();
      var finaleMovieFileName:URLRequest = new URLRequest("stad.swf");

      function showFinaleProgress(evt:ProgressEvent):void
      {
      trace(evt.bytesLoaded/evt.bytesTotal);
      }

      function showFinaleLoadResult(evt:Event):void {
      finaleMovieLoaded = true;
      trace('loading finale completed');
      }

      function showFinaleMovie(event:Event):void
      {
      trace('starting finale');
      addChild(finaleMovieLoader);
      }

      // link functions to the events related to loading the finale movie
      finaleMovieLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showFinaleProg ress);
      finaleMovieLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showFinaleLoadResult);
      finalebtn.addEventListener(MouseEvent.CLICK, showFinaleMovie);

      // start loading the main movie
      finaleMovieLoader.load(finaleMovieFileName);