Jump to content
Search Community

onCompleteParams in Greensock Loaders?

MostTriumphant test
Moderator Tag

Recommended Posts

No, because Event handlers typically only receive one parameter (and Event) by conventional standards. You're probably referring to callbacks in the tweening platform which are different. But you could accomplish something similar by putting generic data in the loader's vars object and then accessing it like:

 

var loader:ImageLoader = new ImageLoader("1.jpg", {onComplete:myFunction, onCompleteParams:["1", "2"], container:this});
loader.load();
function myFunction(event:LoaderEvent):void {
   var params:Array = event.target.vars.onCompleteParams;
   trace("completed " + event.target + " and the parameters are: " + params[0] + " and " + params[1]);
}

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...