home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Esportes / Horse_riding.swf / scripts / frame_3 / DoAction.as
Text File  |  2008-09-23  |  2KB  |  51 lines

  1. function alphaTween(mc, style, from, to)
  2. {
  3.    var _loc1_ = new mx.transitions.Tween(mc,"_alpha",style,from,to,1,true);
  4. }
  5. function scaleTween(mc, style, xFrom, xTo, yFrom, yTo)
  6. {
  7.    var _loc2_ = new mx.transitions.Tween(mc,"_xscale",style,xFrom,xTo,1,true);
  8.    var _loc3_ = new mx.transitions.Tween(mc,"_yscale",style,yFrom,yTo,1,true);
  9. }
  10. function moveTween(mc, style, xFrom, xTo, yFrom, yTo)
  11. {
  12.    var _loc3_ = new mx.transitions.Tween(mc,"_x",style,xFrom,xTo,1,true);
  13.    var _loc2_ = new mx.transitions.Tween(mc,"_y",style,yFrom,yTo,1,true);
  14. }
  15. function setBoxs()
  16. {
  17.    scaleTween(box_mc,mx.transitions.easing.Elastic.easeOut,50,100,50,100);
  18.    wu.start();
  19.    box_mc.onEnterFrame = function()
  20.    {
  21.       if(this._xscale == 100)
  22.       {
  23.          moveTween(box1_btn,mx.transitions.easing.Strong.easeInOut,100,100,-50,128);
  24.          moveTween(box2_btn,mx.transitions.easing.Strong.easeInOut,250,250,-50,130);
  25.          moveTween(box3_btn,mx.transitions.easing.Strong.easeInOut,400,400,-50,130);
  26.          this.onEnterFrame = null;
  27.       }
  28.    };
  29.    var _loc2_ = 1;
  30.    while(_loc2_ <= 3)
  31.    {
  32.       this["box" + _loc2_ + "_btn"].onRelease = function()
  33.       {
  34.          di.start();
  35.          difficulty = this._name.substr(3,1);
  36.          this._parent.gotoAndStop(4);
  37.       };
  38.       _loc2_ = _loc2_ + 1;
  39.    }
  40. }
  41. stop();
  42. var difficulty = 1;
  43. box1_btn._y = -50;
  44. box2_btn._y = -50;
  45. box3_btn._y = -50;
  46. var wu = new Sound();
  47. wu.attachSound("wu");
  48. var di = new Sound();
  49. di.attachSound("di");
  50. setBoxs();
  51.