Solved

AS2 name passing

Posted on 2010-09-23
2
313 Views
Last Modified: 2012-05-10
I am updating multiple calls from hard-coding to a function, passing a variable

var th:String = "round";
var thMask = thSh+"mask";
thisBox.attachMovie(thMask,thMask,70);

The above works as expected. The following is what I have when hard coded:
//gCollisionMask = _level0.workBox.roundmask;

However, I want to pass the value using the following code (which is not correct):
gCollisionMask = _level0.workBox.thMask;

Ican't remember what it should be - should there be brackets around part of it?
0
Comment
Question by:msukow
[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 2

Accepted Solution

by:
phodges4 earned 500 total points
ID: 33748402
you can use eval if you want:

gCollisionMask = eval("_level0.workBox." + thMask);
0
 

Author Comment

by:msukow
ID: 33748826
I also found this works:
gCollisionMask = _level0.workBox[thMask];
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

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,…
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 viewer will learn how to count occurrences of each item in an array.
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.

735 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