Imageをloadする際のErrorHandlingについて
<mx:Image id="main" horizontalCenter="0" verticalCenter="0" scaleContent="true" complete="complete(event);" ioError="ioError(event);" httpStatus="httpStatus(event);"
みたいな感じでImageをLoadingするとき。
- httpStatusハンドラ
- onLoadハンドラ
- ioErrorハンドラ
の順番でロードされるみたい
なので、httpStatusでmain.source = notFoundImage とかやってもその次のonLoadでデフォルトのBrokenImageに代替されちゃう。
なので、ioErrorハンドラでお好みのBrokenImageに変更する。
・・・と思ったけど、brokenImageSkin っていうStyleがあるからhttpStatusハンドラでmain.setStyle("brokenImageSkin", notFoundImage);みたいにすればいいんじゃん。