From: <alk...@Eu...> - 2001-06-21 08:41:20
|
Hi EveryBody=0D I have try to use DynAPI 2.53 in the following script.=0D But I get Error message from DynAPI.=0D "luff is not an Object"=0D I also attach the script and gif-images files.=0D Verry thankfull for tip or advice.=0D Sincerely=0D Urban Avierfj=E4rd=0D ICQ#69907743=0D Homepage http://w1.201.telia.com/~u20100003=0D <HTML>=0D <HEAD>=0D <META NAME=3D"KEYWORDS" CONTENT=3D"MY FILE">=0D <META NAME=3D"DESCRIPTION" CONTENT=3D"MY FILE">=0D <META NAME=3D"JAVASCRIPT GENERATOR" CONTENT=3D"jsEditor">=0D <title>DynAPI Distribution: Create Example</title>=0D <script language=3D"Javascript" src=3D"../src/dynapi.js"></script>=0D <script language=3D"Javascript">=0D DynAPI.setLibraryPath('../src/lib/');=0D DynAPI.include('dynapi.api.*');=0D DynAPI.include('dynapi.event.*');=0D DynAPI.include('dynapi.gui.dynimage.js');=0D </script>=0D <script language=3D"Javascript">=0D var luff =3D new Array(25);=0D for (i=3D0;i<25; i++){=0D luff[i]=3D new Array(25);=0D }=0D var luffParent =3D new Array();=0D var luffChild01 =3D new Array();=0D var luffChild02 =3D new Array();=0D var luffChild03 =3D new Array();=0D var luffChild04 =3D new Array();=0D var luffChild05 =3D new Array();=0D var luffChild06 =3D new Array();=0D var luffChild07 =3D new Array();=0D var luffChild08 =3D new Array();=0D var luffChild09 =3D new Array();=0D var luffChild10 =3D new Array();=0D var luffChild11 =3D new Array();=0D var luffChild12 =3D new Array();=0D var luffChild13 =3D new Array();=0D var luffChild14 =3D new Array();=0D var luffChild15 =3D new Array();=0D var luffChild16 =3D new Array();=0D var luffChild17 =3D new Array();=0D var luffChild18 =3D new Array();=0D var luffChild19 =3D new Array();=0D var luffChild20 =3D new Array();=0D var luffChild21 =3D new Array();=0D var luffChild22 =3D new Array();=0D var luffChild23 =3D new Array();=0D var luffChild24 =3D new Array();=0D var luffChild25 =3D new Array();=0D luffParent[luffParent.length] =3D luffChild01;=0D luffParent[luffParent.length] =3D luffChild02;=0D luffParent[luffParent.length] =3D luffChild03;=0D luffParent[luffParent.length] =3D luffChild04;=0D luffParent[luffParent.length] =3D luffChild05;=0D luffParent[luffParent.length] =3D luffChild06;=0D luffParent[luffParent.length] =3D luffChild07;=0D luffParent[luffParent.length] =3D luffChild08;=0D luffParent[luffParent.length] =3D luffChild09;=0D luffParent[luffParent.length] =3D luffChild10;=0D luffParent[luffParent.length] =3D luffChild11;=0D luffParent[luffParent.length] =3D luffChild12;=0D luffParent[luffParent.length] =3D luffChild13;=0D luffParent[luffParent.length] =3D luffChild14;=0D luffParent[luffParent.length] =3D luffChild15;=0D luffParent[luffParent.length] =3D luffChild16;=0D luffParent[luffParent.length] =3D luffChild17;=0D luffParent[luffParent.length] =3D luffChild18;=0D luffParent[luffParent.length] =3D luffChild19;=0D luffParent[luffParent.length] =3D luffChild20;=0D luffParent[luffParent.length] =3D luffChild21;=0D luffParent[luffParent.length] =3D luffChild22;=0D luffParent[luffParent.length] =3D luffChild23;=0D luffParent[luffParent.length] =3D luffChild24;=0D luffParent[luffParent.length] =3D luffChild25;=0D alert(luffParent.length);=0D function Calculate(){=0D c=3Da+40=0D d=3Db+40=0D }=0D function getAB(e){=0D A=3De.getX()=0D B=3De.getY()=0D }=0D function myarray(){=0D var H=3D0;=0D for (i=3D0;i<=3D480; i=3Di+20){=0D H=3DH+1=0D for (j=3D0;j<=3D20;j++){=0D if (i+j=3D=3DA){=0D a=3Di=0D }=0D }=0D }=0D var V=3D0;=0D for (k=3D0;k<=3D480;k=3Dk+20){=0D V=3DV+1=0D for (l=3D0;l<=3D20;l++){=0D if (k+l=3D=3DB){=0D b=3Dk=0D }=0D }=0D }=0D if (luff[H][V]=3D=3D91){=0D a=3D0;=0D b=3D0;=0D }=0D =0D else {=0D luff[H][V]=3D87;=0D }=0D }=0D function layout() {=0D myLayer =3D new DynLayer()=0D myLayer.setSize(500,500)=0D myLayer.setBgColor('purple')=0D myLayer.moveTo(5,50)=0D myListener =3D new EventListener(DynAPI.document)=0D myListener.onmousemove=3Dfunction(e) {=0D myLayer.setBgColor('pink')=0D }=0D myListener.onmouseout=3Dfunction(e) {=0D myLayer.setBgColor('deeppink')=0D }=0D myListener.onmousedown=3Dfunction(e) {=0D getAB(e);=0D myarray();=0D myChild2 =3D new DynLayer(null,a,b,20,20,'violet')= =0D myChild2.setHTML('<img src=3DAnimation2.gif>')=0D myLayer.addChild(myChild2)=0D Calculate();=0D myChild2 =3D new DynLayer(null,c,d,20,20,'violet')= =0D myChild2.setHTML('<img src=3DAnimation1.gif>')=0D myLayer.addChild(myChild2)=0D }=0D myLayer.addEventListener(myListener)=0D for (i=3D19;i<480; i=3Di+20){=0D myChild =3D new DynLayer(null,i,0,2,500,'black');=0D myLayer.addChild(myChild);=0D }=0D for (i=3D19;i<480; i=3Di+20){=0D myChild =3D new DynLayer(null,0,i,500,2,'black')=0D myLayer.addChild(myChild)=0D }=0D DynAPI.document.addChild(myLayer)=0D }=0D DynAPI.onLoad =3D function() {=0D layout();=0D }=0D function newgame() {=0D layout();=0D }=0D </script>=0D </head>=0D <BODY>=0D <BODY BGCOLOR=3D"lime">=0D <H1>Five in a Row</H1>=0D <PRE>=0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D =0D </PRE>=0D <FORM><INPUT TYPE=3D"button" VALUE=3D"New Game" onClick=3D"newgame();"></FO= RM>=0D </BODY>=0D </HTML>=0D =0D =0D =0D =0D |