Reputation: 11
I want to put a set of onstage movieclip instances into an array, but I am getting object MovieClip instead of the instance name. Any ideas? Thanks.
var puz1_arr:Array = new Array (puz1.wMc, puz1.aMc);
trace(puz1_arr);
The trace gives me: [object MovieClip],[object MovieClip]
instead of: puz1.wMc,puz1.aMc
Upvotes: 0
Views: 51
Reputation: 2554
Accessing the instance of a MovieClip, gives you the MovieClip as an object of type MovieClip
.
If you want the name of the MovieClip object, simply use the .name
property of the MovieClip
Object.
Try this:
var puz1_arr:Array = new Array (puz1.wMc.name, puz1.aMc.name);
trace(puz1_arr);
This is assuming that puz1.wMc
and puz1.aMc
are MovieClip
Objects.
Reference:
Upvotes: 1