You're not going to be able to do it in MXML because a RadioButton
doesn't have children like a container does.  You'll need to do this in
AS and explicitly call addChild and do whatever positioning you need to
do.

Matt

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alberto Albericio
Sent: Monday, March 13, 2006 1:29 PM
To: [email protected]
Subject: [flexcoders] How to extend a radiobutton component?

Hi all,

I want to extend the RadioButton component so that it becomes something 
like:

the radiobutton itself + something else (vbox, canvas, ...)

How can I do this? Right now, Im trying this:

<mx:RadioButton xmlns:mx="http://www.macromedia.com/2005/mxml"; xmlns="*"
    selected="{mySelected}"
    >
    <mx:Script>
        <![CDATA[
            [Bindable]
            public var myData:Object;
           
            [Bindable]
            public var mySelected:Boolean;
        ]]>
    </mx:Script>
    <mx:HBox>
        <mx:Label text="{myData.name}" />
        <mx:Canvas visible="{mySelected}">
            <mx:Label text="Secondary info" />
        </mx:Canvas>
    </mx:HBox>
</mx:RadioButton>

The Script code works, it is extending the component fine but the visual

"addon" is not working, I mean that HBox.

It is important for me to extend the radiobutton component and not 
create a new VBox with a radiobutton on it because im creating these 
components from a Repeater and it should behave as a RadioButton.

Any ideas?

Thank you all.

Albert




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to