Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript "listener"

Status
Not open for further replies.

JontyMC

Programmer
Nov 26, 2001
1,276
GB
I'm changing an actionscript variable using javascript (SetVariable). What's the best way to "listen" for the variable changing in flash?

Is setinterval the best way?

Jon

"I don't regret this, but I both rue and lament it.
 
i usually make a spare movieclip (in the shape of a 'c' for code) and place it off the top left of the stage. in there i can place things that need to control the movie as whole, and need to do work on every frame

UNTESTED
onClipEvent(load)
{
var oldVar:Number = _root.jSVar;
}

onClipEvent(enterFrame)
{
if(oldVar != _root.jSVar)
{
oldVar = _root.jSVar;
_global.onJSVarChange();//do stuff
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top