Groups | Blog | Home
all groups > flash actionscript > october 2004 >

flash actionscript : Scroll Buttons for nextFrame() / prevFrame()


a little ant
10/9/2004 11:35:13 PM
Hi,

This works great as it is for the 2 arrow keys(keyboard). Can you please adapt
it for me so that it works on rollOver for 2 buttons on the stage. I was able
to make something work one frame at a time but not constantly.

_root.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
my_mc.nextFrame();

} else if (Key.isDown(Key.LEFT)) {
my_mc.prevFrame();
}
}
I want my site to be accessible (keyboard) and mouse user friendly too.

Thanks,

Sam.
kglad
10/10/2004 6:13:29 AM
nextButton.onRollOver=function(){
playI=setInterval(playF,80,1);
}
nextButton.onRollOut=function(){
clearInterval(playI);
}
prevButton.onRollOver=function(){
playI=setInterval(playF,80,0);
}
prevButton.onRollOut=function(){
clearInterval(playI);
}
function play(dir){
if(dir){
nextFrame();
} else {
prevFrame();
}
}
a little ant
10/10/2004 10:12:26 AM
That's right. Instead of bringing me the boat - just throw me a life preserver!

I'm still trying to figure out how to incorporate (dir)....

Thanks as usual so far...

kglad
10/10/2004 4:59:35 PM
a little ant
10/10/2004 6:46:42 PM
It's not working for me just now. I have tried it numerous ways. Addressing the
movie clip, addressing the main timeline and all sorts of ways. I'll try again
later when i've calmed down which the likes of Rammstein and even Beethoven
have failed to help me do so far.

: )

Cheers.
kglad
10/11/2004 1:28:18 AM
oops, there's a typo. this line: function play(dir){ should be

function playF(dir){

p.s. i'm assuming that code is placed on the timeline that contains the
buttons and it's that timeline that you want to control. if the buttons are
elsewhere and/or you want to control a timeline other than the one which
contains that code, that code needs a tweak.


a little ant
10/11/2004 11:42:55 AM
kglad
10/11/2004 2:15:53 PM
AddThis Social Bookmark Button