ActionScript 3.0 :: Movieclip Depth Management?

Apr 24, 2010

I started with some AS2 pageflip code that I've been modifying because I needed the code in AS3, and I wanted to make some changes to it. At anyrate, I'm having a problem with the depth of two movieclips created. The code first creates a page using the makePage function, and then creates a shade for that page (makeShade function).When running the code, the page appears on top of the shade. When using getChildIndex, the page's index = 11, and the shade's index = 14.

The complete code is super long so I've attached the code that has the shade and page below:

//create left-aligned page-sized solid fill
function makePage(targ, xQuadrant) {
//trace ("in make page");

[code]...

View 1 Replies


Similar Posts:


Easy Depth Management In Flash?

Mar 2, 2009

I've recently created a game in which the logic and programming all runs perfectly, however the graphics are lackluster. I'm currently having a hard time managing the depth of movieclips on the screen.Basically the game is tile based and each frame of the movieclip holds a different type of tile. All the tiles are 50x50 with the exception of one type of tile which is 60x60 and therein needs to overlap the tiles around it which are 50x50.In AS2 I could of set the depth manually, however I'm told (as is this is my first time dealing with depth in AS3) that I cannot do this anymore. Is there any suggestions on how I can make sure that a tile of one type is automatically set beneath tiles of another type - I've thought about simply coding a function to check this but it somehow seems inefficient (considering larger maps will have a lot of tiles, meaning hundreds of movieclips attached to the stage, each movieclip with multiple frames).

View 2 Replies

ActionScript 3.0 :: Depth Management Of Instances Created At Runtime?

Dec 16, 2009

im develloping an application for  create a layout of advertising newspaper. the user can set the number of pages, and create rectangles represanting the adverts, then drag them and place them into the the representation of the page.the display list is as follow:  on the main stage there is inputs textfields and a button that create the pages according to the number that the user typed.Then instances of the pages are created (MC Page in the lybrary exported for AS as Page and i have a class Page as well). Inside this clip Page i have my tools for create the rectangles and drag and place.....As well as the instances of my pages are created, button(1 for each Page)  are also created. NOTE that Page and button are in the main stage My probleme is that i want my button to change the  depth of is related page for it can be on top or alpha at 100% or the visibilty to true, but my button doesnt find the instance name of the pages at the export because they are not yet created.

View 9 Replies

ActionScript 2.0 :: Putting A Movieclip Into Highest Depth Without Knowing Which Clip Is In The Highest Depth

May 11, 2004

putting a movieclip into highest depth without knowing which clip is in the highest depth

View 2 Replies

ActionScript 3.0 :: Way To Set Movieclip's Depth

Aug 11, 2011

I 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 Replies

ActionScript 2.0 :: Set Depth For A Movieclip

Nov 13, 2005

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

AS2 - Giving A Movieclip A Specific Depth

Feb 15, 2011

I want to give a movieclip a specific depth number, but i cant found a method for this.

View 2 Replies

ActionScript 3.0 :: Change Depth Of MovieClip?

Jul 13, 2011

Im trying to change the depth or index of a movieclip when its click. And bring it to the top of everything. The problem is that the movie clip is not added by addChild, but nested in a frame.
 
so if i try and use any of these:

anyMC.parent.setChildIndex(anyMC, anyMC.parent.numChildren-1);
or public function bringMCToFront($mc:MovieClip){    $mc.parent.setChildIndex($mc, $mc.parent.numChildren-1);}
 
by it gives me this error: Error #1065: Variable setChildIndex is not defined.

View 6 Replies

ActionScript 3.0 :: Movieclip Depth, Changing On The Fly?

Feb 5, 2012

Im trying to keep all my movieclips onto 1 layer/mother mc to speed up the flash display engine
 
I have these takable items(movieclips) that respawn after a while.
 
Initially i build the level starting with all the takable items before adding all the players/npc's. This way the player and npc's walk over the objects if they are not taken.
 
After an items respawns though, i have to re add them to the main mc and then they appear to be over the npc's and they seem to be moving under a carpet of stuff.
Its a nice 3d effect but totally unwanted in this scenario.
 
Is there a way to make sure that items are added as child before a certain clip (like the player). I tried using addchildat but this gives me a index error now and then. I dont really understand how the depths are worked out by flash.
 
I was thinking of storing the original depth of an item movieclip and then on restore, addchild at at its old depth. Or is there a more sensible way?
 
Also: can two movieclips occupy the same index/depth level? or are the incemented or something?

View 1 Replies

ActionScript 2.0 :: Put A Movieclip In Front Of Depth?

Sep 3, 2008

I have 4 movieclips on my "layer1". Everytime my mouse is onRollOver of a movieclip, I just want THIS movieclip coming to the FRONT, that's to say the Highest Depth.

(in Visual Basic, "ZOrder(0)" is simple.. but harder in ActionScript.. lol )

I've found some many examples "around" this, but did'nt success to adapt the code to my simple needs !

View 9 Replies

ActionScript 3.0 :: Keep A MovieClip At The Lowest Depth?

Oct 26, 2009

Is it possible to keep a movieClip at the lowest depth and stack other movieClips on top. I have a container movieClip that I add a movieClip called floorTile. I want floorTile to always be at level 0 no matter what. Then when I click on another movieClip, I want this to be added on top of the floorTile.

ActionScript Code:
//create a container to hold the floor tile and textures
var myContainer:MovieClip = new MovieClip()
myContainer.x=425;

[Code]....

View 9 Replies

ActionScript 2.0 :: Change The Depth Of Movieclip?

Apr 20, 2010

the question is a bit more involed. I have a dynamic text box, which I've put inside a movieclip. I hae a number of movieclips that I bring in using attachMovie, but my movieclip which contains my text box is underneath all the other movieclips.

I would like to know how I can tell my movie to display above all the other?

View 2 Replies

ActionScript 2.0 :: Arrangement Of MovieClip In Z Depth

Jan 8, 2004

I have a slide show of images for my banner that is loaded through the use of a component in my library. The component merely swaps images with a fade out/in as a transition. Now, that is working fine, the thing that I am having a problem with is that I cannot place an graphic/text on top of the component. I what the banner to be in the background. What do I have to add to the component to insure that it will always load in the back, not infront of the text, graphic, etc...

View 1 Replies

ActionScript 3.0 :: Change Depth Of Movieclip With It?

Feb 8, 2011

If i wanted to change the depth of a movieclip using AS3

View 2 Replies

Flash :: Removing A MovieClip After Swapping Depth

Dec 14, 2011

I have some code in ActionScript 2 similar to the below snippet (Item being a MovieClip):[code]I'm unable to remove Temp after swapping the depth (works fine otherwise).[code]how to get rid of Temp?

View 2 Replies

ActionScript 2.0 :: Get A Movieclip To Appear At The Highest Depth From The Library?

Apr 11, 2011

I'm trying to get a movieclip to appear at the highest depth from the library.

View 1 Replies

ActionScript 2.0 :: Can't Remove A Movieclip If It's At A Minus Depth

May 17, 2008

That you can't remove a movieclip if it's at a minus depth? Is this on purpose, or is it a glitch?

View 2 Replies

ActionScript 2.0 :: Find A Tutorial On Movieclip Depth?

Aug 19, 2003

Does anyone know where I can find a tutorial on movieclip depth?

View 3 Replies

ActionScript 3.0 :: Change MovieClip Depth On Drag?

Mar 10, 2009

Is there a way to change the depth (index number) of a movieClip when I click on it to drag. Example:Say I have three circles. Each circle has a MOUSE_UP and MOUSE_DOWN eventListener. When one is clicked It will bring it to the front so when I drag it will be above the two other circles.

View 7 Replies

ActionScript 1/2 :: Changing Depth Of MovieClip On Rollover Of Button?

Jun 27, 2010

I have Macromedia Flash 8 Pro with AS2 and I was wondering if there was a function that would change the depth of a movieclip on rollover of a button.

View 1 Replies

ActionScript 3.0 :: Swap Depth Of Movieclip Based On Y Location?

May 4, 2011

Code:
moviclip.swapDepths(movieclip._y);
and it worked perfectly.

but I decided that I wanted to continue the development of the game in AS3 (so that it will be more up to date and I could learn the new syntax), and I found the equivalent to swapDepths is setChildIndex. so I followed the new rules and came up with this code:Code: setChildIndex(character_mc, character_mc.y);but, sadly it does not work the same. the game becomes extremely laggy and almost unresponsive, but becomes normal again if I remove the code. So, my question is how can I add a similar code for this to work properly.

View 8 Replies

ActionScript 3.0 :: Flash Movieclip On Stage Depth Control?

Feb 23, 2011

I 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.displayisplayObject.

View 2 Replies

ActionScript 1/2 :: Replacing A Movieclip Without Changing It's Children/depth/tweens

Feb 5, 2010

I would like to be able to draw a simple box as a background/placeholder, dress it up with buttons and movie clips at design time, and at runtime call a function to replace the simple box with a new design. How would I go about doing this? I have a graphic design that is too complicated to make with flash. So i made a piece of actionscript that can restyle any existing movieclip. This piece of code works. It basically gets the coordinates of the specified mc, creates a new one in it's place and deletes the original. Unfortunately this also removes any nested movieclips and buttons and breaks animation tweens of this mc. So if the original mc would have a button on it and animates from left to right, the new one doesn't.
mc.clear(); looked very promising, but it only clears stuff you put on it at runtime while I need to clear the stuff from design-time. (= the simple box drawing object)Creating a movieclip with the same name, at the same depth doesn't seem to work. oldbox.parent.createEmptyMovieClip(oldbox._name, oldbox.getDepth()); The old movieclip keeps existing and neither of them animates.So I'm searching for a way to replace a movieclip or clear it's content at runtime.

View 5 Replies

ActionScript 2.0 :: [mc] Replacing A Movieclip Without Changing It's Children / Depth / Tweens

Feb 4, 2010

I would like to be able to draw a simple box as a background/placeholder, dress it up with buttons and movie clips at design time, and at runtime call a function to replace the simple box with the new design. How would I go about doing this? I have a graphic design that is too complicated to make with flash. So i made a piece of actionscript that can restyle any existing movieclip. This piece of code works. It basically gets the coordinates of the specified mc, creates a new one in it's place and deletes the original. Unfortunately this also removes any nested movieclips and buttons and breaks animation tweens of this mc. So if the original mc would have a button on it and animates from left to right, the new one doesn't.

mc.clear(); looked very promising, but it only clears stuff you put on it at runtime while I need to clear the stuff from design-time. (= the simple box drawing object)
Creating a movieclip with the same name, at the same depth doesn't seem to work. oldbox.parent.createEmptyMovieClip(oldbox._name, oldbox.getDepth()); The old movieclip keeps existing and neither of them animates.So I'm searching for a way to replace a movieclip or clear it's content at runtime. Or am I thinking in the wrong direction and are there other ways to restyle a movie clip?

View 1 Replies

ActionScript 2.0 :: Swapping A Dynamic Movieclip's Depth Beneath A Static Set Of Graphics?

Jun 7, 2006

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

[Code]....

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.

View 6 Replies

ActionScript 2.0 :: Dynamic ComboBox Is Giving Negative Depth To Attached MovieClip?

Jun 17, 2007

I've got this new problem where I'm trying to remove a container movieclip i've attached the first time the function is run, but I try to remove it and replace it again, but the second time around it gets a negative depth and all goes to hell.

Code:

function populateBasket(){
trace("B4 REMOVE:" + basketRows.loader.container.getDepth());
basketRows.loader.container.removeMovieClip();

[Code].....

View 1 Replies

ActionScript 2.0 :: Swaps The Depth Of A Dynamically Loaded Image When RollOver Each Movieclip (button)

Mar 23, 2004

I have three movieclips (used as buttons) on my main MC. The following code swaps the depth of a dynamically loaded image the when I rollOver each movieclip (button). I want to put the button.rollOver code in a for loop so I dont have to repeat this code for every image loaded.

[Code]...

View 3 Replies

ActionScript 3.0 :: Flash Change The Index Or Depth Of The MovieClip Breaks The Timeline Animation

Jun 26, 2011

why changing the index or depth of the movieClip breaks the the timeline animation of this movieClip !!

View 7 Replies

ActionScript 3.0 :: More Memory Management Headaches

Aug 29, 2008

I previously asked about some FLV files that I was loading externally, and having trouble with memory being released. Having sort of solved this, I am having the same problem with loading external resources and then getting them to be cleared out of memory when I'm done with them. I have seen kglad mention more than once that GC in flash 9.0.124.0 is broken, but where does that leave us? I have also tried my project in FP 10, and the memory still continues to go up and up. If I load an external resource - in this case I have a class that builds a VR room with papervision - and then close it, set it's instance to null, my memory never goes down.

This is a total guess, but could it have anything to do with using Tweener in my project? Is there any way that the Tweener class could be keeping some of my objects in memory and keep them from being GC'd? I am using weak references in my listeners, setting any variable I can find to null... I can get over how frustrating this is to just see memory go up and up but find no reason. The class I am using also uses a few subclasses to build itself, but I end up with one instance of my VR on the stage. If I have set that instance to a name - myVR - and then removeChild(myVR) from the stage and set the name to null - that should do it right? Boy, this is frustrating.

View 3 Replies

ActionScript 3.0 :: Video Management System Put Together?

Aug 13, 2010

[URL]... How is this video management system put together? This is not a job for me, I am just curous.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved