![](/img/trans.png)
[英]Flash AS3 text=Error #2124: Loaded file is an unknown type when importing XML?
[英]display image using byteArray failed (Unhandled IOErrorEvent:. text=Error #2124:Loaded file is an unknown type)
問題:將byteArray用作source
時,無法顯示jpeg圖像。
假設有一個名為“ card”的現有圖像。 <Image id="card"/>
。 這是場景:
1.獲取bitmapData: var bitmapData:BitmapData = Bitmap(card.content).bitmapData
2.get byteArray: var pixels:ByteArray = bitmapData.getPixels(bitmapData.rect)
3.將byteArray附加到新的Image: var another:Image = new Image(); another.source = pixels.
var another:Image = new Image(); another.source = pixels.
(我也嘗試使用另一種方法,但仍然無法正常工作: var loader:Loader = new Loader(); loader.loader(pixels);
) loader.loader(pixels)將引發錯誤! * 錯誤是“未處理的IOErrorEvent :。 text = Error#2124”:加載的文件是未知類型 *
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.