lundi 21 décembre 2015

Could somebody help me out by telling me how to convert Actionscript 2 to actionscript3?

I devised a simple game that is at mice using actionscript 3. I do not understand how to change the code of actionscript 2 to actionscript 3, please help me.

Could somebody help me out by telling me how to convert Actionscript 2 to actionscript3 ?

jumlah = 0;
waktu_muncul = 0;

function buat_tikus() 
 {
   nomor = random(3)+1;

tikus=attachMovie("tikus","tikus",2{_x:_root["lingkaran"+nomor]._x,_y:_root["lingkaran"+nomor]._y});

tikus.onEnterFrame = function() 
{
    waktu_muncul++;
    if (waktu_muncul == 0)
{
        this.gotoAndStop(4);
}
    if (waktu_muncul == 20) 
    {
        removeMovieClip(this);
        buat_tikus();
        waktu_muncul = 2;
    }
    tikus.onPress = function() 
    {
        sound1 = new Sound();
        sound1.attachSound("Suaratikus");
        sound1.start(0,1);
        var tikus:MovieClip;


    if (jumlah == 90) 
    {
      stop();
    nextFrame();
    }
        if (this._currentframe == 1) 
        {
            jumlah += 10;
            this.gotoAndPlay(2);
         }
     };
 };
}

onEnterFrame = function () 
{
 fps++;
 if (fps == 20) 
  {
    timer_txt--;
    fps=0
       if (timer_txt==0)
         {
          stop();
          gotoAndStop(6);
          }
         }

palu.swapDepths(_root.getNextHighestDepth());
palu._x = _xmouse;
palu._y = _ymouse;
};

  onMouseDown = function () 
   {
      if (palu._currentframe == 1) 
      {
      palu.gotoAndPlay(2);
    }
 };

buat_tikus();

var fps : Number = 0;
var timer_txt : Number = 20;

Aucun commentaire:

Enregistrer un commentaire