473,394 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

FOR LOOP hide

8
I am currently making an application that allows users to customise shapes and draw them dynamically, for part of the form process of it i have to let them specify a colour, i am using radio buttons to let the user choose the colour and am attaching them in a for loop. They attach fine but further down my code on a button release i need them to become invisible yet no matter what i try i cant seem to make it happen inside a for loop? can anyone help me please?

- code to attach buttons:

Expand|Select|Wrap|Line Numbers
  1. for (var i:Number = 0; i<colourNames.length; i++) {
  2.         this.attachMovie("RadioButton", "lineColour"+i, this.getNextHighestDepth());
  3.         this["lineColour"+i].setLabel(colourNames[i]);
  4.         this["lineColour"+i].setData(colourValues[i]);
  5.         this["lineColour"+i].setGroupName("lineColour");
  6.         this["lineColour"+i]._visible = true;
  7. }
  8.  
- code im using to try and make them invisible:

Expand|Select|Wrap|Line Numbers
  1.     second_FormBut.onRelease = function() {
  2.         if (lineColour.getValue() == undefined || fillColour.getValue() == undefined) {
  3.             trace("You need to select both a fill and a line colour");
  4.         } else {
  5.                 for (var i:Number = 0; i<colourNames.length; i++) {
  6.                 this["lineColour"+i].visible = false;
  7.             }
  8.         }
  9.     };
  10. }
  11.  
  12.  
I know the code works as in the else block i have run a trace statement returning the selected values but have no luck with this.

Any help much appreciated, many thanks. Michael
Nov 11 '06 #1
0 2465

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Kingdom | last post by:
I Need some serious help here. strugling novis with ASP and javascript any help would be greatly appreciated The script below does exactly what I want it to do for each product on the two passes...
3
by: Steve Bishop | last post by:
I have 10 fields each with it's own row in a table. Based on another fields value within the same row for each, I would like to hide or show the row. Example: I have 10 rows with size and order...
2
by: Newton | last post by:
I'm having some issues with a greasemonkey script i've made (nothing serious, and you'll notice that by the mess). I made it to learn javascript properly at first but it ended handy and now i'm...
5
by: Mike D | last post by:
Attached is my code. Which I know there is a better way of writing however this is what I came up with and it works until the value is null or not = to the <> value. 'Do While rdrSQL.Read() ...
0
by: pargat.singh | last post by:
Hi : I am using Master/Child page in VS2005 and i wrote generic function to show/hide controls which works fine if i don't use master/child .Below is my function which work fine for single page...
5
by: Ed Jay | last post by:
I have a switch statement that controls which of several containers is displayed or not. It currently looks like: function showHelp(n) { show('vhelp'); //makes parent container visible switch...
3
by: bmerlover | last post by:
I believe my problem lies inside the while loop. When I click the play button on the gui app, it goes inside the while loop, reads the file and calls the necessary function to do what it needs to do....
4
by: joaotsetsemoita | last post by:
hello everyone. Im trying to time out a loot after a certain time. Probably 5 to 10 minutes. I have the following function Private Sub processFileCreation(ByVal source As Object, ByVal e As...
9
by: =?Utf-8?B?U3RldmUgQmVobWFu?= | last post by:
Using Visual C++8.0 Express Edition I created a "Solution " using a "Form" (dialog) of my own design. Without adding any code of my own I compiled the code generated for me by Visual C++. The...
16
by: Andy B | last post by:
I have the following code inside of a WebBrowser.DocumentCompleted event: For index As Integer = 0 To Me.Browser.Document.GetElementsByTagName("ul").Item(0).GetElementsByTagName("li").Count ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.