Solved

Add child behind a movie clip in ActionScript

Posted on 2009-05-13
1
854 Views
Last Modified: 2013-11-11
I have a movie clip called fire_mc. In the time line of fire_mc I have some action script code that makes the movie clip move up randomly and also changes its alpha so that it appears as fire as it goes up. When I add repeatedly many fire_mc to the main time line it will appear as fire. The only problem is that I dont know how to place that animation behind a movie clip. That animation will play fine in front of any movie clip. How could I add several instances of fire_mc behind another movie clip? whenever I use the addChild function it places the movie clip in front of everything else. is there a way to bring a child to stage without placing it in the front?

Another quick question about this animation is that how could I change the color of the movie clip as it goes up. I have changed the alpha, width and height as the fire_mc randomly moves up but my animation will look much better if I could also change the coloer of the movie clip as it moves up. fire_mc is actualy a circle that I converted into a movie clip. Its color is red and it will be nice it it can turn yellow at the top.
0
Comment
Question by:TonoNam
1 Comment
 
LVL 1

Accepted Solution

by:
flash_expert_ro earned 250 total points
ID: 24382700
Hello! Yes it`s possible with addChildAt() method. You can use this like addChildAt(child,index);
index should be a depth lower that your MovieClip(wich you want to remain in front).

If you don`t know the depth of this movie clip, just write

addChildAt(your_fire_mc_instance,getChildIndex(your_movie_clip_instance));
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question