Sfx complete function usage[SOLVED]


(billy2000) #1

Hyas guys. Im wandering how can i use the complete function for a sfx.Where do i override it ,what do i do with it? I have no idea >.<. Thx :smile:


(Jonathan Stoler) #2
/* using constructor */
var sfx:Sfx = new Sfx(__SOURCE__, function():void{
	// do something
}, "type");
sfx.play();

/* using property */
var sfx:Sfx = new Sfx(__SOURCE__);
sfx.complete = function():void{
	// do something
}
sfx.play();

(Mike Evmm) #3

It’s like an event. You define a function somewhere and then point that function as the callback in the constructer. Well, I was beaten to it


(billy2000) #4

THX :smile: u guys are awesome