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

Needed help in Action Script 3.0

Explorer ,
Feb 16, 2022 Feb 16, 2022

Copy link to clipboard

Copied

Hello Everyone.

 

what im creating-

okay so i'm creating a simple drag and drop application, in which you have to drag and drop (CAR) Letters in a right sequence.

 

what i want to do-

after you drop letters in a right sequence i want to run congratulation clip or animation.

 

 

 

here is my code-


/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/

R.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void
{
R.startDrag();
}

R.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void
{
R.stopDrag();
if(R.dropTarget!=null&&R.dropTarget.parent==box03)
{
trace("Sahi hai")
R.x=box03.x
R.y=box03.y
}
else
{
trace("Galat hai")
R.x=151.1
R.y=167.5
}
}

/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/

A.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);

function fl_ClickToDrag_2(event:MouseEvent):void
{
A.startDrag();
}

A.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);

function fl_ReleaseToDrop_2(event:MouseEvent):void
{
A.stopDrag();
if(A.dropTarget!=null&&A.dropTarget.parent==box02)
{
trace("Sahi hai")
A.x=box02.x
A.y=box02.y
}
else
{
trace("Galat hai")
A.x=261.15
A.y=167.5
}

}

/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/

C.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);

function fl_ClickToDrag_3(event:MouseEvent):void
{
C.startDrag();
}

C.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);

function fl_ReleaseToDrop_3(event:MouseEvent):void
{
C.stopDrag();
if(C.dropTarget!=null&&C.dropTarget.parent==box01)
{
trace("Sahi hai")
C.x=box01.x
C.y=box01.y
}
else
{
trace("Galat hai")
C.x=371.05
C.y=167.5
}
}

  

 

TOPICS
ActionScript

Views

108

Translate

Translate

Report

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 ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

Copied

Hi.

 

There's a sample here:

https://community.adobe.com/t5/animate-discussions/animate-drag-drop-help/m-p/9897422#M181679

 

Please let us know if this is what you're looking for.

 

Regards,

JC

Votes

Translate

Translate

Report

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
Explorer ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

Copied

thanks for this,,,

but im amature.....so can you please edit my own code to achieve this result.

 

Votes

Translate

Translate

Report

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
Explorer ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

Copied

 

Votes

Translate

Translate

Report

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 ,
Feb 18, 2022 Feb 18, 2022

Copy link to clipboard

Copied

LATEST

Hi.

 

You can just replace the artworks from the FLA in the link provided by yours.

 

This is something that you can/want to do?

 

Please let us know.

 

Regards,

JC

Votes

Translate

Translate

Report

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