Actionscript 3 - Assign variables on file load
I am making an audio player app that collects variables based on javascript running on the page. By default it loads 2 mp3s, but I 开发者_C百科need to be able to re-assign the mp3s that it loads based on different javascript clicks.
I think what I want to do is assign the default 2 songs to variables on file load. Then call a function that re-assigns those variables to the javascript variables passed in.
My question is - how do I create a function that only runs on initial load? I assume I could then use javascript to call a different AS3 function to stop the player, re-assign the variables, load the file, and then start it again. Does that sound right?
If you need some variables available on file load, the easiest way would be to pass them as flashvars.
精彩评论