A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Arrays HELP!!!!!

  1. #1
    Junior Member
    Join Date
    Dec 2006
    Posts
    4

    Arrays HELP!!!!!

    Hey everyone..been struggling with this for a while and could use a lot of help with this......

    I have an array I created like the following:

    var items = new Array({month:"January", value:this.January}, {month:"February", value:this.February}, {month:"March", value:this.March}, {month:"April", value:this.April}, {month:"May", value:this.May}, {month:"June", value:this.June}, {month:"July", value:this.July}, {month:"August", value:this.August}, {month:"September", value:this.September}, {month:"October", value:this.October}, {month:"November", value:this.November}, {month:"December", value:this.December});


    How would I create this array in a "FOR" loop so that I can build this dynamically rather than static....

    something like the following I tried:


    var items = new Array();

    for (var j = 0; j<11; j++) {
    ?????????
    }

    PPPPLLLEEASE any help would be greatly appreciated

  2. #2
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    Basically:
    for (var j = 0; j<numberOfItems; j++) {
    items.push(itemJ);
    //or
    //items[j]=itemJ;
    }
    how to access the individual items (to put them into the array) depends on how the item objects are provided. do you get them from a php page? are they already individual objects in ActionScript?
    Please sign here

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