themolotov.net


Skip To Content

Actionscript 3 Flash Loader

Actionscript 3 Flash Loader - Notes on Flash and some problems we encountered.

Title is intentional for search engine crawling purposes.

We're working on a site that does a funky image gallery slideshow for a header. Loading external images is simple enough in Flash, but we ran into a problem while doing so. Apparently, different instances of the Loader() object will, if called before the previous load request completes, will terminate the previous request.

As the Loader object can contain only a single child, issuing a subsequent load() request terminates the previous request, if still pending, and commences a new load.

From Adobe: http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html

Looking at it now, it makes sense (and it helps that it's so explicitly spelled out in the docs :P). We were thinking of it previously as Loader() being a 'class' and that instances of the Loader object were independent of each other. However, in Flash, this is not so - instances of objects are not independent (when working with MovieClip objects, this was obvious and frequently irritating when a 'copy' was intended to be a 'duplicate'). We were looping through and re-instantiating the Loader() object, and killing our previous requests before the images were actually loaded. This resulted in us being left with only the last image.

I get so irritated with Flash. I still don't like it, but I'm trying. It's become more fun - if only for the stress it puts your brain under. Alon and I were talking the other day that it's like programming in 3D: top down in a single script, top down in layers, and left to right of the 'timeline'. Throwing and catching exceptions is fun and I'm learning a lot about what I consider 'non-linear' programming.

It's wierd to be working in Flash, using more the text editor than the stage or the timeline.

I post stuff like this so that other people may be able to solve some annoying Flash quirks more quickly.

tagged with

flash

work

this entry

Mood: accomplished
Music: radio
Location: work



You are not able to comment on this entry.



All Content Copyright Jon Gartman 2006, unless otherwise noted.
This site is part of the molonet. Generated in about 0.033 seconds.
Spiral out, keep going.