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 7843445
In Process

The Archive Base Latest Questions

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

The Question : I have a dynamically loaded image. It’s the background of a

  • 0

The Question :

I have a dynamically loaded image. It’s the background of a site. After 10 seconds, I want to swap out that image with a new image!

The Thoughts :

I had thought this would be a simple enough process.

var BGbmd:BitmapData = new backgroundBitmapData(); // from library
var BG:Bitmap = new Bitmap( BBbmd );
    BG.width = stage.stageWidth; //save portrait vs landscape for later...
    BG.scaleY = BG.scaleX;
    BG.smoothing = true;
addChild( BG );

I figured I’d be able to just change the BGbmd to something else and it would update :

function changeBackground() {
    BGbmd = new secondBackgroundBitmapData(); // from Library
}

or something to that extent – but no! nothing changes! it appears I have to remove the child and re-add it which is a pain in the butt because i’d have to keep track of the childIndex…

The Outreach :
I’m really hopping that there’s some magical function or method that I’m just not able to find that will allow me to easily find swap out bitmapdatas… maybe you’ll know!

Thank you all so much!
-Joel

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

    Change the bitmap data inside the Bitmap.

    BG.bitmapData = new secondBackgroundBitmapData();
    

    The Bitmap is the thing on the stage, and it holds onto a reference to the BitmapData itself — not the variable its assigned to. So you need to change the Bitmaps internal state to switch out the images.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My program have several worker threads that calling a function in a dynamically loaded
JQuery UI let us have tabs loaded dynamically: http://jqueryui.com/demos/tabs/#ajax My question is: if the
I have a javascript question. I'm trying to dynamically build a plugins string variable
I want to show pop up of question with it's options. Each question have
I have a question: I have two MSSQL tables, items and states, that are
I have a few dynamically loaded images, with width and height being set inside
I've a question about dynamically loaded controls and events in these controls ( button
I have some JavaScript code that dynamically injects an iframe in a given HTML
i have a question regarding partial page loading with AJAX. Suppose that an user
I just have a question about how to achieve DRY with javascript that generates

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.