|
Create a file:
StateDemo.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0" xmlns="*" <mx:HTTPService id="srv" url="product.xml" useProxy="false"/> <Thumbnail id="thumbnail" product="{srv.lastResult.product}"/> <mx:Label text="Choose a state:"/> </mx:Application> |
Thumbnail.mxml |
<?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" <mx:Script> [Bindable] </mx:Script> <mx:Label text="{product.name}" fontSize="11" fontWeight="bold"/> <mx:HBox> <mx:states> <mx:State name="medium"> <mx:SetProperty name="width" value="200"/> <mx:AddChild relativeTo="{features}"> </mx:State> <mx:State name="large" basedOn="medium"> <mx:SetProperty name="width" value="300"/> <mx:AddChild> </mx:State> </mx:states> </mx:VBox> |