I want to have a same dynamic mask on my each load movie when it is called.
Actually I am trying to have duplicate movieclip which build a grid step by step and act as a dynamic mask and whenever movie loads it plays and reverses itself on new movieload do the same again.
Help is always appreciated:)
This isn’t the best prototype for you needs or the most optimized. Just place the proto in the first frame of your movie, make a mask movieclip around 10px by 10px + export for Actionscript as ‘masker’) and call like so:
//(10,10 is the size of your mask movieclip).
myMovieClip.setGridTrans(10,10);
This proto will add grid masking functionality to any movieclip – also, it is set for radnom postitioning right now – alter away.
Code:
MovieClip.prototype.setGridTrans = function(gridX, gridY) {
if(this.active) return;
this.active = true;
var count = 1;
var numX = Math.ceil(this._width/gridX);
var numY = Math.ceil(this._height/gridY);
maskObj = this.createEmptyMovieClip(“masker”, 1000);
maskObj.base = this;
maskObj.tmpArr = [];
maskObj.alterPlay = function(){
var tmpNum = random(this.tmpArr.length);
tmpClip = this.tmpArr[tmpNum];
tmpClip.play();
if(this.tmpArr.length==0) clearInterval(this.base.loop), this.active = false, removeMovieClip (this);
this.tmpArr.splice(tmpNum,1);
}
for (var n = 0; n<=numY; n++) {
for (var i = 0; i<=numX; i++, count++) {
var clip = maskObj.attachMovie(“box2”, “b”+count, count+100, {_x:igridX, _y:ngridY});
maskObj.tmpArr.push(clip);
}
}
this.loop = setInterval(maskObj,‘alterPlay’,10);
this.setMask(maskObj);
};
by
neue
WH Flasher
California
P.S: I couldn’t make it work? any help how to use it fully and properly??
I’ve tried alot but still couldn’t figure out how to make it work
my debug Object list shows
Level #0: Frame=1
Movie Clip: Frame=1 Target="_level0.pic"
Shape:
Button: Target="_level0.instance1"
Shape:
my debug Variable list shows
Level #0:
Variable _level0.$version = “WIN 6,0,79,0”
Movie Clip: Target="_level0.pic"
Button: Target="_level0.instance1"
Variable _level0.instance1.tabIndex = [getter/setter] undefined
Now the picMC does appear after a mint or so but without any effect.
_root.pic.setGridTrans(10, 10);
aint working on button or clipevent.
it is a test file all independent.
Please tell me where I am wrong or how to make it work for me.
PLEASE HELP!!!
Or atleast let me know how I can apply my single animated mask on all my loaded movies when they are called?
Or just how to reuse my MCmask each time I need it?