frame labels flash
- Started
- Last post
- 7 Responses
- sexypixel
OK. Im have having bit of a nightmare.
I have to make a step by step movie in flash. Im using frame labels, but i cannot use the normal 'goto and play "framelabel" as there is about 200 frame labels in the movie and i dont want to have to asign a different action to each next and back button.
does anyone know of a good tutorial that might show me how to do this using variables
something like
on release
go to and play "current label' +1for the next button
and:
on release
gotoandplay "currentlabel"-1for the back button.
thanks in advance
- autonoma0
Why do you need to use frame labels for the buttons? Why not do:
button.onPress = function() {
nextFrame();
}button.onPress = function() {
prevFrame();
}
- sexypixel0
because for each step there is an animation (about 20 frames, sometimes 10) so previous frame would not work, it would just take me to the last frame of the previous animation
- sexypixel0
anyone?
- autonoma0
Name your frames something like step1, step2, etc. Then create a variable called something like currentStep. Place this on the first frame:
currentStep = 1;
Then on the next button:
nextButt.onPress = function() {
currentStep++;
gotoAndPlay(step+currentStep);
}
- sauerbraten0
frame labels are strings, the + 1 won't work, that will only work if you want to do like _currentframe + 1.. you could do it like that i suppose, i don't really get how you're file is set up, but even if you name your labels say '10' it still reads as a string, not the number 10, however if it's on frame #10 and you say _currentframe + 10, it should skip to #20 in theory..
- Mick0
sexy - if all your frames are X apart you can use GotoAndPlay (_currentframe + 10), otherwise name your frames as stated "frame1, frame2, etc." then on your onRelease do...
i++;
GotoAndPlay("frame"+i);on the back but do
i--;
GotoAndPlay("frame"+i);
- sexypixel0
great thanks, its working.
happy days