States MXML tag converted into AS3 Code

<mx:states>
<mx:State name=”minimized”>
<mx:SetProperty target=”{this}” property=”height” value=”{this.minHeight+15)}”/>
<mx:SetProperty target=”{this}” property=”width” value=”{this.minWidth}”/>
<mx:SetProperty target=”{this}” property=”vScrollPolicy” value=”off”/>
<mx:SetProperty target=”{this}” property=”hScrollPolicy” value=”off”/>
</mx:State>
</mx:states>

private function buildStates():void{
var overrides:Array = new Array();
var newState:State = new State();
overrides.push(makeSetProp(this,”height”,this.minHeight +5));
overrides.push(makeSetProp(this,”width”,this.minWidth));
overrides.push(makeSetProp(this,”vScrollPolicy”,”off”));
overrides.push(makeSetProp(this,”hScrollPolicy”,”off”));
newState.name=”minimized”;
newState.overrides = overrides;
this.states = new Array(newState);
}
private function makeSetProp(target:UIComponent, property:String, value:*):SetProperty{
var sp:SetProperty = new SetProperty();
sp.target = target;
sp.property = property;
sp.value = value;
return sp;
}

  1. here i want sample code convertion

    action script to mxml

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: