I have created an document image viewer in AS2 using CS3 that loads an external jpeg. There’s a “lens tool” that simulates a magnifying lens for easier reading of the document. Here’s an example including the bug:
http://treebuilder.findmypast.com/mediaviewer/mediaviewer.php?DBID=8d07aeb165b45be1cad6642d0bad62d0&MediaID=1869f45810f12eb34c4d29ae7512da28
import flash.display.BitmapData;
var origScale:Number = _root.contentContainer._xscale;
_root.contentContainer._xscale = _root.contentContainer._yscale=100;
var imageBitmap:BitmapData = new BitmapData(_root.contentContainer._width, _root.contentContainer._height);
imageBitmap.draw(_root.contentContainer);
_root.contentContainer._xscale = _root.contentContainer._yscale=origScale;
var cM_mc:MovieClip = _root.createEmptyMovieClip("contentMagnified", _root.getNextHighestDepth());
cM_mc.attachBitmap(imageBitmap,cM_mc.getNextHighestDepth());
var MagnifierMask_mc:MovieClip = cM_mc.attachMovie("MagnifierMask", "MagnifierMask_mc", cM_mc.getNextHighestDepth());
MagnifierMask_mc._x = _root.contentContainer._x+50;
MagnifierMask_mc._y = _root.contentContainer._y+50;
The user can drag the “lens” around the view to view the magnified content.
The SWF works like a charm in the Flash IDE but when I load it in a web browser, the jpeg loads in normally but the cM_mc clip appears only as a white box with the appropriate dimensions. Any ideas? Thanks!
Examples: