Search code examples
flashadobe

Go to next frame on x position


I want frame two to appear when button position is x>230.Here is code.

on (press) {
startDrag (this,false)
}

on (release) {
if (x> 230,00) {
gotoAndStop(3);
}
stopDrag()

}

Solution

  • You have some syntax mistakes and you dragging wrong object. Here is working code

    on (press) {
        startDrag(btn,false);
    }
    on (release) {
        trace(btn._x);
        if (btn._x> 230) {
            gotoAndStop(3);
    }
    stopDrag()
    }