Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Fri Jan 09, 2009 4:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: movieClips act weird when they touch eachother
PostPosted: Mon Oct 09, 2006 9:52 pm 
Offline

Joined: Mon Oct 09, 2006 9:49 pm
Posts: 0
Location: Madison, WI
As a motion graphic artist who's been working with keyframes forever, it's really blowing my mind that you can create cool animation with just code. Being new to this concept, I can't figure out how to get this to happen:

onRelease, movieClip1 (where ever it happens to be at the time of click) travels to x=150, y=60 of the stage. And the other movieClips--movieClip2, movieClip3, movieClip4, and movieClip5 move to the left side of the stage, x=75 y=200, 250, 300, and 350 respectively.

And of course, I want the same to happen to the other movieClips--when you click on them they go to x=150, y=60 and the others go off to the side.

I have some ActionScript that works on the first click of any movieClip, but if you click any movieClip after that, all the movieClips gravitate to eachother. The more you click the closer they get, until they're all overlapping and jittering around a little.

I,m new at all this, and I need help. Thanks.
Here's the code:

var startX2 =_root.ball2._x
var startY2 =_root.ball2._y
var startX1 =_root.ball1._x
var startY1 =_root.ball1._y
var startX3 =_root.ball3._x
var startY3 =_root.ball3._y
var startX4 =_root.ball4._x
var startY4 =_root.ball4._y
var startX5 =_root.ball5._x
var startY5 =_root.ball5._y
var endX1 = 75
var endY1 = 200
var endX2 = 150
var endY2 = 250
var endY3 = 300
var endY4 = 350
var endY5 = 400
var endY6 = 60

var speed = 10
ball2._x = startX2
ball2._y = startY2
ball1._x = startX1
ball1._y = startY1
ball3._x = startX3
ball3._y = startY3
ball4._x = startX4
ball4._y = startY4
ball5._x = startX5
ball5._y = startY5
function moveMe2(targ){
targ._x+=(_root.endX1-targ._x)/_root.speed;
targ._y+=(_root.endY1-targ._y)/_root.speed
}
function moveMe1(targ){
targ._x+=(_root.endX2-targ._x)/_root.speed;
targ._y+=(_root.endY6-targ._y)/_root.speed
}
function moveMe3(targ){
targ._x+=(_root.endX1-targ._x)/_root.speed;
targ._y+=(_root.endY2-targ._y)/_root.speed
}
function moveMe4(targ){
targ._x+=(_root.endX1-targ._x)/_root.speed;
targ._y+=(_root.endY3-targ._y)/_root.speed
}
function moveMe5(targ){
targ._x+=(_root.endX1-targ._x)/_root.speed;
targ._y+=(_root.endY4-targ._y)/_root.speed
}

stop();


ball1.onRollOver = function () {
this.reverser_mc.gotoAndStop(1);
this.play(1);
}

ball1.onRollOut = function () {
this.reverser_mc.gotoAndPlay(2);
}

ball1.onPress = function () {
this.gotoAndStop(15);
}

ball1.onRelease = function () {
this.gotoAndStop(1);
}
ball1.onRelease = function () {
setInterval(moveMe1,30,_root.ball1);
setInterval(moveMe2,30,_root.ball2);
setInterval(moveMe3,30,_root.ball3);
setInterval(moveMe4,30,_root.ball4);
setInterval(moveMe5,30,_root.ball5);
}

ball2.onRollOver = function () {
this.reverser_mc.gotoAndStop(1);
this.play(1);
}

ball2.onRollOut = function () {
this.reverser_mc.gotoAndPlay(2);
}

ball2.onPress = function () {
this.gotoAndStop(15);
}

ball2.onRelease = function () {
setInterval(moveMe1,30,_root.ball2);
setInterval(moveMe2,30,_root.ball3);
setInterval(moveMe3,30,_root.ball4);
setInterval(moveMe4,30,_root.ball5);
setInterval(moveMe5,30,_root.ball1);
}


ball3.onRollOver = function () {
this.reverser_mc.gotoAndStop(1);
this.play(1);
}

ball3.onRollOut = function () {
this.reverser_mc.gotoAndPlay(2);
}

ball3.onPress = function () {
this.gotoAndStop(15);
}

ball3.onRelease = function () {
setInterval(moveMe1,30,_root.ball3);
setInterval(moveMe2,30,_root.ball4);
setInterval(moveMe3,30,_root.ball5);
setInterval(moveMe4,30,_root.ball1);
setInterval(moveMe5,30,_root.ball2);
}


ball4.onRollOver = function () {
this.reverser_mc.gotoAndStop(1);
this.play(1);
}

ball4.onRollOut = function () {
this.reverser_mc.gotoAndPlay(2);
}

ball4.onPress = function () {
this.gotoAndStop(15);
}

ball4.onRelease = function () {
setInterval(moveMe1,30,_root.ball4);
setInterval(moveMe2,30,_root.ball5);
setInterval(moveMe3,30,_root.ball1);
setInterval(moveMe4,30,_root.ball2);
setInterval(moveMe5,30,_root.ball3);
}


ball5.onRollOver = function () {
this.reverser_mc.gotoAndStop(1);
this.play(1);
}

ball5.onRollOut = function () {
this.reverser_mc.gotoAndPlay(2);
}

ball5.onPress = function () {
this.gotoAndStop(15);
}

ball5.onRelease = function () {
setInterval(moveMe1,30,_root.ball5);
setInterval(moveMe2,30,_root.ball1);
setInterval(moveMe3,30,_root.ball2);
setInterval(moveMe4,30,_root.ball3);
setInterval(moveMe5,30,_root.ball4);
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User:
Pass:
Log me on automatically each visit: