Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Passing variables TO Flash FROM Javascript
From: Jason Bouwmeester
Date: Fri, 14 Apr 2000 22:45:56 +0100

Hey all,

Having a bit of a problem. I am trying to send variables to Flash FROM
Javascript. Something is wrong with my script and I just can't figure out
what. Here's my sample code if someone doesn't mind. The first frame of the
movie calls the js function, and I know it is doing this because when I run
just the swf outside of the html code, a browser window pops up with the
javascript:sendDateTime(); in the URL locator.

TIA!
Jason

note: gtaa is the name of the movie...

-------------------------- Begin Code -------------------------

<SCRIPT LANGUAGE="JavaScript">
<!--
function sendDateTime(){
//IE and Netscape refer to the movie object differently.
//This function returns the appropriate syntax depending on the browser.
var moviename="gtaa";

if (navigator.appName.indexOf ("Microsoft") !=-1)
{
return window[moviename]
}

else
{
return document[moviename]
}

todaysDate = get Date();

gtaaHours = todaysDate.getHours();
gtaaMinutes = todaysDate.getMinutes();
gtaaSeconds = todaysDate.getSeconds();

gtaa.SetVariable("/local_time:hours", gtaaHours);
gtaa.SetVariable("/local_time:minutes", gtaaMinutes);
gtaa.SetVariable("/local_time:seconds", gtaaSeconds);
}
//-->
</script>

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml

Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]