|
-
Fade out function
Hi there guys,
I have this code in flash (AS2)... check it out:
interior._visible = false;
back._visible = false;
function fadeout() {
onEnterFrame = function () {
this._alpha -= 10;
if (this._alpha <= 0) {
this._alpha = 0;
delete onEnterFrame;
}
}
}
gointerior.onRelease = function() {
interior._visible = true;
interior.gotoAndPlay(2);
fadeout();
};
stop();
I have a couple of movie clips in the layout, and a button called "gointerior"
The idea is that when I release that button, it fades out (the button). So I have created a function called fadeout(); but when I call that function and I test the movie all the movie fades out. I dont know what Im doing wrong. I think that is something related to the function path or something.
I need your help guys!
Last edited by fabrizzzio; 06-08-2007 at 09:19 AM.
Reason: mistake
 need a light?
-
FK'n_dog
try sending the clip name as a parameter -
Code:
function fadeout(clip) {
clip.onEnterFrame = function () {
clip._alpha -= 10;
if (clip._alpha <= 0) {
clip._alpha = 0;
delete onEnterFrame;
}
}
}
gointerior.onRelease = function() {
interior._visible = true;
interior.gotoAndPlay(2);
fadeout(this);
// or - fadeout(gointerior);
};
-
doesn't work
Is there something related to the function?
 need a light?
-
FK'n_dog
you've stuffed up somewhere 
it works here -
Last edited by a_modified_dog; 08-17-2007 at 06:33 PM.
-
Thanks a lot man!
that's working.
the problem was that I was using a Button symbol, and I cannot associate an onEnterFrame statement to buttons...
so I decide tu use a MC to get the onEnterFrame from it out of the button.
 need a light?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|