Solved

Add child behind a movie clip in ActionScript

Posted on 2009-05-13
1
856 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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 load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

691 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