|
-
Reusing Functions on more than one movie clip
I'm doing a filmstrip animation and each frame of the strip has a small pic on it and using TweenLite, I'm making it expand and contract on mouse rollover and rollout. That's not the problem. Since it's basically the same function, I don't want to have to write it for all 16 frames. I thought I'd try 'this' but that doesn't work on AS3. So I'm trying to find a solution that does. Here's my code (for one frame of the movie....in this case, the eighth).:
import gs.TweenLite;
fsAnim.filmstrip_mc.photo8_mc.addEventListener(Mou seEvent.MOUSE_OVER, photoOver);
fsAnim.filmstrip_mc.photo8_mc.addEventListener(Mou seEvent.MOUSE_OUT, photoOut);
function photoOver(evt:MouseEvent):void {
fsAnim.stop();
TweenLite.to(fsAnim.filmstrip_mc.photo8_mc, .5, {scaleX:1.5, scaleY:1.5});
}
function photoOut(evt:MouseEvent):void {
fsAnim.play();
TweenLite.to(fsAnim.filmstrip_mc.photo8_mc, .5, {scaleX:1, scaleY:1});
}
Adam Bell
[email protected]
--
Over 90% of all websites
suck......
Join the minority.
Tags for this Thread
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
|