1 Reply Latest reply on Apr 13, 2013 5:13 AM by Ned Murphy

    How to use classes in Actions tab

    Daniel12378992

      Hello guys!

       

      I'm just a beginner so i'm sorry for my stupid question.I'm developing a game in which movie clips in our case people have their own schedule.I have multiple screens and so i want to be able to set their locations and make them invisible on other screens(rooms)they're not currently at.The trouble is i can't use variables from Actions in my class,neither can i use classes in my Actions.Can anyone tell me how to export classes into Actions code?

      Here is my code:

       

       

      var currentlocation;
      var currentscreen;
      if (person.currentlocation!==currentscreen){
      person.visible=false;
      }
      

      btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

       

       

      function fl_MouseClickHandler(event:MouseEvent):void

      {

                currentscreen = "classroom";

                classroom.visible = true;

                playroom.visible = false;

       

      }

      btn_2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);

       

       

      function fl_MouseClickHandler_2(event:MouseEvent):void

      {

                currentroom = "playroom";

                classroom.visible = false;

                playroom.visible = true;

      }

       

        • 1. Re: How to use classes in Actions tab
          Ned Murphy Adobe Community Professional & MVP

          Your problem/question is not clear to me.  If you are getting errors you should include the error messages in your posting.

           

          Could the problem arise from using a variable that is not defined?

           

          currentroom = "playroom";

           

          I do not see currentroom defined as a variable anywhere.  There is a currentscene variable though.