1 Reply Latest reply on Dec 6, 2009 8:09 AM by funkysoul

    Loading PNG from Flex Builder 3 - Event.COMPLETE does not fire

    raffjones

      I'm sure some users on this forum will be aware that AddThis are dropping the Clearspring Launchpad, so I'm writing a new AS3 API to get ready for the changeover. Part of that is a base UI that will create buttons for social network sharing destinations. I am just trying to sort a solution for getting the relevant icons for the networks.

       

      At the moment, AddThis contain all the icons in a single long strip that is 16x3520 pixels in size - http://s7.addthis.com/static/r07/widget11.png

       

      What I'm trying to do is load this into a utility class, but the Event.COMPLETE event never fires, and if the Loader class that loads it is added to the stage, the bitmap is never shown. It won't load locally either.

       

      I thought it was maybe a dimensions issue, but what is curious is that if I place the PNG on a Flash stage and export as a SWF, it loads no problem - either locally or from a servver.

       

      I saved their PNG on to my own server - http://bluebear.jollygoodwidgets.com/widget11.png - and it did not load from Flex Builder 3, even if the Loader requesting the file was given a permanent var reference and added to the stage. There is no security error, and the Activity monitor in Safari showed that the PNG had loaded 100%. The COMPLETE event just never fires and the image never appears.

       

      I converted the PNG to a JPEG - http://bluebear.jollygoodwidgets.com/widget11.jpg - and it loads without issue!

       

      I also found that loading the PNG from script on a frame in the Flash IDE worked fine... but trying the EXACT same code from Flex Builder 3 fails.

       

      So I'm really scratching my head here... and any help is welcome.

        • 1. Re: Loading PNG from Flex Builder 3 - Event.COMPLETE does not fire
          funkysoul Level 4

          The problem is indeed the height of the .png, I've tried to load from my localmachine, from the addthis and from your server, everytime failed without giving me a trace on the event.COMPLETE, then I re-saved the png with Photoshop, with the thought that the image might have some bad bytes that would hurt flex displaying it, nope, then I just cut the png at half (1250px height) et voila, the image is being displayed.

           

          As you already mentioned if it works inside of an swf, then I would go that way, put the png in a swf and display the swf instead of the png. it's anyway better in my opinion.

           

          Cheers

          Tiago