Uses a file saved on the CD to find the CD-ROM drive at run-time
property fuzzybunny
global mycd
on beginsprite fuzzybunny
repeat with x = 65 to 90
set drive = numTochar(x)
set thisPath = string(drive & ":"&fuzzybunny)
set myFile = new(xtra "fileio")
openFile(myFile, thisPath, 1)
if status(myfile) = 0 then
set myFile = 0
put drive&":" into mycd
return drive&":"
exit
end if
end repeat
set myFile = 0
alert "Could not find the file ""E&fuzzybunny"E&" on the CD. Please check it and try again."
end
on getpropertydescriptionlist
set mylist=[#fuzzybunny: [#comment: "Specify the file to find on the CD:", #format: #string, #default: ""]]
return mylist
end
on getbehaviordescription me
set line1 to "This behavior will allow the author to find the letter of the cd rom"
set line2 to " so that the movie can find the necessary linked files with the searchpath. Why is this necessary? Because on PC"s, the letter of the CD-Rom drive may differ from machine to machine. In order to play linked media, run external apps, or play other movies from the CD, the searchpath must be changed depending on what letter the path to the CD begins with."&return&return
set line3 to "To use: "&return&"1) Create a text file and name it something unique (i.e. "fuzzybunny.txt")."&return
set line3a to "2) Put the text file on the root of your CD."&return
set line4 to "3) Drag the behavior to a sprite in a stub movie (one that goes to your main movie)."&return
set line4a to "4) Insert the name of the unique text file in the dialogue box (i.e. fuzzybunny.txt)."&return&return
set line5 to "The movie should now be able to dynamically find the letter of the CD rom drive "
set line6 to "and store it in a variable named MyCD. You can now use this variable with the searchpath to find any linked media. An example of this is:"&RETURN&RETURN&"append the searchpath, myCD&""E&"/mymovie/media/""E&"."&RETURN&RETURN
set line7 to "IMPORTANT NOTE: You must be using and distribute the FileIO Xtra in order for this to work."&return&return&return&return
set line8 to "Copyright 1997, Macromedia Inc. By Jeffrey Kafer"
return line1&line2&line3&line3a&line4&line4a&line5&line6&line7&line8
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA