> Andy,
> I see what you are saying, I think. That the .toString()
> has to be used as a method directly being addressed by the
> object. Like I said that what I think you are saying. How
> ever it seems I still can not get the string "myMCinArray1"
> or "myMCinArray2" or "myMCinArray3" etc when I use the
> toString on an array Element.
>
> By the way, the scope in this case is actually the Array
> lement(MovieClip) -see coded snippet
>
> setInterval(rollOvers,10); //calls function 100/second to
>
> function rollOvers(){
> for (i=0; i<aArray.length; i++) {
>
> aArray[i].onPress = function() {
> var myStr:String = aArray[i].toString();
> //***** THIS LINE
> trace(myStr); // still traces [object object]
> trace(i); //gives me 126 .which is the array
> length. if I could get this to give me the value of the Array
> element clicked I would fine too.
> };
It's nothing to do with the fact that it's in an array. toString() always
gives [Object object] for movieClips. Try it: make a vanilla movie, put in a
single movieclip called 'wossname' then put 'trace(wossName.toString()' in
the first frame.
If you want to get its name, put aArray[i]._name, as suggested previously.
Danny
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com