473,610 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FOR LOOP hide

8 New Member
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 2468

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

Similar topics

0
2550
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 it makes however I would like the entire script to loop 34 times and on each of those 30 loops also write the product and the price (only) onto the page building a compleate list of all the products selected over the 34 loops ending with a total...
3
1860
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 qty data: Row 1 thru 4 are taken with sizes large, X-Large, XX-Large and XXX-Large. Rows 5 thru 10 don't have size values populated, so I want to hide the row. I know how to show and hide elements by id including TR's, but I
2
5804
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 addicted to it.. However, it doesn't quite work like i'd expect it to (and like it used to with older versions) I realise that it may be a greasemonkey-specific question, please bare with me if it is. I figured some of you guys may have used it...
5
2775
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() 'While rdrSQL.Read() ' Dim result As String ' result = Trim(rdrSQL.GetString(0))
0
1261
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 to show/hide controls. private void displayOrHideControls(string ctrlNames, string Mode) { string arControlNames = ctrlNames.Split(new char { ';' });
5
1452
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 (n){ case 0: show('image0');hide('image1');hide('image2');...;hide('imagem'); break; ..
3
2496
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. I have it set in a way whenever I click the PLAY button, the PLAY button is suppose to hide and the PAUSE button is suppose to appear. This does not happen until the complete while iteration has finished. My goal is to Play and Pause at any time I...
4
6826
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 System.IO.FileSystemEventArgs) Dim strFilename As String = "c:\web\example.mdb"
9
1659
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 compiled .exe produced the expected dialog with all the function I expected (tabbing, text entry etc.). At that point I ran headlong into a huge stone wall -- try as I may I could not find the message loop in the generated code so that I could...
16
1752
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 NotesList.Items.Add(Me.Browser.Document.GetElementsByTagName("ul").Item(0).GetElementsByTagName("li").Item(index).InnerText) Next index
0
8145
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8556
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8410
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5526
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4037
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1690
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.