AtomicChip
Programmer
So I'm doing a website... (who isn't?
) and I'm trying to decide whether or not to use runtime shared components (using AS 2.0)
I really like the modularity aspect of the shared components, but here's a couple problems that I've come across while using them - hopefully somebody else here has come across these too and found a nice solution to it.
Problem 1
It's great that by using shared components, the footprint of the main .swf file doesn't get bigger... Or is it? Because the footprint doesn't change, you can't really have a true 2 or 3 frame preloader at the beginning of the movie (checking the getBytesLoaded vs. getBytesTotal) as it no longer gives an acurate value... What happens if, say, my imported component is rather large and hasn't completely loaded by the time I try accessing it from client code (in the main .swf file)? Has anyone figured out a nice solution to figure out bytes loaded vs. bytes total while using shared components?
Problem 2
This one's kinda weird... It seems that if I have multiple shared components, each one must be loaded on a seperate frame. If I place multiple shared components in a single frame, only the constructor for the topmost component will fire... WTF? Is this a bug with the 2.0 framework? I don't seem to remember ever having an issue with this using good 'ole Object.registerClass's.
By posting this, I'm hoping either to a) find someone who has come across these problems and found a solution to them, or b) spark some conversation and attempts to find clean solutions to them...
Thanks in advance,
AtomicChip
-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
I really like the modularity aspect of the shared components, but here's a couple problems that I've come across while using them - hopefully somebody else here has come across these too and found a nice solution to it.
Problem 1
It's great that by using shared components, the footprint of the main .swf file doesn't get bigger... Or is it? Because the footprint doesn't change, you can't really have a true 2 or 3 frame preloader at the beginning of the movie (checking the getBytesLoaded vs. getBytesTotal) as it no longer gives an acurate value... What happens if, say, my imported component is rather large and hasn't completely loaded by the time I try accessing it from client code (in the main .swf file)? Has anyone figured out a nice solution to figure out bytes loaded vs. bytes total while using shared components?
Problem 2
This one's kinda weird... It seems that if I have multiple shared components, each one must be loaded on a seperate frame. If I place multiple shared components in a single frame, only the constructor for the topmost component will fire... WTF? Is this a bug with the 2.0 framework? I don't seem to remember ever having an issue with this using good 'ole Object.registerClass's.
By posting this, I'm hoping either to a) find someone who has come across these problems and found a solution to them, or b) spark some conversation and attempts to find clean solutions to them...
Thanks in advance,
AtomicChip
-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy