Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : is there a PHP sleep() function in Flash?


cosu
11/30/2006 9:25:09 PM
Hi!

anonymous thing
11/30/2006 10:33:30 PM
cosu
12/1/2006 4:26:37 PM
what i want to do is to remove some movie clips through a loop, but i don't
want them do dissapear all at once, but one by one... let's say 0.2 seconds
between them...

thanks

[q][i]Originally posted by: [b][b]anonymous thing[/b][/b][/i]
not directly... You can use a timer(setInterval) that will change state of
your application; it might be a boolean value for example. Could you post, with
more details, what you want to do?[/q]


anonymous thing
12/1/2006 5:40:32 PM
In the example a put two pieces of code: one for a complete removeMovieClip and
second for hidding mc so take one of this solution.




// list your mc by there name
// if scope are differents use _target prop for each of your mc
var arrMcToRemove:Array = ["mc1","mc2","mc3","mc4","mc5","mc6","mc7"];

var intIndexToRemove:Number = 0;
var intIdInterval:Number = 0;
var intMMsecTimer:Number = 200; // nb of mmsec for your timer(1seconde ==
1000mmsec)

function yourFunctionName(){
clearInterval(this.intIdInterval);
// remove mc
// first this is your scope; it can be everything(_root[..., _level0[...,
.....)
this[this.arrMcToRemove[this.intIndexToRemove]].removeMovieClip();

// hide mc
this[this.arrMcToRemove[this.intIndexToRemove]]._visible = false;

if(++this.intIndexToRemove < this.arrMcToRemove.length)
this.intIdInterval = setInterval(this, "yourFunctionName",
this.intMMsecTimer);
}

test_btn.onPress = function(){
yourFunctionName();
}
AddThis Social Bookmark Button