PDA

View Full Version : I dont want swf to reload



buzzo
July 24th, 2007, 11:25 AM
Hi

I wonder if anyone can help... I have 3 html pages that each have the same swf movie embeded as a animated header. But I dont want the swf to reload everytime you navigate from one page to the other, I just want the movie to play once and then stay at that same point even if you navigate to the next html page.

Does anyone know if this is possible?

Gareth

dru_nasty
July 24th, 2007, 06:22 PM
Two things come to mind, you could either use an iframe, or you could pass some string variables into flash when a user clicks on another button and force the movie to the last frame using some actionscript.

buzzo
July 26th, 2007, 04:55 AM
Hey Dru...

Thanks for the reply!

I prefer the sound of the second option... do you have a more detailed explanation of how I could achieve this?

freezerburned
July 26th, 2007, 05:47 AM
yeah, when you embed the movie,
myflash.swf?myvar=8

then in the flash video, in the first frame put,

if(_root.myvar != 0 || _root.myvar != null || _root.myvar != ''){
gotoAndPlay(myvar);
}

now, gotoAndPlay, could also be gotoAndStop() depending on how your movie works. Give it a test.

buzzo
July 26th, 2007, 08:16 AM
"yeah, when you embed the movie,
myflash.swf?myvar=8"

Hey Freezer... what exactly do you mean by this?

rabidGadfly
July 26th, 2007, 08:45 AM
He means in the embed code, append ?myvar=8 to the end of the swf file name. If you do that then your swf will be passed an actionscript variable named myvar with a value of 8. Then you do do something like this:

gotoAndPlay(myVar);

and it will go to and play frame 8 on your timeline.

buzzo
July 26th, 2007, 08:48 AM
Ahh!

I see... thanks!

onion
August 6th, 2007, 06:13 AM
I don't understand this, wasn't the original question an issue of caching? I have flash banners for each of my pages and every time you switch pages you have see the preloader for a few seconds as it loads each time. Is there any way to force your browser to cache the banner?

dru_nasty
August 6th, 2007, 11:05 AM
I don't understand this, wasn't the original question an issue of caching? I have flash banners for each of my pages and every time you switch pages you have see the preloader for a few seconds as it loads each time. Is there any way to force your browser to cache the banner?

The original question was along the lines of getting the movie to stop playing over from the beginning each time a new page was requested ;)
In your case if there is a way to force cache I'm not really familiar with it. I'm a little confused though that you're seeing the pre-loader still. Normally a browser automatically caches everything within your html so unless your pre-loader is built "differently" it shouldn't even show up. That, or if you're requesting the swf from an outside source (e.g. http//www.someothersite.movie.swf") it may cause that ;)

Digitalosophy
August 6th, 2007, 11:11 AM
To force cache you would need a server side script

try this http://www.phpinsider.com/smarty-forum/viewtopic.php?=&p=37471