Re: [問題] 動態movieclip是否可以被點選
不好意思呀~描述地不清楚,原始碼如附:
import flash.display.BitmapData;
import mx.transitions.Tween;
loader = new MovieClipLoader()
loader.addListener(this)
var themaxnum=30;//設定可抓取的圖片數量
var theupone:Number=0;
for(var theupone=0;theupone<themaxnum;theupone++){
this.createEmptyMovieClip("myClip" + theupone,this.getNextHighestDepth());
loader.loadClip("http://www.hfu.edu.tw/~hsuaya/"+theupone+".jpg",this["myClip"+theupone])
this["myClip"+theupone]._x=(theupone-1)*5;//有功能
this["myClip"+theupone]._y=5;//有功能
this["myClip"+theupone].height=theupone*10;//沒有功能
this["myClip"+theupone].onPress=CallAndDo;//沒有功能
}
function CallAndDo(){
var thenoe:Number=this._name.substr(-1,1);
if(theone<>theupone){
this.swapDepths(this["myClip"+theupone]);
theupone=theone;
}
var myTween:Tween = new Tween(this, "_x", mx.transitions.easing.Elastic.easeOut, this._x,
this._x+250, 2, true);
}
所以我想要請教的是,沒有功能的地方,是這樣的用法寫錯?還是有什麼解決的辦法
謝謝解答!感激~~
(以上應該複製貼上後,就可以執行)
※ 引述《rainpo17 (貼)》之銘言:
: 我用createEmptyMovieClip建立數個mc
: 然後用loader入jpg檔案,並在stage顯示得出來
: 但是我使用this["myClip"+i].onPress=DoSth做為點選的function
: 可是都沒有反應.....請問不能這樣使用嗎?
: 亦或,其實動態建立的mc沒有可以被點選的範圍?請問要怎麼解決
: 另外,我只能控制其圖片的._x,._y,._rotation這些數值
: 其它的屬性如.width, .height等就不能控制耶..
: 請問該怎麼解決?(會不會跟上一個點選範為的問題一樣)
: 麻煩各位幫忙解惑,感激不盡啊!
※ 引述《rainpo17 (貼)》之銘言:
: 我用createEmptyMovieClip建立數個mc
: 然後用loader入jpg檔案,並在stage顯示得出來
: 但是我使用this["myClip"+i].onPress=DoSth做為點選的function
: 可是都沒有反應.....請問不能這樣使用嗎?
: 亦或,其實動態建立的mc沒有可以被點選的範圍?請問要怎麼解決
: 另外,我只能控制其圖片的._x,._y,._rotation這些數值
: 其它的屬性如.width, .height等就不能控制耶..
: 請問該怎麼解決?(會不會跟上一個點選範為的問題一樣)
: 麻煩各位幫忙解惑,感激不盡啊!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.59.123.53
※ 編輯: rainpo17 來自: 210.59.123.53 (04/02 08:58)
推
04/02 13:53, , 1F
04/02 13:53, 1F
→
04/02 13:54, , 2F
04/02 13:54, 2F
→
04/02 13:54, , 3F
04/02 13:54, 3F
→
04/02 15:21, , 4F
04/02 15:21, 4F
→
04/02 15:57, , 5F
04/02 15:57, 5F
→
04/02 16:36, , 6F
04/02 16:36, 6F
→
04/02 16:37, , 7F
04/02 16:37, 7F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):