Hi,
Ultimately, I hope to get the random number appearing between 2 bouncing balls displayed in an applet and a new random number shows up everytime someone clicks on a button.
I tried the code below but does not seem to be working.
Is there something i am missing. Also, do you know how i can create bouncing balls in Curl?
Thanks,
PangTee
{curl 4.0 applet}
{curl-file-attributes character-encoding = "windows-latin-1"}
{applet manifest = "file:///c:/manifest.mcurl",
{compiler-directives careful? = true}
}
{curl-file-attributes character-encoding = "windows-latin-1"}
{applet manifest = "file:///c:/manifest.mcurl",
{compiler-directives careful? = true}
}
{view
{import * from CURL.GUI.SHAPES}
{Canvas
width = 9cm,
height = 8cm,
{ShapeGroup
translation = {Distance2d 0cm, 7cm},
{RectangleShape
{GRect 0cm, 1cm, 1cm, 0cm},
color = "#006968",
translation = {Distance2d (1.1cm * 1), 0cm}
},
{RectangleShape
{GRect 0cm, 1cm, 5cm, 0cm},
color = "#2462a2",
translation = {Distance2d (1.1cm * 6), 0cm}
}
}
{value
let random:Random = {Random}
{random.next-in-range 1, 1328}
},
}
}
pang tee <[EMAIL PROTECTED]> wrote:
{import * from CURL.GUI.SHAPES}
{Canvas
width = 9cm,
height = 8cm,
{ShapeGroup
translation = {Distance2d 0cm, 7cm},
{RectangleShape
{GRect 0cm, 1cm, 1cm, 0cm},
color = "#006968",
translation = {Distance2d (1.1cm * 1), 0cm}
},
{RectangleShape
{GRect 0cm, 1cm, 5cm, 0cm},
color = "#2462a2",
translation = {Distance2d (1.1cm * 6), 0cm}
}
}
{value
let random:Random = {Random}
{random.next-in-range 1, 1328}
},
}
}
pang tee <[EMAIL PROTECTED]> wrote:
Thanks. I wrote the below code but would like to try to change it to use RolledRandom.next-roll instead. Can someone guide me with the change?I keep getting syntax errors.
{View
{value
let random:Random = {Random}
{random.next-in-range 1, 1328}
},
visibility = "normal",
{on WindowClose do
{exit}
}
}Thanks,PangTee
Kamal Bhatt <[EMAIL PROTECTED]> wrote:Use the class Random.{value let random:Random = {Random}{random.next-float}}Note that Random had several methods to get a random int16, int32, uint8, etc----- Original Message -----From: pang teeSent: Friday, December 16, 2005 6:29 AMSubject: Re: MenuManager and MenuItem.get-prevdoes anyone have a simple example of a random number generator created and displayed in Curl? I want to replace the current usage of _javascript_ Math object to generate and display a random number.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com