ActionScript 3.0 :: Replace Mc In Same Depth?
Mar 17, 2011Is there any code like replacemc? Instead of removeChild() and then placing the new one at the addChildAt(same depth).
View 1 RepliesIs there any code like replacemc? Instead of removeChild() and then placing the new one at the addChildAt(same depth).
View 1 RepliesI'm having some real trouble getting .replace to actually replace something. Here's my code...
[Code]...
I can trace both newFiles[i] and keywords[i][whatever], but the replace doesn't replace anything. The regex is valid as well. I'm using regexr to test it, and it works perfectly there... but will not for me and I don't know why.
putting a movieclip into highest depth without knowing which clip is in the highest depth
View 2 RepliesI've got a strange situation where I'm replacing the text in a string that I've taken from an XML, but the .replace function for the string keeps failing. I've tried running the example given on the Adobe site, so I know the value I'm trying to replace ("%20") isn't at fault - it's something about the string I have! I've included the code below, but it seems correct. Is there a particular tip I should know when taking XML values into AS3? I'm putting them in strings for this project.
[Code]...
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 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.
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 can not 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 RepliesI am making a 3d engine using formulas from a different language and its coming along nicely but I am having depth issues. How do I set the depth of an object within the script? I need the depth to change so I objects that are farther in the distance are further behind other objects.
View 4 RepliesI am creating multiple sprites on the stage using structured classes as shown below, I would like every time I click on one of these sprites to make it go on top of all previously created sprites. I would also like to know if this can be implemented from within the last class "class c" onMouseDown function.
[Code]...
I've got a bunch of movieclips lying on top of each other like a stack. When you click one, it slides out, and comes forward. When clciked again it goes back and slides back into the stack.inside the movieclips iv'e placed:
Code:
this.swapDepths(1);
along the timeline at a spcific frame.I need to make it get the same depth value as it had before I clicked it when it goes back. Basicly:
Code:
this.swapDepths(same-as-before-the-swap-to-depth-1);
I guess I need som kind og listener to logg the changes made...
I'm creating this shooter game. I attached a crosshair mc at the beginning with the depth set to getNextHighestDepth.However I keep adding the monsters mc dynamically when the game progresses, also with getNextHighestDepth. So the monster mc will keep overriding the depth of my crosshair's depth. how to get my crosshair mc's depth always to be on top of everything including the monster mc.I tried getNextHighestDepth()+1000 for my crosshair mc. But it was dumb because the monsters keep getting getNextHighestDepth as well. I assume that monster's depth would be 1001, 1002 and so on...
View 3 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 want to give a movieclip a specific depth number, but i cant found a method for this.
View 2 RepliesI have tried repeatedly to take the examples in setChildIndex and instead of using sprites I want to control the order of 2 buttons on the stage so that when I roll over one of the buttons it comes to the top.
Here is the code I have so far which is from the example given in the on-line documentation:
[Code]...
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 RepliesIm loading some HTML text into a flash dynamic text box and have some list items but i want the bullet to be flush to the left along with the other text and without such a big gap,see below.is there some code i can insert in my plain text document with out using css?<li>Present you with the best market opportunities within your search criteria.</li>
View 1 Replies