home *** CD-ROM | disk | FTP | other *** search
/ The Great Adventure of Natural Gas / start / quiz.swf / scripts / DefineSprite_218 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-01-01  |  1.3 KB  |  63 lines

  1. function initQuestion(scale)
  2. {
  3.    var _loc1_ = scale;
  4.    this._x = startx;
  5.    this._y = starty;
  6.    _level0.zoomTo(_level0.mcscene.question4._x,_level0.mcscene.question4._y,100);
  7.    fond._xscale = 35;
  8.    fond._yscale = fond._xscale;
  9.    fond.fonction = function()
  10.    {
  11.       question.transAlpha(100,5);
  12.    };
  13.    question._alpha = 0;
  14.    question.icone.gotoAndStop(_currentframe);
  15.    question.num = _currentframe + "/15";
  16.    if(_loc1_ != null)
  17.    {
  18.       fond.bounceScale(_loc1_,_loc1_,0.2,0.8);
  19.    }
  20.    else
  21.    {
  22.       fond.bounceScale(100,100,0.2,0.8);
  23.    }
  24. }
  25. function fonctionValider()
  26. {
  27.    var _loc3_ = question.radio1.getValue();
  28.    var _loc2_ = 1;
  29.    while(_loc2_ < 4)
  30.    {
  31.       var _loc1_ = question["radio" + _loc2_];
  32.       if(_loc1_.getValue())
  33.       {
  34.          _loc1_.setValue("rouge");
  35.       }
  36.       _loc1_.setEnabled(false);
  37.       _loc2_ = _loc2_ + 1;
  38.    }
  39.    question.radio1.setValue("vert");
  40.    question.gotoAndStop(2);
  41.    if(_loc3_)
  42.    {
  43.       score++;
  44.       question.messageretour.gotoAndStop(1);
  45.    }
  46.    else
  47.    {
  48.       question.messageretour.gotoAndStop(2);
  49.    }
  50.    fond.onPress = function()
  51.    {
  52.       question._parent.startDrag();
  53.    };
  54.    fond.onRelease = function()
  55.    {
  56.       question._parent.stopDrag();
  57.    };
  58. }
  59. stop();
  60. score = 0;
  61. startx = question._parent._x;
  62. starty = question._parent._y;
  63.