Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Using The SwapDepths Method



I have a small photo gallery that shuffles the thumbnails randomly. When you click them, they move to the center, which I've figured out using the slideTo method.The problem is that when I use:this.swapDepths(1000);to bring the image to the front, I can't figure out how to make it go back to a lower depth. I've tried using (0), (1), (-1000), (back), (bottom) and a whole slew of others. I'm positive there's a way to send something to a lower depth, but I can't figure out what it is. Anybody have a suggestion or run into this problem before? Any help you could give me would be great. Thanks.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-10-2007, 04:02 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] No Method With The Name SwapDepths ? [as 2.0]
I am simulating an Excell spreadsheet. I have three SWFs: one to hold data, one to hold tabs, one to hold the column headings, and one to allow scrolling (because the header needs to scroll in concert with the data). My plan is to load each of these onto one SWF with a separate container for each (using the MoveClipLoader). I've gotten help on other posts to get this far, but I am stuck with errors that do not make sense to me.

Here are the error messages. I know that swapDepths and onLoadInit are real, so what is Flash trying to tell me?


Quote:





There is no method with the name 'swapDepths'
There is no property with the name 'onLoadInit'






These error messages come from the following code.


Code:
//This first container holds spreadsheet data
var MCdata:MovieClipLoader = new MovieClipLoader();
MCdata.onLoadInit = function(_loadedMC:MovieClip) {
//_loadedMC is now done loading and can be placed
//loadedMC is whatever clip you loaded the swf int (ie this.head)
if (_loadedMC == _root.dataFile){ //head loaded
_loadedMC._x = 0;
_loadedMC._y = 150;
}
};
MCdata.loadClip("Summary.swf",this.dataFile);
MCdata.swapDepths(this.getNextHighestDepth());//Pushes container to top

//This second container holds column headings and will sit above the 1st container.
var MChead:MovieClipLoader = new MovieClipLoader();
MChead.onLoadInit = function(_loadedMC:MovieClip) {
//_loadedMC is now done loading and can be placed
//loadedMC is whatever clip you loaded the swf into (ie this.head)
if (_loadedMC == _root.head){ //head loaded
_loadedMC._x = 0;
_loadedMC._y = 0;
}
};
MChead.loadClip("SummaryHead.swf",this.head);
head.swapDepths(this.getNextHighestDepth());pushes 2nd container above 1st

//This 3rd container holds tab button for loading new data and headings.
var MCtabs:MovieClipLoader = new MovieClipLoader();
MCtabs.onLoadInit = function(_loadedMC:MovieClip){
//_loadedMC is now done loading and can be placed
//loadedMC is whatever clip you loaded the swf into (ie this.head)
if (_loadedMC == _root.tabs){ //head loaded
_loadedMC._x = 0;
_loadedMC._y = 516;
}
};

MCtabs.loadClip("TabControl.swf",this.tabs);
tabs.swapDepths(this.getNextHighestDepth());



//This third container holds a scroll controll swf. It will sit at the very top.

var MCnav:MovieClipLoader = new MovieClipLoader();
MCnav.onLoadInit = function(_loadedMC:MovieClip){
//_loadedMC is now done loading and can be placed
//loadedMC is whatever clip you loaded the swf int (ie this.head)
if (_loadedMC == _root.nav){ //head loaded }
_loadedMC._x = 150;
_loadedMC._y = 20;
}
};

MCnav.loadClip("NavControl.swf",this.nav);
MCnav.swapDepths(this.getNextHighestDepth());

SwapDepths Method
I created a button and 2 movie clips. Every time when the button is clicked, the two movie clips change depth level, so that I can see the color changes. It worked fine.

swap_btn.onRelease = function() {
bgBlue_mc.swapDepths(bgYellow_mc);
};

After I loaded swf files onto the movie clips, I couldn't see see any changes of the depth level any more. What is wrong with that? Is there a way to solve this problem.

Function In A Method Return True To Method's Caller?
I think I probably don't know the correct terminology to ask this question, but here goes:

In this example, can anyone tell me how to have the setComplete event function within the main method return true to the caller of the method, instead of just to the listener?


PHP Code:



    function loadAsset(target:MovieClip, asset:String, assetLoaderInfo:LoaderInfo): Boolean    {    var assetLoader:Loader = new Loader();    var assetURLRequest:URLRequest = new URLRequest(asset);    assetLoader.contentLoaderInfo.addEventListener(Event.OPEN, setLoaderInfo);    assetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setComplete);    function setLoaderInfo(event:Event)        {        assetLoaderInfo = event.currentTarget;        }    function setComplete(event:Event)        {        target.addChild(assetLoader);        return true;        }    assetLoader.load(assetURLRequest);    }

Function In A Method Return True To Method's Caller?
I think I probably don't know the correct terminology to ask this question, but here goes:

In this example, can anyone tell me how to have the setComplete event function within the main method return true to the caller of the method, instead of just to the listener within the method?

Many thanks!


PHP Code:



function loadAsset(target:MovieClip, asset:String, assetLoaderInfo:LoaderInfo): Boolean
    {
    var assetLoader:Loader = new Loader();
    var assetURLRequest:URLRequest = new URLRequest(asset);
    assetLoader.contentLoaderInfo.addEventListener(Event.OPEN, setLoaderInfo);
    assetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setComplete);
    function setLoaderInfo(event:Event)
        {
        assetLoaderInfo = event.currentTarget;
        }
    function setComplete(event:Event)
        {
        target.addChild(assetLoader);
        return true;
        }
    assetLoader.load(assetURLRequest);

    }

[AS2 OOP] Calling A Method In A Method
Hi everyone
i'm not quite sure how to phrase my problem, so i'll examplify:

Code:
class A{
function A(){
trace("construct");
}
private function moo(){
trace("moo!");
}
private function cow(){
trace("start mooing");
moo();
}
}
this does what I expect it to: construct, start mooing, moo!

Code:
class A{
function A(){
trace("construct");
}
private function moo(){
trace("moo!");
}
private function cow(){
trace("start mooing");
_root.onEnterFrame = function(){
trace("moo!")
}
}
}
this also does what I expect it to: construct, start mooing, moo!, moo!, moo!, ...

Code:
class A{
function A(){
trace("construct");
}
private function moo(){
trace("moo!");
}
private function cow(){
trace("start mooing");
_root.onEnterFrame = function(){
moo();
}
}
}
yet this doesn't, I'd expect it to: construct, start mooing, moo!, moo!, moo!, ...
yet the moo! moo! moo! doesn't appear, as if moo() never gets called it all.
so what I'm I doing wrong?

SwapDepths
Hi all

have a question about swapDepths. I have a movie instance lets say its called myfirstmovieclip and it is located on level0 so the path would be _level0.myfirstmovieclip I want to use the swapDepths and move just myfirstmovieclip to level100. I would not be switching it with another movie clip instance on level100, nothing on 100. can I do this with swapDepths and if so what would the code look like?

_level0.myfirstmovieclip.swapDepths(_level100):

???? is this right because it aint workin.

thanks all

Swapdepths Help
I've been having problems with using swapdepths when loading movieclips into a main flash movie.

I have ten buttons that load ten movieclips into the main flash file. The movieclips have a bar across the top with startdrag action applied, and are loaded onto their own level, eg button1 one loads a movieclip onto level_1.

Can anyone help me to add a swapdepths action to the movieclips so that each movieclip comes to the front when pressed?

I've tried but can't get it working.

Thanks in advance.

Swapdepths...
hey, I have a mc that duplicates itself
each duplicated mc has a name: "mc"+a
"a" stands for a number
automatically this "mc"+a gets a depth wich is equal to this value of a

after a while I want an other mc to start but this mc has to play to overlay all of these duplicated mc's
the mc plays but all the duplicated mc's are layered above this mc

so my question is
how do I get this mc on top of all these duplicated mc's?

greets opcd

SwapDepths
mc.swapDepths(0); puts the mc to the toppest level, how do I put it in a lower level?

Help pls anybody. Thanks

Swapdepths?
does anyone know exactly what this does?

Using Swapdepths
Hi, i just need to know the sytax and how to use the swapdepths command, I understand WHAT it does i think, just how to use it, lol (repeating myself) thanks

SwapDepths? Please Help Me If You Can
action>object> swapdepths?

I am currently trying to create pannels that will swap levels when you click on them.

the two (or more ) movieclips that i am loading into a movie are pannels like the ones you see on your computer, I would like to know if you can change the levels of the pannels so that when you click on one or the other, the active pannel is moved to the front.

I have one movie that has two buttons in it that when pressed, load two other movie clips into the origional movie.
the two movie clips that get loaded are:
1) profiles.swf
2) services.swf
and the main movie is called "controller".

I just want to know how to change the levels so that the active pannel will come to the front when clicked and visa-versa.
If you can answer this that would be great, its been killing me for like a week!!!! thanks.

SwapDepths?
Can anyone help explain the Swap Depths function? Here is my dilema: I have a bunch of mcs on the stage and when moused over they expand, and when moused out they contract again. What I cannot figure out is how to make each mc be on top of all the other mcs when it expands. My guess is that the swapdepths function is what I need, but I cannot get it to work. I posted a small example here http://www.sevenagainst.com/test.htm . Notice when you mouse over the left mc, it expands underneath the right mc. The finished movie will have about 30 mcs total.
Any help on this would be greatly appreciated!

SwapDepths
OK. I am ready to go insane. I want to have a project that has 5 areas (images) that when clicked become zoomed in on. So far I have 2 MC's (only 2 images so far to test and make sure it will work. If I can figure this out then I will add the other 3) and I have it so that whichever one is clicked on will resize the MC to seem as if it has been zoomed in on. THe problem that I have encountered is that when one image is enlarged, it overlaps the other image. I have tried every synatax of swapdepths and it doesn't work consistently. I have searched the forums for swapDepths and attempted the suggestions made in different threads, but still it does not work. I want whichever image is click to be on top. I am not sure if I put the code in the wrong place, or if I am using incorrect code. I don't know. I will be happy to e-mail anybody the .fla if they would like to see where I am going wrong.

SwapDepths Once... HELP
Hi!
I'm trying to make two mc's swap depths depending on witch one's in front of the other...

if (this._xscale>=114) {
this.swapDepths(_root.ball2);
}

does not work since the MC's toggle depths if "this" is bigger than 114. I want it to change depths once depending on the size of "this". And change back if it's smaller than 114...

MC.swapDepths( )
Does using MC.swapDepths() have any side effects?

I have 2 movie clips of which I want to switch the depths. These movies move positions each frame. However, it seems that when I use this swapDepths, I these movies won't move at all during the next frames.

Any help is appreciated!
Ya Tin

SwapDepths
hi, i have been trying to figure out how to modify this code so that other instance names may be used other than "window". this code is from the actionscript.org tutorial located at http://www.actionscript.org/tutorial...hs/index.shtml

on the main stage on a frame you have the script which sets the highest level to 2:
_level0:highest = "2";

then in the movie clips you have this code on a button the part in red is the instance name of the clips, im trying to get this to be basicly a wildcard so that the instance names dont have to be set to window0 window1 and so on:

on (press) {
this.swapDepths( "_level0:window" + _level0:highest );
_level0:highest = substring ( _name, 7, 1 );
startDrag(this);
}
on (release) {
stopDrag();
}

this is beyond my actionscript knowledge (im slowly progressing) so if anyone knows how to do this, or if its possible, help is greatly appreciated if you need me to explain more feel free to ask, my wording might be a bit off

SwapDepths
on (press) {
box.swapDepths(circle);
}


this is the peace of code that is pissing me off.. haha..

i'm just wondering if i can replace that (circle) with a string...

for example:

objectToSwapTo = "_parent.circle";

on (press) {
box.swapDepths(objectToSwapTo);
}


how can i go about doing that, coz i need a more dimanic way of swapping depths..

is there a way to see what depth lever a MC is on?? that would help a bit if i can't figure out how to use variables with this statement..

SwapDepths Help...
I need to swap the depth of several movieClips but I am not sure how it works...

I am using a loop, where i takes the value of all the clips to be updated:

_root.timeline["barra"+i].swapDepths(i-1);

this is action is to decrement the depth of each clip, but it must not be working because attaching a new clip, makes the last one disappear...
Is this clear? Actually I am building a secuencer... blocks can be inserted to represent screens. The blocks can be deleted and there is where I need to slide all the blocks and modify their depths to equal them to their new index.

any help will be appreciated.

Swapdepths ?
I have a series of movie clips that i'm duplicating repeatedly and i need a seperate movie clip to remain ontop of the clips that are beiong duplicated?

whats the easiest/best way to do this?

many thanks

SwapDepths
I want to randomly shuffle the layering of several movie clips. Each time you launch the movie the clips will be ordered differently. I want to be able to keep track of their order, or at the very least read which one is currently on top. How do I do this?

Swapdepths?
Has anyone dealt with these before? I have a problem that I thought may have been caused by draggable movie clips, but now I'm starting to think that the swapdepths that I have put on the movie clips may be the problem.

I have a frame that contains several draggable movieclips and everytime you move an MC it moves the swapdepth of that MC up one, so that the MC is always on the top. My problem is that when the user drags the MCs to the correct place, the movie moves them a few frames down the timeline. Those buttons are not in any of the new frames, but they will not leave if the user had moved them in the previous section. Why would this be?? How can i get around it?

Need SwapDepths Help...
Hi There...

Not sure I can even do this. I have a main movie with a separate MC for nav. On main movie load, the first movie clip loads to the side. Then if you click a button in the nav MC, another MC loads. This all works fine, just the way I want it to. On each of the top bars is a button to drag that particular MC. Here's the code:


Code:
on (press) {
startDrag("", false, 280, 120, 560, 380);
}
on (release) {
stopDrag();
}
The thing is, up to 6 MC's can be open at once. This is fine, as that's how it was designed. But, I would like to make it so that I can bring any of the MC's forward when the top bar is clicked on. Is this possible?

I'm using MX and publishing as F6. Everything is on layers, not levels, and I want to keep it that way. Which is why I'm not sure this is possible.

Thanks...

Them Swapdepths Again
Hey,

I've got a little problem,
I have a empty holder MC ('tiles') with a depth of 1...

Now in that MC I'm attaching lotta tiles... I was wondering if every value these tiles get can't be used in the main stage, or only not in the 'tiles' MC

SwapDepths
Here is my problem...

I have a main MC that loads 6 other MC's into it. When a new MC's is loaded, the current MC is faded to say, 50%. Then the new MC's preloader begins, over the top of the current MC. How can I do this? It works fine when a movie is loaded into a level above it, but when an MC in level 2 trys to load an MC in level 1 it is blocked, because all my MC's are solid (containing pictures and info).

I used Flash Help, and decided that I should be using swapdepths to fix this problem, but it gave no example. Someone please help, as I have been trying to figure this out for the last three hours...

Mc.swapDepths
I could use some help. I have five buttons on the same layer. All I did was drag them out of the library onto the layer. The buttons overlap. When the user mouses over one of the buttons, I want it to move to the front of the other buttons so the entire image is revealed.

I am trying to use the swapDepths(depth) method (as per the suggestion of two helpful souls from this discussion) to make this work but I think I'm screwing it up. The items remain at their initial depth.

Here is the code for two of the buttons on the layer, GMPCHome and AboutUs

on (rollOver) {
GPMCHome.swapDepths(1000);
}
on (rollOut) {
GPMCHome.swapDepths(900);
}
on (release) {
getURL("about.html");
}

_+_+_+_+_+_+_+_+_+

on (rollOver) {
AboutUs.swapDepths(1000);
}
on (rollOut) {
AboutUs.swapDepths(800);
}
on (release) {
getURL("about.html");
}

The idea is that even though the GPMC Home button is in front of AboutUs, when the user mouses over AboutUs (which is still about 90% visible), it will move to a depth higher than the GPMCHome button.

Please help, I have to deliver this in its completed state on Monday night.

Thanks!

[help] Swapdepths
hi guys,

i've read the sticky and that document is great. http://www.umbc.edu/interactive/flas...e.php?p=depths.

i have just a quick question for you:
i have 2mc's on the stage. 1 called 'hero' the other called 'square'. inside the 'square' mc are 2 mc's called 'square1' and 'square2'. is there anyway at all that i could make the hero appear infront of square 2 and at the same time behind square 1?

Quote:




from that document
The depths of objects can only be changed in respect to other objects within that same timeline. This applies to both actionscript and when working in the Flash authoring environment. What this means is that if you have two movieclips, clipA and clipB and they each have their own clips within, then those interior clips depths can not be changed or rearranged in relation to each other. The only way to rearrange their depth positioning is if you rearranged clipA's and clipB's depths directly which would then of course rearrange everything within those clips either above or below the other




does this mean the above question cannot be done?

thanks guys

How Do I Use Swapdepths?
Hi My problems have been narrowed down a bit to the swapdepths function but i cant implement it correctly.
I have 7 buttons when the mouse passes over any, it masks out the other 6, but, it does not work in the suggested manner, apparently its a problem of depths, as they are placed in the movie or something like that. anyway Im not really sure where the code should go to do the swapdepth function, I have been blundering around with this for near on 2 days and getting knowwhere

could someone look at what I have done and offer suggestions


http://users.bigpond.com/netwitz/nav.fla (129KB)

How Do I Use Swapdepths?
Hi My problems have been narrowed down a bit to the swapdepths function but i cant implement it correctly.
I have 7 buttons when the mouse passes over any, it masks out the other 6, but, it does not work in the suggested manner, apparently its a problem of depths, as they are placed in the movie or something like that. anyway Im not really sure where the code should go to do the swapdepth function, I have been blundering around with this for near on 2 days and getting knowwhere

could someone look at what I have done and offer suggestions


http://users.bigpond.com/netwitz/nav.fla (129KB)

SwapDepths
As you will see from this file, I am trying to swap the depths of the yellowish boxes but keep the greenish one always second from the top. Can anyone tell me why they aren't swapping? Your help is appreciated.

Swapdepths ?
Howdy!

Got 5 mc's mca, mcb, mcc,...stacked on the stage all from different library symbols.

I would simply like to click on any of them and bring to front.

Would like them to drag also if that's not asking too much.

I've tried 4 methods so far and can't get this to work.

Just looking for a simle way.

Thanks,
B

SwapDepths?
I have a bunch of movie clips in my movie that when clicked on they act as though they are falling, ie their gravity script kicks in. These objects are china plates, cups etc. sitting on shelves.
Could anyone give me some pointers or steps on how to get the clip that was last clicked on to come to the front (top depth?) so it appears as though its falling in front of all others. Do I use the swapDepths method somehow? Thanks

SwapDepths
hey,

I have 4 images and on top of the images, i have 4 buttons. I put the images in MCs (mc1, mc2, mc3, mc4). And on the 4 buttons, i have this code:


Code:
on(release){
mc1.swapDepths(1000);
mc1.gotoAndPlay("start");
}
"start" is a simple fade-in animation.

Now, if you click buttons, the image loads on top of the buttons. I want it so that when you click a certain button, the image under the button chages and you're still able to see the buttons.


Something like this:

http://69.20.52.206/laring/portfolio/main3.html


thx,
Baljinder

SwapDepths
I'm new to actionScripting. so I need to be hand held with a step by step script. I have 4 square images that line up with each other to form a larger square (two over and two down). each one is a button. when the user clicks it grows to fill the larger square shape. the problem is I want the button being clicked to always be on top covering the other three.

Swapdepths
peepz,

i have two movieclips and two buttons, if i press a button the desired MC must always have a lower depth then the other MC, now it's only working once...

can somebody fix this so it alwas have a lower depth ?


Code:
this._parent._parent.swapDepths(this._parent._parent._parent.mcTopNavigation);

SwapDepths
Hey,

Does anyone know why my swapDepth isn't working?

This is the code I have...


Code:
_root.pic_1.onRelease = function() {
_root.pic_an_1.swapDepths(_root.getNextHighestDepth());
_root.pic_an_1.gotoAndPlay(1);
};
_root.pic_2.onRelease = function() {
_root.pic_an_2.swapDepths(_root.getNextHighestDepth());
_root.pic_an_2.gotoAndPlay(1);
};


But for some reason, when I click the "pic_2" button...my "pic_an_2" movieclip does not come to the top. Likewise, if I click the "pic_1" button, my "pic_an_1" movieclip doesn't come to the top.


Please download my file and take a look.

Thanks.

SwapDepths
i want to have a picture of a room where the viewer can choose from 3 or 4 different wall colors, flooring materials, countertops and so on. i'm guessing that i have to use swapDepths to allow one pic to appear on top of another but i can't get it to work with more than 2 items. any ideas or suggestions? thanks

This.swapDepths - Little Help?
Hi there...

I'm working on a personal project at the moment. What I'm looking to replicate (in some fashion) is the main screen of Wario Ware for the Nintendo DS (the one with a bunch of characters wandering about).

I've got the random movement worked out, but at the moment the z-stacking is being worked out by Flash - this means that if movieclip A moves in front of movieclip B (which has been stacked at the 'top of the tree' by Flash), A is still obscured - even though, by the basic laws of perspective, it should be in front.

I have an area of about 500x550 that my movieclips are free to roam around in. What I've been trying to do is get the depth of each movieclip to change along with its current y coordinate (rounded up to the nearest whole number) - this way, if a clip moves behind another clip, the stacking order is automatically sorted.

The basic random movement for my characters is based on Suprabreener's example that I found via Google, with a few additions for returning certain variables. This one block of code controls all the movemnt for all the characters, and I'd like to keep it that way if at all possible. It's shown below:


Code:
//special thanks to Suprabeener for the code
function getdistance(x, y, x1, y1) {
var run, rise;
run = x1-x;
rise = y1-y;
return (_root.hyp(run, rise));
}
function hyp(a, b) {
return (Math.sqrt(a*a+b*b));
}
MovieClip.prototype.reset = function() {
//specify the width and height of the movie
width = 500;
height = 500;
//-------------------
var dist, norm;
this.x = this._x;
this.y = this._y;
this.speed = Math.random()*5+2;
this.targx = Math.random()*width;
this.targy = Math.random()*height;
dist = _root.getdistance(this.x, this.y, this.targx, this.targy);
norm = this.speed/dist;
this.diffx = (this.targx-this.x)*norm;
this.diffy = (this.targy-this.y)*norm;
};
MovieClip.prototype.move = function() {
if (_root.getdistance(this.x, this.y, this.targx, this.targy)>this.speed) {
this.x += this.diffx;
this.y += this.diffy;
this.clipdepth = Math.round(this._y);
this.swapDepths(this.clipdepth);
if (Math.abs(this.diffx)>Math.abs(this.diffy)){
if (Math.max(this.targx, this.x)==this.x){
this.direct = "left";
} else {
this.direct = "right";
}
} else if (Math.abs(this.diffy)>Math.abs(this.diffx)){
if (Math.max(this.targy, this.y)==this.y){
this.direct = "up";
} else {
this.direct = "down";
}
}
} else {
this.x = this.targx;
this.y = this.targy;
this.speed = "";
if (!this.t) {
this.t = getTimer();
}
if (getTimer()-this.t>2000) {
this.reset();
this.t = 0;
}
}
this._x = this.x;
this._y = this.y;
this.roundspeed = Math.round(this.speed);
if (this.roundspeed < 5) {
this.speedanim = "walk";
} else if (this.roundspeed > 6) {
this.speedanim = "sprint";
} else if (!this.roundspeed) {
this.speedanim = "stationary";
} else {
this.speedanim = "run";
}
};
this.clipdepth = this._y;

this.swapDepths(this._y);
What I need to figure out is how to get the clips to swap depths like I described, or failing that, swap with each other if they collide and should have their depths reversed. Nothing I've been doing has worked, and I'd be very grateful for any help!

Thanks!

SwapDepths() Help...
Hi flash folks,

I'll try to explain what is happening.
I have a mc1 on the main time line with a
//
onClipEvent(load){
this.swapDepths(390);
{
//
How do i keep the depth of mc1 when i go back to the line with the onClipEvent on it.
I'm duplicating a mc2 every time the mc3(Ball) moves and i need it to stay under mc1.( mc2 is a line which follows the ball like the Tron game).

If you understand the above then please help. If not then i'll have another go at explaining it..

Thanks,

Ivorsmallun...

Bug In Swapdepths?
hi...

i having a problem with my drag n drop and droptarget and swapdepths, but i think its most likely the swapdepths.

its like this, i have 3 different target area, den 6 different mc. so the user will drag the correct mc into the correct target. so once they are done, they click on a button to check the answer. so then the button will go to the frame of which whether it is correct or wrong. for ie if its correct it will go frame 2 and if wrong go frame 3.

everythin is workin perfectly until the user click on the button den go to that particular frame. on that frame, it will show the mc that was last drag, which is not supposed to show out anyway. and the thing is that on the stage i don't have anything for that mc, so the mc kinda stay on the stage when it shouldn't.

so anyone... my dears~ please help me~

SwapDepths
Hi. I really need help on this one. So if anyone out there could help me I would appriciate it

I've loaded aboutme.swf into level 20. When the movie is finished loaded I want to move aboutme.swf to level 10.
Is this possible?

I tried this.swapDepths (10); in the last frame of the movie, but it didn't work.

About SwapDepths
this has been puzzling me

is it possible to swap depths for multiple movie clips at the same time?
how about swapping for negative depths? or will that kind of thing lead me into probs later?

thanks for advising a noob...

Swapdepths On 5 MC
Hi, I understand this concept.

Code:
myMC1_mc.onRelease = function() {
this.swapDepths(myMC2_mc);
};
myMC2_mc.onRelease = function() {
this.swapDepths(myMC1_mc);
};


But how would I swap depths if there are more than 2 movieclips?

I tried a for loop but it didn't work. I've also tried:
Code:
this.swapDepths(this.getNextHighestDepth());
still no worky.

Any pointers would be much appreciated.
----------------------- edited -------------------------
It works now. Thanks.
/Flip

Best Swapdepths() Way
i'm creating a rectangle which is divided into 4 buttons. onRollover each button resizes until it covers the other buttons. and then there is the problem with the depths. i tried some depth methods but nothing seemed to do the right thing. here is an image which will explain my situation probably a bit better:



thanks for your help

SwapDepths
hey, i recently learned about the swapDepth() code.
i have no idea how it works
i cant find a tute for it
i want to know how to make a mc be above or below another mc when its higher up than the other
apparently with the help panel i got:

if (_root.p1._y>_root.p) {
_root.mc1.swapDepths(2);
_root.mc1.swapDepths(_root.mc2);
}else if (_root.mc1._y<_root.p) {
_root.mc1.swapDepths(1);
_root.mc1.swapDepths(_root.mc2);
}

and of course
nothing

i would greatly appreciate any sort of help
cd

Perhaps Not Swapdepths
I have a movie load in a target called "bak", I also have a movie loaded in a target called "front". What I am trying to do is when I press any button, I want the movie in the "front" to move to "back" and the new movie load in "front".

I don't think swapdepth is going to work for this, is it? Any suggestions on how this can be done ? Thanks

SwapDepths HELp
hi guys..im having problem in swapDepths..i made 5 papers and it has swapDepths, the swapping of papers working perfectly except in page5 when i click page1, page5 wont go back on its original position..what should be the problem on this? i hope you can help me..THANKS!

[F8] How Do I SwapDepths ?
Hey I can't get these to dymanic objects to swap depths, heres my code:-


Code:
_root["block"+i].swapDepths(9998);

[F8] : SwapDepths
Hi, I have a question about the SwapDepths function. I have an image gallery with five movieclips (mc1, mc2, mc3, mc4, mc5), which are controlled by a series of corresponding thumbnails with blank buttons. (see http://www.sub-studio.com/landmark/heritage.swf) Sometimes, when clicking through the images in the gallery the transition no longer is between the image you are viewing and the one you've clicked - one of the other images appears behind, which creates a very annoying transition. It's not always the same image, which makes me think there's something wrong with the way I'm using the swapDepth function. When the blank thumbnail button is clicked, I have action script that states:

on (release)
{
_root.bg_mc.mc1.swapDepths(1);
_root.bg_mc.mc1.gotoAndPlay(2);
}

Copyright © 2005-08 www.BigResource.com, All rights reserved