[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.
[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]