A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: don't know what function use!!!

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    3

    Question don't know what function use!!!

    Hi! I'm looking for a simple web to work... What I'm looking for is to make a fade out of the page when I click a button before it sends me to the section the buttons leads to.
    So, I thought that I could make the animation stops right before the fadeout, so the user can navigate, then when he clicks a button, it resumes the animation, so the fade out plays, then sends it to the other section, and so on...

    But... I'm kinda stuck in the code I need to use...

    so... this what I came up with...

    Actionscript Code:
    on (release) play;
    if (_currentframe == 10)  {gotoAndPlay ("esteban")}

    in this test... the frame 10 is when the fade out ends... and "esteban" is when the other scene begins...

    but I can't make it work, I'm making all kinds of changes to it, but the only results I get are a constant play (without skipping frames between 10 and "esteban" that's on 20) or going straight to "esteban" without playing the fade out...

    Maybe I'm going in the wrong way...

    Any advices?
    Thanks!!!!!!

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Please Provide FLA file

    also, that code, to check if the currentframe is 10, will only run once, and then is when you press it, so it only checks then, not continuously afterwards!
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    3
    here's the test file I'm using for testing this...

    http://www.mediafire.com/?a06606pdp7f0xm9

    so... the function _currenframe is not useable the way I want... Is there any function that I could use?

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Try this code on your button:

    Actionscript Code:
    on (release) {play();
        onEnterFrame = function(){
            if (_currentframe == 10) {
                gotoAndPlay ("esteban");
                delete onEnterFrame;
            }
        }
    }
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    Junior Member
    Join Date
    Oct 2011
    Posts
    3

    Smile

    Quote Originally Posted by Nig 13 View Post
    Try this code on your button:

    Actionscript Code:
    on (release) {play();
        onEnterFrame = function(){
            if (_currentframe == 10) {
                gotoAndPlay ("esteban");
                delete onEnterFrame;
            }
        }
    }
    OMG!!! It worked!!!!
    Thank you so much!!!!!!!
    Now I can finish my web...
    Bye!!!!!!!

    PS: Thanks again!

  6. #6
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hehe, no problem
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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