×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Please help me with this (small?) problem.

Please help me with this (small?) problem.

Please help me with this (small?) problem.

(OP)
Hi!

I'm new to this forum and to Director but I have an urgent question.

I want to be able to click on a sprite, and after that I want to click on another sprite and the first sprite must "jump" to the location of the second sprite.

The code I have so far is capable of clicking on a sprite but the sprite jumps to the second sprite without clicking on the second on. I know this is because I iserted the sprite number (1) in it.

Maybe it gets a bit more clear when I just give you the code I have so far :)


property pThisSprite

on beginSprite me
  set pThisSprite = sprite(me.spriteNum)
end beginSprite

on mouseUp me
  sprite(pThisSprite).loc = sprite(1).loc
end


So I dont have the chance to click on the sprite it supposed to jump to.

Any help will be very great!

Thanks in advance!
Joost Tibben

RE: Please help me with this (small?) problem.

I think I might have been able to figure this one out for you,  you just need to add this script to each of the sprites that are going to be moving.  I didn't quite understand what you wanted to do, but I think this is pretty close.

You also need to add a startMovie movie script that sets the gFirstClick and gSecondClick to ""

Hope this helps!!

Happy Programming,
Greg Hudy


global gFirstClick
global gSecondClick



on mouseUp me
  if gFirstClick = "" then
    gFirstClick = sprite(me.spriteNum)
  else
    if gFirstClick = sprite(me.spriteNum) then
      gFirstClick = sprite(me.spriteNum)
    else
      if gFirstClick <> sprite(me.spriteNum) then
        gSecondClick = sprite(me.spriteNum)
        gFirstClick.loc = gSecondClick.loc
        gFirstClick = EMPTY
        gSecondClick = EMPTY
        
      end if
    end if
  end if
end

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close