3 Replies Latest reply on Dec 2, 2006 12:15 PM by Newsgroup_User

    Does not work SendSprite

    Level 7
      Hello:

      I have a handler in a behavior script and I need to call it from a button I
      use this code and does not work

      sendSprite(1,#MoveD ,2,"DCHA")



      The handler :

      On MoveD me, Number, Direction

      --whatever

      end

      Can you tell me please, what is wrong?

      thank you




        • 1. Re: Does not work SendSprite
          Level 7
          Hello again:
          I have seen that my handler is not attached to any Sprite. So, How can I
          call it?
          thank you

          "Anne" <anmalo42@lycos.es> escribió en el mensaje
          news:eksj73$mi5$1@forums.macromedia.com...
          > Hello:
          >
          > I have a handler in a behavior script and I need to call it from a button
          > I use this code and does not work
          >
          > sendSprite(1,#MoveD ,2,"DCHA")
          >
          >
          >
          > The handler :
          >
          > On MoveD me, Number, Direction
          >
          > --whatever
          >
          > end
          >
          > Can you tell me please, what is wrong?
          >
          > thank you
          >
          >
          >
          >


          • 2. Re: Does not work SendSprite
            Level 7
            Anne,

            Your handler has to be attached to a sprite if it's in a behavior. If it's
            in a movie script it just needs to be called using its name and the
            parameters. SendSprite and SendAllSprites are only used when a handler is
            in a script that's attached to a sprite or the frame script. Otherwise
            you'll get no result. That's not a terrible thing since writing code more
            generically will allow you to make this call and have a sprite respond only
            when you're in a frame where you want the sprite to respond. Don't worry if
            that makes no sense.

            So, I see from your post that the handler, MoveD, is in a behavior so all
            you need to do is hilight the sprite in question and go to the pop up menu
            in the upper left corner of the score just below the cast member thumbnail
            and choose the behavior you created with that handler.


            --
            Craig Wollman
            Lingo Specialist
            Word of Mouth Productions
            212-928-9581

            www.wordofmouthpros.com
            "Anne" <anmalo42@lycos.es> wrote in message
            news:ekslag$oot$1@forums.macromedia.com...
            > Hello again:
            > I have seen that my handler is not attached to any Sprite. So, How can I
            > call it?
            > thank you
            >
            > "Anne" <anmalo42@lycos.es> escribió en el mensaje
            > news:eksj73$mi5$1@forums.macromedia.com...
            >> Hello:
            >>
            >> I have a handler in a behavior script and I need to call it from a button
            >> I use this code and does not work
            >>
            >> sendSprite(1,#MoveD ,2,"DCHA")
            >>
            >>
            >>
            >> The handler :
            >>
            >> On MoveD me, Number, Direction
            >>
            >> --whatever
            >>
            >> end
            >>
            >> Can you tell me please, what is wrong?
            >>
            >> thank you
            >>
            >>
            >>
            >>
            >
            >


            • 3. Re: Does not work SendSprite
              Level 7
              Keep in mind that the way you've written the SendSprite call, you'll get a
              response only if the behavior and thus the handler is attached to sprite 1

              --
              Craig Wollman
              Lingo Specialist
              Word of Mouth Productions
              212-928-9581

              www.wordofmouthpros.com
              "Anne" <anmalo42@lycos.es> wrote in message
              news:eksj73$mi5$1@forums.macromedia.com...
              > Hello:
              >
              > I have a handler in a behavior script and I need to call it from a button
              > I use this code and does not work
              >
              > sendSprite(1,#MoveD ,2,"DCHA")
              >
              >
              >
              > The handler :
              >
              > On MoveD me, Number, Direction
              >
              > --whatever
              >
              > end
              >
              > Can you tell me please, what is wrong?
              >
              > thank you
              >
              >
              >
              >