swf start point
- Started
- Last post
- 7 Responses
- design_slave
i know this is possible, but i don't know what the terms are called... so i'm having a hard time searching for the right information.
i have a flash file exported as a swf. depending on what html page the swf displays, i want the swf to start at different frames.
- heavyt0
say what??
do you mean to say that you have 1 SWF, and index.htm plays frame 1, then page2.htm plays frame 45, etc ???please clarify to me.
TR1
- blaw0
i was discussing this with one of the developers i work with and he claims that you can add code to the param tag, or object tag or something that designates the start point. then in the swf you have at the beginning of the movie "if page = 2 goto...".
i haven't tried it out yet, so i don't know the specifics.
- design_slave0
yes, blaw, that sounds like exactly what i want to do. i want to find a tutorial or example on how to do it.
- autonoma0
Can't enter all of the code in here, so I made you a little set of instructions on how to do what you need to do in a clunky javascript way. I've tested this in multiple browsers, and it seems to work well all around. Probably a better way to go about it, though. Here ya go:
- ctrlRmB0
You could put something like this in the swf...
/////////////////////
startFrameFunc = function(fr,actn){
if(actn == "play"){
gotoAndPlay(Number(fr));
}else{
gotoAndStop(Number(fr));
}
}startFrameFunc(startF,startFActi...
/////////////////////
then in the html you add a query string to the end of the swf...
/////////////////////NOTE you have to do this in 2 places/////////////in both the object and embed tags
myswf.swf?startF=10&startFAction...
/////////////////////any parameters you put in the query string are available to level 0 of the swf when it is placed on the page... i put that startFAction thing in there in case you want to control whether it plays or stops.
hope it works for you
- mr_flaco0
in the html,
filename.swf?startFrame=20
In the _root of the flash file,
this.gotoAndPlay(startFrame);
- blaw0
thanks for your efforts on this ctrlRmB!
i'm looking forward to giving it a shot.