At 11/28/09 01:10 PM, milchreis wrote:
Is there an error or is just nothing happening?
nope..
this is the code:
stage.addEventListener(KeyboardEvent.KEY _DOWN, myKeyDown);
function myKeyDown(e:KeyboardEvent):void{
if (e.keyCode == 65){
s4.gotoAndStop(2);
}
}
btw:
i tried to make somethign from as2 to as3 and it worked but it wend diffrant..i made a line thet conect to 2 dots,i\and its conecting to them but his(the line) size is biger then the distance between the dots..
here is the code:
dot 1 = Spike
dot 2 = hand
line = line
----code:---------
addEventListener(Event.ENTER_FRAME, Statch);
function Statch(event:Event):void {
line.x = (Spike.x+hand.x)/2;
line.y = (Spike.y+hand.y)/2;
line.scaleX = Math.sqrt(Math.pow(Spike.x-hand.x, 2)+Math.pow(Spike.y-hand.y, 2))/4;
line.rotation = Math.atan((hand.y-Spike.y)/(hand.x-Spike .x))*180/Math.PI;
}
////EndCode.....