I think i solved it, i post the code if anyone need this

.

First the code separated into two functions:

-The first function (createSmallBullet) is the function that create the bullet

-The second function is an auxiliar to obtain the angle between two points (Our main ship and the bullet)

public function createSmallBullet(levelContainerP:Sprite,bulletsEnemy:Array,mainShip:MainShip,positionX:Number,positionY:Number,bulletSpeed:Number)

{

var bulletToCreate:EnemySmallBullet= new EnemySmallBullet();

bulletToCreate.x=this.x+positionX;

bulletToCreate.y=this.y+positionY;

bulletToCreate.gotoAndStop(1);

var angle:Number;

var dirX:Number;

var dirY:Number;

angle=getAngle(mainShip,bulletToCreate);

dirX = Math.cos(angle*Math.PI/180)*bulletSpeed;

dirY = Math.sin(angle*Math.PI/180)*bulletSpeed;

bulletToCreate.setSpeed(dirX,dirY);

levelContainerP.addChild(bulletToCreate);

bulletsEnemy.push(bulletToCreate);

}

create small bullet expects:

-levelContainer an place to add the child (movieclip)

-bulletsEnemy a list to manage the bullet after the creation

-mainShip the main ship

-position x and y if the bullet is not created in the 0,0 of the enemy movieclip

first we create our bullet with x and y, then we make it stop in 1 (this is used when the bullet have an explode animation)

we get the angle (explained later)

the dirX,dirY use trigonometry to know where to go when is created based on the angle obtained (well explained in Emanuele Feronato site).

the setSpeed is just two Numbers to increment each step in the game loop, we pass the directions obtained before.

something like:

(in the game loop)

x+=speedX;

y+=speedY;

finally we add the child and put it in an array, to handle it and destroy it when it's not longer needed.

public function getAngle(mainShip:MainShip,bullet:EnemySmallBullet):Number

{

var angle:Number;

var shipPositionX:Number;

var shipPositionY:Number;

shipPositionX = (mainShip.x+mainShip.OFFSET_COLLISION_X)-bullet.x;

shipPositionY = ((mainShip.y+mainShip.OFFSET_COLLISION_Y)-bullet.y)*-1;

angle = Math.atan(shipPositionY/shipPositionX)/(Math.PI/180);

if (shipPositionX<0) {

angle += 180;

}

if (shipPositionX>=0 && shipPositionY<0) {

angle += 360;

}

angle = angle *-1

return angle;

}

Ok, here it's the function to get the angle.

shipPositionX is used to determinate the space between the main ship and the enemy bullet.

the same with the y.

the OFFSET_COLLISION_X is used because i have an rectangle movieclip to check the collision and because this movieclip itīs not in the origin 0,0, i added the offset to the x and y of the main ship.

get the angle explained here:

http://www.emanueleferonato.com/2007/02/17/create-a-flash-draw-game-like-line-rider-or-others-part-3/and the angle * -1 rotate the bullet according to the angle.

The code is based on emanuele feronato tutorial to "Create a flash artillery game"

http://www.emanueleferonato.com/2007/04/28/create-a-flash-artillery-game-step-1/Hope it helps

.