Discussion:
control Flash movie with JavaScript
(too old to reply)
mflorida
2009-03-11 01:37:17 UTC
Permalink
I need to have a Flash movie stop when a user clicks an HTML link for a pop-up
content window. The Flash movie is embedded on the same page as this HTML.

Is there a way to have the flash movie stop when a user clicks a link on the
HTML page where the swf is embedded? I have content pop-ups in the html part of
the page and I want the swf to pause when this happens. I'm thinking an
"onblur" javascript would do the trick, but I don't know how to make it "talk"
to the flash movie.

Redundant? Yes! :-P
NedWebs
2009-03-11 02:05:29 UTC
Permalink
Here's a link that provides some information on communicating between a web page and a Flash object...

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683
mflorida
2009-03-11 03:08:32 UTC
Permalink
Yeah, I looked at that link (and about 20 others so far), and they all talk
about exchanging data between HTML and Flash with forms and whatnot. It's too
much info, and it's really crazy complicated (for me anyway).

There's got to be a simpler way...

So I need to set up a function in ActionScript for the JavaScript to "grab".

Then I need to invoke the JavaScript in my HTML page (either from a mouse
click on a link or using <body onBlur="go_to_end">).

Here's my ActionScript:

import flash.external.ExternalInterface;
function go_to_end():ExternalInterface {
gotoAndStop("theEnd");
}

("theEnd" is the name of the frame I want to go to)

I know it's probably not that simple (obviously, 'cause it doesn't work), but
what am I missing?

Any help is appreciated.

Loading...