1 Reply Latest reply on Jun 4, 2013 8:30 PM by jack.black

    Flash Pro + createjs toolkit (dynamic button issue)

    jack.black

      Hi,

       

      I have been using the toolkit for awhile, it seems to work well, but I noticed a issue.

       

      When you create a Button and place it on stage and export it it works fine.

       

      But if you try to do this:

       

       

      var container = new createjs.Container();

      var button;

       

      for(var i = 0; i < arr.length; i++){

                                    button = new lib.MyButton();

        container.addChild(bitmap);

      }

       

      stage.addChild(container);

       

       

      It goes crazy looping through the button's states (up, over, down, hit), and if you put button.stop(); it loses it mouse over and mouse down. (will have to manually control)

       

      I want to dynamically create buttons to add to the stage.

       

      Any ideas?