I have a Flash file containing a floor plan over my office. I want visitors to
be able to locate the room for a specific person by clicking on the room nr.
In my HTML-code I give the FlashVars a value equal to the chosen person's room
number like this:
[b]<param name="FlashVars" value="roomNr=G207" />[/b]
Then I have the script in my Flash file where I first declare a variable
fetching the value from my FlashVars:
[b]myRoom = roomNr;[/b]
After that I have the code to produce a different color to a movieclip, thus
indicating which room it is:
[b]import flash.geom.ColorTransform;
var myCT:ColorTransform = new ColorTransform();
myCT.rgb = 0x009900;[/b]
I have made a movieclip for each room and named their instances like the
values that will be passed when selecting a room. For instance: G207, F106E,
U123 and so on.
My idea here is to let the instance name of a movieclip be the value from my
FlashVars which I declared earlier. So I wrote the next line:
[b]myRoom.transform.colorTransform = myCT;[/b]
BUT... this will not work. I have tried two things to understand the problem:
1. I put a dynamic text field on stage, naming it and assigning its text to be
the value from FlashVars:
[b]testTextField.text = roomNr;[/b]
And it works perfect. It gets the correct value and writes it out on stage.
2. I tried to hard code the myRoom variable to be equal to G207 (myRoom =
G207; ), and that works fine as well.
WHY won't it recognise my FlashVars value as an instance name of a movieClip?
Any ideas anyone?`