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 to syam sundars Cancel reply