PDA

View Full Version : Arrange with actionscript?



rymored
January 26th, 2003, 01:26 PM
I want do use actionscript to arrange a movie. I have three "windows". It looks kainda lika the windows in windows. I want it to be so that when you klick on a window it comes to to. SO that the other windows is underneath. How can i do this?

andr.in
January 26th, 2003, 01:30 PM
You're looking for swapDepths()!
Search the site for a tutorial on swapDepths();
PS The site may be down or not functioining properly, that's because we are moving to a new server!

lostinbeta
January 26th, 2003, 01:30 PM
You will need to use swapDepth()

You can do it like...

on (press) {
this._swapDepth(10);
}


or

on (press){
this._swapDepth(_root.otherClip);
}


Please note that this is just to display how swapDepth works.


What it does it changes the level your clip is on so it can be higher or lower than the other clips on the stage. For the case of windows I recommend using the second method so you can swap depths with the window that is in the front.

http://www.kirupa.com/developer/actionscript/swapdepth.asp

Guig0
January 26th, 2003, 01:34 PM
what you want is swapDepths

try these tutes:

kirupa (http://www.kirupa.com/developer/actionscript/swapdepth.asp)

flashkit (http://www.flashkit.com/movies/Scripting/Other/swapDept-Pradeep_-3414/index.php)

[EDIT]damm you, i was getting a cigarrete and you guys beat me in the race :P not you rymored ;)

Guig0
January 26th, 2003, 01:44 PM
WELCOME TO KIRUPA !
© ELECTRONGEEK CO.

hope you enjoy being here with us. have a nice stay! :crazy:


iŽll leave in you tab the copyright fee of the geeks welcome :P

andr.in
January 26th, 2003, 01:53 PM
ummmm... lost maybe it should be this.swapDepths(depth); ?

senocular
January 26th, 2003, 02:53 PM
you need to use swapDept.. darn you guys are fast! ;)

also be aware of movieclip.getDepth()

and yes, lost was a little offkey there... a brainfart no doubt ;)

BUT the _ thing brings me to mention the following altercation which can be made to add a _depth property to movieclips



MovieClip.prototype.addProperty("_depth", MovieClip.prototype.getDepth, MovieClip.prototype.swapDepths);


myMovieclip._depth = 10;

presto!

rymored
January 26th, 2003, 03:51 PM
Wow.. you answerd realy fast.. thanks.

I managed to fix things, so now my flash is almost perfect! :)

lostinbeta
January 26th, 2003, 04:40 PM
Yeah, it was a brainfart on my part. I was in a bit of a hurry and typed it really fast.