0
所以在一張幻燈片上有這兩個頭(dragRec),每個頭都有一個正常狀態,翻轉和拖動。端點在顯示相對位置的拖動上打印到文本框,閾值設置爲顯示滑塊左端和端點之間的百分比。當你拖動Endpoint時,它的文本更新,但是當移動閾值時,不會顯示任何文本。有任何想法嗎?謝謝。不更新文本框
var textTimer:Timer = new Timer (10);
textTimer.addEventListener(TimerEvent.TIMER,textUpdate);
textTimer.start();
var textTimer2:Timer = new Timer (10);
textTimer2.addEventListener(TimerEvent.TIMER,threshUpdate);
textTimer2.start();
function endDrag (event:MouseEvent):void
{
endpoint.gotoAndStop("2");
endpoint.removeEventListener(MouseEvent.MOUSE_OVER, endOver);
endpoint.removeEventListener(MouseEvent.MOUSE_OUT, endOut);
endpoint.startDrag(false,dragRec);
endpoint.endText.addEventListener(FocusEvent.FOCUS_IN,typeit);
}
function textUpdate2(event:FocusEvent):void
{
endpoint.x = (354+(10.9*((Number(endpoint.endText.text)-19.5))));
textTimer.start();
}
function textUpdate(event:TimerEvent):void
{
position = Math.round(19.5-((354-endpoint.x)/10.9));
endpoint.endText.text = position;
}
function endStopDrag (event:MouseEvent):void
{
//endpoint.gotoAndStop("1");
endpoint.stopDrag();
}
function threshDrag (event:MouseEvent):void
{
threshmc.gotoAndStop("2");
threshmc.startDrag(false,threshRec);
threshmc.threshp.addEventListener(FocusEvent.FOCUS_IN,threshtypeit);
}
function threshStopDrag (event:MouseEvent):void
{
threshmc.stopDrag();
}
function threshUpdate2(event:FocusEvent):void
{
if(Number(threshmc.threshp.text) < 1)
{
threshmc.threshp.text = 1;
}
threshmc.x = (141.45+(((-141.45+endpoint.x)*(Number(threshmc.threshp.text)))/100));
textTimer2.start();
}
function threshUpdate(event:TimerEvent):void
{
tposition = Math.round(((19.5-((354-threshmc.x)/10.9))/(19.5-((354-endpoint.x)/10.9)))*100);
threshmc.threshTip.tpercent.text = tposition;
}
這是相當的文字牆,你爲什麼不張貼[濃縮示例](http://sscce.org/)顯示你的問題? – 2012-03-22 18:37:11
這是濃縮的,因爲我認爲我可以做到。 – user1286697 2012-03-22 19:50:00
threshmc.threshp.text的初始值是什麼?它必須有一個可以根據threshUpdate2函數轉換爲Number的值 – diegoe 2012-03-22 20:18:30