hi everybody
i have just built an animation and would like to add a few buttons so the viewer can view it at his/her own pace (fast forward, stop, resume)…I was wondering how exactly I could do that?
I tried to use
on(release){
gotoAndPlay(nextFrame();
}
but i know that’s not the right thing to do…HELP! thanks!
i’d create a function for each action …
// play movie
playMovie = function() {
play();
}
// stop/pause movie
stopMovie = function() {
stop();
}
// fast forward
fastForward = function() {
_currentframe != _totalframes ? nextFrame() : clearInterval(fastForwardInterval);
}
// play button
playButton.onRelease = playMovie;
// stop/pause button
stopButton.onRelease = stopMovie;
// fast forward button
fastButton.onPress = function() {
fastForwardInterval = setInterval(fastForward, milliseconds);
}
fastButton.onRelease = function() {
clearInterval(fastForwardInterval);
}
if you need a more detailed explanation just tell me =)
by the way … the working equivalent of
on (release) {
gotoAndPlay(nextFrame());
}
would be something like this
on (release) {
gotoAndPlay(_currentframe+1);
}
hi kax,
thank you so much for replying!
but…being the absolute beginner that I am, i still don’t really understand…haha…sorry…
what exactly is a function and how do i go about using it?
thanks for your patience!
hmm … changing the speed of the movie. that’s a toughie
what kind of animation is it that they would need to change the speed?
you can do stop and play easy enough
on (press) {
stop();
}
on (press) {
play();
}
and you can rewind to the beginning
on (press) {
gotoAndPlay(1);
}
skip to the end
on (press) {
gotoAndStop(put the number of your last frame here);
}
but if you want to get into rewinding and fast forwarding that’s a little more complicated
to do a rewind
follow the example set in this file
ok then … i’ll make an example for you =)
in the meantime … you can open the actionscript dictionary [size=1]help | actionscript dictionary[/size] and search for everything you don’t understand in the code
to change speed you’ll need to use ‘set intervals’
use this file to understand the concept
-----------------------edit---------------------
lol kax … we were posting at the same time :whistle:
good job
i’ll let you make the example =)
monkey girl … where ya from?
:sure: no one fills out their info anymore
… or you can do that shuga :sigh:
i’ll have to look into making that example tonight when i get home from work and then out of school … if you haven’t already done it by then. i don’t have time to do much more than check the forums while i’m here at work
good luck!
Thanks Shuga…I’m working on it right now…I’ll let you both know how it turns out…haha =D
oh and i’m from san jose, ca…
ohh i just realized…the backwards2.zip file you posted only works for a movie clip (right?)…what i’m trying to do is control the movie timeline…basically I’m trying to recreate what this company already has in their product demos
www.autdemo.com/?samples
if you click on any of the samples, you’ll see a little control panel thingie on the lower right…
monkeygirl:
your link doesn’t work … atleast it didn’t when i clicked on it. i tried it without the ? too
san jose … that’s cool. i’m in sacramento right now for school. i’ll be moving to san diego in a couple of months once i graduate. what do you do?
oopsie…sorry it’s www.autodemo.com/?samples
sacramento? go KINGS! =P
u in college?
i’m going back to school (hopefully) in a few months…i graduated last may…i work at a software company (in the marketing dept)
marketing dept. cool
where did you graduate from … what was your degree?
yes i am in college … i go to CSU Sacramento
i’m excited to graduate, looking for jobs is fun =)
my portfolio site is coming along although there’s no work up yet. you can see it if at http://www.aaronsleeper.com
the mail form doesn’t work yet though, but you can email me through here =)
what do you do for the marketing dept of autodemo (i’m guessing that’s the company you work for)