View Full Version : ViewStack language reference
springframework
02-21-2008, 12:03 AM
there should be a big fat <h1>
resizeToContent="true" creationPolicy="all"
at the top of the page.
if anyone is using viewstack/tabnavigator, you better make sure you understand what those do.
dr_zeus
02-21-2008, 07:27 PM
With proper use of binding, you'll almost never need to change the creationPolicy of a container. Typically, this involves adding a intermediary property/variable to your component (in general, this may be better OOP too). You can bind that property to something that may not be created right away and you won't get errors.
Example:
<mx:TabNavigator>
<mx:VBox>
<!-- first page content -->
</mx:VBox>
<mx:VBox>
<!-- the button may not be created right away -->
<mx:Button label="{buttonLabel}"/>
</mx:VBox>
</mx:TabNavigator>
<mx:Script>
private var _buttonLabel:String = "OK";
[Bindable]
public function get buttonLabel():String
{
return this._buttonLabel;
}
public function set buttonLabel(value:String):void
{
this._buttonLabel = value;
}
</mx:Script>
springframework
02-27-2008, 10:00 PM
how would you recommend changing the label of the button using the code you posted above?
dr_zeus
02-29-2008, 05:51 PM
whatever.buttonLabel = "changed value";
where whatever is a reference to the instance of the MXML class that includes the buttonLabel setter.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.