Depth Problem
Hello,I've got a movie clip with 2 frames. On first frame, I have put an jpg image of a button in a normal state. And on frame 2, a jpg image of a rollovered button. When instantiating the movie clip, I would like to dynamically create a text field with a string passed by parameter.In my library, my movie clip is called Tab and is linked with the Tab.as class in the src directory.Unfortunaly, the textfield remains under the button image. I've deleted the images and could see then the text field.Thanks in advance for any help,OlivierAttach Codepackage src { import flash.display.MovieClip;import flash.text.TextField;import flash.text.TextFieldType;import flash.text.TextFieldAutoSize;import flash.text.TextFormat;public class Tab extends MovieClip {var result:TextField;public function Tab(txt:String) {result = new TextField();result.x = 0;result.y = 0;result.width = 100;result.height = 25;result.background = false;result.border = false;result.autoSize = TextFieldAutoSize.CENTER;result.selectable = false;result.text = txt; var format:TextFormat = new TextFormat(); format.font = "Verdana"; format.color = 0xFFFFFF; format.size = 10; result.defaultTextFormat = format;addChild(result);result.parent.setChildIndex(result, result.parent.numChildren-1); }}}
Adobe > ActionScript 3
Posted on: 04/28/2008 03:20:55 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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 !!!
Z-Depth
on my site I have content that appears in windows.
Each content window, (itself a mc) is on a different layer, on the timeline.
Is there a way of bringing a movie to the front, (ie by clicking on a button) using actionscript...I have seen the z-depth command but aint sure how to implement it?
Any ideas anyone?
Cheers - Check my site if you don't fully get what I mean....http://www.beseku.co.uk
Set DEPTH
is it possible to change the depth of a (dublicated)movieClip with a variable? I need this for a (pseudo) 3d engine!
peter
Depth
ok going to try this a diffrent way. I am going to preload 10 swf into difrent levels one on top of the other. the top one being blank so nothing shows. now I have 10 buttons in another swf on the right side that are loaded in there own level so the always show. now how to I get the first 10 movies to swap depth, I read what I could on macromedia and just could not make sence out of it.
Fl Depth
I have button that when clicked it makes a mc move back into the screen using the fl perceptive code which works but what I want is when you roll off the button for it to come back to its orignal scale and position .
on the button I have
on rollOver _root.acive =true; and rollOut _root.active=false[code]
onClipEvent (load) {
fl=150;
x=_x;
y=_y;
z=0;
spd=5;
}
onClipEvent (enterFrame) {
if ( _root.active ) {
scale=fl/(fl+z);
_x=x*scale;
_y=y*scale;
_xscale=_yscale=scale*56.4;
z+=spd;
if (z>400) {
z=400;
} else if (!_root.active) {
z-=spd;
[Edited by ericflash on 03-10-2002 at 08:53 PM]
Depth ?
can somebody please explane this depth thing to me cause i've herd of it but i really don't know what it does and how to use it....ect .
Depth.....
I am trying to have a gun that moves from side to side with Key.LEFT and Key.RIGHT.
and when you press spacebar it attaches a movie of a bullet moving forward
I am not worried yet about all the hitTest and enemys
But there is one problem, i don't know how to make all the bullets stay on the screen.
It sets them at one depth and then if you shoot again it will take away the last bullet, because it sets it at thesame depth.
doe any one have a solution¿?¿
Please help!
Depth
Does anybody know how to change depth property in movie clips?
Thanks.
Depth
hi there!
can anyone tell me how to change the depth of a loaded movie?i can't put it behind the content of the original one!
thanx!
Depth
Hello!
Is it posible in flash to make one mc appear over another even that they are in the same layer a _depth or _z something like that?
Depth.....
How would I go about making a MC in _level0 be above _level2
I sthere a way that a MC on the main time line can be higher than a SWF with
code:
loadMovieNum("contact.swf",2)
Depth
Ok, i have some buttons and movieclips, when you press a button i need it to bring it's corosponding movieclip to the front of the rest...
anyone?
-Stwelin
Depth
If i have and object, and I want its depth to be _parent.mc's depth - 1, how would I actionscript it on MX?
Im thinking like
this._depth = _parent.mc._depth-1
but it's not working. how's it meant to work?
Please remember i'm using MX pro 2004, and I will be truly thankful if you provide me the answer.
Depth
If i have and object, and I want its depth to be _parent.mc's depth - 1, how would I actionscript it on MX?
Im thinking like
this._depth = _parent.mc._depth-1
but it's not working. how's it meant to work?
Please remember i'm using MX professional 2004, and I will be truly thankful if you provide me the answer.
Depth?
Hi, after i have duplicated a MC, i want its depth to be less than that of my cursor?? how can i do this??
Depth
Is there a code in actionscript (i'm using Actionscript 2.0, Mx Pro 2004) which tells a movie clip to arrange itself under another mc on _level0, without swapping?
Please try, Ryan.
Set Depth
Hi, I attach a movie clips when movie is running but i want it behind my top layer 'tree'. I want it in the layer 'App'. I tried putting App in quotaion marks in the depth bit and i tried it without quuotaion marks like so
this.attachMovie("Apple","Apple_mc" + AppNum,"App")
Dont work.
How do i do it?
Thx
Help With Depth
How do you change the depth of an object already on the scene?
Get Depth?
i want to search a specific depth, and have it return the name of the movieclip there, i know there is a class that does this, but cant remember its name
Depth
what do i need to to to get a MC on my stage to sit above my circlemc which is using:
this.attachMovie("circle", "circle"+count, 10000+count,{_x:210, _y:250,_xscale:100, _yscale:100});
iv'e tried this:
this.mainBut.getNextHighestDepth();
but no luck
rat
[F8] How Is This Done? 2D, But With Depth...
Yes I know that makes it 3D, but what I'm looking for are flat levels at different depths. So maybe you click on one character and it zooms in and the other levels move accordingly? It could be thought of as paper dolls on toothpicks in a diorama. I'm not sure what to call it - check the example for my ad hoc version 1.
What I want is to move around, but always from the front, in a convincing way, as different characters are clicked. My question is how would I mathematically get the various MC's locations and scales? My best guesses look like just that, guesses...
Thanks!
Depth From AS2 To AS3.
I have been trying to do depth sorting for my MMORPG in Flash AS3. I saw this on Kirupa for Depth Sorting: http://www.kirupa.com/developer/isom...th_sorting.htm, but it seems to be AS2, and I already tried that method the same way in AS3. It doesn't work. What would I need to do to switch this method into AS3? In AS3, the max depth is the number of children, but I think there may be a way around. Anyone know how to fix this? Thanks in advance.
[F8] I'm A Little Out Of My Depth...
Hello, o' noble and sagacious ones;
i recently put up a site at creativelicensedesign.com that is flash based. when i test it on the computer, its fast like anything. but when i go to the site, its really slow. i am aware of the concept of a preloader but i havent the faintest clue what to do about it. any suggestions?
Thanks!
Berish
Can't Set Depth
Hello,
I was trying to remove a movieclip with no luck. I figured it could only be because there was no depth which turn out to be the case. I have tried to manually set the depth and cannot. I have 6 items attached in total and 2 of them cannot be removed or have depths defined for them.
For example...
Code:
subNav = survey_mc.attachMovie("SubNavSet","SubNavSet", survey_mc.getNextHighestDepth(),{_x:13, _y:558});
mainNav = survey_mc.attachMovie("MainNavigation","MainNavigation", survey_mc.getNextHighestDepth(),{_x:0, _y:260});
trace(subNav.getDepth()); //traces undefined
trace(mySlideViewer.getDepth());//traces 7
and
Code:
subNav = survey_mc.attachMovie("SubNavSet","SubNavSet", 2000,{_x:13, _y:558});
mainNav = survey_mc.attachMovie("MainNavigation","MainNavigation", survey_mc.getNextHighestDepth(),{_x:0, _y:260});
trace(subNav.getDepth()); //traces undefined
trace(mySlideViewer.getDepth());//traces 2001
does anyone know why this is happening and how to fix it?
thanks
Depth
I have a serious question about the getNextHighestDepth.
I am using the attach movie method to place some items on the stage, but it seems to be over lapping. Sometimes its in the right place and other times its missing?? Not too sure what's the problem here.
Example:
Code:
this.createEmptyMovieClip("emptyMC", this.getNextHighestDepth());
emptyMC.attachMovie("shapes", "name_shape, emptyMC.getNextHighestDepth(), {_x:329, _y:159});
}
emptyMC.attachMovie("letters", "alphabets", emptyMC.getNextHighestDepth(), {_x:327, _y:163});
}
Thanks
Depth From AS2 To AS3.
I have been trying to do depth sorting for my MMORPG in Flash AS3(Yes, I posted an earlier post, but I found more information and my question changed ultimately). I saw this on Kirupa for Depth Sorting: http://www.kirupa.com/developer/isom...th_sorting.htm, but it seems to be AS2, and I already tried that method the same way in AS3. It doesn't work. What would I need to do to switch this method into AS3? In AS3, the max depth is the number of children, but I think there may be a way around. Anyone know how to fix this? Thanks in advance.
Set Depth?
I have a deck of cards from 1-5 that are overlapping each other. When you click on one it enlarges and using swapDepth come to the front. When I close the card it goes back to it original state but is now on top of the other cards.
Is there a way that you can set depth? I want cards 1-5 to be at depths of 1-5 so when I close my card I can define what depth I want my card to return to.
Thanks for any help
Z-depth?
hi.
Ive just started using flash cs3 for games, and i was wondering if there's a way to control what depth movie clips get displayed at, as in, one picture in front of another? i know you can do it all on layers, but is there a way to control it with actionscript?
thanks.
jack.x
Depth
i've got a button and want to control it in actionscript to be infront of a movieclip created in actionscript...
Depth
Hey guys, I'm sure that I have seen a tutorial on this site with this topic, but for the life of me I can't find it again, and my search was useless so hear goes: How do I bring a movieclip to the front when it is played? So that whichever mc is clicked last goes in front of the others....
Thanks
Insomniac
Help With Depth
Hi i hope u can help me cause i know u rock!!
I´m building a form applicaton using components, i have tree separated forms every one of them inside a MovieClip and i call them whenever i need with the tab component, ok?
Now i also build a slide menu to access any part of the form in the left part of my movie and when it appears it is alway shown at the back of my forms.
I can´t make my menu to be in front of the forms, i have already tryied by inserting the menu on a higher level form, in a higher layer....I want to know if there is an action that helps me to tell the menu to have a higher depth when its shown.
In a very more simple way, How do i manage MovieClips depth ? , because components inside my forms always superpose to my menu.
How do i disable my form's movieclip when the menu is shown.
Thank u and sorry about my english.
[FMX] Depth
Hi!
I try to obtain the effect like this:
http://www.elementzoffoto.com
It's the effect in the 1ST page, after you click on enter, where you have 3 schedules that change depth.
My problem is that when i use the swapDepth, in the same moment I click on the second schedule (For exemple), the depth change.
I would like the depth change after the animation and not imediatley.
So, excuse me for my english, I hope you understand what I mean!!
Bye bye!!
Get Depth
this is a simple one.
on Frame XX i want to have symbols on layers 1,2,3 (for sake of argument) at differnt depths.
thats the tag to change the depth of multiple symbols?
Depth Mc
I have more than one holder(mc) on stage. How can I make sure that the mc I won't on top of the other mc(holder) is. Not by layer but by script.
It's with swapdepth or getnextdepth or something?Don't know any help is appreciated
Depth Help
Hello,
I'm having trouble making a movie clip (portfolio_mc) appear on top of another movie clip. (bg_mc) I've tried setting portfolio_mc to the next highest depth using the following directly on the movie clip.
onClipEvent(enterFrame) {
this.swapDepths(portfolio_mc.getNextHighestDepth() );
}
I've also tried multiple times to set bg_mc to the lowest depth possible, but my novice AS skills are hopeless.
Are there any other ways I can set portfolio_mc's depth to the highest possible?
(or bg_mc's depth to the lowest possible..)
3d And Depth
I'm trying to have a 3d text revolve around an object.
suppose the object's depth is 0 and the text revolve 100 units around the object which means that each individual letters ( which duplicated clips from a dynamic text animation ) changes depth at every frame from 100 to -100.
The problem is that i can't make the letters go around the object.
I checked every letters depths and they are correct. What i'm assuming is that the original text animation is on a different depth than the object ( say 1 ) and each individual letters are on different sub-depths, not related directly to the root, so it would be something like:
_root.text_mc.letter.getDetph() > _root.object.getDepth()
even though,
_root.text_mc.letter.getDepth() = -100
and
_root.object.getDepth() = 0
Have any experienced that kinda problem? How were you able to get around that?
Thanks,
jtax
Depth
Hey guys, I'm sure that I have seen a tutorial on this site with this topic, but for the life of me I can't find it again, and my search was useless so hear goes: How do I bring a movieclip to the front when it is played? So that whichever mc is clicked last goes in front of the others....
Thanks
Insomniac
Help With Depth
Hi i hope u can help me cause i know u rock!!
I´m building a form applicaton using components, i have tree separated forms every one of them inside a MovieClip and i call them whenever i need with the tab component, ok?
Now i also build a slide menu to access any part of the form in the left part of my movie and when it appears it is alway shown at the back of my forms.
I can´t make my menu to be in front of the forms, i have already tryied by inserting the menu on a higher level form, in a higher layer....I want to know if there is an action that helps me to tell the menu to have a higher depth when its shown.
In a very more simple way, How do i manage MovieClips depth ? , because components inside my forms always superpose to my menu.
How do i disable my form's movieclip when the menu is shown.
Thank u and sorry about my english.
Depth..
when i enlarge a button at runtime, other things are overlapping it and i can only see part of it. how do i move the button to the front and back at runtime? like using the align->bring to front command???
Z Depth
At the splash screen of my flash file I am creating a grid of hexagons using a duplicate movie clip command. For some reason, their depths are being listed as "undefined" and even though they are at the lowest layer of the stage, they are on top of everything above. Any ideas on how to set their depth to the bottom or to put other things that are pre-placed manually on the stage above them?
Depth
Hi.
I found a script which generates a walking spider.
http://www.flashkit.com/movies/Anima...8769/index.php
But: I wasn't able to put a background image behind
the spider, because it always walks in the background.
Even if I swap the depth of my background to -1000.
Please try it out and tell me if you could manage a
background for the spider. Thank you.
Best regards!
Fox
Duplicate Mc Depth
what does the depth mean
when i used flash 4
i knew the last parameter of duplicate movie clip was the alpha
but i still don't know what the depth means
LoadMovie Depth?
Alright heres the problem, I load a movie (works fine) Problem is this movie loads above other objects on level0 (this is no good) I need level1 to load below level0.
I have tried to load the movie into a targeted movieclip that is on a lower layer. This works however I have now lost the _root from the loaded movie and script from the loaded movie relies greatly on the _root property. So loaded it into a targeted movie clip is not an option.
Any sudgestions on this?
RemoveMovieClip Depth
Hello everyone...i'm new to the game,
I'm experiencing some difficulties with the following. I'm duplicating about 2800 pie-clips each at different depths.
duplicateMovieClip ("pie", "pie"+k+"_"+j,10000+j);
I can't seem to remove these clips with the function below...i keep seeing a few pieces of pie....although they have been removed and/or made invisible (debug mode). Every help and suggestion is greatly appreciated.
function clean () {
for (k=0; k<8; k++) {
for (j=0; j<361; j++) {
removeMovieClip ("_level0.node0.pie"+k+"_"+j);
removeMovieClip ("_level0.node0.pie"+k+"_0"+j);
setProperty ("_level0.node0.pie"+k+"_"+j, _visible, 0);
setProperty ("_level0.node0.pie"+k+"_0"+j, _visible, 0);
}
}
}
MC Depth Level
Hi folks,
In my scene I am duplicating lots of MCs which I place on different depth levels. Next to these guys I have a small mc (called MC_01) sitting in the middle of the scene throughout the whole root timeline.
Problem: I need to place MC_01 to a certain depth level so the duplicated MCs wouldn't cover it as the timeline progresses.
Question: How can I do that?
Thanx in advance.
Zoo_Mann
Depth, Boardgame, Etc.
Hi, here it is.
Flash 4:
I've got this boardgame where I use a single movieclip as every single, clickable, reactable boardsquare (ectually a hex.) I want flash to generate this board for me so I use the duplicate action (because I also need to generate a name with it), but the problem is that I need the movieclips appear at the same depth, not different one's (I need to place other buttons on top of it). How can I achieve this?
thanks in advance,
Movieclip Depth.
I don't want to have to set the depth of new movies. I just want it to be tacked on to the end, in other words, placed at the highest set depth plus one. How can I do this?
Movieclip Depth
Hiya,
may be missing something obvious, but can I read a attachched movieclip's depth? I need to sort the stacking order to get a 3d effect, but I need to compare depths & distances before i can tell whether or not to use swapDepth.
TIA
Keith
|