Hello list,

Dir 8 - Shockwave

I've got a problem with a sprite jumping around the screen and not staying
with the mouse. I'm hoping someone can figure out where my code is screwing
up.

Here's the skinny: I have a placeholder sprite with a behavior attached to
it (found at the bottom of this post). When the user selects a category the
program downloads swf files from the server that belong in that category.
When all are successfully downloaded the first one in the list replaces the
placeholder. The user can then click down thru the items until he/she get to
the one they want to use. Everything is great so far. Now the problem, when
the user clicks on the sprite that he/she want and drags it to the work area
the sprite is suppose to stay with the mouseLoc. If they move to fast the
sprite doesn't stay with the mouse but moves parallel with it (offset). Also
if the mouse is to close to the edge of the stage when he/she does a mouseUp
then the sprite doesn't take it's rightful place on the stage. When the
mouseUp occurs the sprite goes to the mouseLoc usually but it is very
distracting on the mouseDown. I added a enterframe with a stillDown event in
it but now the sprite really jumps around. I'm not sure if I implemented
that right or not.

Thanks in advance for any help,

Rich


========================================================
global FixItemList, multiplier, gFloorTile, gFloorTileURL
property pSpriteNum, pMember, pLoc, pName

on beginSprite me
  pSpriteNum = sprite(me.spriteNum)
  pLoc = pSpriteNum.loc
end

on mouseDown me
  sprite(pSpriteNum).loc = the mouseLoc
  sprite(pSpriteNum).moveableSprite = 1
  sprite(pSpriteNum).locZ = 250
  cursor 0
end mouseDown

on enterframe
  if the stillDown then
    sprite(pSpriteNum).loc = the mouseLoc
  end if
end enterframe

on mouseUp me
  if sprite(the clickOn).rect.union(rect(145,5,445,269)) =
rect(145,5,445,269) then
    FName = sprite(pSpriteNum).member.name
    furnLevel = FixItemList[symbol(FName)][#itemLevel]
    newLoc = the mouseLoc
    sprite(pSpriteNum).loc = pLoc
    sprite(the clickOn).locZ = pSpriteNum
    flag = 0
    case furnLevel of
      1:
        repeat with x = 71 to 80
          if sprite(x).member.name = "WhiteBox" then
            sprite(x).member = member(FName)
            sprite(x).rect = member(FName).rect * ((multiplier).float/12)
            sprite(x).loc = newLoc
            updateStage
            sprite(x).pName = FixItemList[symbol(fName)][#itemname]
            sprite(x).pURL = FixItemList[symbol(fName)][#itemURL]
            sendsprite(x,#mouseUp)
            flag = 1
            updateStage
            exit repeat
          end if
        end repeat
        if flag = 0 then
          alert "No sprites available for level 1"
        end if
      2:

    ----  more lingo here, does same stuff as above just different channels


    end case
  end if
  updateStage
end mouseUp



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to