hey, Im new at flash, but I learn as2 :P
so my problem is that I want to spawn a ball to the middle of the screen, and want it to move with constant speed in random direction everytime its spawned. it sounds really easy, but I cant make it work...
current code Im using for the ball movement is
Code:
function setBehavior(Ball:MovieClip):Void
{
	var randomAction = random(2);
	switch (randomAction) { 
	case 0 : 
                Ball.xSpeed = Math.random(Ball.mySpeed)*Ball.mySpeed;
		break; 
	case 1 : 
		Ball.xSpeed = -(Math.random(Ball.mySpeed))*Ball.mySpeed;
		break; 
	default : 
		break; 
	} 
	
	var randomAction = random(2);
	
	switch (randomAction) { 
	case 0 : 
		Ball.ySpeed = Math.random(Ball.mySpeed)*Ball.mySpeed;
		break; 
	case 1 : 
		Ball.ySpeed = -(Math.random(Ball.mySpeed))*Ball.mySpeed;	
		break; 
	default : 

		break; 
	}
}
the direction is ok, its random, but its made with randoming speeds, so the speed of each ball is other :/ (even that I want just 1 ball, but it has to have same speed everytime its spawned there)
I bet that it has to be made with angles, not speeds, so it will have to be remade, found some tutorials already, but couldnt make anything really work.
hope you understand what i want, thanks in advance