Problem with scriptable mask

I pieced together this code and it works on its own in separate swf but I want to use it on my main site. I can get it to load and work at position 0,0 of my main stage. My problem is, I can’t figure out how to move it so the top left corner is at position 0,200 and still have the mask work.

Code:


_root.createEmptyMovieClip("image0_mc", 1);
_root.image0_mc.createEmptyMovieClip("imageHolder1_mc", 1);
image0_mc.imageHolder1_mc.loadMovie("http://rberry883.home.comcast.net/gamepics/apeblur.jpg");
_root.createEmptyMovieClip("image1_mc", 2);
_root.image1_mc.createEmptyMovieClip("imageHolder1_mc", 1);
image1_mc.imageHolder1_mc.loadMovie("http://rberry883.home.comcast.net/gamepics/ape.jpg");
_root.createEmptyMovieClip("mask_mc", 3);
mask_mc.lineStyle(3, 0x000000, 0);
mask_mc.beginFill(0, 100);
mask_mc.lineTo(0, 0);
mask_mc.lineTo(0, 200);
mask_mc.lineTo(250, 200);
mask_mc.lineTo(250, 0);
mask_mc.lineTo(0, 0);
mask_mc.endFill();
mask_mc._x = -250;
mask_mc._y = 0;
image1_mc.setMask(mask_mc);
image0_mc.onRelease = function() {
        _root.mask_mc.onEnterFrame = function() {
                this._x += 12;
                if (this._x>=0) {
                        this._x = 0;
                        delete this.onEnterFrame;
                }
        };
};

Any help is appreciated.

here you can see how it works in its own swf: http://rberry883.home.comcast.net/game1.swf

Sorry to bump my own topic but I can’t seem to get this to work anywhere but at position 0,0 of my main movie.

By default the drawing start at x/y 0,0. You can change this with

mask_mc.moveTo(0, 200);//will start at 0,200

scotty(-:

Ahhh, I didn’t even come across moveTo in the endless searching that I’ve been doing. It seems to be working, thanks for the help.

No problem:)
btw Ilyas wrote a nice tut on it:
http://www.kirupa.com/developer/actionscript/tricks/drawing_api.htm

scotty(-:

LOL, it figures it was right under my nose the whole time. I searched for just about every variation of “mask” + “scriptable” and then some. Thanks for the link.

:wink: