Hi,
I have a problem with a email form. I have made an email form. I made two functions to control the forms background and btn_close and mc_titels. This is the code I have:
function scaleClip (clip, wijd, hoog, speed){
clip.onEnterFrame = function(){
var wdiff = wijd-this._width;
this._width += wdiff/speed;
var hdiff = hoog-this._height;
this._height += hdiff/speed;
if (Math.abs(wdiff)<1 && Math.abs(hdiff)<1) {
fadeClip ([mc_titels, btn_close], 100, 4);
delete this.onEnterFrame;
}
}
}
function fadeClip (clips, fade, speed){
//loop: bekijkt de groote van de array
while (clips.length){
// mc's hebben verschillende namen
clips[0].onEnterFrame = function(){
var fadeOut = fade - this._alpha;
this._alpha += fadeOut /speed;
};
clips.splice(0, 1);
}
}
scaleClip (mc_background, 253, 156, 4);
btn_close.onRelease = function(){
scaleClip (mc_background, 0, 0, 3);
fadeClip ([this, mc_titels], 0, 6);
}
The scaleClip function is ment to control the form background. The fadeClip is to control btn_close and the form titles. Everything is working fine so far.
The scaleClip function callback makes the background scale to the right width an height and the fadeClip call back within the scaleClip function is also working because after mc_background reaches it’s final width and height btn_close button and mc_titels are fading in.
So still no problems so far, but when I press the btn_close button things are going wrong. The scaleClip is working fine, but with the fadeClip function connected to btn_close something is going wrong. After btn_close and mc_titels are faded out completely they are fading back in again. I really don’t see what I’m doing wrong. Is there somebody who see a mistake in the script?
Thanks in advance