home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boot Disc 5
/
boot-disc-1997-01.iso
/
media
/
demos.dir
/
00001_Script_1
next >
Wrap
Text File
|
1996-11-05
|
11KB
|
295 lines
on startmovie
global dbase,cards
set cards=new(script "FlipperClass","Adonline","WC4",10,20,"updateRec")
set dbase=new(script "databaseClass","bootdata")
set curname=the name of member (the curcast of cards)
set rec=getrecordfromprop(dbase,#image,curname)
updateRec curname,true
puppetsound 1,0
puppetsound 2,0
end
on updateRec name,clickedflag
puppetsound 2,0
puppetsound 2,"dleep"
global dbase,cards
set rec=getrecordfromprop(dbase,#image,name)
set namesprite=castspritea("name")
set description=castspritea("description")
set curpos=the locH of sprite namesprite
set curdescpos=the locV of sprite description
set delta=50
set numsteps=15
if not clickedflag then
puppetsprite namesprite,true
puppetsprite description,true
repeat with index=1 to numsteps
set curpos=curpos+delta
set curdescpos=curdescpos+delta
set the locH of sprite namesprite to curpos
set the locV of sprite description to curdescpos
updateStage
-- rotateJupiter
end repeat
end if
set the text of member "name" to the name of rec
set the text of member "description" to the description of rec
put (the special of rec) into field "special"
-- set the fontstyle of line spline of field "description" to "bold"
if not clickedflag then
repeat with index=numsteps down to 1
set curpos=curpos-delta
set curdescpos=curdescpos-delta
set the locH of sprite namesprite to curpos
set the locV of sprite description to curdescpos
updateStage
-- rotateJupiter
end repeat
end if
puppetsprite namesprite,false
puppetsprite description,false
set the visible of sprite castspritea("launchDemo") to (the filepath of rec<>"")
set the visible of sprite castspritea("launchWWW") to (the url of rec<>"n/a")
if the platform="Windows,32" then
set the visible of sprite castspritea("PlayVideo") to (the video of rec<>"n/a")
else
set the visible of sprite castspritea("PlayVideo") to false
end if
set the visible of sprite castspritea("launchDemolt") to (the filepath of rec<>"")
set the visible of sprite castspritea("launchWWWlt") to (the url of rec<>"n/a")
if the platform="Windows,32" then
set the visible of sprite castspritea("PlayVideolt") to (the video of rec<>"n/a")
else
set the visible of sprite castspritea("PlayVideolt") to false
end if
if castspritea("thumb") then
moveThumb 395,450,"thumb",0.0,#vertical
end if
end
on rotateJupiter
global state,jupitersprite
if jupitersprite=0 then set jupitersprite=castspritea("Jupiter1")
set state=(state mod 16)+1
if not the puppet of sprite jupitersprite then
puppetsprite jupitersprite,true
end if
set the membernum of sprite jupitersprite to the number of member ("Jupiter"&string(state))
updateStage
end
on scrollthumb startpos,endpos,callback,orient
-- ScrollThumb is called by the thumb, constraining movement between
-- the starting and ending position (startpos and endpos). Orient
-- is a symbol, with values being either #vertical (the
-- default) or #horizontal. Callback is the name of a function
-- which accepts a floating point argument between 0.0 and 1.0.
-- The callback routine handles the translation between the
-- normalized parameter and whatever's being scrolled (a text box,
-- a picture, whatever). See the handler definition "on scrolltext"
-- to see an example of a callback function. ScrollThumb will return
-- a value between 0.0 and 1.0 when the mouse is released, indicating
-- how far between the start position and end position the thumb is
-- located.
--
-- When scrollthumb is called, it starts by checking to see if there
-- is a down state to the thumb graphic (the name of the down state
-- being the name of the up state with "Down" appended at the end,
-- i.e., upstate is "soundThumb", downstate is "soundThumbDown").
-- If there is, the downstate is used while the sprite is depressed;
-- otherwise, the initial state (the up state) is used.
-- The callback routine is called continuously while the
-- mouse is down over the thumb; if the action is desired only upon
-- release of the thumb then the result of the scrollThumb function
-- should be caught by a variable. The following example will
-- play the system beep sound while the mouse is down, then will
-- set a variable when the mouse is released:
-- set percentage=scrollthumb(100,200,"beep",#vertical)
set spritenum=the clickon
puppetsprite spritenum,true
set upcast=the membernum of sprite spritenum
set upcastname=the name of member upcast
set downcast=the number of member (upcastname&"Down")
if downcast<1 then set downcast=upcast
set the membernum of sprite spritenum to downcast
updateStage
if voidP(orient) then set orient=#vertical
if voidP(callback) then set callback=""
repeat while the mousedown
case orient of
#horizontal:
set pos=min(max(the mouseH,startpos),endpos)
set the locH of sprite spritenum to pos
updateStage
set ratio=(pos-startpos)*1.0/(endpos-startpos)
if callback<>"" then do (callback&&ratio)
#vertical:
set pos=min(max(the mouseV,startpos),endpos)
set the locV of sprite spritenum to pos
updateStage
set ratio=(pos-startpos)*1.0/(endpos-startpos)
if callback<>"" then do (callback&&ratio)
otherwise
alert ("The orient parameter was set to "&orient&". It can only take a value of #vertical or #horizontal (include the hash mark).")
halt
end case
end repeat
set the membernum of sprite spritenum to upcast
updateStage
return ratio
end
on GetThumbRatio startpos,endpos,thumbname,orient
set orient=default(orient,#vertical)
set thumbsprite=castsprite(thumbname)
if thumbsprite<1 then
alert ("No sprite with a cast name of '"&thumbname&"' was found. Called from 'moveThumb'.")
halt
end if
case orient of
#vertical:
set ratio=((the locV of sprite thumbsprite)-startpos)*1.0/(endpos-startpos)
#horizontal:
set ratio=((the locH of sprite thumbsprite)-startpos)*1.0/(endpos-startpos)
otherwise
alert ("The orient parameter was set to "&orient&". It can only take a value of #vertical or #horizontal (include the hash mark).")
halt
end case
return ratio
end
on moveThumb startpos,endpos,thumbname,ratio,orient
set orient=default(orient,#vertical)
set thumbsprite=castsprite(thumbname)
if thumbsprite<1 then
alert ("No sprite with a cast name of '"&thumbname&"' was found. Called from 'moveThumb'.")
halt
end if
set ratio=min(max(ratio,0.0),1.0)
set pos=integer(startpos+(endpos-startpos)*ratio)
puppetsprite thumbsprite,true
case orient of
#vertical:
set the locV of sprite thumbsprite to pos
updateStage
#horizontal:
set the locH of sprite thumbsprite to pos
updateStage
otherwise
alert ("The orient parameter was set to "&orient&". It can only take a value of #vertical or #horizontal (include the hash mark).")
halt
end case
end
on pressScrollButton startpos,endpos,thumbname,type,callback,orient,deltapercent
set callback=default(callback,"")
case type of
#forward:
set delta=default(deltapercent,0.05)
#reverse:
set delta=-default(deltapercent,0.05)
#bed:
set delta=default(deltapercent,0.10)
otherwise
alert("The type passed into pressScrollButton was incorrectly given as "&type&". It can only take the values #forward,#reverse, or #bed.")
halt
end case
-- put type
if (the number of member thumbname)<1 then
alert ("The thumb cast member '"&thumbname&"' was not found.Please check the pressScrollButton routine and try again.")
halt
else
set thumbsprite=castsprite(thumbname)
puppetsprite thumbsprite,true
end if
set spritenum=the clickon
puppetsprite spritenum,true
set upcast=the membernum of sprite spritenum
set upcastname=the name of member upcast
set downcast=the number of member (upcastname&"Down")
if downcast<1 then set downcast=upcast
set the membernum of sprite spritenum to downcast
updateStage
if voidP(orient) then set orient=#vertical
set ratio=getThumbRatio(startpos,endpos,thumbname,orient)
if type=#bed then
if orient=#vertical then
-- put "locV="&(the locv of sprite thumbsprite)
-- put "mouseV="&(the mousev)
if (the mouseV)<(the locV of sprite thumbsprite) then
set delta=-abs(delta)
else
set delta=abs(delta)
end if
else
if (the mouseH)<(the locH of sprite thumbsprite) then
set delta=-abs(delta)
else
set delta=abs(delta)
end if
end if
end if
-- put delta
repeat while the mousedown
set ratio=min(max(ratio+delta,0.0),1.0)
moveThumb startpos,endpos,thumbname,ratio,orient
if callback<>"" then
do (callback&&ratio)
end if
end repeat
set the membernum of sprite spritenum to upcast
updateStage
puppetsprite spritenum,false
return ratio
end
on clearthumb thumbname
set spritenum=castspritea(thumbname)
if spritenum>0 then
if the puppet of sprite spritenum then
puppetsprite spritenum,false
end if
end if
end
on scrolltext ratio
puppetsound 2,"Teletype A"
-- put ratio into field "ratio"
set lineheight=the lineheight of member "special"
set linecount=the linecount of member "special"
set pageheight=the pageheight of member "special"
set modheight=lineheight*linecount-pageheight
set pos=integer(ratio*modheight/lineheight)*lineheight
if pos>0 then
set the scrolltop of member "special" to pos
else
set the scrolltop of member "special" to 0
end if
end
--on default parameter,defaultvalue
-- if voidP(parameter) then
-- set target=defaultvalue
-- else
-- set target=parameter
-- end if
-- return target
--end
--on castsprite castname
-- repeat with spritenum=1 to 48
-- set castnum=the membernum of sprite spritenum
-- if castnum>0 then
-- if (the name of member castnum)=castname then
-- return spritenum
-- end if
-- end if
-- end repeat
-- return 0
--end