2 Replies Latest reply on Jan 7, 2008 10:43 AM by Damon Edwards

    loader component not displaying content

    brad9376 Level 1
      I had this issue on a few different projects and have not been able to find a solution:

      When loading an image with the loader component, the image only displays about half the time even though the complete event is received. I sometimes see a quick flicker of the image.

      I have tried both calling invalidate() and resizing after loading has completed, but does not help.
        • 1. Re: loader component not displaying content
          Ben Danis Level 1
          i had a similar issue with that, what i did was create a class.
          this class was linked to a movie clip, and whenever i'd need an image loaded, i'd simply attach this movie.

          as for resizing and positioning of the image, i also did a code in my enterframe that always made the image centered with a max size and height of 100, that way it was always proportionate and i could simply control the size by controlling the xscale and yscale of the image movie clip.

          hope this helps

          class image extends MovieClip {
          function image() {}
          function loadImage(sPath){
          this.createEmptyMovieClip("mContent", 0);
          // you can also attach a loader there
          this.onEnterFrame = function () {
          if(this["mContent"].getBytesLoaded() == this["mContent"].getBytesTotal()) {
          //remove the loader
          this["mContent"]._visible = true;
          } else {
          // update the loader
          this["mContent"]._visible = false;
          • 2. Re: loader component not displaying content
            Damon Edwards Level 3
            Load the image into an empty movie clip using the MovieClipLoader class, that way you can use its events to capture load progress and load complete.