ex:
max = 150
min = 140
só tem 10 de diferença como q eu faço.
to fazendo assim:
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.MouseEvent;
import fl.transitions.Tween;
import fl.transitions.easing.None;
import flash.geom.Rectangle;
var power:int = 0;
var distancia:int = 0;
// Mecher Taco
var verif:Timer = new Timer(0,1);
var volta:Tween;
var area:int = 225 - 175;
verif.addEventListener(TimerEvent.TIMER, verifica);
stage.addEventListener(MouseEvent.MOUSE_DOWN, clica);
function clica(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_DOWN, clica);
stage.addEventListener(MouseEvent.MOUSE_MOVE, meche);
stage.addEventListener(MouseEvent.MOUSE_UP, solta);
}
function verifica(e:TimerEvent):void {
taco_linha.taco.startDrag(false, new Rectangle(-225, 0 , 75,0));
}
function meche(e:MouseEvent):void {
stage.addEventListener(MouseEvent.MOUSE_UP, solta);
verif.start();
}
function solta(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE, meche);
stage.removeEventListener(MouseEvent.MOUSE_UP, solta);
stage.addEventListener(MouseEvent.MOUSE_DOWN, clica);
verif.stop();
// calculando força
power = area - ( area - (taco_linha.taco.x / 3) );
taco_linha.taco.stopDrag();
volta = new Tween(taco_linha.taco, "x", None.easeNone, 0, -175, 1, true);
taco_linha.taco.x = 175,20;
}
// Colisão
var colisao:Boolean = false;
var testColi:Timer = new Timer(1);
var anima:Tween;
testColi.addEventListener(TimerEvent.TIMER, testeColisao);
testColi.start();
function testeColisao(e:TimerEvent):void {
if (taco_linha.taco.hitTestObject(branca)){
distancia = power;
colisao = true;
}
if (colisao == true) {
trace ( distancia);
anima = new Tween(branca, "x", None.easeOut, branca.x, (taco_linha.linha.x + distancia), 12, false);
colisao = false;
}
}
pf onde estou errando, me ajudem ja tentei de tudo mas n da
OBS: ja tentei colocar pra q cada pos~ção tenha uma força determinada mas da erro.
Obrigado desde já.

Help














