Hi iam trying to call the XMLloader class from a flash file. Here the example:
import flash.display.*;
import flash.events.*;
var xl:XMLLoader;
var array:Array;
xl = new XMLLoader();
array = new Array();
xl.addEventListener(Event.COMPLETE, loaded);
xl.addEventListener(ProgressEvent.PROGRESS, loading);
function loaded(e:Event):void {
trace(e.target.data["xml1"]);
}
function loading(e:ProgressEvent):void {
trace(e.target.ratioLoaded);
}
I get this error:
xl.loadXML(["http://flashden.net/feeds/user_item_comments/cg219.atom", "http://feeds2.feedburner.com/kreativeking?format=xml"], ["xml1", "xml2"], false);
1137: Incorrect number of arguments. Expected no more than 2.
Is there something I am doing wrong. please let me know.
Have something to teach the world? Want to earn money doing it? Tutorials, screencasts, and articles published here on Activetuts+ are largely contributed by readers just like you! We'll pay you great money for good content. Find Out More
Would be cool looks how it’s works
Thanks
Good one, Clemente! Thanks for contributing!
@vlasnn: you need to try the class itself to see how it works. Pretty handy though:)
@Vlasnn Sparky is correct, it isn’t a visual class. Stay tuned though, I will have a screencast soon to explain how to use it and its features.
@Sparky Thanks again
Hmmm…. Interesting. Gonna check it later!
I’ve noticed when I use this class online it’s having issues loading multiple xml files at once. Any updates? Thank you.
What kind of issues are you having? Email me at me [at] kreativeking.com. There is an update coming soon in the next coming weeks.
Hi iam trying to call the XMLloader class from a flash file. Here the example:
import flash.display.*;
import flash.events.*;
var xl:XMLLoader;
var array:Array;
xl = new XMLLoader();
array = new Array();
xl.addEventListener(Event.COMPLETE, loaded);
xl.addEventListener(ProgressEvent.PROGRESS, loading);
xl.loadXML(["http://flashden.net/feeds/user_item_comments/cg219.atom", "http://feeds2.feedburner.com/kreativeking?format=xml"], ["xml1", "xml2"], false);
function loaded(e:Event):void {
trace(e.target.data["xml1"]);
}
function loading(e:ProgressEvent):void {
trace(e.target.ratioLoaded);
}
I get this error:
xl.loadXML(["http://flashden.net/feeds/user_item_comments/cg219.atom", "http://feeds2.feedburner.com/kreativeking?format=xml"], ["xml1", "xml2"], false);
1137: Incorrect number of arguments. Expected no more than 2.
Is there something I am doing wrong. please let me know.
Thanx
yup, You’re making a mistake there:
loadXML() method uses 2 arguments only – loadXML($url:Array, $names:Array)
You’ve mixed it up with class constructor arguments –
XMLLoader([$url:Array, $cache:Boolean, $names:Array, $skipErrors:Boolean])
i’ve just read the attached example, which misslead u..
@author:
fix the attached sample code in main class file
i wonder what this class needs and what will return.. please post a sample how can i detect file is loaded and ready to go..