Solved

Actionscript 3 Movieclip Reference

Posted on 2011-02-15
2
495 Views
Last Modified: 2012-05-11
Possibly lame question...

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

MovieClip1_mc
MoveClip2_mc
MovieClip3_mc
(etc)

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

for (var f:Number=1; f<=10;f++){
  trace("Whatever");
}

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

like..

movieclip[f].x = 500;

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

Accepted Solution

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

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

Open in new window

0
 
LVL 2

Author Closing Comment

by:erzoolander
ID: 35098679
Gracias :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

734 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