PDA

View Full Version : is it possible to route events from flash movies to javascript?


brothercake
08-10-2002, 04:32 PM
Say there's a flash movie on the page, and I know there'll be a function on the page it's embedded in; is it possible to call that function from an event inside the flash movie?

How about a java applet?

mordred
08-10-2002, 11:14 PM
IIRC there is a method in ActionScript that goes by the name getURL(). It can be used to trigger a javascript function by using that pseudo-protocol, so you can do

getURL("javascript:myJSFunction();")

to call a function that's defined in the page. No guarantee for the correctness of the syntax, but it's documented in the Flash API documentation.

hth

brothercake
08-11-2002, 01:21 AM
cool :thumbsup: