Solved

AS2 name passing

Posted on 2010-09-23
2
314 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with Progress 4gl Rounding Function 6 60
Edit my bash script 16 46
Open new WPF windows - powershell 4 37
script to read text file 34 29
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

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