• Advertisement
Sign in to follow this  

[web] How do I set a Javascript var from Flash?

This topic is 2779 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When my flash movie reaches a specific frame I need it to set a javascript variable to 1. How would I do this?

if(this._currentframe == 10)
{
//javascript var = 1???
}

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Look up ExternalInterface in the help docs. This will enable you to call a javascript function from inside flash. You can use this function to set your variable.

Share this post


Link to post
Share on other sites
Could you please give me an example?

If I had:

function fromflash()
{
var = 1;
}

in my javascript. What would I need in my flash

if(frame == 10)
{
ExternalInterface.call(???);
}

Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement