i’m using Flex 2, as3.
i have a webcam class, that shows a webcam stream and after snapping, creates a Bitmap from the webcam stream and adds the Bitmap to a display object. the user can snap again.
i’m trying to add a “prev” “next” option. i’m saving the snapped images (Bitmaps) in an Array, so i can display the Bitmaps after paging:
var data:BitmapData = _imgSnapped.bitmapData;
var bitmap:Bitmap = new Bitmap(data);
_snapArr[indx] = bitmap;
and displaying the Bitmaps like so:
var data:BitmapData = _lastSnapped.bitmapData;
var bitmap:Bitmap = new Bitmap(data);
_prevImgSnapped = bitmap;
_previewDisplay.addChild(_prevImgSnapped);
the problem is, the Bitmaps seem to empty. i know the Bitmap i save in the array is the same one (it has the same reference), but the variables of the bitmapData are gone!!! (for example, tracing the bitmapData.width leads to a EOFError).
how can i properly save my Bitmaps with all their bitmapData? :puzzled: