Hi all,
I’d be really grateful for some assistance. I really don’t have much of a clue what I’m doing here. I know some Flash basics but am really struggling with this. Have spent the last few days searching everywhere I can think of for a solution, but nothing I try is working. Am pretty sure the problem is me!!!
Here’s the trouble:
I have an swf being played from an html page using the Javascript Shadowbox plugin. This is executed as soon as the window loads - creating a splashpage for the site. I am trying to get the swf to run the function Shadowbox.close(); as soon as the movie has finished playing without clicking the mouse or “doing” anything. I was previously using a timeout function on the html page to close the Shadowbox after a spcific length of time - but this does not allow for the time it takes for each users browser to download the swf.
I decided it made more sense to use fscommand to execute the function I am after but I think my code must be screwed up because it will not work at all.
Here’s my page code:
<script type="text/javascript">
Shadowbox.init({
skipSetup: true,
modal: true,
overlayColor: "#000000",
overlayOpacity: 1,
showMovieControls: false,
viewportPadding: 0,
flashVersion: "10.0.0",
onClose: function(){$.fn.generalAnimation();}
}
);
window.onload = function() {
Shadowbox.open({
content: '<object width="500" height="367" id="intromovie"><param name="intromovie" value="video/intromovie.swf"><embed src="video/intromovie.swf" width="500" height="367" menu="true" quality="best" play="false" name="intromovie" id="intromovie" type="application/x-shockwave-flash"></embed></object>',
player: "html",
width: 505,
height: 375,
modal: true,
});
};
</script>
<script type="text/javascript">
function intromovie_DoFScommand(command, args) {
if (command == "intromovie")
{
Shadowbox.close();
}
}
</script>
And here’s my action script:
onClipEvent (load) {
fscommand("intromovie");
}
The action script is attached to a single frame movie clip that is placed on the last frame of my swf.
I would be so grateful for help with this as am rapidly losing all patience!
Many thanks in advance.
Em.