A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Frames?

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    20

    Frames?

    I basically have 4 images and an up and a down button. I have it so that if you click the up btn, it will go to the next picture (7 frames away) and I also have it so when you click the down btn you go to the picture before (7 behind).
    It works perfectly well when I click the up btn, it continues after the 4th image to go to the first, but not so much the down button. Whenever it gets to the 1st frame/ picture, it stops. Can you help? Thank you.

    Code:
    next1_btn.addEventListener(MouseEvent.CLICK, image1);
    next2_btn.addEventListener(MouseEvent.CLICK, image2);
    
    
    function image1 (evtObj:MouseEvent):void
    {
    	gotoAndPlay(currentFrame - 7);
    }
    
    function image2 (evtObj:MouseEvent):void
    {
    	gotoAndPlay(currentFrame + 7);
    }

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    maybe try something like:

    actionscript Code:
    function image1 (evtObj:MouseEvent):void
    {
        if(currentFrame != 1){
                 gotoAndPlay(currentFrame - 7);
            }else{
                 gotoAndPlay(totalFrames - 7);
    }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center