FORUMS: list search recent posts

Can you set Components ._visible or .enabled property?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Can you set Components ._visible or .enabled property?
on Dec 2, 2005 at 1:41:28 am

I'm using the Radio Button componenets to make some mutually exclusive choices for an application running off of an XML file of the available files and versions. The XML file has fields for which versions are available and I have a radio button for each available version. I'm trying to get the application to not show the option for file types if they aren't available (as defined in the XML list) and by using trace commands it seems as tho everything is working, but the visibility of the unavailable options is not happening. I've tried the following things:

1LineRadio._visible = false;

1LineRadio.enabled = false;

lineChoice.1LineRadio._visible = false;

lineChoice.1LineRadio.enabled = false;

{the radio buttons have instance names of 1LineRadio, 2LineRadio, and 3LineRadio, they are tied together with the group name lineChoice}

None of those worked (got warning of syntax error in the actionscript).

I know I've used this for regualar buttons and other objects, so the only thing I can think of is that the Components either don't do this or do it differently, in which case I can't find anyting in the AS reference about how to do set the visibility or enabled property for Components.

Thanks in advance for any help.

Return to posts index

Re: Can you set Components ._visible or .enabled property?
on Dec 2, 2005 at 1:45:17 am

Check out the FLA I just made at I was able to hide a radio button with the "_visible" property.


Return to posts index

Re: Can you set Components ._visible or .enabled property?
on Dec 2, 2005 at 5:15:05 pm

Well, that looks exactly how I was coding it and it wasn't working, that's strange, but I found a better work around:

You can set the Radio Buttons .label and .data property in actionscript, so instead of buttons for 1Line, 2Line, and 3Line, since the files always have a 1Line, but only have one or the other of the 2Line or 3Line version, I set up 2 radio buttons for singleLine and multiLine, then based on the XML field for the selected index, if the file has 1&2Line versions I coded: = "_2";
multiLine.lable = "2 Line"

And if the file has 1&3Line versions: = "_3";
multiLine.lable = "3 line"

Which ends up being a bit cleaner since there aren't buttons disappearing and holes in the layout where they would be.

I'm still going to need to figure out why I can't get the ._visible property to work once I get a bit farther into the project tho... I tried it in a quick simple file like you did and it did work, and I tried it in the opening section of the actionscript for my file and that worked too, but when i put it in the if statement's function it doesn't work, even tho the trace command right after it does.

Return to posts index

Sher Ali
Re: Can you set Components ._visible or .enabled property?
on Dec 3, 2005 at 12:33:15 pm

The reason seems to be that you are referencing the
component in a wrong way.

Sher Ali

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved