-
Making actionscript fades gradual
When I fade a movie by reducing its alpha setting in a 'for' loop, it is virtually instantaneous. How would I make it more gradual and subtle. I have had a little look at the set Interval function but can't figure how I would use it here.
Can anyone help?
Thanks
Graeme
www.reebox.co.uk
-
loop the script between 2 frames, the for loop will preform all actions until the condition is true BEFORE returning values
-
Not quite sure what you mean, can you give me an example?
Graeme
www.reebox.co.uk
-
Senior Member of Toon Army
Hi
You should check out onClipEvent(enterFrame); in the reference.
You can have some thing like this ... on the action for a movie clip instance named mc1, which is on the main timeline (_root).
Code:
onClipEvent(load){
_root.mc1._alpha = 100;
}
onClipEvent(enterFrame){
if(_root.mc1._alpha >0) {
_root.mc1._alpha -= 5;//change this to speed/slow rate
}
}
This would reduce the _alpha of mc1 by 5 each frame that is played. Change the 5 in the example or the movie frame rate to speed/slow.
-
I'm looking to do the fade on the rollover of one of the buttons. Here's the code I've got for the rollover:
Code:
newButton.onRollOver = function() {
for (shade=0; shade<100; shade++) {
_root.mouthgraphic._alpha -= (shade/1000);
}
createEmptyMovieClip("rol", 1000);
rol._x = 350;
rol._y = 500;
rol.createTextField("rollovertext", 10, 0, 0,500, 300);
rol["rollovertext"].text = this.var_over;
rol["rollovertext"].setTextFormat(rollover);
How could I incorporate it into this?
Thanks
Graeme
www.reebox.co.uk
-
It's alright. I've managed to sort this one.
Thanks for all your help,
Graeme
www.reebox.co.uk
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
|