1 Reply Latest reply on Sep 6, 2010 10:15 PM by kglad

    How to load something when the frame appears

    Ex0skelet0r

      hello. i have a button load_swf that does that:

       

      swf_path="sample.swf"

      load_swf.onRelease = function() {

      loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void  {

      info.text = Math.round((bytesLoaded/bytesTotal)*100)+"%";

      };

      loadListener.onLoadInit = function(target_mc:MovieClip):Void  {

      info.text = "";

      };

      var mcLoader:MovieClipLoader = new MovieClipLoader();

      mcLoader.addListener(loadListener);

      mcLoader.loadClip(swf_path, swf_loader);

      };

       

      I want to do that without having to press the button. i want to do it when the frame appears on screen. Something like OnClipEvent(load) The problem is i dont know how to convert this code to work with OnClipEvent(load), can you help me?

        • 1. Re: How to load something when the frame appears
          kglad Adobe Community Professional & MVP

          use:

           


           

           

          swf_path="sample.swf"

           

          loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void  {

          info.text = Math.round((bytesLoaded/bytesTotal)*100)+"%";

          };

          loadListener.onLoadInit = function(target_mc:MovieClip):Void  {

          info.text = "";

          };

          var mcLoader:MovieClipLoader = new MovieClipLoader();

          mcLoader.addListener(loadListener);

          mcLoader.loadClip(swf_path, swf_loader);