--CDOpen Behavior-- Using CDPro Xtra
--by Kurt Koenig * Belgium
-- 7/2000
--Parameters : none
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-- Open a CD-door using the "CDPro" free xtra from "Penworks"
-- Since the Microsoft MCI command to open a CD-door doesn't
-- let you specify a particular drive (as far as I know)
-- I looked for another way to open the CD door.
-- Nowadays, particularly with CD burners becoming more
-- affordable, and more systems having two CD-Rom drives,
-- there's need for a way to pass the current CD-drive letter
-- to open the right CD door.
-- Use of the CDPro Xtra is free provided you conform to logo
-- and licensing requirements. Visit the "Penworks" web site
-- for more information: http://www.penworks.com
-- Use this behavior in the scriptchannel, or on a button to open
-- the current CD-drive from within a Director Projector.
-- You can't really test this in Director, not even from a projector
-- on a Harddrive.The projector with the behavior needs to be run from
-- a CD in a CD-drive.
-- The projector is closed immediately after sending the Eject command,
-- Because the "cd = 0" statement you don't have to worry about a bluescreen.
-- when ejecting from within the projector.This behavior is Windows only!!
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
on getbehaviordescription
return¬
"Use this behavior to open the CD-door from within "&RETURN&"¬
a Director Projector on a CD.This behavior uses "&Return&"¬
the free 'CDPro' xtra from 'Penworks'.This behavior"&RETURN&"¬
is specially written, for the case the users system is "&RETURN&"¬
equipped with more then one CD drive."&return&"¬
*** Kurt Koenig * Belgium ***"
end getbehaviordescription
on getBehaviorTooltip
return¬
"Specify the action on which the CD door should open"
end getBehaviorTooltip
on enterFrame me
if pWhen = #enterFrame then initialize me
end
on exitFrame me
if pWhen = #exitFrame then initialize me
end
on mouseUp me
if pWhen = #mouseup then initialize me
end
on mouseDown me
if pWhen = #mouseDown then initialize me
end
on mouseEnter me
if pWhen = #mouseEnter then initialize me
end
on mouseLeave me
if pWhen = #mouseLeave then initialize me
end
on initialize me
--Initialize the xtra.
set cd=New(xtra "cdPro")
--Put the Moviepath first character + ":" in a variable.
CurrentDrive = (the moviepath . char[1]&":")
put currentdrive
--Compare with CDDrivelist and return the position in list(equals cd-driveNumber)
CDdrive = Getone (GetCdDrive(cd), CurrentDrive )
SelectDrive(cd, (Cddrive . value))
shutdown(cd)
set cd = 0
--The xtra has to be re-initialized now.
set cd=New(xtra "cdPro")
SelectDrive(cd, (Cddrive . value))
--Open the CD door
Eject ( cd )
halt
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA