home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / cannonballfollier3.swf / scripts / DefineSprite_326 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-10-01  |  735 b   |  47 lines

  1. function mStart()
  2. {
  3.    play();
  4. }
  5. function mHit()
  6. {
  7.    _root.goGame.poBall.mHide();
  8. }
  9. function mDone()
  10. {
  11.    var liCount = 0;
  12.    var i = 0;
  13.    while(i < this.paLights.length)
  14.    {
  15.       liCount += this.paLights[i];
  16.       i++;
  17.    }
  18.    if(liCount == 2)
  19.    {
  20.       _root.goGame.mLevelComplete();
  21.    }
  22.    else
  23.    {
  24.       _root.goGame.mActivate();
  25.    }
  26. }
  27. function mReset()
  28. {
  29.    item1.gotoAndStop(1);
  30. }
  31. function mToggle(liNum)
  32. {
  33.    var lsName = "light" + liNum;
  34.    if(this.paLights[liNum - 1] == 0)
  35.    {
  36.       this.paLights[liNum - 1] = 1;
  37.       this[lsName].gotoAndStop(2);
  38.    }
  39.    else
  40.    {
  41.       this.paLights[liNum - 1] = 0;
  42.       this[lsName].gotoAndStop(1);
  43.    }
  44. }
  45. paLights = [0,0];
  46. stop();
  47.