22 Replies Latest reply on Jul 13, 2017 6:42 AM by kglad

    Undo Button for Coloring Game

    ratna_282017 Level 1

      I have a coloring game with the following script on the color swatches (paint icons on the picture):

      on (release) {
      _root.fillColor = 0x000000;
      var efeksoundcelup:Sound = new Sound() 
      efeksoundcelup.attachSound("celup");
      efeksoundcelup.start();
      _root.brush.gotoAndStop(2);
      }
      
      
      
      

       

      and the following code for the fill area (part of stick icon in the picture)

      for every time I fill the the fill area, no other color could fill that area, and the swatches (paint) height reduce.

      on (release) {
      if(_root.catputih._height != 0 && _parent.warna1 == false && _root.fillColor == 0xE9E9E9)
      {
      iColor = new Color(this);
      iColor.setRGB(_root.fillColor);
      _root.catputih._y=343.4 + 42-(_root.catputih._height - 42*0.25);
      _root.catputih._height=_root.catputih._height - 42*0.25;
      trace("wah iya");
      var efeksoundcat:Sound = new Sound();
      efeksoundcat.attachSound("ngecat");
      efeksoundcat.start();
      _parent.warna1 = true;
      }
      else if(_parent.warna1 == true)
      {
      var efeksoundcat:Sound = new Sound();
      efeksoundcat.attachSound("blup");
      efeksoundcat.start();
      //warna1 = true;
      trace("2 udah ada");
      }
      }
      

       

      flash cat.PNG

      and the question is:

      how is the script for an undo button? what I want is, every time the undo button clicked, the previous fill color disappear and the height of that color increase.

       

      thank you,

      Ratna