Skip navigation
Currently Being Moderated

callback with parameters

Apr 9, 2013 7:52 AM

I am passing a function to my class file which is called once an xml file has loaded. I want to pass the xml data and an additional string parameter.

 

l.addEventListener( Event.COMPLETE, onComplete );

 

function

onComplete( event:Event ):void

{

 

       _callback.call( event.target.data, _myState); //_callback is defined as the function "weatherLoaded"

 

}

 

 

 

 

function

weatherLoaded( data:String, myState:String):void

{

}

 

I get an error "Argument count mismatch on weatherLoaded(). Expected 2, got 1."

Could someone explain what I am missing here.

 

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points