Friday, November 7, 2008

Displaying a MovieClip from the first loaded frame

About a year ago, I've written a Player for my website Slidex. The player is basically playing a Slideshow, the Slideshow itself is a result of a conversion from a PowerPoint/OpenOffice presentation.





Now for some more technical details about the player..
What it does basically is load an external SWF MovieClip, and when the Loader (loading the slideshow) fires the Event.Complete, I add the MovieClip to the main player's window. That was pretty nice for awhile, but when the slideshows grew bigger, so did the amount of time to load a slideshow to the player, and then be able to navigate through it.

The problem was I couldn't find a way to add the Slideshow's MovieClip to the container before it was completely loaded. In other words, if the slideshow is 10 slides big, then the user will have to wait for all the slideshow to be loaded (all the 10 slides in the MovieClip) before being able to watch it.

What I wanted of course is to allow the user to watch the slideshow from the first loaded slide.
After hours and hours of googling, I've ended up with nothing. It's weird because it seemed like something pretty simple to do, I mean as far as I know anything is stream'able in Flash, and so should a MovieClip object be. So after a closer look at the Loader class, I've found out that the Event.Init was my savior. When the Loader fires the Init event, then from it's delegate the MovieClip will be accessible through the Content property. So I can just add it to my container from there.

The result:

1 comment:

Ariel Ben Horesh said...

http://tech.walla.co.il/?w=/4007/1393120

Why it's not you? SlideShare is beating you with PR?