From dd613b463ace87355f4b11fa5e05920d73b088e4 Mon Sep 17 00:00:00 2001 From: shmyga Date: Wed, 29 Apr 2015 17:26:02 +0300 Subject: [PATCH] [ImageView] added imageUrl field --- haxework/gui/ImageView.hx | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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