Ultrashock Forums > Flash > Flash Professional
Problem in loading XML in Flash CS3

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Problem in loading XML in Flash CS3
Old 2008-11-05

Hi Guys i am facing problem with this little script and unable to load XML in Flash CS3...

My Code is ...

package
{
import flash.display.MovieClip;
import flash.display.Loader;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.xml.*;

public class LoadingXML1 extends MovieClip
{
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

xmlLoader.addEventListener(Event.COMPLETE,LoadXML);

var requestURL:URLRequest = new URLRequest('first.xml');

xmlLoader.load(requestURL);

public function LoadXML(e:Event):void
{
xmlData = new XML(e.target.data);
trace(xmlData);
}
}
}


................

is some thing wrong with this code??? Please Help... Thanks in Advance
postbit arrow 1 comment | 557 views postbit arrow Reply: with Quote   
Registered User
vijendramisra is offline
seperator
Posts: 21
2008-01-18
vijendramisra lives in India
vijendramisra's Avatar
seperator

Ultrashock Member Comments:
Isocase's Avatar Isocase Isocase is offline Isocase lives in United States 2008-11-06 #2 Old  
Code:
package 
{
	import flash.display.MovieClip;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;

	public class LoadingXML1 extends MovieClip
	{
		private var xmlLoader:URLLoader;
		private var requestURL:URLRequest
		
		private function LoadingXML1()
		{
			xmlLoader = new URLLoader();
			requestURL = new URLRequest('first.xml');
			
			xmlLoader.addEventListener( Event.COMPLETE, loadXML, false, 0, true );
			xmlLoader.load(requestURL);
		}

		private function loadXML(e:Event):void
		{
			xmlLoader.removeEventListener( Event.COMPLETE, loadXML, false );
			xmlData = new XML( e.target.data );
			trace( xmlData );
		}
	}
}
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: