[AS3] When I load local movie file, security error has occured.

I usually develop flash content with Flash Builder.

First I output the swc file from Flash CS 5 application.
And then, I import it from FB.
And I compile it to swf.

I tried to load the movie file in local file system.
But an Error dialog has been appeared.

The dialog said this.

SecurityError: Error #2148: SWF file file:///Users/kinkuma/Documents/temp/main.swf cannot access local resource ./video/samplef4v.f4v. Only local-with-filesystem and trusted local SWF files may access local resources.

I googled it. And I found how to solve it.
This page shows
Only local-with-filesystem and trusted local SWF files may access local resources

It says I have to add the compiler settings.
Project > Properties > ActionScript Compiler > Additional compiler arguments

-use-network=false

I can fix it!

Caution
If you load external swf files, you have to make all swf files same network policy.

Additional info
You can select the above settings with Flash Application.

File > Publish Settings > Local playback security

Comments are closed.