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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:17:07+00:00 2026-05-25T12:17:07+00:00

I have the following problem: I have this multi-level array (nested array) which contains

  • 0

I have the following problem: I have this multi-level array (nested array) which contains two rows of bitmapData. Row 1:360 rotated bitmapData objects; row 2: 360 rotated and colored bitmapData objects.

I try to access row 2 but that doesn’t work. There are some mysterious error messages coming up (“TypeError: Error #1034: Type Coercion failed: cannot convert []@36d7e9e9 to flash.display.BitmapData. at BasicBlitArrayObject/updateFrame()”).

Please can someone help me out with this problem? Thank you very much.

this function rotates and colors bitmapData; the rotated bitmapData is thrown into an array and the colored bitmapData is thrown into another array; a third array is used as a level array for nesting the other two arrays inside of it

public function     createColoredRotationBlitArrayFromBD(sourceBitmapData:BitmapData, inc:int,     offset:int = 0, color:Number = 1, $alpha:Number = 1):Array
{

tileList = [];
tileListSec = [];
levelArray = [tileList, tileListSec];
var rotation:int = offset; 

while (rotation < (360 + offset))
{
    var angleInRadians:Number = Math.PI * 2 * (rotation / 360);
    var rotationMatrix:Matrix = new Matrix();

    rotationMatrix.translate(-sourceBitmapData.width * .5, -sourceBitmapData.height * .5);
    rotationMatrix.rotate(angleInRadians);
    rotationMatrix.translate(sourceBitmapData.width * .5, sourceBitmapData.height * .5);


    var matrixImage:BitmapData = new BitmapData(sourceBitmapData.width, sourceBitmapData.height,
                                true, 0x00000000);

    matrixImage.draw(sourceBitmapData, rotationMatrix);
    tileList.push(matrixImage.clone());


    bitmapData = new BitmapData(matrixImage.width, matrixImage.height, true, 0x00000000);
    bitmapData = matrixImage;


    var colorMatrix:ColorMatrixFilter = new ColorMatrixFilter (
                        [color, 0, 0, 0, 0,
                        0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0,
                         0, 0, 0, $alpha, 0]);

    matrixImage.applyFilter(bitmapData, bitmapData.rect, point0, colorMatrix);


    tileListSec.push(matrixImage.clone());


    rotation += inc;

    matrixImage.dispose();
    matrixImage = null;
    rotationMatrix = null;
    bitmapData.dispose();
    bitmapData = null;
    colorMatrix = null;
    }

return(levelArray);

}

creating my rotated and colored bitmapData

animationFrames = tempBlitArrayAsset.createRotationBlitArrayFromBD($bitmapData, 1, 270);

here I try to access the first row of my level array (that doesn’t work; I can’t access it)

tempEnemy.animationList = animationFrames;
tempEnemy.bitmapData = tempEnemy.animationList[1][tempEnemy.frame];

This function is for updating the frames

public function updateFrame(inc:int, row:int = 0):void
{
frame += inc;

if (frame > animationList.length - 1){
    frame = 0;
}
bitmapData = animationList[row][frame];                 


}

}   

this is a line showing how the updateFrame-function is used in my game (trueRotation is 0)

tempEnemy.updateFrame(tempEnemy.trueRotation);
  • 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-25T12:17:08+00:00Added an answer on May 25, 2026 at 12:17 pm

    I can’t find anything wrong with createColoredRotationBlitArrayFromBD

    var $bitmapData:BitmapData = new BitmapData(40,40,false, 0x7f7f7f);
    var animationFrames:Array = createColoredRotationBlitArrayFromBD($bitmapData, 1, 270);
    trace(animationFrames.length);   // 2
    trace(animationFrames[0].length);  // 360
    trace(animationFrames[1].length);  // 360
    
    var bitmap:Bitmap = new Bitmap();
    this.addChild(bitmap);
    bitmap.bitmapData = animationFrames[1][0]; // works..
    

    That seems correct. Right? I get a red tinted bitmap.

    The only ‘bug’ I see in the code you listed is in updateFrame

    if (frame > animationList.length - 1){
        frame = 0;
    }
    

    should probably be:

    if (frame > animationList[row].length - 1){
        frame = 0;
    }
    

    because animationList.length == 2

    But everything else looks okay in the code you’ve provided, so without more code, i’m not sure there is anything to help.

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

Sidebar

Related Questions

This is a code review question more then anything. I have the following problem:
Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
Never thought I'd have this problem :) The following snippet of code works in
Problem: I have to design an algorithm, which does the following for me: Say
I have a following problems with eclipse, when I installed ClearCase plugin from this
I have problems with the following bit of javascript/jquery code: this.droppable = function(){ $('.imageWindow
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
I have the following problem: I have an HTML textbox ( <input type=text> )
I have the following problem using subversion: I'm currently working on the trunk of

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.