Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
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.

Thanks!


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 {
e.target.startDrag();
answer.text="";
}

function endDrag(e:MouseEvent):void {
e.target.stopDrag();

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

if (e.target==blue && blue.hitTestObject(hit2)){answer.text="correct !";}
else if (e.target==blue && 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


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]