A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Array storing an increasing variable .i

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    6

    Array storing an increasing variable .i

    i want to make the elements for an array, each one i++........so

    ArrayOne = Array()
    ArrayOne[i] = i
    i++

    can somone make it work so the array would liik like....

    ArrayOne = [0,1,2,3,4,5,6,7...]

    chrz...

  2. #2
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    The code below will do what you want, but with the use of a recurring function by way of set Interval.
    PHP Code:
    var arr:Array = new Array();
    var 
    interval setInterval(update1000);
    var 
    i:Number 0;

    function 
    update():Void {
        
    i++;
        
    arr.push(i);
        
    trace(arr);

    Wile E. Coyote - "Clear as mud?"

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