Comunidad de diseño web y desarrollo en internet online

SWFAddress y Flex3 (Deep Linking)

Citar            
MensajeEscrito el 14 Abr 2010 03:20 pm
Estoy tratando de utilizar SWFAddress y no encuentro un ejemplo para solucionar mi problema... Tengo varios States llamados por un botón, lo que quiero hacer es que en la url me aparezca: www.misitio.com#/State1 por ejemplo.

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!!!! :)

Por xchacalx

Claber

133 de clabLevel



 

firefox
Citar            
MensajeEscrito el 14 Abr 2010 03:42 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 14 Abr 2010 06:22 pm
Gracias Jorge, lo voy a probar!

Por xchacalx

Claber

133 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.