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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:22:26+00:00 2026-05-19T22:22:26+00:00

I have a very complex Flash application (think Photoshop in Flash). There is a

  • 0

I have a very complex Flash application (think Photoshop in Flash).

There is a lot of image manipulation, and all is working well with the exception of one bug.

The application has an undo/redo feature that sometimes throws an error. There is way too much code to paste here, but the issue revolves around this line of code:

trace("UNDO BMD: " + BeautyGlobal.undoArray[_undoSteps].bitmapData);
var newUndoData:BitmapData = BeautyGlobal.undoArray[_undoSteps].bitmapData.clone()

The trace statement displays:

UNDO BMD: [object BitmapData]
ArgumentError: Error #2015: Invalid BitmapData.
    at flash.display::BitmapData/clone()
    at Main/undoAction()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.beautyCanvas.ui::Toolbar/undoClick()

So there is bitmapdata there, but it is not valid. This issue doesn’t preset itself all of the time. If I could detect if the bitmap data is valid, I can stop it from crashing the entire application. I have tried a few things:

  • check the height of the BM Data (crashes the app with same error)
  • looping through the BMD to get all of the properties… nothing comes up even before the error presents itself.

Any suggestions would be greatly appreciated.

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-05-19T22:22:27+00:00Added an answer on May 19, 2026 at 10:22 pm

    This is most likely because your application is using too much memory and has hit a limit. Check Flash Player’s memory usage.

    A way to catch and deal with this error is to simply use a try..catch block:

    try {
      var newBitmapData:BitmapData = oldBitmapData.clone();
    } catch (e:Error) {
      if (e.errorID == 2015) {
        // handle it
      } else {
        throw e;
      }
    }
    

    If you keep running into this error and can confirm that there is indeed a correlation with increased memory usage, then the one thing you want to do first is make sure that you are properly disposing of any discarded BitmapData objects:

    // dispose first
    myBitmapData.dispose();
    
    myBitmapData = null;
    

    Before you lose all references to a BitmapData instance, you want to dispose() it first.

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

Sidebar

Related Questions

I have an idea for a web-based service. The implementation is very complex. There
So, we have a very large and complex website that requires a lot of
I have a very complex cross-platform application. Recently my team and I have been
I have a very simple WPF application in which I am using data binding
I'm working on a very graphic-heavy application which uses content from a bunch of
I have a very simple stored procedure which returns multiple record sets. All of
All, I have a very general question regarding a future project. I need to
I've worked on projects that have very complex XML configuration, and one problem that's
I have a very complex DOM structure, A small for example or say demo
I have two very complex queries that are displayed on the same form and

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.