hey elgin -
1) flash6 will be using AS1, AS2 wasn't introduced until flash7.
2a) to assign a 'handler' to a button, on the main timeline, create an new
layer, call it 'actions'. then place the codes you need for each button on
that layer. it will look something like this:
my_btn1.onPress = function() {
//do whatever here
}
2b) however you need additional functionality for the second button, because
you want two things to happen, a) initiate the transition is the 'skip' button
hasn't been pressed, and b) cancel the 'timers' action if the button does get
pressed. but even if the first button is pressed we should still assume that
the interval should be terminated, so we would wnat to make sure that that
happens as well.
for this you would use a 'setInterval' method (which will act like a timer)
but we also need to 'stop' the interval once it fires or if the button is
pressed, so we would do so by calling: clearInterval(var); the 'var' is the ID
of the interval that were starting up.
So now we need to apply these things all together, so in the first frame of
your new 'actions' layer, the code would be all as follows:
stop();
var timer:Number;
clearInterval(timer);
timer = setInterval(gotoPage, 10000); //10sec
function gotoPage() {
clearInterval(timer);
gotoAndPlay(frame#here);
}
my_btn1.onPress = function() {
clearInterval(timer);
gotoAndPlay(frame#here);
}
my_btn2.onPress = function() {
clearInterval(timer);
gotoAndPlay(frame#here);
}
>> Stay informed about: A novice user who needs some help with Flash.