how can i make a sprite un-moveable

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default how can i make a sprite un-moveable

    I use this script to drag a sprite and match it with another
    and works very good with the rest of my script.
    I have one problem with it , i want to force it not to be moveable when i am trying to drag it for second time.
    e.g. when i am trying to drag it the first time , the sprite moves and itis ok.
    now , if i try to drag it again i want the sprite being unmoveable

    i know about moveablesprite=false or true but nothing
    can you help me please
    thanks a lot

    [ on beginSprite me
    pPressed = FALSE
    pOrigLoc = sprite(me.spriteNum).loc

    end

    on mouseDown me
    pPressed = TRUE
    pClickDiff = sprite(me.spriteNum).loc - the clickLoc

    end


    on mouseUp me
    release(me)
    end

    on mouseUpOutside me
    release(me)
    end

    on exitFrame me
    if pPressed then
    sprite(me.spriteNum).loc = the mouseLoc + pClickDiff
    end if
    end ]


    ieraks webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. How to make a sprite so mouse accept its shape?
      Hi everyone! I have made a circle in Photoshop and the area out of the border of the circle is transparent. It gets into Director as it really...
    2. Using the moveable sprite property
      hi, I've been using the moveable sprite property button in the property inspector to enable a user to move a sprite. I notice that the moveability...
    3. make one sprite follow another
      I'm making a small game. I want one sprite to jump and if it intersects the other sprite in another channel, it is to follow this sprite, who moves...
    4. Moveable Text Sprite
      Hi I am trying to add multiple 'post it' style notes to a director(8.5) project i can get the editable text fields to move(on the stage during...
    5. Make Sprite hide and then appear.
      I have a project were I need certain layers to be hidden and when it gets to a certain page number in the projector then those layers will be turn...
  3. #2

    Default Re: how can i make a sprite un-moveable


    -- This might help:


    property pactive


    on beginSprite me
    pactive = 0
    end


    on mousedown me
    if pactive = 0 then pactive = 1
    end


    on mouseUp me
    pactive = 2
    end


    on mouseUpOutside me
    pactive = 2
    end


    on exitFrame me
    if pactive = 1 then
    sprite(me.spriteNum).loc = the mouseLoc
    end if
    end



    -- good luck!


    rick@mcorp webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139