Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE FLASH:HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

Label and identify diagram activity

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Ben MettlerLabel and identify diagram activity
by 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
Reply   Like  

demetri tashieRe: Label and identify diagram activity
by 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
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


Creative COW LinkedIn GroupCreative COW Facebook PageCreative COW on Twitter
© 2015 All rights are reserved. - Privacy Policy