ActionScript 2.0 :: Generate An Object Behind Something (depth)?
Sep 14, 2009How can I generate a MovieClip from an object and make it go behind that object?I've got a object that leaves a trail and I want the trail behind it.
View 1 RepliesHow can I generate a MovieClip from an object and make it go behind that object?I've got a object that leaves a trail and I want the trail behind it.
View 1 RepliesSo I have a bunch of objects (thumbnails) and I want every photo to be displayed on top of other photos once it's clicked. So what should I put inside the click handler inside the photo object?
View 1 RepliesI have been trying to change the depth of an object. I have only just started learning AS3, so I haven't looked into this yet.So far I have been using a trial-&-error method to try to get this piece of code to work which I found on a site, but I have not succeeded:
Code:
setChildIndex(example,numChildren-1);
I am putting this code in it's class, and I tried replacing the word example with 'this'. Can someone please help me? When I test the swf it comes up with this in output:
Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/setChildIndex()
at Foreground/enterFrame()
I have a Flash application that includes an MC (bitmap object) that is dynamically assigned to a Class. In that Class, other graphics are created, but the class MC is overlapping those graphics. Event though I tried dynamic depth swapping, it generally works, yet not for the inherent MC assigned to the class. The MC still overlaps the other graphic, even if I have swapped that graphic to the top depth
View 8 Repliesmy designer made a fla file where he has animated layers loads of them. All the images inside those animations are loaded from outside the swf.
Now, the issue is at one point in time I want some of the objects to go under another object ( current their on top) . If I do this visually the images inside the swf(loaded) are lost.
i have objects on my stage and when i rollover on each object he raize.exmeple u can see here (here i make only 2 objects):http: [url]....what i want to do is that all of the objects have the same depth but when one of my object rollovered and he start to raize get the top depth (up then other)
Code:
stop();
acceleration = 10[code].....
When I click on an object, I need it (technically it's parent object) to drop to the lowest level, but I'm having a heck of time. I've tried:
stage.setChildIndex(this, 0);
and
stage.swapChildrenAt(0, getChildIndex(this));
Which seem like they would both do what I want, but both of which get an Error #2006: The supplied index is out of bounds.
I've also tried:
stage.setChildIndex(e.target.parent, 0);
Which produces Error #2025: The supplied DisplayObject must be a child of the caller.
and stage.setChildIndex(this.parent, 0);
Which doesn't error, but also doesn't do what I want it to do.
As the title says, i would like to have an object which is nested beneath another objects depth set higher than that of one the is NOT nested. Is this possible if so how, may be real easy and im just over-looking it but
View 1 RepliesI am drawing some lines in my program using
graphics.lineTo(xx, yy);
The program has a background image over which these lines are drawn.The problem which I am facing is that the image overshadows the lines and the lines are not visible to the user.Since these lines do not have an id, I am not sure as to how I can assign a depth to them?
I am getting a warning when i run my application flash builder burrito.the warning is Warning: Failed to place object at depth 1.
View 2 RepliesI have about 85 movie clips on stage and they all have startDrag with MOUSE_DOWN.
here is the thing I need the active one to come forward to the top of all others.
I tried using:
setChildIndex(e.currentTarget, 85)
on the mouse over function but its not working its giving me an error
1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.
putting a movieclip into highest depth without knowing which clip is in the highest depth
View 2 RepliesHow can you trace the "depth" or stacking order of a display object with AS3? I'm trying to figure out if my sprite is behind another sprite.
View 4 RepliesI am making a game in Flash CS4 (actionscript 3) and I would like to be able to make "copies" of an instance that would randomly appear at the top of the screen and fall. For example, multiple objects(that are the same one) are falling from the top of the screen continuously, starting at random X positions. (i think this would be considered Real-Time effect).
View 2 RepliesBasically I've got a reasonably complex drawing object in a fla and I want to reproduce it in a class definition using the drawing api. However obviously this is a tedious task, so is there some trick or automated method of doing this?
Last time I needed to do this it was a drawing of an arrow and I ended up writing down x,y,width,height values for everything but this one has curves in it which I don't have experience with drawing anyway.
i'm workin with some "self created windows" in my flash app. how can i put the window i click on front of the others? I found smth about swapDepth, but there is no swapDepth in as3.
View 3 Repliesi have this drag and drop thing basically when i drop the item on top of its slot i want it to do a hittest to set the depth to a number assigned to it. so lets say I drag an item called Item to a spot called slot i want it to do like item on hit test to slot set depth(2) lets say.
View 1 Replies[code]When I publish it keeps swapping over and over.How can I get it to call only once?
View 2 RepliesIs there any way to see if a depth is already being used by a movieclip before assigning it to another movieclip? I have a game where there are hundreds of movieclips moving around on screen at the same time and changing depths every time they move. But at rare times, one movieclip will spawn at the exact spot another movieclip is in and use that depth, making the old movieclip invisible (but still active and moving around).
View 2 RepliesI'm trying to create a menu for my game, it is a tile-based game, and it draws my tile game ontop of everything. So how can I make my menu layer be above the tile game?
View 3 RepliesI have a movie clip that has about 20 layers that make up four different groups. (Five of the layers work together)Any one of the four groups has to come to the front of the others at any time.Is there an easiesh way to swap depths of these groups?EG. Can you swap a folders depth for example?
View 1 RepliesI m looking for method similat to MovieClip.swapDepths(depth).what is the method in as3, i have movieclips i wanne update those deths
View 4 RepliesI have 3 sprites: img1spr, img2spr, and img3spr. Inside every sprite I have some bitmaps.Every sprite has a name:
img1spr.name=name1;
img2spr.name=name2;
img3spr.name=name3;
[code].......
I'm running a loop that's creating a multiple movieclips. Each clip can be dragged to drop point on the screen. What i'm trying to accomplish is when you select an item to drag it should take the highest depth, and should appear over all other draggable items. Right now the first clip is always under all of them while the last is getting the highest.
View 1 RepliesThis should be really easy to do, but i cant find anything from searching. It's all tuturials for buttons and stuff. All i want to do, is put a MC called "face" on top of everything. What exactly would be the AS3 for this, and where would i put it?
View 4 Repliesshow me a good algorithm which loops through an entire XML without knowing from the start the number of children and sub-children?I studied something in university but at the time I didn't get the explanation well and now I totally forgot.
View 0 RepliesIs there any code like replacemc? Instead of removeChild() and then placing the new one at the addChildAt(same depth).
View 1 Repliesi have a slide out panel, which is a clip, with animated buttons,(they are cheat buttons so they have time lines or clips for each of the button states) these load pages or clips to the main stage, the problem is i want these swfs to load under the slide out panel, here is a little of my code,i know its a little crude but the way i have made the panel and buttons i found it easier this way.clip is laid out like "stage.page_loader.navi_pane.navi_pane_animations.buttons",the navi_pane loads clips to stage,the stage has about 15 layers with various animations,the navi pane has rollover states so clips have to be loaded to the stage so as not to take on button properties
any help would be most greatfull.
navi_pane.addEventListener(MouseEvent.ROLL_OVER, npRollover);
navi_pane.addEventListener(MouseEvent.ROLL_OUT, npRollout);
navi_pane.b1.addEventListener(MouseEvent.CLICK,pageb1);
[code]....
Here is my issue. I have 6 MCs that are the same size and are on the same position on the stage. I am using AC variables to activate each one of them, here is an example of my script for the button:
Code:
on (release) {
if (number(test) == 2) {
[code].....
How can I set the depth for a movieclip.Actually I want my popup to always come on the top and there is some problem using swapdepth.Would it help setting the depth of movieclip to be something like 10000??
View 1 Replies