Using rollovers to play movieclips

Actionscript 3.0 questions.

Using rollovers to play movieclips

Postby ralphiedee » Mon Apr 02, 2012 1:43 am

I'm developing a childrens interactive book using Flash. Gotta admit I'm a bit rusty on my as.3.0 but I need some help in doing the following.

I have artwork of a car on stage with three characters

I need to make 3 movieclips out of the three characters

character one needs to spin 360o once

character two needs to jump up and down once

character 3 needs to transfrom to twice its size and transform back

all of these have to happen on mouseovers for now.

If I have the mc's named char_1 char_2 and char_3

how do I code this?

thanks as I need to brush up on my as 3.0
ralphiedee
 
Posts: 48
Joined: Fri May 01, 2009 8:05 pm
Flash Version: Adobe Flash CS5

Re: Using rollovers to play movieclips

Postby freddyatlantis » Mon Apr 09, 2012 9:05 pm

assuming you are using a Document class:
Code: Select all
import flash.events.MouseEvent;

char_1.addEventListener(MouseEvent.ROLL_OVER, overHandler);
char_2.addEventListener(MouseEvent.ROLL_OVER, overHandler);
char_3.addEventListener(MouseEvent.ROLL_OVER, overHandler);
private function overHandler(e:MouseEvent):void {
     e.currentTarget.gotoAndPlay("over");
}

and also assuming that the character animations are timeline based, and that each contains a frame label named "over" (without the quotation marks).
art school was a lot easier than this!
User avatar
freddyatlantis
Supporting Member
 
Posts: 485
Joined: Mon Jan 08, 2007 11:14 am
Location: Boston/Linz
Flash Version: Adobe Flash CS5
Authoring Environment: Microsoft Windows


Return to Actionscript 3.0

Who is online

Users browsing this forum: lenext and 1 guest

cron