Código Flex :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="SWFAddress.onChange=getURL"
backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#444242, #444242]">
<mx:Script>
<![CDATA[
import com.asual.swfaddress.SWFAddress;
private function getURL():void{
var path: String = SWFAddress.getPath();
switch (path) {
case "/1":
currentState = 'S1';
// viewstack1.selectedIndex = 0;
break;
case "/2":
currentState = 'S2';
break;
case "/3":
currentState = 'S3';
break;
case "/4":
currentState = 'S4';
break;
}
}
private function setURL(event:Event):void{
SWFAddress.setTitle('URL Title: ' + event.target.selectedChild.label);
SWFAddress.setValue('/' + event.target.selectedChild.label);
}
]]>
</mx:Script>
<mx:states>
<mx:State name="S1">
<mx:AddChild position="lastChild">
<mx:Canvas width="578" height="200" horizontalCenter="-142" top="83" backgroundColor="#FEFEFE" borderStyle="solid" cornerRadius="20">
</mx:Canvas>
</mx:AddChild>
</mx:State>
<mx:State name="S2">
<mx:AddChild position="lastChild">
<mx:Canvas width="578" height="200" horizontalCenter="-142" top="83" backgroundColor="#E4E5B4" borderStyle="solid" cornerRadius="20">
</mx:Canvas>
</mx:AddChild>
</mx:State>
<mx:State name="S3">
<mx:AddChild position="lastChild">
<mx:Canvas width="578" height="200" horizontalCenter="-142" top="83" backgroundColor="#77CC81" borderStyle="solid" cornerRadius="20">
</mx:Canvas>
</mx:AddChild>
</mx:State>
<mx:State name="S4">
<mx:AddChild position="lastChild">
<mx:Canvas width="578" height="200" horizontalCenter="-142" top="83" backgroundColor="#CB77CC" borderStyle="solid" cornerRadius="20">
</mx:Canvas>
</mx:AddChild>
</mx:State>
</mx:states>
<mx:Button x="70" y="109" label="1" click="currentState='S1'"/>
<mx:Button x="70" y="139" label="2" click="currentState='S2'"/>
<mx:Button x="70" y="169" label="3" click="currentState='S3'"/>
<mx:Button x="70" y="199" label="4" click="currentState='S4'"/>
</mx:Application>
No se si estoy haciendo algo mal o necesito agregar un archivo .js o algo... si alguien uso la librería y me puede ayudar... Gracias por todo!!!!
