ActionScript 2.0 :: How To Clear Depth Of MovieClips
Dec 29, 2009This is a bit of a rooky question, probably cos I'm a bit of a rooky, but how do I clear a level, say level 24 of movieclips?
View 3 RepliesThis is a bit of a rooky question, probably cos I'm a bit of a rooky, but how do I clear a level, say level 24 of movieclips?
View 3 RepliesI'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 Repliesi want when user rollover on any movieclip it comes on top after rollout it goes it's original position but, this code is showing error.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
private function pan3D():void{
excelmc=thumbswork.excel
officemc=thumbswork.office
googlemc=thumbswork.google
[code]....
How do you go about swapping depths in AS3? I've got a movieClip (allContent_mc) that contains a bunch of other movieClips(mc1, mc2, etc.) that expand in size when clicked on. However, when they are expanded I need to make sure that the one being viewed is on top. The control to expand each clip lives within each clip itself. Ideally, when the expand code (below) is executed, I'd like to make sure the clip's depth supersedes all others. I'm keeping all the clips together in one larger clip because the larger clip is living inside a scrollPane component. Pretty sure I'm just not defining the path to the clip correctly.
ActionScript Code:
function goOpen(e:MouseEvent):void{
this.setChildIndex (square_mc , this.numChildren - 1 );[code]...........
I asked this question yesterday but I found out that my problem is using fullscreen my goal is 2 mc 2 buttons : if btn 1 is clicked mc1 fullscreen and mc2 appears at the right bottom corner on top of mc1 if btn 2 is clicked mc2 fullscreen and mc1 appears at the right bottom corner on top of mc2 stage.swapChildren or setChildIndex is the way but with the fullScreen I had this error appears
[Code]...
I have two movie clips. The child movieclip is a button with rollover events which is nested inside the parent. I would like the parent to also have rollover events, but I understand that this is not possible in flash. I am familiar with two workarounds: event bubbling/delegation and the event listeners.
[Code]....
i have a movie clip on the stage, and i need its depth to always be higher than everything, but other movieclips are being duplicated constantly. How do i do this?
View 2 Repliesim having some trouble when trying to implement the swap depth function to movieclips that have the setmask function implimented to them. the problem is that i can get the swapdepth to work but when the setmask is implimented at the same time the movie clips will not swap depths.
the code that i am using to set the mask is _root.bgmasked.setMask(_root.dragger); this is on frame one in the action/code layer bgmasked is the imaged being masked by dragger.
[Code]...
I am working on a game engine that works like an overhead RPG, but the terrain is drawn at an angle with the characters at the same angle to give the illusion of a 3D world. the problem I am running into is that, while I can get the character to move perfectly fine on the ground, I need to be able to set the character to go behind or above certain objects depending where he is.
The best example of what I am trying to accomplish is from Gaia's MMO.
[URL]
As you can see in the first frame of the image, the character is in front of the bush, but behind the lamppost. In the second frame he is both behind the lamppost and bush. In the last frame, he is in front of both the lamppost and bush. during all of this though the bush and Lamppost never change position with the terrain or each other.
Basically, I have come to the conclusion that I believe the way this RPG is able to do this is through distance detection and depth swaps.
ex. if distance is above 0 character is above object. if distance is below 0, character is below object.
The main I would like to accomplish with this is the character, enemies, and NPC's are the only thing that changes depth. why? If an enemy is following and is on a different depth then the character, possibly higher or lower then the object, it could appear above or below the object while the character is the opposite.
I have a movie clip that has 20 key frames, and on each key frame is a different bitmap that has been dragged into place from the library. when i attached this, the movie clip play and the memory goes (levels out at the end of the sequens).
But when i remove the movie clip (removeChild) and set the instance to 'null' the memory doesn't come down (even if i wait or force it to garbage collect). Does movie clips content get cleared?
I have a page with several input boxes and several instances of movie clips on the stage which have been added with addChild, what i want to do is make a reset buttun that clears all the input boxe and removes the movieClips so that the page looks as it did when it was first loaded but the help files are usless with a specific request like this.
View 14 RepliesI'm working on a game whose background has many layers that each scroll at different speeds.
Inside each layer I have a Sprite, I've started using graphics.beginBitmapFill, but what I've found is that the graphics.clear() function doesn't actually clear the contents set by the previous call to graphics.begin.BitmapFill. Each frame, I adjust the matrix to shift the layer as needed. Then, I call graphics.clear() and graphics.beginBitmapFill() with the adjusted matrix. Since my layers have alphas in the bitmap, I can see the contents that was drawn the previous frame.
putting a movieclip into highest depth without knowing which clip is in the highest depth
View 2 Replies[Code]...
doesnt clear the line when mc1 moved ? How solve tihs problem?
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].......
This 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 RepliesI've got an isometric view of a flat surface. On this surface there are various characters running around and I obviously need to control the depths of each object.
My flat surface needs to be used in two views: top-bottom + isometric.
The original mc is generated in the flat top-bottom mode. For the isometric view, that same mc gets distorted: this way the whole XY coordinates system gets distorted too.
Have a look at this (updated).
So i'd need to create this extra coordinate (is it the classic Z-depth?), and manage to gather information about it...
Does anyone know what the formula would be to calculate the depths of each character (red lines)?
Whenever I create a MovieClip in the IDE and draw on it with the IDE then use ActionScript to add more to it (add a Sprite, draw graphics etc..) the thing I added is always behind the graphics of the MovieClip that was drawn in the IDE. How do I bring the Sprite/Graphics that I draw/add to the MovieClip in front of the graphics that were drawn with the IDE?I have tried doing this:
Code:
var myMC:mcDemo = new mcDemo(); //mcDemo being a MovieClip created in the IDE.
var sp:Sprite = new Sprite();[code]...
The final product of this is the myMC movieclip on the screen with my sprite behind whatever I drew in the IDE for myMC. How do I make it so the sprite is in front of everything? I have tried setting it to numChildren-1 which should set it in front of all objects.