-
extending Array Class
I'm trying to extend the Array class...
ex.
my_array = new cArray("bob", "cat", "dog");
how do I get the variables passed, onto the actual array?
I tried...
Code:
dynamic class cUtil.cArray extends Array{
//CONSTRUCTOR:
//====================================================================
function cArray(){
super(arguments);
}
}
my_array = new cArray("bob", "cat", "dog");
trace(my_array.length); // outputs "1"
it should output "3"???????
-
Uses MX 2004 Pro
I'm just starting to read about arrays, but I think you'd use this:
Code:
var myArray = new Array("bob", "cat", "dog");
trace(myArray+" "+myArray.length);
The output would read, "bob,cat,dog 3".
-
Senior Member
here is an example of what you are doing. Scroll down:
http://www.quepublishing.com/article...74328&seqNum=2
- The right of the People to create Flash movies shall not be infringed. -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|