4 Replies Latest reply on Jan 14, 2009 12:18 PM by Newsgroup_User

    Dynamic loading PNG - No Complete Event

    csrocks
      I'm loading PNG images from a web site. Some of the PNG files will not fire a COMPLETE event when I try to load the PNG bytes into the Loader. It appears that the bytes are correctly transferred to the flex application.

      Code:
      var buffer:ByteArray = urlLoader.data;
      var loader:Loader = new Loader();
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onBytesLoadComplete);
      loader.loadBytes(buffer);

      Any Suggestions...
        • 1. Re: Dynamic loading PNG - No Complete Event
          Zen Seven Level 1
          Hi csrocks,

          This is the EXACT problem I've run into this morning. Did you ever find a solution for this issue?

          I've found the bytes event is hit and Flex says all the bytes are loaded, but it never finishes the job by firing the complete. Very frustrating.

          Regards.
          • 2. Re: Dynamic loading PNG - No Complete Event
            Zen Seven Level 1
            I didn't solve the problem, but I found a workaround.

            It seems like if the png uncompressed size is more than 1 meg it won't fire the load complete event. I shrunk down the dimensions of the png to be under a meg uncompressed and it fixed it!
            • 3. Re: Dynamic loading PNG - No Complete Event
              Zen Seven Level 1
              I didn't solve the problem, but I found a workaround.

              It seems like if the png uncompressed size is more than 1 meg it won't fire the load complete event. I shrunk down the dimensions of the png to be under a meg uncompressed and it fixed it!
              • 4. Re: Dynamic loading PNG - No Complete Event
                Level 7

                "Zen Seven" <webforumsuser@macromedia.com> wrote in message
                news:gklfdj$mta$1@forums.macromedia.com...
                >I didn't solve the problem, but I found a workaround.
                >
                > It seems like if the png uncompressed size is more than 1 meg it won't
                > fire
                > the load complete event. I shrunk down the dimensions of the png to be
                > under a
                > meg uncompressed and it fixed it!

                Unless the physical dimensions of you png are ginormous, it should NEVER be
                over 1MB. Are you sure that the problem isn't that there's extra info in
                the file? For instance, a Fireworks authoring png will be really large
                compared to a Fireworks exported png. If you just take the Fireworks file
                you were editing and pop it in the directory without exporting, you'll wind
                up with a file that's many times the size of what you actually need to show
                the image.