FORUMS: list search recent posts

Button Rollover with seperate movie-clip animation

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Philip Hogarth
Button Rollover with seperate movie-clip animation
on Oct 26, 2012 at 3:53:42 pm


I have decided to improve a project as I am pursuing web developer positions and the design fizzled out after the first page, and should have included more tweens. I have a monkey with a large leaf, please see attached, and I want the monkey to point to the desired button on rollover and to retract when on rollout or when clicked. I have some basic script in at the moment which affects the Flunkey movie clip which consists of an armature layer spread over 15 frames with an actionscript layer consisting of 4 stop() actions at frame 1, 5, 10 and 15, or, starting position, top-button, middle-button and bottom-button. This just affects the top button at the moment. The case statements do need correctly ordering but I will do this later.

Can you help me please.




import com.greensock.*;
import com.greensock.easing.*;

var numberOfButtons:Number = 3

var startX:Number;
var startY:Number;

var currentButton:MovieClip

for (var i:int = 1; i <= numberOfButtons; i++)

this["btn"+i].buttonMode = true;
this["btn"+i].mouseChildren = false;
this["btn"+i].addEventListener(MouseEvent.MOUSE_OVER, doRollover)
this["btn"+i].addEventListener(MouseEvent.MOUSE_OUT, doRollout)
this["btn"+i].addEventListener(MouseEvent.CLICK, showContent);

function doRollover(e:MouseEvent):void
{[], 1, {scaleX:1.1, scaleY:1.1, ease:Elastic.easeOut});

// This function handles the Rollout event
function doRollout(e:MouseEvent):void
{[], 1, {scaleX:1, scaleY:1, ease:Elastic.easeOut});

function showContent(e:MouseEvent):void

currentButton = this[]
switch (currentButton)
case btn1:
TweenMax.from(mcGallery, 1, {x:450, y:300, scaleX:1, scaleY:1, ease:Back.easeOut});
mcGallery.parent.setChildIndex(mcGallery, mcGallery.parent.numChildren-1);


case btn2:
TweenMax.from(flvPlayer, 1, {x:-72, y:-721, ease:Back.easeOut});
flvPlayer.parent.setChildIndex(flvPlayer, flvPlayer.parent.numChildren-1);

case btn3:



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved