?
Solved

Iterative Variables in Actionscript 2

Posted on 2013-12-04
2
Medium Priority
?
351 Views
Last Modified: 2013-12-05
If I copy the currentText output from the trace below and paste it into the code and append a "._visible = false", the item is rendered invisible.

Referring directly to the currentText variable, however, doesn't work. There are no errors. It just doesn't do anything! I suspect I have set up the variable wrong even though the trace output comes out correctly.


stop();
numberOfQuestions = 10;

//safetyExpectations.safetyExpectations1.safetyExpectationsText1._visible = false;
safetyExpectations.safetyExpectations1.mc_check_1._visible = false;
safetyExpectations.safetyExpectations1.check1_btn._visible = false;

for (i = 1; i < numberOfQuestions; i++) {
currentText = ["safetyExpectations.safetyExpectations"+i+".safetyExpectationsText"+i];
trace (currentText);
currentText._visible = false;
}

Open in new window

0
Comment
Question by:Karessa
[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 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 39698304
Use the following :
stop();
numberOfQuestions = 10;

//safetyExpectations.safetyExpectations1.safetyExpectationsText1._visible = false;
safetyExpectations.safetyExpectations1.mc_check_1._visible = false;
safetyExpectations.safetyExpectations1.check1_btn._visible = false;

for (i = 1; i < numberOfQuestions; i++) {
	currentText = safetyExpectations["safetyExpectations"+i]["safetyExpectationsText"+i];
	trace (currentText);
	currentText._visible = false;
}

Open in new window

0
 

Author Closing Comment

by:Karessa
ID: 39699028
Thank you!
0

Featured Post

Technology Partners: 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 purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

770 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