Solved

Iterative Variables in Actionscript 2

Posted on 2013-12-04
2
340 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 500 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

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…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

690 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