# Array vs Vector issue - BitmapData lost?

**URL:** <https://forum.kirupa.com/t/array-vs-vector-issue-bitmapdata-lost/326511>\
**Category:** flash\
**Created:** [December 20, 2011, 9:04am UTC](https://forum.kirupa.com/t/array-vs-vector-issue-bitmapdata-lost/326511 "2011-12-20T09:04:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brastas](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@brastas](https://forum.kirupa.com/u/brastas)\
**Post date:** [December 20, 2011, 9:04am UTC](https://forum.kirupa.com/t/array-vs-vector-issue-bitmapdata-lost/326511/1 "2011-12-20T09:04:03Z")

</div>

[TABLE=“class: tborder, width: 100%, align: center”]  
[TR]  
[TD=“class: alt1, bgcolor: #FFFFFF”]Hi guys,  
I’m trying to make a simple test for my current project and I have som problems with Vector class. I’m assigning BitmapData to the MovieClip and store this MovieClip to an Array. Then I’m able to access BitmapData.

If I do the same but use Vector instead of Array class, I get this error if I want to access BitmapData:  
1119: Access of possibly undefined property bitmapData through a reference with static type flash.displayDisplayObject.

What am I doing wrong? Thanks for your answers.

```auto

[LEFT][COLOR=#f000f0]*[TABLE="class: tborder, width: 100%, align: center"]
[TR]
[TD="class: alt1, bgcolor: #FFFFFF"][LEFT][COLOR=#F000F0]*//var store:Array = new Array(); // - THIS ONE WORKS!
*[/COLOR][COLOR=#993300]var[/COLOR] store:Vector.<MovieClip> = [COLOR=#993300]new[/COLOR] <MovieClip>[COLOR=#000000][[/COLOR][COLOR=#000000]][/COLOR];
[COLOR=#993300]var[/COLOR] itemBitmap :Bitmap = [COLOR=#993300]new[/COLOR] Bitmap[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
itemBitmap.[COLOR=#000000]bitmapData[/COLOR] = [COLOR=#993300]new[/COLOR] BitmapData[COLOR=#000000]([/COLOR][COLOR=#000000]100[/COLOR], [COLOR=#000000]150[/COLOR], [COLOR=#993300]false[/COLOR], 0x990000[COLOR=#000000])[/COLOR];
[COLOR=#993300]
var[/COLOR] mc:[COLOR=#993300]MovieClip[/COLOR] = [COLOR=#993300]new[/COLOR] M[COLOR=#993300]ovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
mc.[COLOR=#000000]addChild[/COLOR][COLOR=#000000]([/COLOR]itemBitmap[COLOR=#000000])[/COLOR];
store.[COLOR=#993300]push[/COLOR][COLOR=#000000]([/COLOR]mc[COLOR=#000000])[/COLOR];
[COLOR=#993300]
trace[/COLOR][COLOR=#000000]([/COLOR]store[COLOR=#000000][[/COLOR][COLOR=#000000]0[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#000000]getChildAt[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#000000]bitmapData[/COLOR][COLOR=#000000])[/COLOR];
[/LEFT]

[/TD]
[/TR]
[/TABLE]

*[/COLOR][/LEFT]

```

[/TD]  
[/TR]  
[/TABLE]
