Object is not bindable i think.

Why do not you make a custom class and bind on this?

ie:

[Bindable]
Myclass
var a:whateverneeded
var b:...

and then you update the class instance as usuall and bind on its members



On Tue, Feb 10, 2009 at 4:33 PM, Keith Hughitt <[email protected]>wrote:

>   In case this helps anyone else, here is a fairly simple way to solve
> this problem:
>
> *main.xml*
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> xmlns:custom="custom.*">
>     <mx:Script>
>     <![CDATA[
>         import mx.controls.Alert;
>
>         public function updateObj(e:Event):void {
>             detailsPanel.breed= e.target.label;
>             detailsPanel.age = 5;
>         }
>     ]]>
>     </mx:Script>
>     <mx:Button label="Lab" click="updateObj(event)" />
>     <mx:Button label="Poodle" click="updateObj(event)" />
>     <mx:Label text="Details:" />
>     <custom:Details id="detailsPanel" />
>
> </mx:Application>
>
>
> *custom/Details.xml*:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml";
> horizontalAlign="center" verticalAlign="middle">
>     <mx:Script>
>     <![CDATA[
>         [Bindable]
>         public var breed:String;
>
>         [Bindable]
>         public var age:Number;
>     ]]>
>     </mx:Script>
>     <mx:Text text="Breed: {breed}" />
>     <mx:Text text="Age: {age}" />
> </mx:VBox>
>
> This wasn't to original solution I was going for, but it is simple enough.
>
> Hope this helps someone else :)
> Keith
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[email protected],

Reply via email to