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
Solved

Iterative Variables in Actionscript 2

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Animating text  - electrons orbit around letter M 12 87
Removing Flash from Website 6 68
Column Spacing 3 92
Problem to echo 6 108
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

789 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