PDA

View Full Version : _currentframe +1 legal syntax


franmartin
05-14-2001, 05:13 PM
Hi again.
I was looking for a explanation solution on the forums but none fits my single "problem". I have a button inside a MC placed in the Mainmovie (_root). This button is to move to the next frame on the _root I was trying it whit those scripts:

on (press) { _root.gotoAndPlay (_currentframe + 1); }


on (press) { _root.gotoAndPlay (_root._currentframe + 1); }

and others similars. Doesn´t work.

on (press) {_root.nextFrame();}

it works but I want to know the properly scripts which could work with the (_currentframe + 1) expression.

Now I was checking scripts ( to be sure before to post ) and ouh... how a miracle...
on (press) { _root.gotoAndPlay (_root._currentframe + 1); }
works fine. Anyway... why first expresion does not work. _root is targeted but it looks like to play the MC again (_currentframe is the last frame of MC and (+ 1) looks like to go to the first frame).why?? I spent last two hours with that problem and I need some explanation. ;)

thanks in advance.

Jesse
05-15-2001, 09:35 AM
You have to remember the relativity of timelines. You are doing the right thing by using _root.gotoAndPlay but by the same logic you must use _root._currentframe, otherwise you are taking the current frame of the daughter MC:

on (release) {
_root.gotoAndPlay (_root._currentframe - 1)
}

Cheers

Jesse

keywords: current frame goto time line movie clip

jesseharsh
02-11-2009, 01:24 PM
:eek: very simple and clear...