flash visibility help
- Started
- Last post
- 9 Responses
- steadyvibe
Hey is ther a way to make a movie clip invisible when it hits a certain y and x axis? or have it fade away?
- Mr_Jump0
yeah, just change it's alpha proprety - innit?
- steadyvibe0
i think this is the code i have to make it move away but i want it to fade to o alpha too...
this[target]["sub"+i].button.new... = this[target]["sub"+i].button.oYp...
- steadyvibe0
i think it might make more sence for it to check what the x any y is and then determin what alpha to fade to.. does anyone know how to do that?
- unfittoprint0
function changeA (targetObj, targetA){
targetObj._alpha += (targetA-targetObj._alpha)/4;
if(Math.abs(targetA-targetObj._a...
- steadyvibe0
Where do i put that?
- unfittoprint0
function changeA (targetObj, targetA){
targetObj._alpha += (targetA-targetObj._ alpha)/4;
if(Math.abs(targetA- targetObj._alpha){
clearInterval(alphaLoop)
targetObj._alpha=targetA;
}
}function fade(targetObj, targetA){
clearInterval(alphaLoop)
alphaLoop = setInterval(this, "changeA", 30, targetObj, targetA)
}usage:
fade(this[target].button)
- steadyvibe0
That didnt work
- steadyvibe0
anyone?
- jkosoy0
changing the alpha is nice and recommended for a fade.
HOWEVER, flash is still going to draw an object on the screen with an alpha of 0...it'll just be completely transparent. the user won't think twice of it, but you're wasting the processor that way.
movieClip._visible = false;
movieClip.enabled = false;will make a movieclip invisible. it will also make it so that if there are mouse commands (such as onRelease) applied to that movieclip, they are not enabled.
movieClip._visible = true;
movieClip.enabled = true;would re-enable your movieclip.
this is generally considered better practice. i think. :)