PDA

Click to See Complete Forum and Search --> : Can I pause a specific movie clip using MM_controlShockwave javascript?



sirzooass
01-24-2007, 06:59 PM
Hi all! I'll try to be concise as I possibly can on this one!

I'm updating part of a presentation that uses javascript to pause and resume playback of the main timeline. I am aware that this code doesn't work in Firefox, but that's not a requirement. The code is as follows (javascript then trigger):

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
var obj=MM_findObj(objStr);
if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?fr ameNum:'')+')');
}

<a href="#"><img src="nav_images/pause.gif" alt="Pause this section" name="pause" width="113" height="19" border="0" id="pause" onClick="MM_controlShockwave('business_overview','','StopPl ay')" /></a>

This works fine for the original SWFs, which were created completely on the main timeline with streaming sound so when the main timeline is paused everything pauses (aside from a continuously moving background animation movie), but the one I had to update actually exceeded 16,000 frames (yes I was shocked too) so I had to split it in half. So now I have a main SWF (business_overview.swf) that loads business_overview_a.swf into a movie called "presentation", then when that finishes, it loads the second SWF into the same movie clip.

Is it possible to target the movie clip "presentation" and pause it rather than the main timeline? I'm trying to avoid:
1) loading the SWFS into _root which works, but resets the background animation so it jerks (I moved that animation into the main loader movie to make the transition seamless but if I have to move it back into the 2 parts this will be an issue)
2) having 2 html pages which would cause a noticeable break between the 2 halves

Any ideas? Any help would be much appreciated!

sirzooass
01-25-2007, 11:41 AM
Looks like I'm out of luck, but I did find the Firefox fix.

If you're having problems getting the Control Flash behavior to work in Firefox, find this line of code:

var obj=MM_findObj(objStr);

and add this code on the line after it:

if (obj && obj[1]) obj=obj[1];

After making this addition, the MM_controlShockwave function should look like this:

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
var obj=MM_findObj(objStr);
if (obj && obj[1]) obj=obj[1];
if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?fr ameNum:'')+')');
}

cristi_b_1
02-13-2007, 06:16 PM
i see you have our way with coding. can u help me please? i want to put a code on a HTML page, wich checks the flash player version installed on the visitor's browser. if the browser has the right flash player version OR HIGHER, the code should redirect the visitor to the page wich contains the flash site, ELSE, the code should redirect him to another HTML page ( where he'll find a link to adobe download center, so he can install the latest flash player version). thank you very much.