FORUMS: list search recent posts

Label and identify diagram activity

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ben Mettler
Label and identify diagram activity
on Apr 12, 2012 at 7:02:27 pm

Does anyone know of a tutorial that shows how to create a label and identify diagram activity. So for example you have an image of a heart and you have lines coming from different parts of the heart and then you have a list of labels that you then drag to the appropriate lines.


Return to posts index

demetri tashie
Re: Label and identify diagram activity
on Apr 13, 2012 at 2:38:56 pm

think of this as a 'drag and drop game'. you can see a real simple example of this in action here

the code that makes this work:
red.addEventListener(MouseEvent.MOUSE_DOWN, beginDrag);
blue.addEventListener(MouseEvent.MOUSE_DOWN, beginDrag);

red.addEventListener(MouseEvent.MOUSE_UP, endDrag);
blue.addEventListener(MouseEvent.MOUSE_UP, endDrag);

function beginDrag(e:MouseEvent):void {;

function endDrag(e:MouseEvent):void {;

if ( && red.hitTestObject(hit1)){answer.text="correct !";}
else if ( && red.hitTestObject(hit2)){answer.text="wrong. try again !";}

if ( && blue.hitTestObject(hit2)){answer.text="correct !";}
else if ( && blue.hitTestObject(hit1)){answer.text="wrong. try again !";}

the red and blue squares on the bottom (movieclips named ;'red' and 'blue' ), need to be dragged and dropped onto the correct hitTest movieclip ( the grey squares named 'hit1' and 'hit2' ) the dynamic text box named 'answer' will change the response accordingly, and is voided upon the initiation of the next drag

i hope that helps out.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved