7/6/2010 5:11:31 AM
Title:
How to go back to previous depth ?
hi, i am using Flash CS3 (AS 2)
that's what I've done:
on(rollOver){
gotoAndPlay("over");
this.swapDepths(_root.getNextHighestDepth());
}
on(rollOut){
gotoAndPlay("out");
}
now I need to restore object's previous depth on rollOut
kindly help me :-(
7/6/2010 6:00:11 AM
before setting the new depth store the old depth in a variable and when you need to restore it use that stored variable to restore the depth.
//on roll over store the old depth
var oldDepth
on(rollOver){
oldDepth=this.getDepth()
gotoAndPlay("over");
this.swapDepths(_root.getNextHighestDepth());
}
//to restore use
this.swapDepths(oldDepth);
7/6/2010 7:15:47 AM
A "Friend" in need is a friend indeed... :)
Thanks Buddy !
7/6/2010 8:22:02 AM
hi, needs your help again
here is my work:
http://www.iamgamester.com/projects/luscious/test.html
when you'll see 3 picture thumbnails, roll over & roll out
your cursor on them... they are working fine with the above
mentioned AS.
but if you stay on Roll Over (I mean you don't roll out)
the thumbnail will spoil animation... :-(
Tip: to jump direct to thumbnail's section click on Win Prizes
var oldDepth
on(rollOver){
oldDepth=this.getDepth()
gotoAndPlay("over");
this.swapDepths(_root.getNextHighestDepth());
}
on(rollOut){
this.swapDepths(oldDepth);
gotoAndPlay("out");
}
7/6/2010 9:32:32 AM
when your animation proceeds just send all three to the out animation , so if anyone was visible it will disappear
thumbnail1.gotoAndPlay("out");
thumbnail2.gotoAndPlay("out");
thumbnail3.gotoAndPlay("out");