1 Reply Latest reply on Mar 22, 2011 12:29 PM by kglad-zqbLf4

    onRelease make a MC Change Frames Help!

    UltimateFlashxz Level 1

      im trying to make a Inventory Btn that when clicked will open up the inventory ive tryed adding the actual inventory inside the Btn and its fail horribley so now im trying to have it that when the Inventory Btn is Clicked to change my Inventory MC from Frame 1 (Nothing) to Frame 2 (The Inventory)

       

      when i click the Inventory Btn nothing happens and i get no errors.

      idk what im doing wrong.

       

      Heres code

      on(release){

      Inventory_MC.gotoAndPlay(2);

      }

        • 1. Re: onRelease make a MC Change Frames Help!
          kglad-zqbLf4 Level 3

          don't attach code to objects.  assign instance names (in the properties panel) to your buttons/movieclips and use that in the actions panel attached to a frame or in a class:

           

          yourbutton.onRelease=function(){

          Inventory_MC.gotoAndPlay(2);

          }

           

           

          //////////////////////////////////////////

          to debug your code, use the trace() function:

           

           

          trace(yourbutton);  // if undefined, you haven't assigned an instance name to your object

          yourbutton.onRelease=function(){

          trace(Inventory_MC);   // if undefined, you aren't using the correct reference to this movieclip.

          Inventory_MC.gotoAndPlay(2);

          }