diff --git a/haxework/gui/ImageView.hx b/haxework/gui/ImageView.hx index baf9642..d66e626 100755 --- a/haxework/gui/ImageView.hx +++ b/haxework/gui/ImageView.hx @@ -1,5 +1,6 @@ package haxework.gui; +import haxework.net.ImageLoader; import haxework.gui.utils.DrawUtil.FillType; import haxework.gui.skin.BitmapSkin; import haxework.gui.skin.ButtonBitmapSkin; @@ -8,6 +9,7 @@ import flash.display.BitmapData; class ImageView extends SpriteView { public var image(default, set):BitmapData; + public var imageUrl(default, set):String; public function new() { super(); @@ -21,4 +23,14 @@ class ImageView extends SpriteView { } return image; } + + private function set_imageUrl(value:String):String { + if (imageUrl != value) { + imageUrl = value; + new ImageLoader().GET(imageUrl).success(function(data) { + image = data; + }); + } + return imageUrl; + } } \ No newline at end of file