---Examples for using the Random function and the web access function --These could be placed in buttons or other script locations --You can copy these scripts and paste them into the Director script window --This variation also goes to access a web page after clicking on mouseUp -- pick a random number and rotate to that degree rr=random(3) r = random(360) -- rotation sprite(1).rotation = r --set up a list of words, pick a random number, pick that item of the list --and put it into a text field in="spider,ants,pincherbug,scorpion,cicada" r2 =random(5) -- insect wo = item r2 of in put wo into field "insects" --- set up a list of font names, pick a random number, pick that font name -- change the font of a member called insects to be that font fo="geneva,chicago,new york,monaco,helvetica" r3 = random(5) -- fonts f= item r3 of fo member("insects").font =f --create several members with various names, put those names in a list -- pick a random number, take than member name -- change a particular sprite to show that member na="circle,square,christmas" r6= random(3) --members m = item r6 of na sprite(1).member=m -- import several sounds, create a list of those sound names -- pick a random number -- play that item in the list soundlist = "bark, purr,hiss" r5 = random(3) sound(1).play(member r5) updatestage ---- Set up a url using the randome insect names that come up -- previous routine puts random insect name into variable wo -- composite a url using wo and the & feature of director to build strings -- the url has the http part, then the insect name, then the .com part. -- puts it into a variable called url and writes it in text field called "u" -- then uses the director command gotoNet page to access page in a target -- window called "new" -- a more elegant way would create frames and have the shockwave running -- in one frame and accessing pages in the attached frame set url="http://www."&wo&".com/" put url into field "u" gotoNetPage url,"new" updatestage --- you could substitue this one instead of the random one above to just go -- access a page that person has typed into a field called "u" --set url = member("u").text --gotoNetPage "http://userwww.sfsu.edu/~infoarts/","new" end ================= -- this is separate routine that could be attached to a field -- it checks each key press -- if the person types return, it assumes they are done -- and uses the director command gotonet page -- to go get the address they have typed on keyUp if the key = Return then set url = member("u").text --gotoNetPage "http://userwww.sfsu.edu/~infoarts/","new" gotoNetPage url,"new" updatestage end if end