This is because you are assigning value to the string in Canvas in
creationComplete event and in panel you are just creating and instance
of Canvas component. It will not trigger the creationComplete event of
Canvas component. To achieve this, you have to add your canvas
component inside the Panel component.

something like this

public function init():void{
var callcanvas:mycanvas = new mycanvas();
addChild(callcanvas);

Alert.show(callcanvas.mystring);
}

it should work for you.

-Ravi
http://achieveravi.blogspot.com

On Oct 30, 1:21 pm, jakir qureshi <asraf.ja...@gmail.com> wrote:
> your Panel will be like that hope his is ok for u
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
>
> width="400" height="300"
>
> creationComplete="init()" xmlns:ns1="*">
>
> <mx:Script>
>
> <![CDATA[
>
> *import* mx.controls.Alert;
>
> *public* *function* init():*void
> *
>
> {
>
> Alert.show(callcanvas.mystring);
>
> }
>
> ]]>
>
> </mx:Script>
>
> <ns1:myCanvas id="callcanvas"/>
>
> </mx:Panel>
>
>
>
> On Fri, Oct 30, 2009 at 1:08 PM, prajnith K <prajn...@gmail.com> wrote:
> > hi friends
> > i'm not able bind between two components...
>
> > im sending my code please help me...
>
> > how to approach using metadata or waht?
> > got stuck here
>
> > ***************************** main application*****************************
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml";
> > layout="absolute" xmlns:ns1="*">
> >     <ns1:mypanel x="100" y="100">
> >     </ns1:mypanel>
> > </mx:WindowedApplication>
>
> > ********************************* component 1*****************************
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";
> >      width="400" height="300"
> >      creationComplete="init();">
> > <mx:Script>
> >     <![CDATA[
> >         [Bindable]
> >         public var mystring:String;
> >         public function init():void
> >         {
> >         mystring = "prajnith";
> >         }
> >     ]]>
> > </mx:Script>
> > </mx:Canvas>
> > ************************************component
> > 2***************************************
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
> >      width="400" height="300"
> >       creationComplete="init()">
> >     <mx:Script>
> >         <![CDATA[
> >         import mx.controls.Alert;
> >         public     var callcanvas:mycanvas = new mycanvas();
> >         public function init():void
> >         {
> >             Alert.show(callcanvas.mystring);
> >         }
>
> >         ]]>
> >     </mx:Script>
> > </mx:Panel>
>
> > Prajnith
>
> --
> Thanks & Regards
>
> M.Jakir Qureshi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to