A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Pushing My Array

  1. #1
    Senior Member zervell's Avatar
    Join Date
    May 2004
    Posts
    259

    Pushing My Array

    I having trouble with the arrayname.push(). I think that its writen correctly
    Code:
    for (i=0; i<xml.childNodes.length; i++) {
    
    		var atr = xml.childNodes[i].attributes;
    		output.push({score:atr.score, date:atr.date, id:atr.ident, comments:atr.comments});
    		
    	}
    my question is how to display the things I've pushed in.
    CEO OF

  2. #2
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    trace(output[0].score); perhaps?
    http://www.birchlabs.co.uk/
    You know you want to.

  3. #3
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    Code:
    for (var i=1;i<=output.length;i++){
    trace("values: "+output[i-1].score+", "+output[i-1].date+", "+output[i-1].id+", "+output[i-1].comments);
    }
    have you declared before a new Array ?
    Code:
    output= new Array();

  4. #4
    Senior Member zervell's Avatar
    Join Date
    May 2004
    Posts
    259
    thanks VENGEANCE MX it worked, and also to renderhjs. My last question is; is there a way to make a php file run a function in flash?

    For example I'm making a score bored and I want my php file to send a message to flash to refresh the xml file. Lets say I have a function in flash called 'xmlrefresh()' and I want it to run when a php file is executed; is this posable? I would describe it as a "real time" turn based updater. It almost sounds like a chat room idea but unlike a chat room this will not need a stock connection and its for high scores.

    Thanks for the help
    CEO OF

  5. #5
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    PHP might be able to trigger a JavaScript event which could call a function in Flash (something to do with fscommand, I believe).
    http://www.birchlabs.co.uk/
    You know you want to.

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