Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 1st, 2012, 09:30 AM
frengix frengix is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 1 frengix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 7 sec
Reputation Power: 0
Question Load XML into SWF Real-Time

Hi,

I am a newbie and I need to load data from an XML file but the data is changed constantly. Is there a way to have the SWF refresh instead of caching the XML content at the first load.

My current code is as following:

Code:
var index:Number = 0;

var myxml:XML = new XML();
myxml.ignoreWhite = true;
myxml.onLoad = function(success:Boolean):Void{
	loadData();
	setInterval(loadData, 3000);
	
};

function loadData(){
	
	var messages:XMLNode = myxml.firstChild;
	if(index >= messages.childNodes.length)
		index = 0;
	var my_message:XMLNode = messages.childNodes[index];
	

	_root.status_1.htmlText = my_message.childNodes[0].firstChild.nodeValue; 
		
	_root.status_2.htmlText = my_message.childNodes[1].firstChild.nodeValue; 
		
	_root.status_3.htmlText = my_message.childNodes[2].firstChild.nodeValue; 
		
	_root.status_4.htmlText = my_message.childNodes[3].firstChild.nodeValue;
	_root.status_5.htmlText = my_message.childNodes[4].firstChild.nodeValue;
	_root.status_6.htmlText = my_message.childNodes[5].firstChild.nodeValue;		
		
	
  	index++;

}
myxml.load("data.xml");



Thanks

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > Load XML into SWF Real-Time


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap