1 Reply Latest reply on Jan 22, 2008 12:46 PM by Newsgroup_User

    kEEPING the ACTOR but DELETING the attached SCRIPT on ENTERFRAME

    BIRD_FROM_CANADA
      Hi, new in this forum.

      Lets put it that way...On frame 50, I've got on the score 25 buttons that are handled by 25 different(but similar) property scripts. These buttons could be enabled(checked) or unchecked. Now, when i'm going on frame 100, I compile in a linear list all the sprites that have been clicked. Then, using those sprite numbers, i'm trying to keep the actor(button) on the scene(score) on their checkep state, but i want that the checked buttons would be now impossible to click for the user. (like once you've clicked and pass the frame 101, the state of the button won't change even if you click on it.

      Please find here an example of a script that is attached to a button in the Attached Code.

      Thank you for helping me...kind of a big headache for me.
        • 1. Re: kEEPING the ACTOR but DELETING the attached SCRIPT on   ENTERFRAME
          Level 7
          Sorry, don't have time to read through all your code, but what you want
          to do sounds pretty simple. If I understand you correctly, simply set a
          global variable in frame 100 to tell the other sprites they're no longer
          active. Something like this for your frame script:

          global gclickable

          on exitFrame me
          gclickable = false
          end

          Then in each button have it look for that same global variable.
          Something like this:

          global gclickable

          on mouseUp me
          if gclickable = true then
          do whatever you want here
          end if
          end

          Then you'd just need to remember to set gclickable to true up near frame
          50 so that the buttons would actually do something when you wanted them to.

          Hope that helps.