NateS
NateS

Reputation: 5876

Flash and JavaScript interaction, load timing issue

I've been unable to find information about the timing of loading Flash and JavaScript. I have a page that includes a JavaScript file and has a Flash SWF:

<script src="stuff.js"></script>
...
<object ...><embed ...>
...
<script>
// some code
</script>

The SWF calls a function defined in the JavaScript.

  1. Is it possible for the SWF to load before the JavaScript and be unable to find the function?
  2. Is it possible for "some code" to run before the SWF is loaded?

Upvotes: 2

Views: 487

Answers (1)

Eugene
Eugene

Reputation: 2216

Instead of embed tag use http://code.google.com/p/swfobject/

also use ExternalInterface to interact with JS from AS3, for more samples please lokk here http://blog.flexexamples.com/category/externalinterface/

Regards Eugene

Upvotes: 1

Related Questions