Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MOUSEOVER BUTTON TO PLAY MOVIECLIP FORWARD AND IN REVERSE ON MOUSEOUT

Posted on 2003-11-01
2
Medium Priority
?
646 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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 …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

618 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