Actionscript question
- Started
- Last post
- 8 Responses
- amadio4
I have a timeline that has a series of images that cycle in and out and stop at specific points along the way. I have a rewind scipt that cycles the timeline backwards and I just use play to move forward. My problem is that at times I want the timeline to play forward to a specific frame without stoping at some of the stop actions along the way. I want to skip ahead a few stops... I was trying to put together an if/then statement but I'm a shabby coder. Anyone have any suggestions?
P.S.- There are a set of navigation buttons that I'm using to move back and forth through the timeline. I also don't want to take the stop actions out that are already in place.
- joyride0
wow you got a lot of stuff going on.
Start to think about the logic first.
You want it to go to a specific spot with out stopping at stop points. Look for a var (at the stop points) on whether to stop or not, you're on the right path.
Whatever triggers the goto certain specific spots need to set this var (boolean) so it doesn't stop. Then at that spot, turn the var off or false. You're on the right path. just think about the logic.
from the sounds of it, it should be pretty easy. So keep with it.
gl
- jarredbishop0
does not work for going backwards. it probably wouldn't be too hard to incorporate tho..
also i haven't tested it very exclusively. good luck.
- joyride0
oh... I wouldn't use an on enterFrame... very processor intensive
I guessed that you had a serious of actions on the timeline and could run the if/else at each stop frame. That might solve your backwards issue
- jarredbishop0
with reverse.
- joyride0
just be sure to test that on older machines. that oEF is pretty simple, but depending on how you call the function, you don't want multiple instances of it running. That would really slow things down.
- amadio40
Hmmm. Going backwards isnt the problem. It's going forward. Where would the if then statement be placed? Under each section I have a stop action?
The time line looks like this...for the most part:
stop1...stop2...stop3...stop4
I want to move from 1 to 4 without stoping at 2 and 3. But the stop actions need to stay on 2 and 3.
I'm using simple buttons to move along the timeline, so the script needs to work with them. I have a feeling it's simple, but I just can't find the right code...and I stink at actionscript.
- joyride0
how do you trigger the movie to stop at 4 and not 2 and 3?
That is where you put variable the if statement is looking for.
Then when you reach 4, you clear/ set to false the variable. it is pretty simple, just keep at it, you'll figure it out.
and remember there are always multiple ways to do the same thing.
- PonyBoy0
I just did something exactly like this for this website: http://www.stonecanyon.com...
The nav at the bottom - the mountains react w/the actual amount of buttons that are input into the sub-nav... if there are 5 buttons in the sub-nav (see 'Homes & Land')... 'it's' mountain-set runs along the timeline either stopping or playing based on a simple 'if' statement:
if (mtn_var == 3) {
stop();
} else {
play();
}'mtn_var' is a variable that the main button sends to 'it's' assigned mountain animation instance. The above 'if' statement would stop the timeline if there were three buttons in the sub-nav.
It's just some simple frame-based scripts reacting to variables (in this case, a number).