Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Drag and Drop Shapes that snap back to its original position, if it is placed in the correct shape it stays there. What code can I use? PLEASE HELP!

New Here ,
Mar 30, 2015 Mar 30, 2015

I need the code for this, how could I possible do this?

I'm a begginer and I am very interested as to how I can create this.

TOPICS
ActionScript
198
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 31, 2015 Mar 31, 2015
LATEST

using the same initialization code shown in your previous post, use:

// in your drop listener function

if(square.hitTestObject(whatever)){

square.x=whatever.x;

square.y=whatever.y;

} else {

square.x=square.initX;

square.y=square.initY;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines