A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: extending Array Class

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    419

    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"???????

  2. #2
    Uses MX 2004 Pro Quixx's Avatar
    Join Date
    Nov 2004
    Location
    U.S.
    Posts
    877
    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".

  3. #3
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center