You are using the wrong syntax, that's all.
for (var btn in btnClipArray) {
btnClipArray[btn].removeMovieClip();
}
btn is simply referring to the index in the array, not the object in
that array's position. If you traced btn you'd get a number counting
down from the length - 1 of the arr
One technique I often use is to create the array as a private member of
a class and guard it against including invalid classes. For example:
import mypackage.Item;
class mypackage.ItemList extends Object {
public function ItemList() {
super();
_items = new A
Also, if you dont want to go all the way to haXe, MTASC has added the
ability to indicate the type of an array. I forget the exact syntax,
but you put the type in a comment.
Regards
Hank
On 9/17/06, Mark Winterhalder <[EMAIL PROTECTED]> wrote:
On 9/17/06, dc <[EMAIL PROTECTED]> wrote:
> is ther
On 9/17/06, dc <[EMAIL PROTECTED]> wrote:
is there a way to tell flash what types an array contains?
Not in ActionScript, unless you make some custom methods that access
it and check for the type at runtime.
In haXe, however, you can do just that. It can compile for FlashPlayer
6/7/8/9, into ex
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 a
5 matches
Mail list logo