for...in loops don't work the same as they do in Java or C#. Take a
look at the following code:
for (var key in btnClipArray) {
btnClipArray[key].removeMovieClip();
}
The loop iterates over keys, not values This technique is not limited
to arrays and can be used on any object in Flash.
Flash assumes items held in arrays are objects. You can call any
method on them, without the compiler complaining. There is no way to
type arrays.
Scott
On 16/09/06, dc <[EMAIL PROTECTED]> wrote:
is there a way to tell flash what types an array contains?
eg given this:
var btnClipArray:Array;
--- later:
for (var btn in btnClipArray) {
btn.removeMovieClip();
}
flash defaults to thiking the array contains only strings, so the
movieclip methods throw a compile error. of course, i can cast or
otherwise hack, but it would be nice not to...
var btnClipArray:Array:MovieClip; ?
/dc
-------------------------------------------
David "DC" Collier
mailto:[EMAIL PROTECTED]
+81 (0)80 6521 9559
skype: callto://d3ntaku
-------------------------------------------
Pikkle 株式会社
http://www.pikkle.com
-------------------------------------------
_______________________________________________
[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
_______________________________________________
[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