Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:05:58+00:00 2026-06-14T09:05:58+00:00

I have a flash applcation which has two things 1.Browse for new image component

  • 0

I have a flash applcation which has two things
1.Browse for new image component
2.Build scroller image gallery component- has 10 recently uploaded images only

How do I save the new images as and when the user browses it and store it locally and then reuse it again for later sessions (load the images from the saved location and build the scroller again when user visits next time)

Please help me know how to save images locally and then reuse it later as well, more like a history application

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:06:00+00:00Added an answer on June 14, 2026 at 9:06 am

    Here you go :

    This piece of code save images in shared object and restore them when you restart.

    Result

    package{
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.net.FileFilter;
        import flash.net.FileReference;
        import flash.net.SharedObject;
        import flash.text.TextField;
        import flash.utils.ByteArray;
    
        [SWF(width="100",height="800")]
        public class TestSO extends Sprite{
    
            private var _soFileIndex : SharedObject = SharedObject.getLocal("fileIndex");
            private var _addBtn : Sprite = new Sprite;
            private var _fr : FileReference = new FileReference;
    
            public function TestSO(){
                // Add a button
                var tf : TextField = new TextField;
                tf.text = "Add image";
                tf.width = 100;
                tf.height = 20;
                tf.selectable = false;
                _addBtn.addChild(tf);
                _addBtn.graphics.beginFill(0xDDDDDD);
                _addBtn.graphics.drawRect(0,0,_addBtn.width, _addBtn.height);
                _addBtn.graphics.endFill();
                addChild(_addBtn);
    
                // If file index is empty
                if(!_soFileIndex.data.index)
                    _soFileIndex.data.index = [];
                else{
                    // Display stored images
                    for each(var fileName : String in _soFileIndex.data.index)
                        displayImage(fileName, SharedObject.getLocal(fileName).data.bytes)
                }
    
                // Listeners
                _addBtn.addEventListener(MouseEvent.CLICK, onAddClick);
                _fr.addEventListener(Event.SELECT, onFileSelected);
                _fr.addEventListener(Event.COMPLETE, onFileLoaded);
            }
    
            // Ask for a file
            private function onAddClick(e : Event) : void{
                _fr.browse([new FileFilter("Images", "*.jpg;*.jpeg;*.png")]);
            }
    
            // open file
            private function onFileSelected(e : Event) : void{
                _fr.load();
            }
    
            // save file
            private function onFileLoaded(e : Event) : void{
    
                var fileName : String = _fr.name.split(" ").join("_");
                // Save a reference to filename
                if(_soFileIndex.data.index.indexOf(fileName) == -1)
                    _soFileIndex.data.index.push(fileName);
                else return;
    
    
                var fileSo : SharedObject = SharedObject.getLocal(fileName);
                fileSo.data.bytes = _fr.data;
                fileSo.flush();
    
                displayImage(fileName, _fr.data);
            }
    
            // Display an image
            private function displayImage(name : String, data : ByteArray):void{
                var item : Sprite = new Sprite;
    
                // Load image
                var imgLoader : Loader = new Loader;
                imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageLoaded);
                imgLoader.loadBytes(data);
                item.addChild(imgLoader);
    
                var label : TextField = new TextField;
                label.text = name;
                label.y = 100;
                label.height = 20;
                item.addChild(label);
    
                item.y = height;
                addChild(item);
            }
    
            // Resize image when loaded
            private function onImageLoaded(e : Event) : void{
                e.target.content.width = e.target.content.height = 100;
                e.target.removeEventListener(Event.COMPLETE,onImageLoaded);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an application recently which has articles, etc, with a commenting/moderation system
We have a web application that has a flash UI for which we would
Imagine that I have a form in a flash application with two fields, input1
we have a small flash component on our website/application to upload multiple files. This
Here's the challenge: I have a Flash movie which will be embedded in a
We have an application in which the user has to enter a date who's
Currently I have a flash based application (game) which I need to put on
I have a Flex application embedded in a Flash application, which was working fine
I have a footer template which has a input and submit for email subscription.
I have a flash application which uses a single php file to retrieve records

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.