views:

103

answers:

1

I'm just starting out with Flash, I'm using ActionScript 2.0, and trying to acomplish something seemingly simple but it is not happening like I would think it should, any help would be appreciated.

I'm trying to load a large image about 3000x2000 pixels and then mask it with a small square, so that later I can scroll through the image to view it.

Here is the code I have so far, it produces a blank white screen.

createEmptyMovieClip("container", getNextHighestDepth());
container.createEmptyMovieClip("fullImage", container.getNextHighestDepth());
//When I replace the above line of code with the line of code bellow the image is displayed but it still not masked.
//createEmptyMovieClip("fullImage", getNextHighestDepth());

var fullClipLoader = new MovieClipLoader();
fullClipLoader.loadClip("fountain.jpg", fullImage);


// Funtion for scrolling through the image
fullClipLoader.onLoadComplete = function() {
    createEmptyMovieClip("mask", getNextHighestDepth());
    mask._x = 50;
    mask._y = 50;

    mask.beginFill(0xFF0000,50);
    mask.lineStyle(5,0xFF00FF,100);
    mask.lineTo(100,0);
    mask.lineTo(100,100);
    mask.lineTo(0,100);
    mask.lineTo(0,0);

    container.setMask(mask);
/*
    fullImage._x += _level0._xmouse;


    if (fullImage._x>_level0._x) {
        fullImage._x = _level0._x;
    }

    if (fullImage._x<(_level0._x-(fullImage._width-_level0._width))) {
        fullImage._x = _level0._x-(fullImage._width-_level0._width);
    }
*/
};
A: 

From Adobe's documentation:

  • The maximum width and maximum height of a BitmapData object is 2880 pixels. (AS2 docs)

  • In AIR 1.5 and Flash Player 10, the maximum size for a BitmapData object is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 in width. (FP10 docs)

Your bitmap is too big for AS2.

heavilyinvolved