Flash and Local Files

Posted on 2006-05-10
Last Modified: 2013-12-16
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.
Question by:chuckbeats
    LVL 12

    Expert Comment

    The answer is yes, but only with Flash 8!
    LVL 12

    Accepted Solution

    You can find more information on file IO here:

    I'm not sure about the flashpaper/pdf bit - maybe someone else can jump in.
    LVL 3

    Assisted Solution

    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.
    LVL 4

    Assisted Solution

    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
    class (Flash 8! see docs ActionScript 2.0 classes / security).

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now