A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Verify if CD in CDROM and play projector otherwise not

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    29

    Post Verify if CD in CDROM and play projector otherwise not

    Hello all,

    This is my very first post on this website.

    I am working on a CD project in flash. I have a main Projector(.exe) file which call other swf files. I compile all these files(.exe and swf) to installable CD which copy all the files on the local hard disk and make a shortcut on the desktop.

    Now the problem is that I want to run my .exe file only if CD is in CDROM otherwise it loads another swf(from the local hard disk) which shows the message "please insert the CD and restart the application". Any help will be very helpful to me.

    Thanks in advance.
    Harry Kooner.

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Here's a dumb question, why install the files to the hard drive if they need the CD anyway? Unless they're huge, you could probably just run from the CD.

    In any case, in theory you could try to load one of the files from the CD and check its bytesTotal parameter. If it came back as zero, you could assume CD wasn't in the drive. The problem you may run into is say if you try to load from D:\, that may not be the drive letter of their CD, and there's no way for you to know that, at least not in Flash alone. It may be possible with some other tool such as AIR, SWF Studio, etc.

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    29

    Wink

    Quote Originally Posted by rdoyle720 View Post
    Here's a dumb question, why install the files to the hard drive if they need the CD anyway? Unless they're huge, you could probably just run from the CD.
    Hello friend, thanks for your reply. Actually my swf files are of 10mb each, so if I run these from CD it takes a time to load into projector. I am doing this all to improve performance. getbytestotal is another great idea but the issue is to find CDROM drive letter. Someone genius told me to record Drive letter at the time of installation but how?? I already tried it with batch file but actionscript fails to run batch file. Is there any help from you?? thanks again another genius.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center