Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Flash and Local Files

I know this is seems lazy, but I am short on time - someone's gonna get an easy 500 points for urgency.

I have looked over the Flash livedocs, and think I now the answer to this already - YES.

But here goes - I don't even need to know how, although a point in the right direction would be great.

I'm fairly new to flash. Can a locally deployed Flash App, access local and network files, and how difficult is this. I'm pretty sure the answer is YES, but i don't want lots of prompts. I think I can set a config file or something globally to allow this at development time.

Basically what I want to be able to do is use create printable forms that use some database info and local pictures. I don't want to have to upload pics to the server to create the forms.

I'm also assumming that I will not be able to use coldfusion/flashpaper/pdf to create this with local pictures, but is that possible? If not, I will just use printjobs to create printable screens.
Thanks in advance.
  • 2
3 Solutions
The answer is yes, but only with Flash 8!
You can find more information on file IO here:


I'm not sure about the flashpaper/pdf bit - maybe someone else can jump in.
There are different ways to load image files, the most common probably is using

mymovieclip.loadMovie("http:imageurl") to load the image into a movieclip

for grabbing info from a database, i usually use a serverside script and create a LoadVars object. Then use the method for theLoadVars class sendAndLoad

make sure to place code on frames and not on movieclips      

var sender:LoadVars = new LoadVars();
       sender.postVar1 = "somevalue";
       sender.postVar2 = "somevalue";

      var loader:LoadVars = new LoadVars();
      loader.onLoad = function(success){
            //code after load goes here to process query results
            //received from script
               loader.flash1        or this.flash1 is the same since this=loader


then grab the post variables in the script.  $post1 =  $_POST['postVar1']; //for php

the run the query. After that you have to echo the result in a url type string to return it to flash

echo "&flash1=something&flash2=something";

then when it gets back to flash they will become variables of the loader LoadVar object. see above in the loader.onLoad function

I'm not quite clear on what you are saying in that last part. Hope the other part helps.

i use php. I can post a sample script if you use php as well. Sounds like you are using coldfusion. I'm sure its pretty easy with coldfusion to do this as well, but I've never done it.
Flash can access any local files.
By default, network files can only be accessed from the same domain your .swf is on, but you
can add any number of domains / load an XML access policy file, using the System.security
class (Flash 8! see docs ActionScript 2.0 classes / security).

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now