Hello everyone, first off, Just want to say how great of a site this is. I have started teaching myself Flash and AS over the past couple months and this site has been a huge resource to learn alot of this often confusing stuff, lol.
Anyway, I have been working on a completely flash based site, and I am running into some issues with rotating different objects on the stage. I have managed the major navigation part using motion tweens and gotoAndPlay commands, but now I am trying to rotate an image of a gear when I click on a link in the navigation wheel. I am also trying to condense my actionscript for my navigation wheel, if possible, by revamping the way it animates, but I have no idea where to start with the AS. I have searched all over the net and havent been able to find anything that works.
Here is a link to the hosted .swf if you would like to take a look at how the site will basically function: http://www.unsaidband.com/bigthumb/flashrotator.swf
What I am trying to do is to have the gear that is on the left side of the navigation links rotate when I click on one of the links, but when the main wheel reaches its destination and stops rotating, I want the smaller gear to stop rotating as well. Here is all of the actionscript I used on the beginning, including the easing and everything.
The rotation of the main wheel is done with tweens, and I have onEnterFrame handlers placed on the frames I want the animation to stop on with variables to control them.
[URL="http://www.unsaidband.com/bigthumb/flashrotator.swf"]stop();
_root.currMovie = "newsScroll";
container.loadMovie(_root.currMovie+".swf");
// Easing function
var d = 0;
var amount = 4;
MovieClip.prototype.easeIn = function(tarX) {
this.onEnterFrame = function() {
this._x = tarX-(tarX-this._x)/1.2;
if (Math.abs(this._x-tarX)<1) {
nextMc();
delete this.onEnterFrame;
}
};
};
function nextMc() {
if (d<amount) {
d++;
this["mc"+d].easeIn(450);
}
}
nextMc();
//end easing function
//begin gotoAndPlay functions for animation
var optionValue:Number = 1
var optionValueTwo:Number = 1
newsShading.onRelease = function(){
if(optionValue == 2){
gotoAndPlay(220)
closeDoor.easeIn(130)
}
else if(optionValue == 3){
gotoAndPlay(200)
closeDoor.easeIn(130)
}
else if(optionValue == 4){
gotoAndPlay(180)
closeDoor.easeIn(130)
}
else if(optionValue == 5){
gotoAndPlay(160)
closeDoor.easeIn(130)
}
else if(optionValue == 6){
gotoAndPlay(140)
closeDoor.easeIn(130)
}
else if(optionValue == 7){
gotoAndPlay(120)
closeDoor.easeIn(130)
}
else(null)
optionValue = 1
}
artistsShading.onRelease = function(){
if(optionValue == 1){
gotoAndPlay(1)
closeDoor.easeIn(130)
}
else if(optionValue == 3){
gotoAndPlay(200)
closeDoor.easeIn(130)
}
else if(optionValue == 4){
gotoAndPlay(180)
closeDoor.easeIn(130)
}
else if(optionValue == 5){
gotoAndPlay(160)
closeDoor.easeIn(130)
}
else if(optionValue == 6){
gotoAndPlay(140)
closeDoor.easeIn(130)
}
else if(optionValue == 7){
gotoAndPlay(120)
closeDoor.easeIn(130)
}
else(null)
optionValue = 2
}
tourShading.onRelease = function(){
if(optionValue == 1){
gotoAndPlay(1)
closeDoor.easeIn(130)
}
if(optionValue == 2){
gotoAndPlay(20)
closeDoor.easeIn(130)
}
else if(optionValue == 4){
gotoAndPlay(180)
closeDoor.easeIn(130)
}
else if(optionValue == 5){
gotoAndPlay(160)
closeDoor.easeIn(130)
}
else if(optionValue == 6){
gotoAndPlay(140)
closeDoor.easeIn(130)
}
else if(optionValue == 7){
gotoAndPlay(120)
closeDoor.easeIn(130)
}
else(null)
optionValue = 3
}
aboutShading.onRelease = function(){
if(optionValue == 1){
gotoAndPlay(1)
closeDoor.easeIn(130)
}
if(optionValue == 2){
gotoAndPlay(20)
closeDoor.easeIn(130)
}
if(optionValue == 3){
gotoAndPlay(40)
closeDoor.easeIn(130)
}
else if(optionValue == 5){
gotoAndPlay(160)
closeDoor.easeIn(130)
}
else if(optionValue == 6){
gotoAndPlay(140)
closeDoor.easeIn(130)
}
else if(optionValue == 7){
gotoAndPlay(120)
closeDoor.easeIn(130)
}
else(null)
optionValue = 4
}
mediaShading.onRelease = function(){
if(optionValue == 1){
gotoAndPlay(1)
closeDoor.easeIn(130)
}
if(optionValue == 2){
gotoAndPlay(20)
closeDoor.easeIn(130)
}
if(optionValue == 3){
gotoAndPlay(40)
closeDoor.easeIn(130)
}
if(optionValue == 4){
gotoAndPlay(60)
closeDoor.easeIn(130)
}
else if(optionValue == 6){
gotoAndPlay(140)
closeDoor.easeIn(130)
}
else if(optionValue == 7){
gotoAndPlay(120)
closeDoor.easeIn(130)
}
else(null)
optionValue = 5
}
shopShading.onRelease = function() {
if(optionValue == 1){
gotoAndPlay(1)
closeDoor.easeIn(130)
}
if(optionValue == 2){
gotoAndPlay(20)
closeDoor.easeIn(130)
}
if(optionValue == 3){
gotoAndPlay(40)
closeDoor.easeIn(130)
}
if(optionValue == 4){
gotoAndPlay(60)
closeDoor.easeIn(130)
}
if(optionValue == 5){
gotoAndPlay(80)
closeDoor.easeIn(130)
}
else if(optionValue == 7){
gotoAndPlay(120)
closeDoor.easeIn(130)
}
else(null)
optionValue = 6
}
linksShading.onRelease = function() {
if(optionValue == 1){
gotoAndPlay(1)
closeDoor.easeIn(130)
}
if(optionValue == 2){
gotoAndPlay(20)
closeDoor.easeIn(130)
}
if(optionValue == 3){
gotoAndPlay(40)
closeDoor.easeIn(130)
}
if(optionValue == 4){
gotoAndPlay(60)
closeDoor.easeIn(130)
}
if(optionValue == 6){
gotoAndPlay(100)
closeDoor.easeIn(130)
}
else(null)
optionValue = 7
}
Any help anyone could give would be amazing, as I have been beating my skull on this for about 8 hours straight now…and getting almost nowhere. It also doesnt help that I havent had any formal training whatsoever, but whatever, I’m still learning this stuff pretty fast I think.