Multiple reversing animations on one page

  • indium
  • Born
  • Born
  • indium
  • Posts: 4

Post 3+ Months Ago

Hi

I'm designing a web site which features multiple reversing animations, saved as movie clips; it can be seen at http://www.imadgination.com.au/test

I'm using Flash CS3 and Actionscript 2.

The animations work perfectly as long as one rolls into and out of each button area without touching any of its neighbours. As soon as one does that, the second button animation starts without simultaneously finishing or removing the first.

As you'll see from the link above, another problem I'm having is that the animations encroach on the other button areas once they start. I did try appropriately placed coloured squares in the movie clips to mask the other button areas, but with no success - they're treated as 'hot spots' by the browser to activate the animation, which I don't want.

What I'm aiming for are four buttons, with the reversing animation, that don't interfere with one another in the way they do currently. I'm happy for an animation to be completely removed when another button is rolled over, but I want to avoid animations running over the top of other buttons.

I hope I've explained myself well enough! The code I've been using, for which I have coldminer, a poster at Flash Kit, to thank for, follows. It's attached to Frame 1 of the movie.

var loopInterval:Number;
var animateSpeed:Number = 40; // 1000 = 1 sec
//
hexapro_anim.onRelease = function()
{ _root.gotoAndStop(30);
};
hexapro_anim.onRollOver = function() {
startInterval(this, "forward");
};
hexapro_anim.onRollOut = hexapro_anim.onDragOut=function () { startInterval(this, "back");
};
function startInterval(who:MovieClip, how:String) {
clearInterval(loopInterval);
loopInterval = setInterval(loopMe, animateSpeed, who, how);
}
function loopMe(who:MovieClip, how:String) {
if (how == "back") {
who.gotoAndStop(who._currentframe-1);
if (who._currentframe<=1) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(who._totalframes);
}
} else {
who.gotoAndStop(who._currentframe+1);
if (who._currentframe>=who._totalframes) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(1);
}
}
updateAfterEvent();
}
//
hexapro_2.onRelease = function()
{ _root.gotoAndStop(30);
};
hexapro_2.onRollOver = function() {
startInterval(this, "forward");
};
hexapro_2.onRollOut = hexapro_2.onDragOut=function () { startInterval(this, "back");
};
function startInterval(who:MovieClip, how:String) {
clearInterval(loopInterval);
loopInterval = setInterval(loopMe, animateSpeed, who, how);
}
function loopMe(who:MovieClip, how:String) {
if (how == "back") {
who.gotoAndStop(who._currentframe-1);
if (who._currentframe<=1) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(who._totalframes);
}
} else {
who.gotoAndStop(who._currentframe+1);
if (who._currentframe>=who._totalframes) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(1);
}
}
updateAfterEvent();
}
//
hexapro_3.onRelease = function()
{ _root.gotoAndStop(30);
};
hexapro_3.onRollOver = function() {
startInterval(this, "forward");
};
hexapro_3.onRollOut = hexapro_3.onDragOut=function () { startInterval(this, "back");
};
function startInterval(who:MovieClip, how:String) {
clearInterval(loopInterval);
loopInterval = setInterval(loopMe, animateSpeed, who, how);
}
function loopMe(who:MovieClip, how:String) {
if (how == "back") {
who.gotoAndStop(who._currentframe-1);
if (who._currentframe<=1) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(who._totalframes);
}
} else {
who.gotoAndStop(who._currentframe+1);
if (who._currentframe>=who._totalframes) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(1);
}
}
updateAfterEvent();
}
//
hexapro_4.onRelease = function()
{ _root.gotoAndStop(30);
};
hexapro_4.onRollOver = function() {
startInterval(this, "forward");
};
hexapro_4.onRollOut = hexapro_4.onDragOut=function () { startInterval(this, "back");
};
function startInterval(who:MovieClip, how:String) {
clearInterval(loopInterval);
loopInterval = setInterval(loopMe, animateSpeed, who, how);
}
function loopMe(who:MovieClip, how:String) {
if (how == "back") {
who.gotoAndStop(who._currentframe-1);
if (who._currentframe<=1) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(who._totalframes);
}
} else {
who.gotoAndStop(who._currentframe+1);
if (who._currentframe>=who._totalframes) {
clearInterval(loopInterval);
//or loop the animation:
//who.gotoAndStop(1);
}
}
updateAfterEvent();
}

Any help would be greatly appreciated. I'm an ActionScript newbie, so please be gentle with me!

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • indium
  • Born
  • Born
  • indium
  • Posts: 4

Post 3+ Months Ago

Hi

Thank you to everyone who took a look at this post.

Just a note to say that this issue is now resolved.

Thanks again.
  • darsh999
  • Newbie
  • Newbie
  • darsh999
  • Posts: 8

Post 3+ Months Ago

caught you this is the main problem man it should be (who.gotoAndPlay(who.currentframe+1) inspite of who.gotoAndStop(who._currentframe+1);

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.