i am using the following setup:
- i load a local file with FileReference.load() into the swf
- then i user Loader.loadBytes() to parse the loaded ByteArray into BitmapData to pass it to a BitmapImage's source
step 1 works fine and i get the bytearray which is about 36k, according to the progressevent.
now i pass the the data as follows: loader.loadBytes(event.payload as ByteArray);
here's where i'm stuck. i have listened both for Event and DataEvent but nothing happens. i enclosed the part in a try/catch statement, still nothing. i ran it with the debugger and: NOTHING. it just seems to do nothing after calling 开发者_如何学编程loadBytes.
i looked up a lot of threads about complete events not firing on loader, but nothing similar to my problem.
To clarify what's discussed here (I just had the same problem) you need to attach the event listener to Loader.contentLoaderInfo, NOT Loader.
ok, i gave up on this. it was probably my fault somewhere but i ended up just adding the loader itself and stopped trying to load the bytearray into a bitmapimage.
精彩评论