1 Reply Latest reply on Apr 9, 2013 9:09 AM by pauland

    callback with parameters

    scrubhead Level 1

      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.