Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Actionscript 3 Movieclip Reference

Posted on 2011-02-15
Medium Priority
Last Modified: 2012-05-11
Possibly lame question...

Let's say I have 7 movieclips...named something like:


Then I have a script that iterates from 1 to 10...  Let's say:

for (var f:Number=1; f<=10;f++){

As the script iterates up - I want to use that count number to reference the movieclip.


movieclip[f].x = 500;

What is the proper syntax for referencing the movieclip in that loop?
Question by:erzoolander
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
LVL 37

Accepted Solution

CyanBlue earned 2000 total points
ID: 34899546
You'd do something like this...

var _mc:MovieClip;
for (var i:int = 1 ; i <= 10 ; i++)
   _mc = getChildByName("MovieClip" + i + "_mc");
   _mc.x = 500; 

Open in new window


Author Closing Comment

ID: 35098679
Gracias :)

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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 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.

705 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