I linke your solution and though I usually prefer to reuse objects such as
loader, I'm not totally against creating a loader per request since in some
situations it can be handy. But let me tell you, you have a subtle bug in
your code.
You need to pin down your loader somehow, because otherwise,
..how to combine:
function loadXML(dfile:String):void
{
urlLoader.load(new URLRequest(dfile));
urlLoader.addEventListener(Event.COMPLETE, parseXML);
}
function parseXML(e:Event):void
{
xmlFile:new XML(e.target.data);
totalBars = xmlFile.children().length();
}
My goal is to send the
Can you set a private var other functions can use?
--
Kenneth Kawamoto
http://www.materiaprima.co.uk/
On 26 February 2010 14:24, Lehr, Theodore ted_l...@federal.dell.com wrote:
..how to combine:
function loadXML(dfile:String):void
{
urlLoader.load(new URLRequest(dfile));
Ted - this should do what you're after:
package
{
public class MyData
{
private var _myVarA:String;
private var _myVarB:Number;
private function loadXML(dfile:String, myValueA:String,
myValueB:Number):void
Another option:
function loadXML(dfile:String,arg1:Object,arg2:Array):void
{
urlLoader.load(new URLRequest(dfile));
urlLoader.addEventListener(Event.COMPLETE, function(e:Event):void {
parseXml(e,arg1,arg2);
});
}
function parseXML(e:Event,arg1:Object,arg2:Array):void
{
xmlFile:new
Juan Pablo Califano wrote:
Another option:
function loadXML(dfile:String,arg1:Object,arg2:Array):void
{
urlLoader.load(new URLRequest(dfile));
urlLoader.addEventListener(Event.COMPLETE, function(e:Event):void {
parseXml(e,arg1,arg2);
});
}
and another option:
save this as
6 matches
Mail list logo