Some useful AS3 snips that always slip my mind


/ Published in: ActionScript 3
Save to your folder(s)

- Get the charCode in a String
- Navigate to an external URL


Copy this code and paste it in your HTML
  1. // get charCode in a String
  2.  
  3. s = new String("Chris");
  4. i = s.charCodeAt(0);
  5. // i = 67
  6.  
  7. // Navigate to external URL
  8.  
  9. var targetURL:URLRequest = new URLRequest("http://yourhomepage.com/");
  10. var target:String; // Open the link in..
  11.  
  12. target = "_self" // specifies the current frame in the current window.
  13. target = "_blank" // specifies a new window.
  14. target = "_parent" // specifies the parent of the current frame.
  15. target = "_top" // specifies the top-level frame in the current window.
  16.  
  17. navigateToURL(targetURL,target);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.