Macromedia Flash MX 2004 Killer Tips

[ LiB ] 

I noticed that a large number of people have the desire to load an SWF or other file into their Flash movie from a local drive. Perhaps they want to link to a file that they know will be on a user's hard drive or want to load an image with loadMovie that they know will be on a local drive. There's a right and a wrong way to do this. I see no point in telling you the wrong way, so just take a look at the right way next.

Any time you refer to a file on a local machine and you know its absolute path (location), make sure you place this in front of the path to the file. Think of it as http:// but intended for the local computer.

file://

This code refers to the computer that is running the Flash movie. So, opening an image called alwaysthere.jpg on the C drive would look like this:

_root.loadMovie("file://c/alwaysthere.jpg");

[ LiB ] 

Категории