0
votes

I have a flash file that I want to embed on a webpage, however, I want it to load when the user clicks on it (which will run the preloader) - (like clicking play on a youtube video)

It's one flash file that loads in XML data and is graphically heavy.

I'm not sure if the only way to do it is to load the flash file through another swf, i.e., flash container -> click flash container to load flash file with preloader.

Any suggestions?

2

2 Answers

0
votes

You could add an additional frame before the already existing frames inside your movie and keep it at that position using:

stop();

Then, add a play button on your stage with a similar following action:

on (release) {
    gotoAndPlay("your_loader");
}

alt text

I uploaded a demo project to try it out.

0
votes

My first impulse would be to use an image or explicitly-sized DOM element as a placeholder and some Javascript to swap in the Flash applet on-click. That'd be guaranteed to solve your loading issue as well as deferring the overhead of starting the flash player. (Which would make users who think like me but don't know about FlashBlock happy)

With jQuery, it'd just be something like

$('#flash_placeholder').click(function() {
    $(this).replaceWith(flash_applet_markup);
});

...and on-hover behaviour with something like opacity animation is also trivial.