Here i have pasted the code.
Test2.mxml
--------------------------
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="714"
height="380" >
    <mx:Script>
   <![CDATA[

 private function addBar():void {

      dispatchEvent(new Event('addButton'));
 }

]]>
</mx:Script>

 <mx:Metadata>
 [Event(name="addButton", type="flash.events.Event")]
 </mx:Metadata>

<mx:LinkButton color="red" x="147" y="261" label="A" click="addBar()"/>


</mx:Canvas>

Test.mxml
-----------------
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="880"
height="484" xmlns:components="components.*" xmlns:ns1="*">
   <mx:Script>
 <![CDATA[
 import mx.controls.Button;
 import mx.controls.Alert;
 private function addButtonHere():void {

 var linkButton:Button =new Button();
    linkButton.label = 'A';
   cBar.addChild(linkButton);
 }
 ]]>
   </mx:Script>
<mx:ApplicationControlBar id="cBar" width="763" height="42">
<mx:Button label="settings"/>
<mx:Button  label="settings1"/>
</mx:ApplicationControlBar>
 <components:Test2 x="49" y="64" addButton="addButtonHere()">
 </components:Test2>
</mx:Canvas>
Main1.mxml(application)
-------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
xmlns:components="components.*" width="1064" height="600">

    <components:Test />
</mx:Application>
   Here My requirement is i have one more linkbutton named 'B' in
Test2.mxml.When i clicked on B it will be
added to applicationcontrolbar(Test.mxml).How can i achieve this?
plz help me
-- 
Regards
D.Mahesh Babu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to