Solved

MOUSEOVER BUTTON TO PLAY MOVIECLIP FORWARD AND IN REVERSE ON MOUSEOUT

Posted on 2003-11-01
2
627 Views
Last Modified: 2009-07-29
How do I make a button that plays a movie clip forward on mouseover and play in reverse on mouseout?

I'm doing this wrong currently, but its the action I want my button to do.  Currently I am using this code on a movieclip symbol:

onClipEvent (enterFrame) { // runs a hit test
 if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
   this.nextFrame(); // if true the movieclip plays forward
 } else {
   this.prevFrame(); // if not plays backwards to beginning
 }
}

In the movieclip I have my animation and a stop(); on the first frame.

I also have a button in the movieclip that has the click area that I want to use and this code:

on (release) {
   stop();
   getURL("http://www.somesite.com/index.cfm", "_self");
}

My problem is that I don't want to use the movieclip as the click area, I want the click area of the button to activate the movieclip to play forward on mouseover, and in reverse on mouseout.  

Don't know how to make a button do this.

Any help would greatly be appreciated and 500 points to the expert with the solution.
0
Comment
Question by:madasczik
2 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
ID: 9664646
• assign to the movieclip:

onClipEvent(load){
      this.forward = false;
}
onClipEvent (enterFrame) {
      this.forward ? this.nextFrame() : this.prevFrame();
}

• assign to the button:

on(rollOver){
      this.forward = true;
}
on(rollOut){
      this.forward = false;
}
on (release) {
      stop();
      getURL("http://www.somesite.com/index.cfm", "_self");
}
0
 

Author Comment

by:madasczik
ID: 9664692
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question