[問題] load進來的圖片大小

看板Flash作者 (兔子)時間13年前 (2011/11/29 13:40), 編輯推噓4(405)
留言9則, 4人參與, 最新討論串1/4 (看更多)
我做了一個空的元件 然後在元件的影格中LOAD圖片 這樣子就可以在場景中無動態的使用這個圖片元件 但是現在有點頭痛的就是 這個元件的長與寬並不會因為LOAD圖片而改變 所以如果我想要抓這圖片的長與寬 應該要怎麼做呢? var _bgtime:Loader = new Loader(); trace(_bgtime.x+"/"); // 是0 fileT=".\\d********n\\"+"d****e.png"; _bgtime.load(new URLRequest(fileT)); trace(_bgtime.x+"//"); // 還是0 -- ◤ __ \__◢◤◢◤ ψhirabbitt ◤ ◢███◣ ◢███◣ 我摸不到妳 █████ █████ 妳摸不到我 ██ ███ ██╱╲ ●◥█████◣●╱╱ ● ◥████ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.13.251.83 ※ 編輯: hirabbitt 來自: 163.13.251.83 (11/29 14:10)

11/29 14:22, , 1F
Loader.contentLoaderInfo.width
11/29 14:22, 1F

11/29 19:26, , 2F
WOW 太棒了
11/29 19:26, 2F

11/30 10:20, , 3F
唔...可是我改不了它的大小 可以再請教一下嗎?
11/30 10:20, 3F

11/30 10:45, , 4F
Loader.content.width
11/30 10:45, 4F

11/30 11:21, , 5F
x 是座標耶
11/30 11:21, 5F

11/30 12:42, , 6F
XDDD 真的耶 寫程式寫到瘋了
11/30 12:42, 6F
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,function(E:Event):void{ trace("today test"); trace(ldr.contentLoaderInfo.width); }); /* 輸出: today test Error: Error #2099: 正在載入的物件載入不充分,不足以提供此資訊。。 at flash.display::LoaderInfo/get width() at MethodInfo-721() */ 為什麼呢 我都已經用Event.COMPLETE了... ※ 編輯: hirabbitt 來自: 125.226.143.191 (12/01 14:01)

12/01 17:49, , 7F
我猜是ldr 等等我試驗一下@@
12/01 17:49, 7F

12/01 20:01, , 8F
ldr怎麼了 不太懂@@
12/01 20:01, 8F

12/01 20:01, , 9F
喔 看到您的堆文了 感謝
12/01 20:01, 9F
文章代碼(AID): #1Er70_e5 (Flash)
文章代碼(AID): #1Er70_e5 (Flash)