I’ve seen lots of threads on achieving an alpha fade effect using actionscript. I want to be able to adjust the alpha of an Mc using a button instance.
I’ve experimented with a few techniques using loops and hitTest but at the moment on mouseOver for example the alpha only increases the once until the mouse is taken away and placed over the button again. Obviously I need to achieve a continual evaluation of the mouse position or hitTest in order to achieve a continuous fade effect.
Also how would I ensure that a Mc faded out when the mouse comes away from the button.
I guess what I am asking for is a way of creating a fade in and out on a Mc with a remote button.
What this does is… onRollOver it starts an onEnterFrame handler, which will keep updating the code when the movieclip enters the frame (repeatedly that is). So it will increase by 5 until it gets to 100, when it gets there it will stay there and then delete the onEnterFrame so as to preserve CPU resources.
Next is the onRollOut, same method as the onRollOver, but subtracts 5 from the _alpha. And waits until it gets to 0 then deletes the onEnterFrame.
change “this” which targets the clip the actions are on to “_root.yourClip” which targets another movieclip on the _root timeline with the instance name “yourClip” (no quotes).