Jump to content
  • Advertisement
Sign in to follow this  
Imozeb

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

This topic is 3021 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!