Using targetCurrent -- I am able to get the name of the MovieClip a user clicks on.
On function toggleClick there is a trace statement that says:
trace("movieClip Instance Name = " + e.currentTarget);
OUTPUT Window:
movieClip Instance Name = [object Comp]
Based on what a user clicks on -- there will be a value associated to the MovieClip.
On the flash stage there are multiple toggle buttons: User can toggle the MovieClips ON or OFF. On the stage there are MovieClips of the following: a computer, light bulb, and TV. The user can toggle the objects ON or OFF.
If the user clicks on the 'Computer' MovieClip...
I want to be able to loop through houseArray--and when the loop finds comp in the array-- in a variable called var powerData -- it will store the power value of comp. (I am unsure how to write that process in AS3.) In houseArray comp = "2" --so...
var powerData:int = 2;
var houseArray:Object = {lightA:"1",
lightB:"1",
lightC: "1"
lightD: "1"
lightE: "1"
comp: "2"
tv: "3"
stove: "4"
laundry: "5"};