Solved

MOUSEOVER BUTTON TO PLAY MOVIECLIP FORWARD AND IN REVERSE ON MOUSEOUT

Posted on 2003-11-01
2
622 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now