OK, I'm not very used to Flash and I've been stuck for hours on this problem, so any help would be really appreciated...
I have this quite complicated FLA which is basically set up like this :
"Scene 1"
- some loading animation (and code)
- AS code receiving values from flashvars (in the HTML code) and validating them
- at the end of the Scene 1 timeline, we enter a second movie clip:
"map-total"
- here a map is displayed and various elements appear on it
- nothing interesting here actionscript-wise
- but among those elements, a movie clip :
"btn-vb"
- here, various layer; one of those contains yet another movie clip (vb_anim)
- also contains some AS code to make vb_anim grow bigger as the mouse rolls over it, and reverse when the mouse leave (and react to click)
"vb_anim"
- here we find several layers with some basic animation.
- among those layers, three represent different variants of one same button (available, not ready, forbidden).
- each of those three layers contain one instantiated object (with some tweening)
What I need is this:
Depending on the flashvars I receive in Scene 1, I need to display or hide one or several of those three objects in "vb_anim".
In order to access the variables set in Scene 1, I use the following shortcut:
var global:MovieClip = MovieClip(root);
// allows for access to the "root" variables
// e.g. global.myVar
I already use the same code in "btn-vb" (I need to access the information provided by the flashvars in order to define the onclick event) and it works like a charm.
However, it appears that when called from inside "vb_anim", MovieClip(root) evaluates to null. So it's impossible to access the variables from Scene 1, and Flash throws a "TypeError: Error #1009" when I try to do so.
Since "vb_anim" is simply embedded in "btn-vb", I don't understand why it can't see MovieClip(root) while its parent can.
Any idea of what I did wrong?