Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

'Dynamic' movieclip references

Posted on 2003-03-18
2
Medium Priority
?
223 Views
Last Modified: 2010-04-03
Hi

I am trying to find out the values of some movieclip properties. I want to be able to tell Flash to check several movieclips, so I will pass a unique value for each movieclip to the function.

Can someone please tell me why, in the following function, trace 1 returns the length of _root.movieX but trace 2 does not?

function doTraces(whichMovie)
{
trace('1) movie X length = ' + _root.movieX._totalframes + ' frames');

myMov = ('_root.movie' + whichMovie)
trace('2) movie ' + whichMovie + ' length = ' + myMov._totalframes + ' frames');
}


Many thanks

Dan
0
Comment
Question by:__wired__
2 Comments
 
LVL 1

Accepted Solution

by:
mickydunks earned 200 total points
ID: 8163842
Hey Dan,

give this a go...

forget your myMov line and implement this
trace('2) movie ' + whichMovie + ' length = ' + _root["movie" +whichMovie]._totalframes + ' frames');


Where you have myMov try _root["movie" +whichMovie]


md.
0
 

Author Comment

by:__wired__
ID: 8163873
Wicked. Thanks Micky.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
Suggested Courses

578 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