2 Replies Latest reply on Dec 15, 2006 8:05 AM by Kajasinis

    Help!! Intersects function

    Kajasinis
      I need help!!

      Im trying to edit a draggable sprite behaviour to recognise the global right answer (gBanana) and use the intersects function to jump to markers depending on if the right or wrong sprite intersects sprite number 9. As it is they all go to the marker "GorillaW".
      Think i need to define that one pSprite on the stage is gBanana but i cant get it working:(

      Help really really appreciated!

        • 1. Re: Help!! Intersects function
          James Newton, ACP Level 3
          Here's a demo movie that will jump to a given marker, depending on which sprite you drag the draggable sprite to: http://nonlinear.openspark.com/tips/navigation/dragdrop/. In the demo, the mouse needs to be inside the target sprite at the moment that the dragged sprite is dropped. You could change the stepFrame() handler in the Drag and Drop behavior so that it sends...

            sendAllSprites(#DropSprite, pSprite)

          ... instead of the mouseLoc, and alter the DropSprite() handler in the Drop Target behavior so that it reads:

          on DropSprite(me, aSprite)
          vSprite = sprite(me.spriteNum)

          if vSprite.intersects(aSprite) then
          go marker
          end if
          end DropSprite
          • 2. Re: Help!! Intersects function
            Kajasinis Level 1
            Hi openspark,

            Im just looking to alter the current code on the above script. The 3 sprites that have the draggable behaviour are randomly generated from a list and 1 is always the global right answer (gBanana).

            My problem is altering the above behaviour so it recognises which of the random 3 sprites is the right answer. The mouseup, if statement recognises all 3 as pSprite and therefore when the right answer intersects it jumps to the wrong marker.