I have 28 jpegs in my library. I want to call them as needed from an array.
This code works fine for 1 image.
When I try to replace the first line with an array reference like this...Code:var myPic:Bitmap = new Bitmap(new pic1); var scaleFactor:Number = 0.35; var newWidth:Number = myPic.width * scaleFactor; var newHeight:Number = myPic.height * scaleFactor; var scaledBitmapData:BitmapData = new BitmapData(newWidth,newHeight,true,0xFFFFFFFF); var scaleMatrix:Matrix=new Matrix(); scaleMatrix.scale(scaleFactor,scaleFactor); scaledBitmapData.draw(myPic,scaleMatrix); myPic.bitmapData = scaledBitmapData; pic_holder.addChild(myPic);
I get this error....Code:var myPic:Bitmap = new Bitmap(new myArray[0][8]);
TypeError: Error #1007: Instantiation attempted on a non-constructor.
How can I easily reference the picture from my array. I have 28 arrays nested in another array. Each nested array contains strings, a sound and a jpeg
Thanks.


Reply With Quote
