This should work as long as you define an id in the main application
mxml, for your CheckCell.mxml component.
<yourNamespace:CheckCell id="checkCell" click="checkCell.dummy()"/>
In the CheckCell.mxml:
cbSelected = Application.application.dummyCheckBox_cb.selected;
//------------------------------------------------------------------
However, you could do it this way.
Define your component in the main application xmxl like this:
<yourNamespace:CheckCell id="checkCell" cbSelected=
{dummyCheckBox_cb.selected}/>
In the CheckCell.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
[Bindable]
public var cbSelected:Boolean;
]]>
</mx:Script>
<mx:CheckBox id="followUpCB" selected="{cbSelected}"/>
</mx:VBox>
//------------------------------------------------------------------
Regards,
-TH
--- In [email protected], "Chaitu Vadlapatla"
<[EMAIL PROTECTED]> wrote:
>
> <mx:CheckBox id="dummyCheckBox_cb" click="CheckCell.dummy()"
x="15" y="535"/>//this piece is in my main application mxml
>
> My problem is with the click function. On this click of the check
box I want to call a function inside my component mxml and I cannot.
The component MXML looks like this
>
> Component MXML named ="CheckCell.MXML
>
> <?xml version="1.0" encoding="utf-8"?>
>
>
>
> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
>
> <mx:Script>
>
> <![CDATA[
>
> // Define a property for returning
>
> // the new value to the cell.
>
> public var cbSelected:Boolean;
>
> public function dummy ()
>
> {
>
> cbSelected =
parentApplication.dummyCheckBox_cb.selected;
>
> }
>
> ]]>
>
> </mx:Script>
>
> <mx:CheckBox id="followUpCB"
selected="{cbSelected}" creationCompleteEffect=" dummy ()" />
>
> </mx:VBox>
>
> Thanks
>
> Chaitu.
>
>
>
>
>
> ________________________________
>
> From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Luís Gustavo Sanabio
> Sent: Wednesday, June 14, 2006 6:37 AM
> To: [email protected]
> Subject: Re: [flexcoders] calling custom component methods inside
the parent application
>
>
>
> What is raga?
>
> Maybe ID is missing.
>
> <mx:CheckBox id="raga" click="CheckCell.dummy()" x="15" y="535"/>
>
> Gustavo Sanabio
>
>
>
> 2006/6/13, Jeremy Lu <[EMAIL PROTECTED]>:
>
>
>
> try this:
>
> public function dummy ()
>
> {
>
>
>
> cbSelected = parent.raga.selected;
>
>
> //or
>
> cbSelected =
Application.application .raga.selected;
>
>
>
> }
>
> ]]>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
--
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/