Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Question on Rollover, Rollout

New Here ,
Dec 11, 2013 Dec 11, 2013

Hi,

I am new to flash.  I created a frame in the main time line and in the main timeline I created a movie clips which has two frames.

What my code suppose to do is that when I rollover an object in unit 32, it will move to frame 2 in the movie clip(object with a box beside).  When I rollout an object, it will move back to frame 1(object only).

My problem is that the box remains on the stage even though the mouse already rollout of the object.  When I click it again, it becomes normal again.

Can someone help me... Many Thanks in advance.

KC

Main Timeline

main_timeline.jpg

Frame 1

stop();

--------------------------------------------

Movie Clip

movieclips.jpg

Frame 1:

stop();

addEventListener(MouseEvent.ROLL_OVER, onMouseoverbtn1);

function onMouseoverbtn1(event:MouseEvent) :void {

          removeEventListener(MouseEvent.ROLL_OVER, onMouseoverbtn1);

          gotoAndPlay("2");

 

}

Frame 2:

stop();

var link1:URLRequest = new URLRequest("http://www.test.com");

addEventListener(MouseEvent.ROLL_OUT, onMouseoutbtn1);

addEventListener(MouseEvent.CLICK, onMouseclick);

function onMouseoutbtn1(event:MouseEvent) :void {

          removeEventListener(MouseEvent.ROLL_OUT, onMouseoutbtn1);

gotoAndStop("1");

}

function onMouseclick(event:MouseEvent) :void {

          navigateToURL(link1);

 

}

TOPICS
ActionScript
567
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 11, 2013 Dec 11, 2013

what's this mean, "My problem is that the box remains on the stage even though the mouse already rollout of the object."?

in particular, what's "..the box.."?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 11, 2013 Dec 11, 2013

The box is a  black box graphics which only appears in frame 2 but not in frame 1.  Thanks for your reply.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 11, 2013 Dec 11, 2013

i can't see enough of the movieclip timeline to determine where on stage objects (like that black box) are located.

and you can use the trace function to confirm your rollover and rollout are doing what you want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 12, 2013 Dec 12, 2013
LATEST

should be without quotes

gotoAndPlay(2);

&

gotoAndStop(1);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines