1 Reply Latest reply on Jun 9, 2006 12:51 PM by Newsgroup_User

    Applying/Removing Behavior at Run-Time.  (Or the "pass" command)

    Level 7
      I know it must be possible to do this, but I can't figure out how. I need a
      particular sprite to have a behavior either applied or removed at run-time.
      I tried using the "pass" command to get mouse-input to click through the
      object if certain conditions are not true, but it doesn't seem to work.
      Here's a sample of the script:

      on mouseWithin me
      if (someConditions) then
      if the mouseDown then
      <do a bunch of stuff>
      end if
      else
      pass
      end if
      end

      Technically, if the conditions are FALSE, it should skip right past the rest
      and pass the mouse input down to lower sprites, but it doesn't. I've tried
      a whole bunch of different things, adding the "pass" to mouseDown and
      mouseUp events, but most of the things in this game are controlled by
      mouseWithn/if the mouseDown, allowing you to click and drag over multiple
      sprites to record a down-click on all of them. (Also tried using
      mouseEnter, but that didn't work either.) I'm guessing that the "pass"
      command only works on explicit "mouseUp" and "mouseDown" events, and doesn't
      apply to other cases. If that's true, then I need to simply have this whole
      behavior not be there if those conditions are FALSE. Any help?