Posted By


landock on 06/11/11

Tagged


Statistics


Viewed 88 times
Favorited by 0 user(s)

netdoc insterstitial


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



Copy this code and paste it in your HTML
  1. import com.greensock.*;
  2. import com.greensock.easing.*;
  3.  
  4.  
  5. var currentTween:TweenMax;
  6. var bgTween:TweenMax;
  7.  
  8. function randomRange(min:Number, max:Number):Number {
  9. return Math.random() * (max - min) + min;
  10. }
  11.  
  12. function getNewColor() {
  13. return (Math.random()) * 0xffffff;
  14. //trace(newColor);
  15. }
  16.  
  17. function runTween() {
  18. var scaleR:Number=randomRange(6,18);
  19. currentTween=TweenMax.to(logo_mc,10,{rotation:randomRange(0,120),alpha:randomRange(.5,1),scaleX:scaleR,scaleY:scaleR,x:randomRange(0,500),y:randomRange(0,300),ease:Sine.easeInOut,onComplete:runTween});
  20. }
  21.  
  22. var timeline:TimelineLite = new TimelineLite();
  23. timeline.insertMultiple([ new TweenLite(quote_mc, 1, {alpha:1, ease:Sine.easeOut}),
  24. new TweenLite(qa1_mc, 1, {x:350, ease:Sine.easeOut, delay:1}),
  25. new TweenLite(qa1_mc, 0.25, {alpha:0, ease:Sine.easeOut, delay:4}),
  26. new TweenLite(qa2_mc, 1, {alpha:1, ease:Sine.easeOut}),
  27. new TweenLite(learn_btn, 1, {alpha:1, ease:Sine.easeOut})],
  28. 0, TweenAlign.SEQUENCE, 0);
  29.  
  30. runTween();
  31. //add hand cursor
  32. learn_btn.buttonMode = true;
  33. learn_btn.useHandCursor = true;
  34.  
  35. //assign eventListeners
  36. learn_btn.addEventListener(MouseEvent.MOUSE_OVER, navOver);
  37. learn_btn.addEventListener(MouseEvent.MOUSE_OUT, navOut);
  38.  
  39. //on mouse over do this
  40. function navOver(e:MouseEvent):void{
  41. //trace(e.target)
  42. TweenLite.to(e.target, 0.75, {scaleX:1.2, scaleY:1.2, ease:Back.easeOut});
  43. };
  44. //on mouse out do this
  45. function navOut(e:MouseEvent):void{
  46. TweenLite.to(e.target, 0.25, {scaleX:1, scaleY:1,ease:Back.easeIn});
  47. };
  48.  
  49. var _url:String = "";
  50. if (LoaderInfo(root.loaderInfo).parameters.clickTAG) {
  51. _url = LoaderInfo(root.loaderInfo).parameters.clickTAG;
  52. myButton.addEventListener(MouseEvent.MOUSE_UP, handleMouse);
  53. learn_btn.addEventListener(MouseEvent.MOUSE_UP, handleMouse);
  54. }
  55. function handleMouse(event:MouseEvent):void {
  56. navigateToURL(new URLRequest(_url), "_blank");
  57. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.