10 Replies Latest reply on Mar 26, 2007 10:49 AM by kglad

    Loading Progress not work

    vovantuan Level 1
      Dear all,

      I am using Flash8.
      I create a loading progress as an example showed:

      - put a movie named "bar_mc".
      - Put this actionscript:

      var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100);
      bar_mc._xscale = pctLoaded;

      - Put this action script:

      if (this.getBytesLoaded() < this.getBytesTotal()) {
      } else {

      Frame3 and after that: put images

      The example works.

      But I got problem with situation:
      - From frame3 and after that, I want to attach movie clips in library instead of putting image directly into frame.
      Then loading progress doesn't work any more.

      - I found that: when I convert bitmap to movies in library, loading progress will not work, even I still put images into frames as above.
      - I tried to change load bitmap instead of attach movies in order to delete movies in library, loading still not work.

      import flash.display.BitmapData;

      var linkageId:String = "libraryBitmap";
      var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
      trace(myBitmapData instanceof BitmapData); // true

      var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
      mc.attachBitmap(myBitmapData, this.getNextHighestDepth());

      - I think it is because images were set linkage (in order to be specified when load image)

      In summary, loading progress in frame1 only work when the following frames don't contain action script and only put images without linkages.

      What problem did I meet?
      How can I load images or movie in following frames and loading progress still work?

      Many thanks,