ࡱ> 'NRoot Entryp|YrRASH0e@VContentsz(Page 1USymbol 59  ) - #"2$&[(%+*K,J./01!4653789:;<=>?@ABCDEFGHIVWXZ]^_`abcdefghijklmnopqrstuvwxy{|}~Root Entryp|YrRASHC@VContentsO(Page 1USymbol 59)O -"2M%*K./01!4653789:;<=>?@ABCDEFGHIPLQRTUYSymbol 42 'Symbol 43Symbol 77SSymbol 56Symbol 50JSymbol 48DfSymbol 47 qSymbol 5>W\Symbol 73kSymbol 74_Symbol 75SSymbol 76O`CPicPage CPicLayer CPicFrame CPicShape3S~ S m000cYb0t#9Y":, 1-1#90(1(1(Ӏ1(Ӏ0VC0NG Y0PB00 80)00e00 0D00E00E0020C0 0D0000*Pl0cTm0.0}0- cYc0Tt#Yƀ",,#0΀؀0V0O0P00 0)0o0000600+ 0MY(0\100QPʀ(04\b|8GZS\ـ U` Հ85=484z+85Q4no; ;D^k=-J$'U5400D00E00D001q0D00E00p00,ol0b  ?B Layer 1OCPicPage CPicLayer CPicFrameSymbol 12Symbol 60&Symbol 40 CSymbol 41 3Symbol 42 'Symbol 43Symbol 52Symbol 56Symbol 50JSymbol 48DfSymbol 47 qSymbol 5>WCPicPage CPicLayer CPicFrame?& CPicShape 3S7,_0/4_/4/4/4/404444444004h400B80h0r0%0I0@0L0H0&00C90 0BЀh44Ѐk4084hh40 0Ѐ0&00&0C`Ѐ0BYЀЀЀ0%00_/^///0/0|_,/09////^/094__h4//4h^h/k4/h/44/h/44^h4\h40?4/4/4/4//4//4_//0/_0/_0|000u0000000/0000/000_09`_00|00__?6f&`&3S7,_0/4_/4/4/4/404444444004h400B80h0r0%0I0@0L0H0&00C90 0BЀh44Ѐk4084hh40 0Ѐ0&00&0C`Ѐ0BYЀЀЀ0%00_/^///0/0|_,/09////^/094__h4//4h^h/k4/h/44/h/44^h4\h40?4/4/4/4//4//4_//0/_0/_0|000u0000000/0000/000_09`_00|00__? ?{ CPicSymbol L?rWii!$W+eIp   b  M   4S7      (000v?M 00v0(?M boxOOCPicText $Verdana(reset?G  $Verdana(reset?T textOCPicPage CPicLayer CPicFrame 00v0(?$ (000v?^0 boxOOCPicText 8Verdana(score? D textOCPicPage CPicLayer CPicFrame 00v0(?<s (000v?~ boxOOCPicText $Verdana(show? 9  $Verdana(show?> textOCPicPage CPicLayer CPicFrames 00v0(?0s (000v?  boxOOCPicText $Verdana(OK?V  $Verdana(OK??,i textO?Jstop();?~?gotoAndStop("off");?h?<gotoAndStop("off"); scriptsOO?off?correct@?wrong] labelsOOHVerdanaf"sugars CPicPage CPicLayer CPicFrame CPicShape]t(SU 0>0p0Upj>0"1?) backgroundOCPicText {HVerdanaf"sugars  ~ HVerdanaf"starch  IHVerdanaf"protein  %[ H Verdanaf"fats and oils  1 H Verdanaf"cellulose1?#H decorationOO CPicSprite%6 )6%6dgbox96 )66dl=box1 6 )6 6d,box4You scored?;2 labelO  U@_root.scorePercentVerdana"?" scoreO? & %3 CPicButton5 5 ( +on(release){ _root.gotoAndStop("start"); }?k buttonOO16 )616drbox136 )66dRibox7w )6w d_box2 )6 dIbox3 w )6 w dmbox5 )6 dZbox6w )6w dAbox8%w )6%w d&box10% )6% dbox11% )6%d box121w )61w d.box141 )61 dbox151 )61d<box161: )61:d  !"#$%&()*+,-./012456789:;<=>?@ABDEFGHIJKLMNOPQRTUVWXYZ[\]^`abcdefghijlmnoprstuvwxyz{|}~~box171? boxesO1 1d>word14% %d<Mword17 O  OSymbol 61 Symbol 62Symbol 63Symbol 64Symbol 65Symbol 66Symbol 67Symbol 68d=-word4 d>fword21O 1Od?]word13% %d@8word1010" 10"dAword15 dDword8   dC &word5%0" %0"dE word11O OdFuword70" 0"?2 textOCPicPage CPicLayer CPicFrame CPicSprite Gd0:]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?a backgroundOOCPicText  H Verdana"margarine? textOCPicPage CPicLayer CPicFrame CPicSprite Gd0P]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?_v backgroundOOCPicText  HVerdana"icing?+ textOCPicPage CPicLayer CPicFrame CPicSprite Gd0@]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?CPicPage CPicLayer CPicFrame CPicShape|Y^Osnl2 00R0?EN backgroundOCPicText P Verdana" backgroundOOCPicText  HVerdana"flour?D{ textOCPicPage CPicLayer CPicFrame CPicSprite Gd?+D textO answer[7] CPicPage CPicLayer CPicFrame CPicSprite Gd0Y]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?0I]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?CPicPage CPicLayer CPicFrameCPicText +C@_root.scorePercentVerdana"  Verdana"Score?k Layer 1O backgroundOOCPicText  HVerdana"card backgroundOOCPicText  HVerdana"apple?*% textOnew array(CPicPage CPicLayer CPicFrame CPicSprite Gd0E]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?W backgroundOOCPicText  HVerdana"peanut?u  textOotoAndPlaCPicPage CPicLayer CPicFrame CPicSprite Gd0]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }? backgroundOOCPicText  HVerdana"perfume?-: textO word inCPicPage CPicLayer CPicFrame CPicSprite Gd0]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?"m backgroundOOCPicText  HVerdana"soya? textO<= wordNo;iCPicPage CPicLayer CPicFrame CPicSprite Gd05]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?~ backgroundOOCPicText  HVerdana"rice? textOncorrect iCPicPage CPicLayer CPicFrame CPicSprite Gd0L]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?Z backgroundOOCPicText  H Verdana"olive oil?_ textO } } CPicPage CPicLayer CPicFrame CPicSprite Gd0]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }? + backgroundOOCPicText  HVerdana"logs?] textO if(r =CPicPage CPicLayer CPicFrame CPicSprite Gd03(]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?_ backgroundOOCPicText  HVerdana"corn oil?tx textOords[i]CPicPage CPicLayer CPicFrame CPicSprite Gd0k]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?S backgroundOOCPicText  HVerdana"cotton? textOs[tempCouCPicPage CPicLayer CPicFrame CPicSprite Gd0k]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }? backgroundOOCPicText  HVerdana"honey?9P textO}CPicPage CPicLayer CPicFrame CPicSprite Gd0JI]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?O backgroundOOCPicText  HVerdana"potatoes?w textO;CPicPage CPicLayer CPicFrame CPicSprite Gd0@]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?2 backgroundOOCPicText  HVerdana"paper?q textOCPicPage CPicLayer CPicFrame CPicSprite Gd0Ri]on(press){ _parent.startDrag(false); } on(release){ stopDrag(); _root.overBox(_parent); }?r backgroundOOCPicText  H Verdana"furniture?Z textOCPicPage CPicLayer CPicFrame CPicShapesP000P?g boxOrd[i]){ words[i]._x = words[i]._x - xadCPicPage CPicLayer CPicFrame CPicSprite d2I?dGxXword30" 0"dHIword16O OdJ}yword1%% %%dKO1word12%O %OdB@.word9Symbol 69Symbol 70Symbol 71Symbol 72Symbol 73kSymbol 74_Symbol 75SSymbol 78O`      !"#$%'()*+,-./013456789:;<=?@ABCEFGHIKLMNPQRSTUVWXSymbol 12Symbol 60&Symbol 40 CSymbol 41 3_ Layer 1OCPicPage CPicLayer CPicFrames 00:00?m Layer 1O?LforCPicPage CPicLayer CPicFrame CPicShapexxt $SBeIp   b  M   4S7     +? > Layer 1O this variable sets if you allow the user to have multiple attempts for each word // 1 = yes, 2 = no (only scores first time) var attempts = 1; // this variable sets if a wrong answer goes back to its starting position // 1 = go back, 2 = stay, 3 = stay until select score var sendWordBack = 2; // this variable sets if you want the tick or cross to appear // 1 = yes, 2 = no var tick = 2; // this variable sets if the text labels are randomised // 1 = yes, 2 = no var randomWoCPicPage CPicLayer CPicFrame? CPicShape 3S7,_0/4_/4/4/4/404444444004h400B80h0r0%0I0@0L0H0&00C90 0BЀh44Ѐk4084hh40 0Ѐ0&00&0C`Ѐ0BYЀЀЀ0%00_/^///0/0|_,/09////^/094__h4//4h^h/k4/h/44/h/44^h4\h40?4/4/4/4//4//4_//0/_0/_0|000u0000000/0000/000_09`_00|00__?f&`&3S7,_0/4_/4/4/4/404444444004h400B80h0r0%0I0@0L0H0&00C90 0BЀh 0"  0"dIfword61? 9 wordsOO CPicButton +  +d+@%on(release){ _root.onClickReset(); } resetButtonY7) Y7)d4Xmessage1?;, controlsO,?3  d/H scoreboard?# score?6[%// makes some important varables global by creating them at the start var xdif; var ydif; var mymc; var xadif = new array(); var yadif = new array(); var showClick; var randomPlace = new array(); var theClip; var thisWord; var boxNo = 0; var wordNo = 0; var showScore = false; v44Ѐk4084hh40 0Ѐ0&00&0C`Ѐ0BYЀЀЀ0%00_/^///0/0|_,/09////^/094__h4//4h^h/k4/h/44/h/44^h4\h40?4/4/4/4//4//4_//ar scoreVar = 0; var totalItems; // set up an array for the word destinations (the boxes) var boxes = new array(); //set up an array for the words var words = new array(); // set up an array for the correct answers var answer = new array(); // ** you can edit the code below this point ** // set the correct answer for each word so that the movie can check // answer[1] = word1 destination box answer[1] = 1; answer[2] = 1; answer[3] = 1; answer[4] = 2; answer[5] = 2; answer[6] = 2; answer[7] = 3; answer[8]       !"#$%'()*+,-./013456789:;<=?@ABCEFGHIKLMNPQRSTUVWXpe$W+eIp   b  M   4S7     ? Layer 1O= 3; answer[9] = 4; answer[10] = 4; answer[11] = 4; answer[12] = 4; answer[13] = 5; answer[14] = 5; answer[15] = 5; answer[16] = 5; answer[17] = 5; // this variable sets how the score is displayed // 1 = percentage (50%), 2 = score out of total (5/10) var scoreType = 1; // this variable sets if the score is shown in a dialog or all the time // 1 = dialog, 2 = continuously var scoreDialog = 1; // this variable sets if you allow the user to have multiple attempts for each word // 1 = yes, 2 = no (only scores first time) var attempts = 1; // this variable sets if a wrong answer goes back to its starting position // 1 = go back, 2 = stay, 3 = stay until select score var sendWordBack = 2; // this variable sets if you want the tick or cross to appear // 1 = yes, 2 = no var tick = 1; // this variable sets if the text labels are randomised // 1 = yes, 2 = no var randomWords = 1; // this variable sets if more than one text label can be placed on the target boxes // 1 = no, 2 = yes var duplicateDrop = 1; // ** you should not change any code below this point ** // find all the instances of box (target) and word (labels) findClips(); // get the number of items for the scoring countItems(); // hide the score button if score is shown all the time if(scoreDialog == 2){ scoreButton._visible = false; scoreOutput._visible = true; calculateScore(); } else{ scoreButton._visible = true; scoreOutput._visible = false; } // set the reset position of each word to its starting position for(var i=1;i<=wordNo;i++){ words[i].starty = words[i]._y; words[i].startx = words[i]._x; } // sets up array to use when sending back selected labels var selWord = new array(); // sets up an array to store if a word has already been tried var usedWord = new array(); for(var i=1;i<=wordNo;i++){ usedWord[i] = 0; } // functions to mix up and place text labels randomiseWords(); placeWords(); // function linked to reset button function onClickReset(){ showClick = false; for(var i=1;i<= wordNo;i++){ usedWord[i] = 0; words[i]._visible = true; } randomiseWords(); allGoBack(); } // sends an individual word back to its start position function sendBack(backLabel){ mymc = backLabel; xdif = (mymc._x - mymc.startx) / 10; ydif = (mymc._y - mymc.starty) / 10; gotoAndPlay("goback"); } // sends all words back to start position function allGoBack(){ for (var i = 1;i <= wordNo;i++){ xadif[i] = (words[i]._x - words[i].startx) / 10; yadif[i] = (words[i]._y - words[i].starty) / 10; selWord[i] = true; } gotoAndPlay("allback"); } // sends selected words back to start position function someGoBack(){ for (var i = 1;i <= wordNo;i++){ xadif[i] = (words[i]._x - words[i].startx) / 10; yadif[i] = (words[i]._y - words[i].starty) / 10; } showClick = false; gotoAndPlay("allback"); } // checks if a word is being dropped over a destination box and responds accordingly function overBox(currWord){ var flag = false; // loop to identify the word that has been dropped for(var i=1;i <= wordNo;i++){ if(currWord == words[i]){ thisWord = i; } } // loop to find out which box it was dropped into for(var i = 1;i <= boxNo;i++){ if(currWord.hitTest(boxes[i])){ // check if the box has already got a word in it if(occTest(boxes[i],currWord) == false){ // position the word into the centre of the box flag = true; currWord._x = boxes[i]._x + ((boxes[i]._width - currWord._width)/2) - 3; currWord._y = boxes[i]._y + ((boxes[i]._height - currWord._height)/2); // note that the word has been used usedWord[thisWord] ++; // check if it is correct checkAnswer(currWord); } } } if (flag == false){ sendBack(currWord); } } // checks if a destination box is already occupied function occTest(currBox,thisWord){ var flag = false; if(duplicateDrop == 1){ for(var i = 1;i <= wordNo;i++){ if(words[i] != thisWord){ if(currBox.hitTest(words[i])){ flag = true; } } } } return flag; } // function to check if the answer is correct function checkAnswer(checkWord){ scoreVar = 0; for(var i = 1;i <= wordNo;i++){ selWord[i] = false; } for(var j = 1;j <= boxNo;j++){ if(words[thisWord].hitTest(boxes[j])){ if(answer[thisWord] == boxes[j].tag){ if(attempts == 1 or (attempts == 2 and usedWord[thisWord] == 1)){ // mark the answer to hide it later theClip = checkWord; if(duplicateDrop == 2){ theClip._visible = false; } // play a "correct" message if(tick == 1){ message.gotoAndPlay("correct"); } } } else { // mark the object to be sent back selWord[thisWord] = true; // play a "wrong" message if(tick == 1){ message.gotoAndPlay("wrong"); } } } } if(scoreDialog == 2){ calculateScore(); } showClick = false; // send the object back if it is incorrect if(sendWordBack == 1){ someGoBack(); } } // does what it says on the tin function calculateScore(){ scoreVar = 0; for(var i = 1;i <= wordNo;i++){ selWord[i] = false; } for(var i = 1;i <= wordNo;i++){ for(var j = 1;j <= boxNo;j++){ if(words[i].hitTest(boxes[j])){ if(j == answer[i]){ if(attempts == 1 or (attempts == 2 and usedWord[i] == 1)){ scoreVar = scoreVar + 1; } } else { selWord[i] = true; } } } } showClick = false; if(scoreType == 1){ scorePercent = Math.round((scoreVar / totalItems) * 100) + "%"; } else{ scorePercent = scoreVar + " / " + totalItems; } if(scoreDialog == 1){ if(sendWordBack == 3){ showScore = true; someGoBack(); } else{ gotoAndPlay("score"); } } } // click handler for show button function onClickShow(){ for (var i = 1;i <= WordNo;i++){ if(answer[i] > 0){ xadif[i] = (words[i]._x - (boxes[answer[i]]._x - 3 + ((boxes[answer[i]]._width - words[i]._width)/2))) / 10; yadif[i] = (words[i]._y - (boxes[answer[i]]._y + ((boxes[answer[i]]._height - words[i]._height)/2))) / 10; selWord[i] = true; } } showClick = true; gotoAndPlay("allback"); } // mix up words function randomiseWords(){ if(randomWords == 1){ // reset the array for(var i=1;i<=wordNo;i++){ randomPlace[i] = -1; } // give a random number to each answer for(var i=1;i<=wordNo;i++){ do{ var flag = false; var r = myRandom(1,wordNo); for(var j=1;j<=wordNo;j++){ // has the value been chosen already if(r == randomPlace[j]){ flag = true; } else{ // no, do nothing } } }while(flag == true) randomPlace[i] = r; } placeWords(); } } // random integer generator function myRandom (minNo, maxNo) { r = Math.random(); // toss away 1 if we get it while (r == 1) { r = Math.random(); } return minNo + Math.floor(r * (maxNo + 1 - minNo)); } // place words function placeWords(){ if(randomWords == 1){ for(var i=1;i<=wordNo;i++){ words[i]._y = words[randomPlace[i]].starty; words[i]._x = words[randomPlace[i]].startx; } for(var i=1;i<=wordNo;i++){ words[i].starty = words[i]._y; words[i].startx = words[i]._x; } } else{ for(var i=1;i<=wordNo;i++){ words[i]._y = words[i].starty; words[i]._x = words[i].startx; } } } // find the words and boxes function findClips(){ var myClip = _root; // work through all the movie clips on the main timeline for(var property in myClip){ // only deal with movie clip instances if(typeof myClip[property] == "movieclip"){ // store the _name property var tempStr = myClip[property]._name; // find all the box instances // check for the word "box" in the name and store its position var tempIndex = tempStr.indexOf("box"); // only process movie clips that have "box" in their name if(tempIndex > -1){ // extract the number at the end of the name var tempCounter = parseInt(tempStr.substring(3,tempStr.length)); // use the number to store the name of the instance in the array boxes[tempCounter] = eval(myClip[property]._name); // add a tag to each target boxes[tempCounter].tag = answer[tempCounter]; // add one to the numObjects variable boxNo ++; } // find all the word instances // check for the word "word" in the name and store its position var tempIndex = tempStr.indexOf("word"); // only process movie clips that have "word" in their name if(tempIndex > -1){ // extract the number at the end of the name var tempCounter = parseInt(tempStr.substring(4,tempStr.length)); // use the number to store the name of the instance in the array words[tempCounter] = eval(myClip[property]._name); // add one to the numObjects variable wordNo ++; } } } } function countItems(){ totalItems = 0; for(var i=1;i<=wordNo;i++){ if(answer[i] > 0){ totalItems ++; } } }?f // hide the score button if score is shown all the time if(scoreDialog == 2){ scoreButton._visible = false; scoreOutput._visible = true; } else{ scoreButton._visible = true; scoreOutput._visible = false; } if(scoreDialog == 2 and showClick == false){ calculateScore(); } stop();?y3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?u3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?WF3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?I,3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?a<3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?/3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?il3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?(3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?a:3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?"Jmymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif; gotoAndStop("start"); ?}for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?&for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?^for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?Hfor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?rafor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?rkfor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?2for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?@for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?qfor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } } if(showScore == true){ showScore = false; gotoAndPlay("score"); } else { gotoAndStop("start"); }?yscoreboard._x = (_root._width - scoreboard._width) / 2; scoreboard._y = (_root._height - scoreboard._height) / 2; stop(); scriptsOO?setvarsO?startJI?gobackw?allbackD?score labelsO ) CDocumentPagePage 1Scene 1eAH Symbol 76Tween 2L H H Symbol 59 scoreoutput;&H Symbol 59''H Symbol 50shape2݊H Symbol 50lH Symbol 48 background0{sH Symbol 48mH Symbol 47 scoreboard/+HR Symbol 47,HSymbol 5boxDA7Symbol 5 mHSymbol 1word1ASymbol 1mH Symbol 60word2<bH word1 copymH Symbol 61word3=bH word2 copymH Symbol 62word4>bH word3 copymH Symbol 63word5?bH word4 copymH Symbol 64word6@bH word5 copymH Symbol 65word7AbH word6 copymH Symbol 66word8BbH word7 copymH Symbol 67word9CbH word8 copymH Symbol 68word10DbH word9 copymH Symbol 69word11EbH word10 copymH Symbol 70word12FbH word11 copymH Symbol 71word13GbH word12 copymH Symbol 72word14HbH word13 copymH Symbol 73word15IbH word14 copymH Symbol 74word16JbH word15 copymH Symbol 75word17KcH word16 copymH Symbol 40ok(DŽA@8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flaokMȄADŽA@MȄA Symbol 41show)YĄA:8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flashowYĄAYĄA:YĄA Symbol 42score*yĄA>8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flascoreĄAyĄA>ĄA Symbol 43reset+gĄA<8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flaresetĄAgĄA<ĄA Symbol 52message4,"H=E:\my webs\animation_toolkit\drag\alternatives\true_false.flamessagePH,"HHM>.hhhhh CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3ff`zf*]hxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfx0/_0/_0|000u0000000/0000/000_09`_00|00__?'?id CPicSymbol N?2hi"U$SBeIp   b  M   4S7     +?,?M8 textO?Astop();?M?agotoAndStop("off");?V3?,gotoAndStop("off"); scriptsOO this variable sets if you allow the user to have multiple attempts for each word // 1 = yes, 2 = no (only scores first time) var attempts = 1; // this variable sets if a wrong answer goes back to its starting position // 1 = go back, 2 = stay, 3 = stay until select score var sendWordBack = 2; // this variable sets if you want the tick or cross to appear // 1 = yes, 2 = no var tick = 2; // this variable sets if the text labels are randomised // 1 = yes, 2 = no var randomWo_ Layer 1OCPicPage CPicLayer CPicFrames 00:00?m Layer 1O?LforCPicPage CPicLayer CPicFrame CPicSha?offk?correctx?wrongO labelsOOHVerdanaf"sugars CPicPage CPicLayer CPicFrame CPicShape]t(SU 0>0p0Upj>0"1?) backgroundOCPicText {HVerdanaf"sugars  ~ HVerdanaf"starch  IHVerdanaf"protein  %[ H Verdanaf"fats and oils  1 H Verdanaf"cellulose1?#H decorationOO CPicSprite%6 )6%6dgbox96 )66dl=box1 6 )6 6d,box416 )616drbox136 )66dRibox7w )6w d_box2 )6 dIbox3 w )6 w dmbox5 )6 dZbox6w )6w dAbox8%w )6%w d&box10% )6% dbox11% )6%d box121w )61w d.box141 )61 dbox151 )61d<box161: )61:d~box171? boxesO1 1d>word14% %d<Mword17 O  Od=-word4 d>fword21O 1Od?]word13% %d@8word1010" 10"dAword15 dDword8   dC &word5%0" %0"dE word11O OdFuword70" 0"dGxXword30" 0"dHIword16O OdJ}yword1%% %%dKO1word12%O %OdB@.word9 0"  0"dIfword61? 9 wordsOO CPicButton +  +d+@%on(release){ _root.onClickReset(); } resetButtonY7) Y7)dMXmessage1?;, controlsO,?3  d/H scoreboard?# score?6[%// makes some important varables global by creating them at the start var xdif; var ydif; var mymc; var xadif = new array(); var yadif = new array(); var showClick; var randomPlace = new array(); var theClip; var thisWord; var boxNo = 0; var wordNo = 0; var showScore = false; var scoreVar = 0; var totalItems; // set up an array for the word destinations (the boxes) var boxes = new array(); //set up an array for the words var words = new array(); // set up an array for the correct answers var answer = new array(); // ** you can edit the code below this point ** // set the correct answer for each word so that the movie can check // answer[1] = word1 destination box answer[1] = 1; answer[2] = 1; answer[3] = 1; answer[4] = 2; answer[5] = 2; answer[6] = 2; answer[7] = 3; answer[8] = 3; answer[9] = 4; answer[10] = 4; answer[11] = 4; answer[12] = 4; answer[13] = 5; answer[14] = 5; answer[15] = 5; answer[16] = 5; answer[17] = 5; // this variable sets how the score is displayed // 1 = percentage (50%), 2 = score out of total (5/10) var scoreType = 1; // this variable sets if the score is shown in a dialog or all the time // 1 = dialog, 2 = continuously var scoreDialog = 1; // this variable sets if you allow the user to have multiple attempts for each word // 1 = yes, 2 = no (only scores first time) var attempts = 1; // this variable sets if a wrong answer goes back to its starting position // 1 = go back, 2 = stay, 3 = stay until select score var sendWordBack = 2; // this variable sets if you want the tick or cross to appear // 1 = yes, 2 = no var tick = 1; // this variable sets if the text labels are randomised // 1 = yes, 2 = no var randomWords = 1; // this variable sets if more than one text label can be placed on the target boxes // 1 = no, 2 = yes var duplicateDrop = 1; // ** you should not change any code below this point ** // find all the instances of box (target) and word (labels) findClips(); // get the number of items for the scoring countItems(); // hide the score button if score is shown all the time if(scoreDialog == 2){ scoreButton._visible = false; scoreOutput._visible = true; calculateScore(); } else{ scoreButton._visible = true; scoreOutput._visible = false; } // set the reset position of each word to its starting position for(var i=1;i<=wordNo;i++){ words[i].starty = words[i]._y; words[i].startx = words[i]._x; } // sets up array to use when sending back selected labels var selWord = new array(); // sets up an array to store if a word has already been tried var usedWord = new array(); for(var i=1;i<=wordNo;i++){ usedWord[i] = 0; } // functions to mix up and place text labels randomiseWords(); placeWords(); // function linked to reset button function onClickReset(){ showClick = false; for(var i=1;i<= wordNo;i++){ usedWord[i] = 0; words[i]._visible = true; } randomiseWords(); allGoBack(); } // sends an individual word back to its start position function sendBack(backLabel){ mymc = backLabel; xdif = (mymc._x - mymc.startx) / 10; ydif = (mymc._y - mymc.starty) / 10; gotoAndPlay("goback"); } // sends all words back to start position function allGoBack(){ for (var i = 1;i <= wordNo;i++){ xadif[i] = (words[i]._x - words[i].startx) / 10; yadif[i] = (words[i]._y - words[i].starty) / 10; selWord[i] = true; } gotoAndPlay("allback"); } // sends selected words back to start position function someGoBack(){ for (var i = 1;i <= wordNo;i++){ xadif[i] = (words[i]._x - words[i].startx) / 10; yadif[i] = (words[i]._y - words[i].starty) / 10; } showClick = false; gotoAndPlay("allback"); } // checks if a word is being dropped over a destination box and responds accordingly function overBox(currWord){ var flag = false; // loop to identify the word that has been dropped for(var i=1;i <= wordNo;i++){ if(currWord == words[i]){ thisWord = i; } } // loop to find out which box it was dropped into for(var i = 1;i <= boxNo;i++){ if(currWord.hitTest(boxes[i])){ // check if the box has already got a word in it if(occTest(boxes[i],currWord) == false){ // position the word into the centre of the box flag = true; currWord._x = boxes[i]._x + ((boxes[i]._width - currWord._width)/2) - 3; currWord._y = boxes[i]._y + ((boxes[i]._height - currWord._height)/2); // note that the word has been used usedWord[thisWord] ++; // check if it is correct checkAnswer(currWord); } } } if (flag == false){ sendBack(currWord); } } // checks if a destination box is already occupied function occTest(currBox,thisWord){ var flag = false; if(duplicateDrop == 1){ for(var i = 1;i <= wordNo;i++){ if(words[i] != thisWord){ if(currBox.hitTest(words[i])){ flag = true; } } } } return flag; } // function to check if the answer is correct function checkAnswer(checkWord){ scoreVar = 0; for(var i = 1;i <= wordNo;i++){ selWord[i] = false; } for(var j = 1;j <= boxNo;j++){ if(words[thisWord].hitTest(boxes[j])){ if(answer[thisWord] == boxes[j].tag){ if(attempts == 1 or (attempts == 2 and usedWord[thisWord] == 1)){ // mark the answer to hide it later theClip = checkWord; if(duplicateDrop == 2){ theClip._visible = false; } // play a "correct" message if(tick == 1){ message.gotoAndPlay("correct"); } } } else { // mark the object to be sent back selWord[thisWord] = true; // play a "wrong" message if(tick == 1){ message.gotoAndPlay("wrong"); } } } } if(scoreDialog == 2){ calculateScore(); } showClick = false; // send the object back if it is incorrect if(sendWordBack == 1){ someGoBack(); } } // does what it says on the tin function calculateScore(){ scoreVar = 0; for(var i = 1;i <= wordNo;i++){ selWord[i] = false; } for(var i = 1;i <= wordNo;i++){ for(var j = 1;j <= boxNo;j++){ if(words[i].hitTest(boxes[j])){ if(j == answer[i]){ if(attempts == 1 or (attempts == 2 and usedWord[i] == 1)){ scoreVar = scoreVar + 1; } } else { selWord[i] = true; } } } } showClick = false; if(scoreType == 1){ scorePercent = Math.round((scoreVar / totalItems) * 100) + "%"; } else{ scorePercent = scoreVar + " / " + totalItems; } if(scoreDialog == 1){ if(sendWordBack == 3){ showScore = true; someGoBack(); } else{ gotoAndPlay("score"); } } } // click handler for show button function onClickShow(){ for (var i = 1;i <= WordNo;i++){ if(answer[i] > 0){ xadif[i] = (words[i]._x - (boxes[answer[i]]._x - 3 + ((boxes[answer[i]]._width - words[i]._width)/2))) / 10; yadif[i] = (words[i]._y - (boxes[answer[i]]._y + ((boxes[answer[i]]._height - words[i]._height)/2))) / 10; selWord[i] = true; } } showClick = true; gotoAndPlay("allback"); } // mix up words function randomiseWords(){ if(randomWords == 1){ // reset the array for(var i=1;i<=wordNo;i++){ randomPlace[i] = -1; } // give a random number to each answer for(var i=1;i<=wordNo;i++){ do{ var flag = false; var r = myRandom(1,wordNo); for(var j=1;j<=wordNo;j++){ // has the value been chosen already if(r == randomPlace[j]){ flag = true; } else{ // no, do nothing } } }while(flag == true) randomPlace[i] = r; } placeWords(); } } // random integer generator function myRandom (minNo, maxNo) { r = Math.random(); // toss away 1 if we get it while (r == 1) { r = Math.random(); } return minNo + Math.floor(r * (maxNo + 1 - minNo)); } // place words function placeWords(){ if(randomWords == 1){ for(var i=1;i<=wordNo;i++){ words[i]._y = words[randomPlace[i]].starty; words[i]._x = words[randomPlace[i]].startx; } for(var i=1;i<=wordNo;i++){ words[i].starty = words[i]._y; words[i].startx = words[i]._x; } } else{ for(var i=1;i<=wordNo;i++){ words[i]._y = words[i].starty; words[i]._x = words[i].startx; } } } // find the words and boxes function findClips(){ var myClip = _root; // work through all the movie clips on the main timeline for(var property in myClip){ // only deal with movie clip instances if(typeof myClip[property] == "movieclip"){ // store the _name property var tempStr = myClip[property]._name; // find all the box instances // check for the word "box" in the name and store its position var tempIndex = tempStr.indexOf("box"); // only process movie clips that have "box" in their name if(tempIndex > -1){ // extract the number at the end of the name var tempCounter = parseInt(tempStr.substring(3,tempStr.length)); // use the number to store the name of the instance in the array boxes[tempCounter] = eval(myClip[property]._name); // add a tag to each target boxes[tempCounter].tag = answer[tempCounter]; // add one to the numObjects variable boxNo ++; } // find all the word instances // check for the word "word" in the name and store its position var tempIndex = tempStr.indexOf("word"); // only process movie clips that have "word" in their name if(tempIndex > -1){ // extract the number at the end of the name var tempCounter = parseInt(tempStr.substring(4,tempStr.length)); // use the number to store the name of the instance in the array words[tempCounter] = eval(myClip[property]._name); // add one to the numObjects variable wordNo ++; } } } } function countItems(){ totalItems = 0; for(var i=1;i<=wordNo;i++){ if(answer[i] > 0){ totalItems ++; } } }?f // hide the score button if score is shown all the time if(scoreDialog == 2){ scoreButton._visible = false; scoreOutput._visible = true; } else{ scoreButton._visible = true; scoreOutput._visible = false; } if(scoreDialog == 2 and showClick == false){ calculateScore(); } stop();?y3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?u3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?WF3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?I,3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?a<3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?/3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?il3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?(3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?a:3mymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif;?"Jmymc._x = mymc._x - xdif; mymc._y = mymc._y - ydif; gotoAndStop("start"); ?}for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?&for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?^for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?Hfor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?rafor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?rkfor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?2for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?@for(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } }?qfor(var i = 1;i <= wordNo;i++){ if(selWord[i]){ words[i]._x = words[i]._x - xadif[i]; words[i]._y = words[i]._y - yadif[i]; } } if(showScore == true){ showScore = false; gotoAndPlay("score"); } else { gotoAndStop("start"); }?yscoreboard._x = (_root._width - scoreboard._width) / 2; scoreboard._y = (_root._height - scoreboard._height) / 2; stop(); scriptsOO?setvarsO?startJI?gobackw?allbackD?score labelsO &H Symbol 59) CDocumentPagePage 1Scene 1eAH Symbol 59 scoreoutput;&H Symbol 59''H Symbol 50shape2݊H Symbol 50lH Symbol 48 background0{sH Symbol 48mH Symbol 47 scoreboard/+HR Symbol 47,HSymbol 5boxDA7Symbol 5 mHSymbol 1word1ASymbol 1mH Symbol 60word2<bH word1 copymH Symbol 61word3=bH word2 copymH Symbol 62word4>bH word3 copymH Symbol 63word5?bH word4 copymH Symbol 64word6@bH word5 copymH Symbol 65word7AbH word6 copymH Symbol 66word8BbH word7 copymH Symbol 67word9CbH word8 copymH Symbol 68word10DbH word9 copymH Symbol 69word11EbH word10 copymH Symbol 70word12FbH word11 copymH Symbol 71word13GbH word12 copymH Symbol 72word14HbH word13 copymH Symbol 73word15IbH word14 copymH Symbol 74word16JbH word15 copymH Symbol 75word17KcH word16 copymH Symbol 40ok(DŽA@8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flaokMȄADŽA@MȄA Symbol 41show)YĄA:8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flashowYĄAYĄA:YĄA Symbol 42score*yĄA>8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flascoreĄAyĄA>ĄA Symbol 43reset+gĄA<8E:\my webs\animation_toolkit\drag\fla\photosynthesis.flaresetĄAgĄA<ĄA Symbol 77messageM,"H7E:\my webs\animation_toolkit\drag\fla\drag_and_drop.flamessage.H,"H.H Symbol 78Tween 2N.H7E:\my webs\animation_toolkit\drag\fla\drag_and_drop.flaTween 2.H.H.HO>.hhhhh CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3ff`zf*]h