2 Replies Latest reply: Apr 28, 2012 3:54 PM by mentalcase129 RSS

    Preloader challenge

    mentalcase129 Community Member

      I'm trying to do something really specific for a sort of excersize using the 'preloader' template that flash provides in cs5.5 with actionscript 3.  I've got played with all kinds of ways to customize this preloader in various ways but I'm not sure how to do one thing that I'm guessing should be easy for people with a bit more actionscript experience.  The template as it is now loads the second frame of the swf.  I want to change that so that it instead loads a different swf.  Anybody know how to do that?  Here's the actionscript as it is from the 'preloader for swf' template in CS5.5.

       

      stop();

       

      this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoading);

      this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

       

      function onLoading(evt:ProgressEvent):void {

          var loaded:Number = evt.bytesLoaded / evt.bytesTotal;

          percent_txt.text = (loaded*100).toFixed(0) + "%";

      };

       

      function onComplete(event:Event):void {

          this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onLoading);

          this.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);

          gotoAndStop(2);

      };