Solved

Add child behind a movie clip in ActionScript

Posted on 2009-05-13
1
851 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now