Geografiek wrote:
Hi list,
Suppose I have an associative array like this:
var myArray:Object = new Object();
myArray.item1 = item1;
myArray.item2 = item2;
myArray.selected = false;
var myObj:Object = new Object();
myObj.itemGroup=[];
myObj.itemGroup.push( item1);
myObj.itemGroup.push( item2);
myObj.selected = false;
item1.addEventListener(MouseEvent.CLICK, onClick);
item2.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:Event):void {
for (var idx:uint=0; idx<myObj.length; idx++){
if (myobj.selected){
myObj.itemGroup[idx].alpha=1;
} else {
myObj.itemGroup[idx].alpha=1;
}
}
I don't like calling objects Arrays, though I understand your usage..
What happened to the subject line.. ?
Paul
item1 and item2 are 2 mc's living on the stage. Selected is a newly
created property on myArray.
Now I want to change myArray.selected by clicking on one of both item
and change the appearance of both items based on the value of
myArray.selected. Is this possible?
In other words: myArray knows it contains item1 but does item1 have a
way of knowing it is part of myArray.
Thanks,
Willem van den Goorbergh
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Geografiek is a Dutch, Utrecht-based map and chart design company.
Willem van den Goorbergh can be contacted by telephone:
(+31)30-2719512 or cell phone: (+31)6-26372378
or by fax: (+31)302719687
snail mail: Hooghiemstraplein 89 3514 AX UTRECHT
Visit our website at: http://www.geografiek.nl
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders