flash masking yscale
- Started
- Last post
- 8 Responses
- versa
i need some hints - can't find anything close to what i want to do...
basically just want to dynamically create scaled down empty mcs - like this maybe:
function panelCreate ()
{
this.createEmptyMovieClip ("panel1MC", 10);
panel1MC.yscale = .10;
panel1MC.drawSquare (0, 251, 740, 20, 0xddddbb);var fade = 100;
panel1MC._alpha = fade;
}panelCreate();
*drawSquare function is predefined and works right*
that will act as masks for movies underneath them...no problem there, but i want them to reveal what is under them by 'opening up' so to speak in both an upward and downward direction - so the yscale is changing and that is it
make any sense? i can't get the math right to achieve this, and my attempts are only making the whole mc move rather than changing its scale...
i am a bit lost with this one.
thanks for any ideas!
- unfittoprint0
u could use the following function to stretch the square:
//AS inside your square movie
MC.changeHeight = function(targetH){
this.movieH=this._height
this.movieH+= (targetH-this.movieH)/4;
this._height = this.movieH;
}MC.scale = function(targetH){
clearInterval(this.heightLoop);
this.heightLoop= setInterval(this, "changeHeight", 30, targetH)
}//initial scale
MC._height=0//call method outside movie
MC.scale(200);
- versa0
unfit - thanks! have you done this before...will that start it at a 'central' point and then scale it up and down at the same time so to speak...
?
- unfittoprint0
that only changes the height of the square/mask movie [you could add a targetwidth, and add the lines to the setInterval]. put this after your code, substitute MC for your square's name and add a trigger test button just to see what happens. And build the rest from there...
- versa0
i don't think i explained myself very well, but your flash knowledge is freakin' still so impressive ... awesome...
i really want the panels to grow in scale in an upward fashion and a downward fashion - simultaneously - so it is increasing in scale but its center point would never change.
let me know if you follow that
- mr_flaco0
You'll have to change the _y position of the clip at the same rate as the _height function.
- unfittoprint0
I can only think of way to that:
//create an empty holder
this.createEmptyMovieClip("holde...//you could then attach your movieclip inside, center it
this.holder.attachMovie("myMC", "myMC", 4);//center
this.holder.myMC._x -= this.holder.myMC._width
this.holder.myMC._y -= this.holder.myMC._height//the scale is always made in relation to a clip's 0,0 so myMC's center point will not change.
and then just use the [sligthly changed] previous function...
//AS inside your square movie
holder.changeScale = function(targetS){
this.movieS=this._xscale=this._y...
this.movieS+= (targetS-this.movieS)/4;
this._xscale=this._yscale= this.movieS;
}holder.scale = function(targetS){
clearInterval(this.scale
Loop);
this.scaleLoop= setInterval(this, "changeScale", 30, targetS)
}//call method outside movie
holder.scale(200);
- mr_flaco0
rockin.
- versa0
seriously rockin. thanks
i'll have to fiddle with that one for a while...but i at least understand the logic which is half the battle now