FireworksColdFusionDreamweaverFreehandFlashMXHome
Latest New Content

Latest Free Content
View All
Free Content
Accessibility
CMX Learning Guides
Hosted by enterhost

Creating an Auto-Start CD using Flash

By: Bill Horvath

Page 1 of 1

Set for printing

I had a client once with no internet access. I know... I felt like starting up a charity in his name too. He wanted a website, but had no practical way to view it. I burned his website to a CD for him, but he had no understanding of how to open the index page on the CD. Using Notepad and Flash, I created a CD that would launch his browser window for him, and open up the index page so that all he had to do was navigate the website through his browser. But that's a whole other story. Sigh. The nice part of this method is that the user doesn't need Flash in order for the Flash executable to run.

You'll need the following tools to complete this project:
1. A text editing program (notepad, Word, etc.)
2. Flash
3. CD burning software

FYI: This solution will only work when the CD is loaded on a computer using Windows95 or greater.

Step One: Creating the .inf file

Open up any text editor that will allow you to save a .txt file, and type in the following:

[autorun]
open=startbrowser.exe
icon=favicon.ico

Save this as a text file, anywhere you like. Windows will look at the CD before deciding what to do with it. If it encounters [autorun], it will look for the next line, 'Open=" and will open the file indicated in that line, which in this case is 'startbrowser.exe', which we will explain later.

You could also use open=/FolderName/startbrowser.exe if the executable is going to be placed in a subdirectory on the cd.

The next line, 'icon=favicon.ico' is the icon that the user will see next to the drive letter representing their CD-Rom drive after inserting your CD into the drive. It can be your company logo, your client's company logo, or a happy face- whatever you like.

You could also use a .bmp file instead of .ico if you want to. Either way, set the size to 16 x 16 pixels. If you'd like to learn how to create an icon file, you can see Laurie Casolino's Kbase item here. If you do not include the icon= line, Windows will use it's own default CD-Rom icon. You can also name the icon anything you like. It doesn't have to be 'favicon'... It could be 'melvin'. But that would be odd.

Your .inf file is completed. Let's go on to the next step:

Setting up the Flash document.

The startbrowser.exe file we're about to create is the file that will actually open up the user's default browser window and load the page that we specify. Go ahead and fire up Flash. Create a new document, 20 pixels x 20 pixels. The document can be any size you like, but since it does open up on the users computer, you may want to keep it small just to avoid clutter.

Tip: You could also use this Flash window as a splash screen, or to display the client's logo (of course, you'd want to make the document larger than 20x20, or you risk blowing up the eyeballs of your poor unsuspecting users), or to display some type of introduction to the user before we launch the browser window. For instance, if you are using the cd for a presentation about your company, you could create a full-fledged Flash movie before launching the user's browser.

On frame 2 of your movie, insert a keyframe and apply the 'GetURL' action:

You could always move this action to a later frame if you'd like to prevent the browser from launching immediately. For instance, if you want the words 'Presented by Coolest Designs, inc.' to display in the Flash document for a few seconds before launching the browser, you could move the getURL action forward by x number of frames.

The getURL Action

The above image shows the action when viewed in Expert mode, but you can perform the same function in Normal mode as well.

If you know how to create a button in Flash, you have an alternative method of launching the browser window available to you: You could apply the getURL action to a button so that the user will launch the browser window at their convenience. This could allow you to let the user read any text on the screen before the browser launches, and also serves to create a more interactive experience for your user.

When you originally apply the getURL action, you'll have a set of empty parentheses that you'll need to fill in with the parameters shown above. Using "_blank" will force the default browser to launch if it is not already open, so for our purposes, this is perfect since we won't know whether or not the user already has their browser launched.

Tip: If your entire site/presentation is in Flash, you can skip the entire 'getURL' nonsense. No new window is necessary at all in this case. In this case, your Flash movie can be the executable file (more on that below, under 'Creating the Flash Executable')

"index.html" is the page we're using for this tutorial, but if you want the first page the user sees to be "sloppyjoes.html" you can change the name.

Since the only thing we need this flash file to do is launch the user's default browser and open our web page - which it does on frame 2 - we don't need anything else to happen at this point. Insert a keyframe and apply a Stop action on frame 3.
Your timeline should look like this:

Save the Flash file as 'startbrowser.fla' anywhere you like. Now it's time to export our movie.

Creating the Flash executable

We could export the file as a .swf, but what if your user doesn't have the right version of Flash, or worse yet, doesn't have any version of Flash? We're going to export the movie as a Windows Projector file (.exe) so that the file will launch regardless of whether or not the user has Flash.

Go to your Publish settings (File>Publish Settings), and click on the 'Formats' tab. Click the 'Windows Projector' checkbox and click 'Publish'.

Publish Settings

The .exe file will be saved into the same directory you saved your .fla file.

Assembling the CD

All that is needed now is to get all of the files that will need to be on the CD:

1. autorun.inf
2. startbrowser.exe
3. Web Page(s)
4. favicon.ico

The most important part before burning these items onto your cd is to make sure all of your path information is correct. Be sure that the autorun.inf points to where the startbrowser.exe will end up on the CD. Also make sure that the flash file points to where the index.html page will end up on the CD. It's also advisable to use document-relative links rather than site-root relative links. Failing to do so could wreak havoc on your links.

Now you can burn your cd and try it out. Close all instances of your browser, insert the CD, and you should see a small .swf window open, followed by your browser launching and displaying the index.html page.

Final Word

For Mac users, or the Windows users who have disabled CD's from auto-playing, you may want to include a 'readme.txt' file to instruct them on how to get to the page on your CD you'd like them to see.

The support files from this tutorial can be downloaded by clicking on the disk below.

Page 1 of 1 1


download
Download Support Files


Keywords
autorun, cd-rom, cd, website, no internet access