Posted By

Pablo on 05/03/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vkord


How to use Buttons


 / Published in: ActionScript 3
 

  1. stop();
  2. import flash.net.navigateToURL;
  3. import flash.net.URLRequest;
  4. import flash.events.MouseEvent;
  5. var getYouTube:URLRequest = new URLRequest("http://www.youtube.com");
  6.  
  7. /// B Button Get a URL ///
  8. B_btn.addEventListener(MouseEvent.CLICK, bClick);
  9. function bClick(event:MouseEvent):void{
  10. navigateToURL(getYouTube);
  11. }
  12.  
  13.  
  14. /// G Button Property ///
  15.  
  16. G_btn.addEventListener(MouseEvent.CLICK, gClick);
  17. G_btn.addEventListener(MouseEvent.MOUSE_OUT, gOut);
  18.  
  19. function gClick(event:MouseEvent):void{
  20. gotoAndStop("getJargon");
  21. }
  22. function gOut(event:MouseEvent):void{
  23. gotoAndStop(1);
  24. }
  25.  
  26.  
  27. /// R Button Property ///
  28.  
  29. R_btn.addEventListener(MouseEvent.CLICK, rClick);
  30. R_btn.addEventListener(MouseEvent.MOUSE_OUT, rOut);
  31.  
  32.  
  33. function rClick(event:MouseEvent):void{
  34. R_btn.alpha -= 0.1;
  35. }
  36. function rOut(event:MouseEvent):void{
  37. R_btn.alpha = 1;
  38. }

Report this snippet  

You need to login to post a comment.