Welcome to the navigation

Commodo sit do cupidatat sint tempor culpa est sunt dolore ullamco ex laborum, amet, ut in duis et cillum dolore velit ea magna fugiat elit. Amet, lorem irure veniam, in ex magna exercitation excepteur aliquip dolore sint adipisicing do enim laboris labore laborum, in sit incididunt commodo minim ullamco id

Yeah, this will be replaced... But please enjoy the search!

Sleep in Flash AS3

I've noticed a lot of questions around the Internet regarding sleep() functions in Flash. Well, there isn't exactly a direct command to pause a Flash movie, instead we have to rely on the same type of functions available in JavaScript, setTimeout or setInterval. Alright, here it is

// Call the function, time in seconds

function sleep(sec) {
	// Stops the script on the current frame

	// The actual pause, and starter
	setTimeout(this.gotoAndPlay, sec*1000, this.currentFrame + 1);
I usually place the function inside a class, or in a bottom layer that's always included. That way I can just call the sleep() whenever I want.