gotoAndPlay(...) Action

  • Hey, I'm new to flash, my question is:
    If I got 2 tags, for this sample, they'll be "_over" and "_out" which are used for a button that has a motion of color tint.
    Now, lets say I start with gotoAndPlay("_over"), then the button turns from one color to another, then I trigger the gotoAndPlay("_out") and the button changes back to it's original color.
    My problem is when I trigger the gotoAndPlay("_out") while gotoAndPlay("_over") was playing, so I was wondering if you can somehow get the frame being played by the "_over" tagged frame and relate it to the gotoAndPlay(...) function.


  • Why not specify when you want each function to take place? If you would use movie clips for buttons you could give the MC an instance name like btn1 and then code like so;

    btn1.onRollOver = function() {
    gotoAndPlay("_over");
    }
    btn1.onRollOut = function() {
    gotoAndPlay("_out");
    }


  • Why not specify when you want each function to take place? If you would use movie clips for buttons you could give the MC an instance name like btn1 and then code like so;


    ActionScript Code:
    btn1.onRollOver = function() {


    gotoAndPlay("_over");


    }


    btn1.onRollOut = function() {


    gotoAndPlay("_out");


    }




    I indeed do that, but then, when I enter the _out instance while im in the _over instance, the animation bugs.



  • You need to get familiar with IF statements and also _currentframe.

    Rough Example:

    btn1.onRollOver = function() {
    if(btn2._currentframe>=20)
    //perform these actions
    }

    else{
    //perform these actions)
    }

    If you use movieclips as opposed to buttons - you can be specific about where in the timeline of each or anything the playhead is and then allow something to happen based on that information.

    Look up `If statements' and `_currentframe' anyway to get familiar and use movie clips instead of buttons.

    I'm crappy at AS so the two things above are easy to learn.

    Thanks, all I needed is the _currentframe thingy ;) I'm pretty strong in scripting, with any language, so that won't be a problem :)


  • You need to get familiar with IF statements and also _currentframe.

    Rough Example:

    btn1.onRollOver = function() {
    if(btn2._currentframe>=20)
    //perform these actions
    }

    else{
    //perform these actions)
    }

    If you use movieclips as opposed to buttons - you can be specific about where in the timeline of each or anything the playhead is and then allow something to happen based on that information.

    Look up `If statements' and `_currentframe' anyway to get familiar and use movie clips instead of buttons.

    I'm crappy at AS so the two things above are easy to learn.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about gotoAndPlay(...) Action , Please add it free.