Groups | Blog | Home
all groups > flash actionscript > july 2004 >

flash actionscript : Executing Javascript fuctions


Scott Filloon
7/13/2004 10:24:15 PM
Is it possible to execute javascript functions using fscommand?

I've looked at some tutorials on Flashkit, but none of them do exactly what
I need to do. What I'm trying to do is, have my Flash movie execute the
javascript function that sets a variable back to the Flash movie. Reason
being, the Flash movie is a menu, and it's used on many different pages.
The value of the variable being sent back to Flash is the name of the button
that should be highlighted to mark which page it's currently displaying.
I'm wanting to do it this way to ensure the Flash movie has fully loaded
before the function is executed.

Thanks for any help,

Scott

Scott Filloon
7/14/2004 1:40:36 AM
Thanks guys!! With your help, I got it figured out.

Thanks again,

Scott



[quoted text, click to view]

AshwiniD
7/14/2004 5:04:34 AM
for setting a variable from javascript function back to your flash movie, you
would use SetVariable command in your javascript function. its used as follows.
you will need to modify this according to your needs. hope this will solve your
query.

<script language = "JavaScript">

<!--
function PassFlash(){
window.document.movie.SetVariable("text", "hello");
}
//-->
</script>

navslakra
7/14/2004 6:10:06 AM
Try the following link, it covers the flash-javascript communication issue pretty thoroughly.

http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm

AddThis Social Bookmark Button