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 XML(e.target.data);
  totalBars = xmlFile.children().length();
}

This method has a drawback (and is usually frowned upon) because you cannot
remove the listener. In this case, though, I don't think this is a problem
(the loader seems to be owned by the class)

Cheers
Juan Pablo Califano
2010/2/26 Lehr, Theodore <[email protected]>

> ..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 first function additional parameters that would be
> used in additonal function calls.... right now I do not see how to send
> those on to parseXML.... my thought was if there was a way to combine these
> two functions - it would be easier....
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to