|
-
Senior Member
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
-
Script kiddie
trace(output[0].score); perhaps?
-
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();
-
Senior Member
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
-
Script kiddie
PHP might be able to trigger a JavaScript event which could call a function in Flash (something to do with fscommand, I believe).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|