A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: dynamic array

  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    42

    dynamic array

    Hello
    I am trying to pass some variables to an array.
    If you have any idea please help.

    Code:
    function Picture (picName, link, picColor, description) {
      this.picName = picName;
      this.picLink = link;
      this.picColor = picColor;
      this.description = description;
    }
    
    pics = new Array();
    myData = new LoadVars()
    myData.load("flash_used_cars.php")
    myData.onLoad = function(success){ 
                if(success){
    				
                   for (var k = 0; k<myData.total; k++) {
    
                     text1 = myData["model"+k];
                     text2 = myData["date"+k];
    
                     link = myData["path"+i];
    					
    	        pics[k] = new Picture(text1, link, 0xFF9999, text2);
                        
                    }
    				
    				
                } else mess.text = 'error';
    			
            }
    
    for (var i = 0; i<pics.length; i++) {
      newCell(i, pics[i]);
    }

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    At first sight your code seems fine.
    What's not working for you?

    You seem to have structured data (coming from a table), why not using xml instead (or amfphp)?
    You'll still get the data structured into Flash and won't have to rebuild it.

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