just wondering if it's possible to pull an js file into flash directly, and passing vars from it into flash as u do with php using the loadvars function.?
just trying to improve me knowledge.
Andy.
Printable View
just wondering if it's possible to pull an js file into flash directly, and passing vars from it into flash as u do with php using the loadvars function.?
just trying to improve me knowledge.
Andy.
You can't exactly "pull" it in. Loading a js file in would be the same as loading in a plain text file and wouldn't do you much good. Flash and Javascript run in the browser and you can communicate in between the two using various methods. Which one you use really depends on what version of Flash you're using. The latest method is called ExternalInterface, here's an example:
http://www.adobe.com/devnet/flash/ar...interface.html
So say if i had a javascript that produced the following vars..
var1 = data
var2 = data
var3 = data
var4 = data
could i port the var values into flash using the external interface by just connecting to the js file?
Andy
If you're asking if it's as simple as linking to your .js file, no, it isn't. You use ExternalInterface and then you call Javascript or Flash functions to pass data around. The link I posted has examples of how it works.