1 Reply Latest reply on Mar 5, 2008 1:33 PM by Newsgroup_User

    progress bar external image load

    studiotyphoon
      Hello all,
      I have a proplem I can't figure out.
      I am making a portfolio website of images. These images are external files loaded using the loader component. I want to have a progress bar that gives feedback and disappears when the image is loaded and displaying. I've tried the progress-bar tutorials in "help" file and searched online but cannot find the answer as to how to get it too work.
      My images load but slow so I need a progress bar. Thanks
      (Flash CS3 A.S. 2.0)

      The below code is I took from the tutorial on using component progress bar and modified it to my file. It's f-d up I'm sure. the progress bar and loader are on the same layer and the actionscript is added to that layer (as that's how they do it in the tutorial)
      I'm trying to get the bar to function 0-100%, (that's what I though the listener was for) then I want it to become invisible when done loading.

      "mainimage" is my instance of the picture loading component
      "my_pb" is the instance name of the progress bar component


      var mainimage:mx.controls.Loader;
      var my_pb:mx.controls.ProgressBar;

      my_pb.mode = "polled";
      my_pb.source = my_ldr;

      var pbListener:Object = new Object();
      pbListener.complete = function(evt_obj:Object) {
      trace("image loaded");
      }
      my_pb.addEventListener("complete", pbListener);


      mainimage.autoLoad = false;
      mainimage.contentPath = "images/handbridge.jpg";

      // when autoLoad is false loading does not start until load() is invoked
      mainimage.load();
        • 1. Re: progress bar external image load
          Level 7
          Here's a sample I made some time ago that uses the list component with the
          progress bar in loading jpg files.
          http://www.smithmediafusion.com/blog/?p=31

          It should give you a good idea on how to use the progress bar in AS2.

          --
          Dan Smith > adobe community expert
          Flash Helps > http://www.smithmediafusion.com/blog/?cat=11
          http://www.dsmith.tv

          "studiotyphoon" <webforumsuser@macromedia.com> wrote in message
          news:fqkc9v$kdd$1@forums.macromedia.com...
          > Hello all,
          > I have a proplem I can't figure out.
          > I am making a portfolio website of images. These images are external files
          > loaded using the loader component. I want to have a progress bar that
          > gives
          > feedback and disappears when the image is loaded and displaying. I've
          > tried the
          > progress-bar tutorials in "help" file and searched online but cannot find
          > the
          > answer as to how to get it too work.
          > My images load but slow so I need a progress bar. Thanks
          > (Flash CS3 A.S. 2.0)
          >