Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Flash Action Script 3 help...

    Hello!

    I have been set an assignment to make a photo viewer with forward and backwards buttons but my code isn't working :/

    that is the code ive got but the line it seems to have problems with is the one marked with **

    stop ()

    btn1.addEventListener (MouseEvent.CLICK, backward);
    btn2.addEventListener (MouseEvent.CLICK, forward).

    function forward(event:MouseEvent)){ **
    if this.currentFrame == this.totalFrames){
    gotoAndStop(1);
    }
    else{
    nextFrame();
    }
    }
    function backward(event:MouseEvent){
    if this.currentFrame == 1 ){
    gotoAndStop(1): this.totalFrames
    }
    else{
    prevFrame();
    }
    }

    any help would be greatly appreciated as I need this completed by monday!

    Thank you

    :)
    xxxx

  2. #2
    Moderator Corrosive's Avatar
    Join Date
    May 2010
    Location
    Bristol, UK
    Posts
    980
    Thanks
    18
    Thanked 27 Times in 20 Posts
    Does it have to be in flash?

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes unfortunately it has to be in flash :/

    I did it a couple of years ago but I really can't find the error at all now! :(

  4. #4
    Moderator Corrosive's Avatar
    Join Date
    May 2010
    Location
    Bristol, UK
    Posts
    980
    Thanks
    18
    Thanked 27 Times in 20 Posts
    Quote Originally Posted by happi_fairy View Post
    yes unfortunately it has to be in flash :/

    I did it a couple of years ago but I really can't find the error at all now! :(
    Oh well, that's out of my comfort-zone I'm afraid.

  5. #5
    Member
    Join Date
    Oct 2009
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This will work:

    stop ()

    btn1.addEventListener (MouseEvent.CLICK, backward);
    btn2.addEventListener (MouseEvent.CLICK, forward);

    function forward(event:MouseEvent)
    {
    if (this.currentFrame == this.totalFrames){
    gotoAndStop(1);
    }
    else{
    nextFrame();
    }
    }

    function backward(event:MouseEvent)
    {
    if (this.currentFrame == 1 ){
    gotoAndStop(this.totalFrames);
    }
    else{
    prevFrame();
    }
    }

Similar Threads

  1. script font for caps
    By capfan in forum Font Forum:
    Replies: 1
    Last Post: 03-09-2011, 11:01 PM
  2. Replies: 3
    Last Post: 02-09-2011, 12:32 PM
  3. Script typeface?
    By HoggettCreative in forum Logo Design & Brand Identity Forum:
    Replies: 0
    Last Post: 08-11-2010, 11:49 AM
  4. need a php script written
    By cre8ivdesign in forum Tenders & Services Required Forum:
    Replies: 2
    Last Post: 05-12-2010, 04:45 PM
  5. New calligraphy/script fonts
    By 10thWay in forum Font Forum:
    Replies: 0
    Last Post: 06-17-2009, 07:45 AM

Posting Permissions

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