Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…2cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
juliantenney committed Jun 8, 2010
1 parent 0658f58 commit efe9b01
Showing 1 changed file with 1 addition and 1 deletion.
@@ -1 +1 @@
<PG name="categories"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);pageIcon.templateData = myXML.toObject();rootIcon.setTitleText(templateData.learningObject[0].name);//create a linear list of items from each categoryitems = new Array();catCount = 0;ddItems = "";tracking = new Array();for (i = 0; i < pageIcon.templateData.categories[0].category.length; i++){ catCount++; tracking.push(new Array()); for (j = 0; j < pageIcon.templateData.categories[0].category[i].item.length; j++){ items.push({name: pageIcon.templateData.categories[0].category[i].item[j].name, cat: i}); }}//make the dragItems stringfor (i = 0; i < items.length; i++){ ddItems += 'dd' + i + '~leave~0,';}if (pageIcon.templateData.categories[0].narration != undefined){ narration = pageIcon.templateData.categories[0].narration; rootIcon.broadcast('showAudio');}]]></SCR> <DIS h="474" w="760" tabIndex="-1" id="panel" name="panel" x="20" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <DIS tabIndex="80" textColour="#333333" id="desc" name="description" x="40" y="40" w="720 - 720 / catCount" h="10" type="text"><![CDATA[{pageIcon.templateData.categories[0].text}]]></DIS> <SCR name="setup"><![CDATA[if (icon.attributes.built != "true"){ icon.nextSibling.firstChild.duplicate(catCount - 1); icon.nextSibling.nextSibling.firstChild.duplicate(items.length - 1); icon.attributes.built = "true";}//coordinates for drawinginitY = (desc._y + desc._height < 70 ? 180 : desc._y + desc._height + 20);catH = 444 - initY;tabManager = new Array();targetLabels = new Array();dragLabels = new Array();matchedCount = 0;//label sizelblH = Number(STYLES.defaultSize) + 8;if (pageIcon.templateData.categories[0].labelSize == 'Medium'){ lblH *= 2;}if (pageIcon.templateData.categories[0].labelSize == 'Large'){ lblH *= 3;}]]></SCR> <DEC name="targets" repeat="all" branch="sequence" pause="0" erase="0" eraseOnExit="0"> <PG name="protoTarget"> <DIS tabIndex="-1" id="protoTarget" name="protoTarget" x="40 + 720 / catCount * icon.parentNode.index()" y="initY" w="150" h="10" type="text"><![CDATA[{'<b>' + pageIcon.templateData.categories[0].category[icon.parentNode.index()].name + '</b>'}]]></DIS> <SCR name="drawTarget"><![CDATA[protoTarget.beginFill(STYLES.fillColour,100);protoTarget.lineStyle(1,STYLES.statusBarColour,100);protoTarget.drawRect(0,0,720 / catCount - 20,catH);targetLabels.push(protoTarget.txt);]]></SCR> </PG> </DEC> <DEC id="labels" name="labels" repeat="all" branch="randomUnused" pause="0" erase="0" eraseOnExit="0"> <PG name="protoItem"> <SCR name="setID"><![CDATA[icon.nextSibling.attributes.id = 'dd' + (labels.repCount - 1);]]></SCR> <DIS tabIndex="-1" textColour="#000000" name="protoItem" x="desc._x + desc._width + 20" y="desc._y" w="720 / catCount - 60" h="10" type="text"><![CDATA[{items[labels.repCount - 1].name}]]></DIS> <SCR name="drawItem"><![CDATA[tempIc = icon.previousSibling.clip();tempIc.cat = items[labels.repCount - 1].cat;tempIc.beginFill(0xFFFFCC,100);tempIc.lineStyle(1,0x666666,100);tempIc.drawRect(0,0,720 / catCount - 60,tempIc._height);//lblH);tempTF = tempIc.txt.getTextFormat();tempTF.align = "center";tempIc.txt.setTextFormat(tempTF);tempIc.index = labels.repCount - 1;icon.parentNode.clip().swapDepths(items.length - icon.parentNode.index());tabManager[items.length - icon.parentNode.index()] = tempIc;dragLabels.push(tempIc);]]></SCR> </PG> </DEC> <SCR name="setupInteraction"><![CDATA[icon.nextSibling.firstChild.attributes.dragItems = ddItems;if (icon.attributes.built != "true"){ icon.nextSibling.firstChild.duplicate(catCount - 1); for (i = 0; i < dateCount; i++){ icon.nextSibling.childNodes[i].attributes.name = pageIcon.templateData.categories[0].category[i].name; } icon.attributes.built = "true";}matched = 0;tabManager[tabManager.length - 1].tabIndex = 101 + items.length;//make list of random orderdragLabels.randomize();dragLabels[0]._visible = true;]]></SCR> <INT id="ddInt" name="mainInteraction" perpetual="0"> <RES name="protoTarget" type="targetArea" x="40 + 720 / catCount * icon.index()" y="initY" w="720 / catCount - 20" h="catH" dragItems="ddItems" erase="1" exit="0"> <SCR name="handleDrop"><![CDATA[catIndex = icon.parentNode.index();tracking[catIndex].push(ddInt.objectDropped);//animate to the right placenewX = 60 + 720 / catCount * icon.parentNode.index();//have to wrok out newY from the heights of all the existing objectstempY = 0;for (i = 0; i < tracking[icon.parentNode.index()].length - 1; i++){ tempY += tracking[catIndex][i]._height + 10;}newY = initY + targetLabels[catIndex]._height + 10 + tempY;ddInt.objectDropped.animate(newX, newY, 5, 'linearTween');matched++;tabManager[items.length - matched].tabIndex = 9999 + items.length;itemCount = 0;for (i = 0; i < tracking.length; i++){ itemCount += tracking[i].length;}if (dragLabels[itemCount]._visible == false){ dragLabels[itemCount]._visible = true; dragLabels[itemCount].fade('in', 0.5, 'None', 'easeNone');}]]></SCR> </RES> <RES name="onStartDrag" type="event" eventName="onStartDrag" icon="ddInt" erase="1" exit="0"> <SCR name="swapDepths"><![CDATA[ddInt.objectDragged._parent.swapDepths(99);//remove this item from tracking if it existsfor (i = 0; i < tracking.length; i++){ if (tracking[i].findValue(ddInt.objectDragged) != -1){ //already in a list //delete it tracking[i].deleteAtIndex(tracking[i].findValue(ddInt.objectDragged)); tempY = 10; for (j = 0; j < tracking[i].length; j++){ //animate to the right place newX = tracking[i][j]._x; if (j > 0){ tempY += tracking[i][j-1]._height + 10; } newY = initY + targetLabels[i]._height + tempY; tracking[i][j].animate(newX,newY,5,'linearTween'); } break; }}]]></SCR> </RES> <RES w="100" swf="templatePath + 'common/button.swf'" name="checkAnswers" type="button" x="40" y="460" label="Check Answers" erase="1" exit="0"> <DIS tabIndex="-1" id="fb" name="fb" x="0" y="0" w="400" h="10" type="text"><![CDATA[]]></DIS> <SCR name="check"><![CDATA[n = 0;for (i = 0; i < tracking.length; i++){ for (j = 0; j < tracking[i].length; j++){ if (tracking[i][j].cat == i){ n++; fb.attachMovie('tick', 'tick' + n, n); fb['tick' + n]._x = tracking[i][j]._x + tracking[i][j]._width; fb['tick' + n]._y = tracking[i][j]._y; } }}]]></SCR> </RES> </INT> </PG>
<PG name="categories"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);pageIcon.templateData = myXML.toObject();rootIcon.setTitleText(templateData.learningObject[0].name);//create a linear list of items from each categoryitems = new Array();catCount = 0;ddItems = "";tracking = new Array();for (i = 0; i < pageIcon.templateData.categories[0].category.length; i++){ catCount++; tracking.push(new Array()); for (j = 0; j < pageIcon.templateData.categories[0].category[i].item.length; j++){ items.push({name: pageIcon.templateData.categories[0].category[i].item[j].name, cat: i}); }}//make the dragItems stringfor (i = 0; i < items.length; i++){ ddItems += 'dd' + i + '~leave~0,';}if (pageIcon.templateData.categories[0].narration != undefined){ narration = pageIcon.templateData.categories[0].narration; rootIcon.broadcast('showAudio');}]]></SCR> <DIS h="474" w="760" tabIndex="-1" id="panel" name="panel" x="20" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <DIS tabIndex="80" textColour="#333333" id="desc" name="description" x="40" y="40" w="720 - 720 / catCount" h="10" type="text"><![CDATA[{pageIcon.templateData.categories[0].text}]]></DIS> <SCR name="setup"><![CDATA[if (icon.attributes.built != "true"){ icon.nextSibling.firstChild.duplicate(catCount - 1); icon.nextSibling.nextSibling.firstChild.duplicate(items.length - 1); icon.attributes.built = "true";}//coordinates for drawinginitY = (desc._y + desc._height < 70 ? 180 : desc._y + desc._height + 20);catH = 444 - initY;tabManager = new Array();targetLabels = new Array();dragLabels = new Array();matchedCount = 0;//label sizelblH = Number(STYLES.defaultSize) + 8;if (pageIcon.templateData.categories[0].labelSize == 'Medium'){ lblH *= 2;}if (pageIcon.templateData.categories[0].labelSize == 'Large'){ lblH *= 3;}]]></SCR> <DEC name="targets" repeat="all" branch="sequence" pause="0" erase="0" eraseOnExit="0"> <PG name="protoTarget"> <DIS tabIndex="-1" id="protoTarget" name="protoTarget" x="40 + 720 / catCount * icon.parentNode.index()" y="initY" w="720 / catCount - 20" h="10" type="text"><![CDATA[{'<b>' + pageIcon.templateData.categories[0].category[icon.parentNode.index()].name + '</b>'}]]></DIS> <SCR name="drawTarget"><![CDATA[protoTarget.beginFill(STYLES.fillColour,100);protoTarget.lineStyle(1,STYLES.statusBarColour,100);protoTarget.drawRect(0,0,720 / catCount - 20,catH);targetLabels.push(protoTarget.txt);]]></SCR> </PG> </DEC> <DEC id="labels" name="labels" repeat="all" branch="randomUnused" pause="0" erase="0" eraseOnExit="0"> <PG name="protoItem"> <SCR name="setID"><![CDATA[icon.nextSibling.attributes.id = 'dd' + (labels.repCount - 1);]]></SCR> <DIS tabIndex="-1" textColour="#000000" name="protoItem" x="desc._x + desc._width + 20" y="desc._y" w="720 / catCount - 60" h="10" type="text"><![CDATA[{items[labels.repCount - 1].name}]]></DIS> <SCR name="drawItem"><![CDATA[tempIc = icon.previousSibling.clip();tempIc.cat = items[labels.repCount - 1].cat;tempIc.beginFill(0xFFFFCC,100);tempIc.lineStyle(1,0x666666,100);tempIc.drawRect(0,0,720 / catCount - 60,lblH);tempTF = tempIc.txt.getTextFormat();tempTF.align = "center";tempIc.txt.setTextFormat(tempTF);tempIc.index = labels.repCount - 1;icon.parentNode.clip().swapDepths(items.length - icon.parentNode.index());tabManager[items.length - icon.parentNode.index()] = tempIc;dragLabels.push(tempIc);]]></SCR> </PG> </DEC> <SCR name="setupInteraction"><![CDATA[icon.nextSibling.firstChild.attributes.dragItems = ddItems;if (icon.attributes.built != "true"){ icon.nextSibling.firstChild.duplicate(catCount - 1); for (i = 0; i < dateCount; i++){ icon.nextSibling.childNodes[i].attributes.name = pageIcon.templateData.categories[0].category[i].name; } icon.attributes.built = "true";}matched = 0;tabManager[tabManager.length - 1].tabIndex = 101 + items.length;//make list of random orderdragLabels.randomize();dragLabels[0]._visible = true;]]></SCR> <INT id="ddInt" name="mainInteraction" perpetual="0"> <RES name="protoTarget" type="targetArea" x="40 + 720 / catCount * icon.index()" y="initY" w="720 / catCount - 20" h="catH" dragItems="ddItems" erase="1" exit="0"> <SCR name="handleDrop"><![CDATA[catIndex = icon.parentNode.index();tracking[catIndex].push(ddInt.objectDropped);//animate to the right placenewX = 60 + 720 / catCount * icon.parentNode.index();//have to work out newY from the heights of all the existing objectstempY = 0;for (i = 0; i < tracking[icon.parentNode.index()].length - 1; i++){ tempY += tracking[catIndex][i]._height + 10;}newY = initY + targetLabels[catIndex]._height + 10 + tempY;ddInt.objectDropped.animate(newX, newY, 5, 'linearTween');matched++;tabManager[items.length - matched].tabIndex = 9999 + items.length;itemCount = 0;for (i = 0; i < tracking.length; i++){ itemCount += tracking[i].length;}if (dragLabels[itemCount]._visible == false){ dragLabels[itemCount]._visible = true; dragLabels[itemCount].fade('in', 0.5, 'None', 'easeNone');}]]></SCR> </RES> <RES name="onStartDrag" type="event" eventName="onStartDrag" icon="ddInt" erase="1" exit="0"> <SCR name="swapDepths"><![CDATA[ddInt.objectDragged._parent.swapDepths(99);//remove this item from tracking if it existsfor (i = 0; i < tracking.length; i++){ if (tracking[i].findValue(ddInt.objectDragged) != -1){ //already in a list //delete it tracking[i].deleteAtIndex(tracking[i].findValue(ddInt.objectDragged)); tempY = 10; for (j = 0; j < tracking[i].length; j++){ //animate to the right place newX = tracking[i][j]._x; if (j > 0){ tempY += tracking[i][j-1]._height + 10; } newY = initY + targetLabels[i]._height + tempY; tracking[i][j].animate(newX,newY,5,'linearTween'); } break; }}]]></SCR> </RES> <RES w="100" swf="templatePath + 'common/button.swf'" name="checkAnswers" type="button" x="40" y="460" label="Check Answers" erase="1" exit="0"> <DIS tabIndex="-1" id="fb" name="fb" x="0" y="0" w="400" h="10" type="text"><![CDATA[]]></DIS> <SCR name="check"><![CDATA[n = 0;for (i = 0; i < tracking.length; i++){ for (j = 0; j < tracking[i].length; j++){ if (tracking[i][j].cat == i){ n++; fb.attachMovie('tick', 'tick' + n, n); fb['tick' + n]._x = tracking[i][j]._x + tracking[i][j]._width; fb['tick' + n]._y = tracking[i][j]._y; } }}]]></SCR> </RES> </INT> </PG>
Expand Down

0 comments on commit efe9b01

Please sign in to comment.