Swapping Depth Problems, Urgent
Hi,I?m making a commersial banner for a poker company online, and what?s supposed to happend is that the dealer grabs cards from his deck and give two to each three persons on the table. Next he swings a card up in the air which becomes really big, and the news is on that card. My problem is that when one card after anoter dissapears from the top of the deck they land under the players? hand. I?m talking about the six cards that are not news now. When the card with the news on is sent up it goes underneath everything else so I figured I need a swapDepths function, but all the tutorials explain only the swapDepths function with a mouse action to set it off, but I need some sort of onEnterFrame because the user shouldn?t need to interact. Please help! I?m sorry, but I can?t post the .fla file because this is a project I?m doing for a major firm, and I?m not allowed to give anything to anyone else.
General Flash
Posted on: Sat Mar 25, 2006 11:20 am
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Depth Swapping
Hi all. I have a question about a problem I'm having getting some action scripting to work right.
I have a main page that I use buttons with loadMovie commands to load outside .swf files into it as MC instances. I've had no problem getting depthswapping to work with the MC instances. When I click on one, it pops to the top of the others fine. But, when I click to load another, it doesn't seem to know what the currect value of my _level incrementing variable is. The new MC instance loads beneath the last window I clicked on to bring above the rest.
Here's the various code I'm using:
For the load button in the _level0 timeline:
on (release) {
//establish location for starting position of
//loaded MCs for cascading windows based on
//"target" value
target = target + 1;
if (target > 4) {
target = target - 4;
}
depth = "_level" + z;
z = z + 1;
loadMovieNum ("green.swf", z);
test = depth; //displays this value to test output field
}
This scripting increments the depth z and loads the green.swf to _levelz. There is an OnClipEvent in the green.swf that repositions the green MC instance based on the value of the target variable producing a window cascading effect when multiple windows are opened. This cascading works fine.
The green.swf is just a plain rectangular window with a window wide drag handle. The scripting on it is:
on (press) {
_level0.z = _level0.z + 1;
_root.swapDepths( _level0.z );
depth = "_level" + _level0.z;
greentest = depth;
startDrag ("_root.green");
}
on (release) {
stopDrag ();
}
Why would the depthswapping work fine from instance to instance of this MC, but when I load a new instance it appears under whichever window I happened to click on last?
I know this is a pretty detailed question to ask on a message board like this. This is just a little "how does it work project" I was messing with so I just have a couple files I've dummied up to work out the mechanics of it. I'd be happy to email anyone my source files to take a look at as my explanation of the problem might leave something to be desired.
Thanks for any and all help.
Depth Swapping
Here's the deal:
*I have four layers
Layer 1: Backround
Layer 2: Box 1
Layer 3: Box 2
Layer 4: Box 3
Box 1 is in the center, Box 2 is the back left, and Box 3 is in the back right.
If I click a button in box1, lets say [SwitchtoBox2] button, box 1 and box 2 switch places, but in an animation where 2 moves to the left and box 1 then goes where box 2 started from, then box 2 moves to where box 1 started from. So I can't use the On (Release) event, the depth switching has to be automatic. Any ideas?
Here is the Link
-Thanks
Help - How To Do Swapping Of Depth ?
Hi, Can someone help me!?
How can I press the Button1 and it will automatically increase the depth in the loadmovie(). (So I can display as many Popup in different depth using the loadmovie function)
Thankx..
Help With Depth Swapping Please?
Hello, I'm making a game where there are two objects falling from the top of the screen, and the one closer to the bottom need to be above the one closer to the top (they overlap you see) also, they move at variable speeds so they will occasionally have to swap and then may need to swap back depths.
depth swaping has ALWAYS confused me and if someone could give me an example or a link i would really appriciate it
Depth Swapping Help
is this site using the depth swapping method?
http://www.alycium.com/
I am trying to do the effect of having one MC move from infront of another MC to behind an MC just like they do on the Alycium site.
please help.
Thanks
Depth Swapping
is it possible to swap the depths of externally loaded movies? if so, what is the best way to do it?
thanks!
Depth Swapping
is it possible to swap the depths of externally loaded movies? if so, what is the best way to do it?
Depth Swapping
is it possible to swap the depths of externally loaded movies? if so, what is the best way to do it?
thanks!
Depth Swapping
is it possible to swap the depths of externally loaded movies? if so, what is the best way to do it?
Depth - Level Swapping
Hi people
Im trying to make a objects rotate around eachother.
I know I need to swap the depth levels.
I just need to get the z co-cords sorted?
but how do I find the depth of a MC?
ok I know I swap depths SO I suppose I could make a dummy MC to store it as a temp?
Are there other ways?
Thanks
Bazburg
=)
Depth - Level Swapping
Hi people
Im trying to make a objects rotate around eachother.
I know I need to swap the depth levels.
I just need to get the z co-cords sorted?
but how do I find the depth of a MC?
ok I know I swap depths SO I suppose I could make a dummy MC to store it as a temp?
Are there other ways?
Thanks
Bazburg
=)
Depth Swapping And _Y Property
I can't figure out what's wrong with this code, for some reason it just doesn't work. I'm trying to swap the depths of two movieClips when one MC has a greater _Y value than the other MC.
Here's the code:
<B>onClipEvent (enterFrame) {
if (_root.bad._x>_root.good) {
_root.bad.swapDepths (_root.good) {
}
}
}</B>
Rpg Maps... Depth Swapping?
I am working on a role playing game, final-fantasy styled.
I'm at the point where I'm designing the map system.
I'm wondering how I should proceed in order to be able to design it properly, effectively and accuratly. I dont have a problem with collision detection against walls that stops the character from moving. I'm woring about how to make the character behind and in front of certain objects.
The first way I found is to create a boolen zone and perform a subroutine. Whenever the character collides with this zones, the alpha effect of the character is set to 0, then when he leaves that zone, its set back to 100.
The problem is if he hides behind a table, he still goes transparent and it doesnt produce the right effect. This effect can be seen here : http://www.shade.ca/games/rpg/Map.html
The second solution seemed like the right one but I cant get it to work. It was to make a mask for every map and use this mask over the character+make the mask move as the background moves.. but it seems the mask is bound to the character and follows him around the scene.
The last solution seems to be depth swapping and working with horizontal stripes. Can someone help me through this?
Thanks a lot!!!
Depth Swapping Problem :(
Hi - Im trying to swap the level of a movieclip of mine using
anyMovieClip.swapDepths(depth);
but I can seem to to swap it to any other level than 1
I would like it to be on the second layer down (which I guess would be 2, but it always goes on top of everything else!
would anybody have any idea why this would be?
thanks alot for your help
Depth Swapping Or Somethin Like That
Here's the deal:
*I have four layers
Layer 1: Backround
Layer 2: Box 1
Layer 3: Box 2
Layer 4: Box 3
Box 1 is in the center, Box 2 is the back left, and Box 3 is in the back right.
If I click a button in box1, lets say [SwitchtoBox2] button, box 1 and box 2 switch places, but in an animation where 2 moves to the left and box 1 then goes where box 2 started from, then box 2 moves to where box 1 started from. So I can't use the On (Release) event, the depth switching has to be automatic. Any ideas?
Here is the Link
Depth Swapping Problem
Okay I have a project in Flash, and I want to make a realistic type of depth swapping, anyways does anyone know why this code isnt working?
function DepthSwapping(obj1,obj2)
{
if(obj1._y < obj2._y && obj1.getDepth() > obj2.getDepth())
{
obj1.swapDepths(obj2);
}
if(obj1._y > obj2._y && obj1.getDepth() < obj2.getDepth())
{
obj1.swapDepths(obj2);
}
}
and my call to the function is this:
for(var i=0;i<iEcnt;i++)
{
DepthSwapping(this,Map["Character"+i]);
}
Swapping Depth Of Two Overlapping Mcs
i dont really know where to start to code this but i would like to have movieclips that may overlap individually brought to the front on mouse over. I think it would involve swapping depths but i'm not sure how to do it.
Issues With Depth Swapping
Hello,
I continue to have an issue with a flash project. I am trying to swap depths with a movieclip so that the tween appears on top of other layers. The swapDepth works fine, but when returning to the main movie, the onRelease function no longer works.
The code is:
this.loudon_button.onRelease = function() {
duplicateMovieClip(loudon_button, "louder", 6);
loudon_button.swapDepths(louder)
loudon_button.gotoAndPlay("_end");
}
When returning from the MC to this I have tried removing the louder Movie, and swap depths back again. Neither work. When I click, the move becomes a placeholder, just another graphic.
Anybody know why the onRelease function no longer works? It still has the rollOver and RollOut functions working, but after clicking these don't work either.
Thanks,
Techmaniac
Swapping Depth Of MovieClips On Stage
Hey. I'm making a interactive Calendar. The Calender had to be resized and this that some information boxes were lost and I now have to get them back in. I made 2 test movieclips to test there work fine, but wen I play the movieclip "De Stichting ReVaBo" I see the movieclip "Meedenken?" above it. What i want is that if I play the movieclip "De Stichting ReVaBo" I don't want the movieclip "Meedenken?" above that & if I play the movieclip "Meedenken?" I don't want the movieclip "De Stichting ReVaBo" above that.
Does Anyone knows a solution?
Depth Swapping Getting Confused When I Use The Tutorial. Is There A Better Way In MX?
Hi there.
I've been following and working with a lot of tutorials on this site, and they are usually pretty good. There is one though, which I am only partially satisfied with. The results are not perfect, and can in fact cause a very unsightly glitch. First, I'll link you to the tutorial:
http://www.actionscript.org/tutorial...hs/index.shtml
Now I will link you to the site that I'm building:
http://www.drexle.com/
It's just what it looks like. You can create windows by clicking the icons on the "desktop" or by opening them via the little pull-out menu bar and I want these dynamically created windows to be able to swap depths when you click on the blue bar at the top of said window.
My problem is that when I follow the directions supplied by that tutorial, one of two weird things often happens. The less bad thing is that when you click on one window to bring it forward. Let's say you have three windows open at once and you click on the lowest window, it will send the one that was on top to the very bottom instead of simply bringing the one on the bottom to the top. But wait, it can sometimes get even worse! You see, sometimes, clicking on one of the windows brings it to the second highest depth instead of the highest depth. This is very bad for obvious reasons... it doesn't help to keep the window you want to view trapped beneath some other window.
Is there a better way to change depths in MX? I'm very frustrated with this.
Can You Think Of An Easy Way To Convert This To AS3? '3D' Depth Swapping.
ActionScript Code:
swapDepths(Math.round(this._xscale) + 100);//this is for a pseudo-3D effect, the standard cliche carousel.//It keeps things visually layered properly.
... thoughts?
So, I guess the obvious first thing is that _xscale is now scaleX, but the bigger question is - now that we can't arbitrarily set things to non-existent depths, this needs to be much more precise.
Ideas? I'm like [---] far from just jamming a bunch of empty sprites in there.
edit: Got it working with the following:
ActionScript Code:
private function setDepths(e:Event = null):void{ _items.sortOn("scaleX", Array.NUMERIC | Array.DESCENDING); for(var i:int = 0; i < numOfItems; i++) { setChildIndex(_items[i], numOfItems) }}
Swapping A Dynamic Movieclip's Depth Beneath A Static Set Of Graphics?
Flash 8 - AS 2.0
Ok kiddies. I've been toying with AS and trig. and have a little wiggly worm that half-heartedly responds to the mouse just as I want. It's created by looping 30 times through a for loop and using attachmovie() like this.
for(i=0; i<30; i++){
attachMovie("mcCircle", "mcCircle" + i, i, {_x:mx[i], _y:my[i]});
}
As you can see for their depths I have used the increment of the for loop. So I have 30 clips with depths from 0 to 29. On the other hand, the graphics which have been statically placed on the stage have these depths.
instance7:-16352
mcThought:-16355
instance6:-16357
mcCode:-16360
instance5:-16362
mcAural:-16365
instance4:-16367
mcVisual:-16370
instance3:-16372
mcHome_WF:-16374
mcHome:-16377
instance2:-16379
instance1:-16382
What I need is to place the mcCircle clips underneath some of the objects on the stage. Imparticularly, the menu bar at the top of the stage and the logo at the bottom while staying on top of the background. I just want it to look like it's going behind these two graphics. I've tried a number of things and have ran out of ideas. By the way - the bottom of frame 27 of the actions layer has the code that is outputting the depths in the Output panel in Flash.
Many thanks,
John
Problem About Depth Of Objects..(swap Depth) Plse.help
umph..hello i'm nameg sir
i'm trying to do dragging project. drag isomatric object in small room(isomatric view too) for test installation..(so i necessary have foreground objects,background objects ..u know)
now i can drag many objs. in same movie when i press it , by i use swap depth command (for see it above other)and drag it around sometime it works...but sometime it don't!...
1..... some obj. automatic swap its depth! when i release other one....i don't know why
2. some time i dup. new obj. to drag and it del some old obj. that call before
ps. i use swap code from this site tutorial ...s.a.Drag & Drop / Swap DepthsAuthor by : estudioworks
thank u so muchhhhhhhhhhhhh
Question About Depth And Highest Depth
Hello hello
I am learning AS and am now at the depth story.
I have questions about it : when I create an empty mc, where different swfs will load in ( loaded on main stage by several movie clips) is it interesting to use the getNextHighestDepth command ??
Thank you action scripters !!!
Swapping Mc
This is really stupid but I am an actionscript newbie.
I have an empty mc. When I rollover a button I want the blank movie clip to play a different mc, on mouseout it goes back to empty. When I mousedown I want the blank movie clip to switch. It is just like in HTML when you want to swap images but I want to do it in flash with mc's.
I hope this makes sense. I can do it in a timeline format but I want to use actionscript.
Thanks in Advance
Spiral
Swapping Mc - Duh
This is really stupid but I am an actionscript newbie.
I have an empty mc. When I rollover a button I want the blank movie clip to play a different mc, on mouseout it goes back to empty. When I mousedown I want the blank movie clip to switch. It is just like in HTML when you want to swap images but I want to do it in flash with mc's.
I hope this makes sense. I can do it in a timeline format but I want to use actionscript. Do I use OnMouseEvent with a LoadMovie?
Thanks in Advance
Spiral
Swapping Mcs?
i have one mc nested in another in another in another... and a second one, invisible, outside on the top (_root).
at a certain point i want to swap the one inside (with all its content) with the one outside, and later on reverse this again. how can i achieve this?
can i eventually not use the dummy mc outside but instead create or copy a dummy mc (to swap with) and delete this when swapping back in?
tenthousandtimes thank you for any help, danny.
Swapping MC Help Please
Howdy all,
I've been trying to figure this one out on my own, but am getting nowhere. I have a MC on stage with 25 smaller MC in it. How can I randomly swap-out the 25 each of the smaller MC with 1 of 5 animations MC storied the library.
Any advice on this would be great.
Thanks
-L
Swapping MCs ..
Kinda new to Flash .. issit possible to do this
I've got a FLA containing several sections , around 5 of 'em..
but i need to do a transition between the sections.
The transitions are basically the same but the backgrounds
are different. I don't wanna build 25 different transition
MCs .. i just wanna build 1 MC with the transition on top
and the background below. SO i probably need some variable
to detect which background to switch to .. how do i do it ?
Thanks...
Swapping Swf For Gif
Apologies if I searched in the wrong area for information before asking this question but rather desperate for a comprehensive answer and have not found it thus far on the site:
Being a front end designer I wonder if there is a simple way for me to code a page such that if someone's browser does not have Flash installed it defaults to a gif substitute? Is there an easy way for me to do this within Dreamweaver 8?
Swapping Z-indexes How The F$^*$k?
Hi there flash gurus ;D
my problem is simple, I've got a drag-n-drop make your own scene, with various characters and props.
now, what I want to be able to do is bring things to the front (ie: z-index swap to top), so you can drag something around, then click on a bring to front button....
is this possible?
Layer Swapping?
Hello.
I've got a relatively simple question regarding Layers.. is it possible to swap them in mid-movie?
The situation is this. I have this rotating-thingie that looks like its 3D. Kinda cool, actually. I want to further simulate the third dimention by having it pass in front of a row of buttons on the upswing, and go behind these buttons on the backswing. The only way I could think of doing this (besides making two separate sets of buttons) would be to have the Rotator layer and the Button layer switch places during the movie, so they pass off priority to each other.
I know I read something about being able to do this.. somewhere.. awhile ago. I can't find it again for the life of me.
A little help?
- Bill
Swapping Images :)
Hi All,
I am not very good at flash but I am an expert in Director.
I need to do a very simple thing in Flash. I have a gallery of items and I want to display different items in a main window which are animated in some sort of way.
Every item should appear at the same way. So it would be very easy to just swap the images (In Director this is a piece of cake).
I searched all over internet but I can't find a property for an image URL or something like that. I tried converting it into a movieclip so I could use _name, _target etc. But it still doesn't work.
Now please tell me I am missing something here. It shouldn't be that hard.
Thanx for your attention and for your reply,
Cheers,
One23
Swapping Images
Hi,
This is probably a real simple thing to do but its had me stuck for a day now so I'd appreciate any help.
I'm working on a card game. I've got an image of a card face down so you see the back. I also have the name of the card I want to show in its place in a variable, e.g. "heart6". "heart6" and all the other cards are in the library as graphics.
How do I change the image of the face down card for the one from the library I've chosen?
Also, thinking ahead to another issue I'll face. Is it different to do this with movie clips?
Thanks!
Swapping Movies?
Howdy,
I'm trying to create an effect where, when you move the mouse over a grid of dots, each dot that you pass over wiggles a few times and then stops, almost as if you've physically disturbed it.
I understand the hitTest function, and I can create the wiggle movie, but I don't know how to have the movie only play the first frame when there's no hit (dot appears stationary), and then play the wiggle movie only once when there's a hit.
Thanks in advance!
Swapping Clips
I want to create a draggable movie clip that switches to a different clip upon dragging over another (stationary) clip can anyone direct me to a source file or give any pointers? Thanks a mil....
Swapping Scaling MC
I have an MC picture inside a button, that scales within a _root MC. However, I want a button in the _root to swap the MC picture with another MC picture.
Any suggestions?
::bluemoth::
Swapping Depths
I'm looking for a solution to my little problem.
What I am trying to do is to swap the depths of two clips I attach to stage in the runtime
http://galileo.spaceports.com/~skd/scr.swf
'Craft Window' attaches a new 'window' clip to the stage with a name of "newindowX" (where X is the accumulator var) on depth equal to X.
What I want to achieve is on press of the drag bar (A button inside the window clip), I want to switch the depths of the clip on which I activate the button with the clip on top (it's depth is equal to the current value of X), thus bringing the needed clip on top of the stash.
What my problem is - I cannot yet get how to call swapDepths for the clip A by activating the event from inside the clip A (with the help of button, in my case).
Any help would be deeply appreciated.
Swapping Symbols
Is it possible to use ActionScript to swap out a graphic on the symbol on the scene with one that's in the library?
Swapping Depths
How can swap depths between more than two movieclips.. Please help
Swapping Movies
Hi,
I have 2 movies, both of which are the same size.
When playing the first movie, I want to be able to swap that movie for the second movie on the click of a button. I also want to pass a couple of variables between the two movies when swapping them over.
The way I was thinking of doing it was using loadMovie, assigning the variables and then using unloadMovie on the original movie. Thing is, I'm not too sure about how to use layers/targets. What exactly is the difference? What layer do new targets appear in?
If someone could outline the code for me I'd be really grateful
cheers,
Darkwhiteorange
Swapping MCs From The Library
Hi all,
Does anyone know how to tell Flash to make an MC on the stage take on the properties of an MC in the Library. In other words, swap out a MC on the stage with one from the Library.
Thanks.
Scene Swapping
Building a program which contains 9 scenes. one of them is a main menu which has buttons linking to the other 8 scenes. These 8 scenes also have buttons which link to each other and back to the main menu.
What i want to do is to be in 'scene A' move to scene B and then back to scene A. When scene A loads again it will be in the same frame where it left off.
As currently when you move beack to a scene which was previously visited it starts back at frame 1 and doesn't continue from where it left off.
Swapping Depths Of .swf's
i have three buttons...when clicked i want each button to open a window with more buttons, which when clicked on open other windows...
the first one i managed to do...it is draggable and collapsable, but i would like to know how to open the other windows, and then bring a window to the front when clicked on (i woud also love it if the ones in the background could by less opaque as well!)
thanks anyone and everyone!
Swapping Levels Of .swf's
i would really appreciate any help on how to swap levels of loaded .swf's. also is it possible to have the ones in the back less opaque?
thanks
Swapping Many MC's Using Buttons Next/last
I've had a look through the tutorials, and I found one on Back and Forward Buttons for Flash and I also trolled the forum for info, and mainly found a nice collection of unanswered questions!
Anyway, what I'm trying to achieve is something I did in Director which was similar (don't ask). What I had was a library full of MC's, of which were named sequentially. I then swapped the original (first) MC on the stage with the 'next' in the library with a button click.
I could also go backwards through the MC's with a back button. I could also loop from the last MC to the first MC on a 'next' click.
The project was a kiosk program that showed veneer swatches, and you basically just clicked 'next', and a new veneer swatch would appear where the old one was, and the text description would also change, and you'd just go next, next, next through the whole lot, and back again using buttons as necessary.
I'd like to achieve a similar thing in flash, without having to put in 50 'gotoandstop(#)' codes with 50 buttons, one for each frame or anything like that. I would like to just have two buttons that swap out a specific group of MC's into a particular spot (where the original was) with a button click.
Is there any way of doing this simply? I know I can do it manually with seperate frames, but if I could get it down to one frame per collection of 50 different MC's and just use a script to swap the next and/or last cast members, it'd save me a world of hassle.
One way I thought I could do it is to have each different piece of info that was to be cycled as a seperate frame in one large MC, and have the buttons 'gotoandStop(list1,nextFrame)' or whatever the code is, and cheat that way.
Would this method be suitable? What would to code be to goto the current frame plus one of a seperate MC?
Am I barking up the wrong tree?
Am I barking mad?
Do you need a better explanation?
Thanks.
--Rico_Stallion
Texts Swapping
Please help...
Why doesn't it work? What's wrong with the script?
Help Swapping Images
I thought i had this working but now its not
What i am trying to achieve is:
Each section of the site has a title.
When you go to a different section that title changes.
Simple i know but i've done something wrong.
This is the script im using
PHP Code:
//set current title
currentTitle = home_mc;
//hide all other pages
listings_mc._visible = false;
djs_mc._visible = false;
fun_mc._visible = false;
info_mc._visible = false;
//controlls fun section
fun_btn.onPress = function() {
fun_mc._visible = true;
fun_mc.gotoAndPlay(1);
currentTitle.gotoAndPlay(33);
};
//controlls listings section
listings_btn.onPress = function() {
listings_mc._visible = true;
listings_mc.gotoAndPlay(3);
currentTitle.gotoAndPlay(33);
};
//controlls djs section
djs_btn.onPress = function() {
djs_mc._visible = true;
djs_mc.gotoAndPlay(1);
currentTitle.gotoAndPlay(33);
};
//controlls info section
info_btn.onPress = function() {
info_mc._visible = true;
info_mc.gotoAndPlay(1);
currentTitle.gotoAndPlay(33);
};
//controlls home section
home_btn.onPress = function() {
home_mc._visible = true;
home_mc.gotoAndPlay(2);
currentTitle.gotoAndPlay(33);
};
Each movie clip sets it self as currentTitle when the transision is compleate.
Thing is, when i test it they all work fine apart form when i get to 'listings' then it all goes wrong and they simply stack up behind the listings title
Confused so am i if you can help it would be grately appreciated
-ADAM-
|