FORUMS: list search recent posts

Newb with SIMPLE script question

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jason Richards
Newb with SIMPLE script question
on Mar 10, 2009 at 5:59:08 pm


I'm just learning flash and I'm banging my head on my desk crying to the Flash gods for simple guidance.
Here's my scenario: I have 8 full screen info pages 600x658 on the same layer on different keyframes. I have another layer with 2 buttons. One that says "next" and one "previous". I have another layer that is my actions. For the life of me I can't get anything to work. What is the correct scripting so that each time I press one of my buttons it either goes to next page or previous.

someone please throw me a bone.


Return to posts index

demetri tashie
Re: Newb with SIMPLE script question
on Mar 10, 2009 at 6:18:58 pm

fairly easy and straight forward. here is a basic example of a 4 frame SWF with a button to advance or go back one:

here is the code:

function goNext(evt:MouseEvent):void{

nextBTN.addEventListener(MouseEvent.CLICK, goNext);

function goPrev(evt:MouseEvent):void{

prevBTN.addEventListener(MouseEvent.CLICK, goPrev);

also- the first frame needs a stop action.
the code should be self explanatory and easily adaptable to your site. let us know how it goes.

Return to posts index

Rebecca Gallagher
Re: Newb with SIMPLE script question
on Aug 30, 2009 at 11:26:33 pm

This code works great, but how do I get it to go back to the first frame once it reaches the last frame and/or get it to go to the last frame from the first frame?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved