Hi,
variable 'i' was losing it's reference in the second loop, so I made it
global to both loops, maybe it should be renamed,
but this works:
<html>
<head><title></title>
<Script language="Javascript" src="../js/dynapi.js"></script>
<Script language="Javascript">
DynAPI.setLibraryPath('../js/lib/')
DynAPI.include('dynapi.api.dynlayer.js')
DynAPI.include('dynapi.api.browser.js')
DynAPI.include('dynapi.api.dyndocument.js')
intBoxW = 30
intBoxH = 20
intNoLin = 3
intNoCol = 4
intBoxSpace = 1
var c
DynAPI.onLoad=function() {
var i=0
c = new Array(4)
for(i=0; i<intNoLin; i++) {
c[i] = new Array(4)
for(j=0; j<intNoCol; j++) {
c[i][j] = new DynLayer()
//null,intBoxW,intBoxH,j*(intBoxW + intBoxSpace),i*(intBoxH +
intBoxSpace),"#ffccff")
c[i][j].setSize(intBoxW, intBoxH)
c[i][j].moveTo(j*(intBoxW + intBoxSpace), i*(intBoxH
+ intBoxSpace))
c[i][j].setBgColor('#ffccff')
c[i][j].setHTML('<center>x</center>')
DynAPI.document.addChild(c[i][j])
}
}
}
</script>
</head>
<body>
</body>
</html>
cheers,
Richard :)
----- Original Message -----
From: "adriant" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 8:33 AM
Subject: [Dynapi-Help] DynProblem
> Can anyone tell me whay this dosn't work?
>
> <html>
> <head><title></title>
> <Script language="Javascript" src="../js/dynapi.js"></script>
> <Script language="Javascript">
>
> DynAPI.setLibraryPath('../js/lib/')
>
> DynAPI.include('dynapi.api.dynlayer.js')
> DynAPI.include('dynapi.api.browser.js')
> DynAPI.include('dynapi.api.dyndocument.js')
>
> intBoxW = 30
> intBoxH = 20
> intNoLin = 3
> intNoCol = 4
> intBoxSpace = 1
> var c
>
> DynAPI.onLoad=function() {
> c = new Array(4)
> for(i=0; i<intNoLin; i++) {
> c[i] = new Array(4)
> for(j=0; j<intNoCol; j++) {
> c[i][j] = new DynLayer()
> c[i][j].setSize(intBoxW, intBoxH)
> c[i][j].moveTo(j*(intBoxW + intBoxSpace),
i*(intBoxH + intBoxSpace))
> c[i][j].setBgColor('#ffccff')
> c[i][j].setHTML("x") // <-- here is the problem
> DynAPI.document.addChild(c[i][j])
>
> }
> }
> }
>
> </script>
> </head>
> <body>
> </body>
> </html>
>
> thanks!
>
> Please replay to [EMAIL PROTECTED]
> Adrian
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/mailman/listinfo/dynapi-help
> ____________________________________________________________
> Get your FREE personal .com domain name and
> NAMEzero Personal Portal at: http://www.namezero.com.
> For customer service, mailto:[EMAIL PROTECTED].
>
>
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help