Hey everyone - thanks for the great tools. They have helped immensely, but I'm driving myself nuts trying to do something that *should* be so simple. Here we go - I have one main.swf file that contains a child (container) clip called "videoTarget". A second .swf file named "video_default.swf" loads upon the main movie loading.
Ok, with that out of the way ... I am passing variables through links on a page that contains main.swf -- the links pass variables just fine to main.swf but for the life of me I can't get any variables to pass through to the container clip ie. "videoTarget"
I assume it is because the second clip isn't defined in the javascript as main.swf is:
---------------------------------
<script type="text/javascript"> var so = new SWFObject("main.swf", "videogallery", "604", "380", "8", "#FFFFFF"); so.addParam("quality", "high"); so.write("flashcontent"); </script>
----------------------
Do I need to define "video_default.swf" in order to pass variables to it within the parent .swf? If so, could someone please help? I Would greatly appreciate it!!
BTW - If people could do a quick search BEFORE posting questions it would be really good to the few helpful (but very professionally busy) volunteers which moderate the forums, as most of the time the questions have been asked/answered before :)
Thanks Aran. I actually did come across the scoping answer/post and figured that is where the problem stems. I guess lack of sleep blinded me to a few fundamental aspects I need to pay more attention to. Once back at work today I will follow both links you have provided here and hopefully resolve the issues I'm having.
I truly appreciate your time and response. I will make sure to post my resolution, however simple it may seem, in hopes of helping some poor soul out there ;)
Cool. I know all about the lack of sleep, and perhaps that was unfairly reflected in my reply to you. We try to be a friendly/helpful as possible around here, but as you can appreciate, we get a lot of repeat requests. I hope your resolution comes quickly.
the problem happened to be due to the video component I was calling, not the scoping itself. Essentially I was passing a variable to the video player, but the player wasn't told what to do with it.
Through javascript I set a new variable to instruct the player (ns stream) to pause and then resume playing with the new .flv URL. Worked out great (after hours of banging my head into the wall)....and though this bit of code may work, please correct any mistake you may notice ...
You shouldn't need an onEnterFrame function if you are using external interface. With external interface you can call an internal flash function directly from javascript and pass it parameters; something like:
// my_flash_movie is the "id" of your swfobject movie // // the playVideo function can do anything inside your flash movie such as play/pause the netstream etc
Anyhow, if your code is working for you and you are happy, then cool. It's just that since you never destroy your onEnterframe, it is constantly sucking CPU cycles.