Skip to main content
November 23, 2011
Answered

Beginner, Simple - Needed Mouse_Over to Pause Animation

  • November 23, 2011
  • 1 reply
  • 1473 views

I'm trying to create a slideshow - a set of Still Images that continuously slide by with links to corresponding pages. I want this slideshow to stop sliding when MOUSE_OVERd'.

Here's an example of what I wish to create:

http://www.beatport.com/   ---  Slideshow is top left of page body - called - "NEW ON BEATPORT"

- Notice how when you rollover the slideshow - it stops, and pauses while you hover over it.

I've managed to created the keyframed slides, along with corresponding hotspots.

I need help with AS to pause the keyframe animated slides when rolled over. Of course, I want the slides to begin sliding again when MOUSE_OUT.....

I have an Actions layer on my timeline.....

- This is my simple attempt of AS to pause the slideshow:

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

slides.addEventListener.(MouseEvent.MOUSE_OVER);{
slides.function = stop
}

slides.addEventListener.(MouseEvent.MOUSE_OUT);{
slides.function = play
}

Thank you so much for any help you can offer, I truly appreaciate it !!!

This topic has been closed for replies.
Correct answer Ned Murphy

ALSO --- with the last script - when tested,,,, the slides didn't move at all.


The problem is due to missing removing something in your original code, an extra " . "  (dot) where there shouldn't be (the ones ypu placed after addEventListener)...

Try the following

slides.addEventListener(MouseEvent.MOUSE_OVER, stopSLides);

function stopSLides(evt:MouseEvent):void {
    stop();
}

slides.addEventListener(MouseEvent.MOUSE_OUT, playSlides);

function playSlides(evt:MouseEvent):void {
    play();
}

1 reply

Ned Murphy
Legend
November 23, 2011

Try it this way:

slides.addEventListener.(MouseEvent.MOUSE_OVER, stopSLides);

function stopSLides(evt:MouseEvent):void {
    slides.stop();
}

slides.addEventListener.(MouseEvent.MOUSE_OUT, playSlides);

function playSlides(evt:MouseEvent):void {
    slides.play();
}

If those don't work you will need to explain the nature of the slides animation.

November 23, 2011

Thanks so much for your expert help!!!!   The code you provided was entered exactly but didnt work.

Above, those Still Image thumnails slide to the left, stopping at each slide for 5 seconds within the dark gray frame.... The entire strip of slides are animated with keyframes on the timeline.  I need a mouseover to pause this keyframed play, and then a mouse out to UnPause the slides and their sliding.....  When I entered your code - the slides didn't move at all, and yielded the following error message:

ERROR MESSAGE:

TypeError: Error #1123: Filter operator not supported on type builtin.as$0.MethodClosure.

at FLASH_SCREEN_001C_fla::MainTimeline/frame1()

____________________________________________________________________

These Still Image Slides perfectly loop in their keyframed play.

Again - I need a MOUSE_OVER to pause the keyframed play of the slides, allowing viewers to see and read particular slides, and then click if they want to go to the corresponding page.....

I then need a MOUSE_OUT to permit the keyframed play to resume.

Ned Murphy
Legend
November 23, 2011

As I said in my initial reply, if it doesn't work you'll need to explain the nature of the slides animation. What in your original code are you referring to as "slides".  If it is not a movieclip then it is not correct to be targeting it to play/stop.

Are all of the images you show on the main timeline?  If that is the case, then you just want to have stop() and play() in those functions, though you still need to explain what "slides" is.

As far as the error message goes, it  should not be related to the code provided since that code has no relationship to filters.