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

  • SEARCH
  • Home
  • 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 9172523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:22:02+00:00 2026-06-17T16:22:02+00:00

i have multiple images that are created dynamically, and i want in some cases

  • 0

i have multiple images that are created dynamically, and i want in some cases to change the image. i can save them in an array, but how can i change the image (load another image) by getting it from the array.
let’s say that i have an array:

var ImagesArray:Array = [];

and i push to it loader objects, and want to change (load new) image of ImagesArray[0] or ImagesArray[1]… like:

var loaderNew:Loader = new Loader();
loaderNew = ImagesArray[i];
loaderNew.load(new URLRequest("../lib/NewImg.png"));

Thanks,

  • 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-17T16:22:03+00:00Added an answer on June 17, 2026 at 4:22 pm

    You dont need to create new loader if you only want to change its image, here’s an example of function to update image url:

    private function changeImageByIndex(i:int, url:String):void    
    {
        var loader:Loader = ImagesArray[i] as Loader;
        if (!loader)
        {
            loader = new Loader();
            addChild(loader);       
            ImagesArray[i] = loader;
        }
        loader.load(new URLRequest(url));
    }
    

    If you have bitmap, use loadBytes() method instead load(), here’s example:

    var bitmap:Bitmap = new Bitmap(new BitmapData(100, 100, true, 0xff0000));
    var encoder:JPEGEncoder = new JPEGEncoder();
    loader.loadBytes(encoder.encode(bitmap.bitmapData));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple images that have the same class attribute and I want to
I have created a css sprite image for multiple images. The css for sprite
I have an application that requires processing multiple images in parallel in order to
If we have a website with multiple images and videos, I've read that it's
For a client I have build a simple script that uploads multiple files(images), resizes
I have a custom library that can pick mulitple images from the camera roll,
I have an image upload function that supports multiple files upload, but somehow it
I have a view that has multiple views inside it, and an image presentation
I have a psd image with me. This image has been created combining multiple
I have created a helper that requires some parameters and should upload a file,

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.