3 Replies Latest reply on Sep 29, 2008 6:58 AM by Newsgroup_User

    sendSprite clarification

    Bob220867 Level 1
      Can I send more than one arguement via sendSprite? Director documentation refers to args.
      Also are only certain types of info (only words or integers or such) that can be sent as arguements?
      Thanks
        • 1. Re: sendSprite clarification
          Level 7
          Not hard to test for yourself, but yes - you can send as many arguments
          as you like (bearing in mind that they are received in the order sent).
          In some cases it is easier to send a single property list and extract
          named properties in the handler called - that way the order of
          parameters/arguments can be ignored.
          • 2. sendSprite clarification
            Bob220867 Level 1
            Great thanks
            • 3. Re: sendSprite clarification
              Level 7
              What you have should work, there is no beginSprite handler required. The
              movie must be running so that the sprites are "alive" to receive the
              message.

              BTW, you can shorten your code a bit if you want.

              on MoveCharac me, lCharacMove
              my.rotation=lCharacMove.angle
              CharacV=lCharacMove.moveV
              CharacH=lCharacMove.moveH


              Bob220867 wrote:
              > The single property list seems the cleanest way to approach this.
              >
              > So, once I've established my list, in this case lCharacMove, do I then send it
              > in the normal way like this:
              >
              > sendSprite(12, #MoveCharac, lCharacMove)
              >
              > and to use it in the other script would I then simply reference it and then
              > extract properties like so:
              > on MoveCharac me, lCharacMove
              > my.rotation=lCharacMove.getProp(#angle)
              > CharacV=lCharacMove.getProp(#moveV)
              > CharacH=lCharacMove.getProp(#moveH)
              >
              > or do I need to establish the list in a beginSprite handler.
              > I can add properties to the list but the MoveCharac handler doesn't seem to be
              > responding is my problem.
              > Thanks.
              >