Hi,
Here is a custom fader function that might be useful...
Code:
function NTDfader(myTarget, myAlpha) {
myTarget.onEnterFrame = function() {
intA = myTarget._alpha;
newA = myAlpha;
newAlpha = intA+((newA-intA)/9);
myTarget._alpha = newAlpha;
//clear enterframe events for optimized codeing
if (newAlpha == myAlpha) {
delete this.onEnterFrame;
}
}
}
//Example usage with a mouseDown and Up event
_root.onMouseDown = function() {
NTDfader(_root.box, 0);
}
_root.onMouseUp = function() {
NTDfader(_root.box, 100);
}
The above is just a demo of manipulating the alpha of a movieclip named "box". To create an image fade, you would either import the image at runtime and run the function on a movieclip that holds the image with it's alpha initiated to 0, or you could use the loadMovie method to load the image at runtime and then use the fader function to fade the clipholder to 100 alpha...
Code:
_root.box._alpha=0;
_root.box.loadMovie("someImage.jpg");
NTDfader(_root.box,100);
Something to be aware of, I am developing with Flash8 and AS2. I believe the alpha settings for version CS3 have changed from 0 - 100..........to...... 0 - 1.
hope it helps
NTD
Bookmarks