2 Replies Latest reply on Jun 23, 2006 6:44 PM by Craig Grummitt

    Flash 8 - actionscript button problem

    cijfer
      Hi all,

      I created a button "place holder" (until I had time to design my own) on an object using the standard button component, this worked great. When I replaced it with my own user defined button it stopped working. The object has the same name and is referenced identically.

      Can anyone explain this weird behaviour?

      Here is my code (worked for standard button but not for user defined)

      var invMenuState:Number = 0;
      // function for the Next button
      function inventorySlider(eventObj:Object) {

      switch(invMenuState) {
      case 0:
      inventory_mc.gotoAndPlay("slideUp");
      invMenuState = 1;
      break;
      case 1:
      inventory_mc.gotoAndPlay("slideDown");
      invMenuState = 0;
      }
      }

      // add the event listener for the button
      inventory_mc["inventory_bx"]["inventory_btn"].addEventListener("click", inventorySlider);

      thanks,

      Paul.