Welcome to WebmasterWorld Guest from 23.22.206.103

Forum Moderators: open

Message Too Old, No Replies

Get flash to push data to javascript

     
12:18 pm on Jun 24, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:June 17, 2008
posts: 47
votes: 0


Hi, I'm a bit of a Flash noob.

I have a flash movie with several buttons. When a button is pressed I want it to send the button ID to a javascript function (outside the flash file).

Any ideas how to do this?

Thanks

1:58 pm on June 24, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Check the help files for getURL() and "external data," there are many methods for this.
8:18 am on June 29, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:June 17, 2008
posts:47
votes: 0


Thanks for the reply rocknbil.

For anyone else who stumbles on this ticket:

getURL() to execute a javascript function will work - it's no longer officially supported though because these days everything is done through ExternalInterface. So you'd do:

ExternalInterface.call("changeMyDropDownMenu","scotland");

where "changeMyDropDownMenu" is the function and "scotland" is the argument.

That said, getURL should still work, you can do

getURL("javascript:changMyDropDownMenu('scotland'));