Posted By

curiousmedia on 10/15/09


Tagged


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

Demian
shea14
adrianparr
davidino1978
dubogii


Basic SWFAddress Setup


 / Published in: ActionScript 3
 

  1. import com.asual.swfaddress.*;
  2.  
  3. function handleSWFAddress(e:SWFAddressEvent):void {
  4. trace("# SWFAddress Path: "+e.path);
  5.  
  6. switch(e.pathNames[0]) {
  7. case "section2":
  8. //code to go to section 2
  9. break;
  10.  
  11. case "section1":
  12. default:
  13. //code to go to section 1
  14. break;
  15. }
  16. }
  17.  
  18. SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleSWFAddress);
  19.  
  20. //Use setValue to change sections
  21. //If left here it will override deeplinks by changing the value immediately
  22. SWFAddress.setValue("/section1/");

Report this snippet  

You need to login to post a comment.