Load an image into a flash application from an external location

Posted on 2011-04-22
Last Modified: 2012-05-11
I am having a flash application built and need the following :

I have an image that is stored in a folder called 'Images'. I need this image called main.jpg to be shown as the background in a flash .swf but I do not want the image to be stored internally to the flash file. It's location must stay external to the flash file in this 'images' folder.

The reason I need this is becasue this flash file will be used many times, and every time it is used again the image (main.jpg) will change and I want to be able to simply replace the image in the 'Images' folder rather than having to do it through Flash, as I do not have adobe flash.

How can I do that
Question by:nathan1038
    1 Comment
    LVL 17

    Accepted Solution

    In AS3, user Loader Class to load image.
    import flash.display.Loader;
    var image_path:String = "imagse/my_image.jpg";
    var loader:Loader;
    var request:URLRequest;
    public function loadImage()
        loader=new Loader();
        request=new URLRequest(image_path);
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete, false, 0, true);
    function onComplete(event:Event):void {

    Open in new window

    Warm Regards
    Deepanjan Das

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    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…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

    729 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

    20 Experts available now in Live!

    Get 1:1 Help Now