Posted By

GringoS04 on 08/11/10


Tagged

MotionBlur


Versions (?)

Motion Blur on Enter Frame


 / Published in: ActionScript 3
 

  1. // ACTION FRAME
  2.  
  3.  
  4. import fl.transitions.*;
  5. import fl.transitions.Tween;
  6. import fl.transitions.easing.*;
  7. import flash.display.Sprite;
  8. import flash.filters.BitmapFilterQuality;
  9. import flash.filters.BlurFilter;
  10.  
  11. addEventListener(Event.ENTER_FRAME, btnBaropen);
  12.  
  13. //Sets tween object, moves bar across screen
  14. var btnTween:Tween;
  15.  
  16. //Method to slide out button bar and half circles, based on Mouse event
  17. function btnBaropen(event:Event):void{
  18.  
  19. btnTween = new Tween(btnBar01, "x", Strong.easeOut, -300, 0, .25, true);
  20.  
  21. //Listener to control Blur on/off
  22. btnTween.addEventListener(TweenEvent.MOTION_CHANGE, blurOn);
  23. btnTween.addEventListener(TweenEvent.MOTION_FINISH, blurOff);
  24.  
  25. //Method to control blur
  26. function blurOn(event:TweenEvent):void{
  27. var blur:BlurFilter = new BlurFilter();
  28. blur.blurX = 50;
  29. blur.blurY = 0;
  30. blur.quality = BitmapFilterQuality.MEDIUM;
  31. btnBar01.filters = [blur];
  32. }
  33. //Method to control blur OFF
  34. function blurOff(event:TweenEvent):void{
  35. var blur:BlurFilter = new BlurFilter();
  36. blur.blurX = 0;
  37. blur.blurY = 0;
  38. blur.quality = BitmapFilterQuality.MEDIUM;
  39. btnBar01.filters = [blur];
  40. }
  41. }
  42.  
  43. //FRAME B
  44.  
  45. removeEventListener(Event.ENTER_FRAME, btnBaropen);
  46.  
  47. //FRAME C
  48.  
  49. addEventListener(Event.ENTER_FRAME, btnBarclose);
  50.  
  51. var btnTween_out:Tween;
  52.  
  53. //Method to slide out button bar and half circles, based on Mouse event
  54. function btnBarclose(event:Event):void{
  55.  
  56. btnTween_out = new Tween(btnBar01, "x", Back.easeIn, 0, 300, .75, true);
  57.  
  58. }
  59.  
  60. // FRAME D
  61.  
  62. removeEventListener(Event.ENTER_FRAME, btnBarclose);
  63.  
  64. // FRAME SHUFFLE
  65.  
  66. MovieClip(parent).gotoAndStop(1);

Report this snippet  

You need to login to post a comment.