/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import com.asual.swfaddress.*; function handleSWFAddress(e:SWFAddressEvent):void { trace("# SWFAddress Path: "+e.path); switch(e.pathNames[0]) { case "section2": //code to go to section 2 break; case "section1": default: //code to go to section 1 break; } } SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleSWFAddress); //Use setValue to change sections //If left here it will override deeplinks by changing the value immediately SWFAddress.setValue("/section1/");