Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Show Me the Movie
Inno Setup Pro
DivXInstaller Xtra
SpriteMap
eCommerce Xtra 1.5
Mastering Macromedia Director 6
Wait For Media Ready
BASS Xtra v1.0
Get the default fixedLineSpace from a text member
DirectImage Xtra
 

 

 

Behavior CD-ROM Drive Letter Finder-Using a File

Added on 6/10/1999

 

Compatibilities:
behavior D6_5 Mac PC

This item has not yet been rated

Author: JeffreyKafer

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

Send e-mail