Welcome Guest [Log In] [Register]
Welcome to Brackenwood. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Simple And Sweet
Topic Started: Mar 30 2005, 07:31 PM (148 Views)
KWarp
Member Avatar
Brackenwood Middleweight
BEHOLD!!! The first compitent Actionscript code I made completely from scratch! The code below is code for the navagation buttons on the linked movie. There's a play, pause, skip forward, skip backward, and back to start button. A little variable keeps track of where I am in the movie to help the skip forward/backward buttons function correctly. :bing:
Code:
 
var placeNum = 1;
//button methods from left to right
backtostart1.onRelease = function() {
placeNum = 1;
gotoAndPlay("place1");
};
rewind1.onRelease = function() {
if (placeNum>0) {
 placeNum--;
 gotoAndPlay("place"+placeNum);
} else {
 placeNum = 1;
 gotoAndPlay("place1");
}
};
pause1.onRelease = function() {
stop();
};
start1.onRelease = function() {
play();
};
forward1.onRelease = function() {
if (placeNum<7) {
 placeNum++;
 gotoAndPlay("place"+placeNum);
} else {
 placeNum = 7;
 gotoAndPlay("place7");
}
};

//not included in this code: placeNum increments
//by 1 one frame before every frame with a "place"
//name on it (except the first one since it's already
//set to 1 by default).


I probably could have made it play backwards too, but hey I'm lazy. :P
Offline Profile Quote Post Goto Top
 
Arse
Brackenwood Lightweight
Well done... the first steps to becoming a Guru! :)
Offline Profile Quote Post Goto Top
 
mikepol
Member Avatar
Brackenwood Newbie
coo well done dude!

to play backwards, you'd do something like

Code:
 
rewind.onRelease = function() {
gotoAndStop(_currentframe-1);
};
:++: :++:
Offline Profile Quote Post Goto Top
 
KWarp
Member Avatar
Brackenwood Middleweight
Bleh, I'm certain if I try to play it backwards the sound will chop up. Thanks anyway. ;)
Offline Profile Quote Post Goto Top
 
mystical-mongoose
Member Avatar
Eggy Toast
I dont think it matters if the siund chops uo when your rewinding though.
Offline Profile Quote Post Goto Top
 
mikepol
Member Avatar
Brackenwood Newbie
also you probably shouldn't place your sounds on the timeline byt have them event triggered
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Actionscript · Next Topic »
Add Reply