flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [04/14] git commit: [flex-asjs] [refs/heads/develop] - handle ioerror
Date Fri, 31 Oct 2014 22:08:39 GMT
handle ioerror


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/56727c56
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/56727c56
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/56727c56

Branch: refs/heads/develop
Commit: 56727c566e5fcf18afa7362d2930758893f93dcd
Parents: 06c2aff
Author: Alex Harui <aharui@apache.org>
Authored: Thu Oct 30 21:38:56 2014 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700

----------------------------------------------------------------------
 .../FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as  | 5 +++++
 .../FlexJSUI/src/org/apache/flex/html/beads/ImageView.as        | 5 +++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56727c56/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
index dcb3515..7210967 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
@@ -23,6 +23,7 @@ package org.apache.flex.html.beads
 	import flash.display.SimpleButton;
 	import flash.display.Sprite;
 	import flash.events.Event;
+    import flash.events.IOErrorEvent;
 	import flash.net.URLRequest;
 	
     import org.apache.flex.core.BeadViewBase;
@@ -103,6 +104,10 @@ package org.apache.flex.html.beads
 				sprite.addChildAt(loader, 0);
 				var url:String = backgroundImage as String;
 				loader.load(new URLRequest(url));
+                loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function
(e:IOErrorEvent):void {
+                    trace(e);
+                    e.preventDefault();
+                });
 				loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void
{ 
                     var host:UIButtonBase = UIButtonBase(_strand);
                     if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56727c56/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
index 86d5a07..c218006 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
@@ -21,6 +21,7 @@ package org.apache.flex.html.beads
 	import flash.display.Bitmap;
 	import flash.display.Loader;
 	import flash.display.LoaderInfo;
+    import flash.events.IOErrorEvent;
 	import flash.net.URLRequest;
 	
     import org.apache.flex.core.BeadViewBase;
@@ -87,6 +88,10 @@ package org.apache.flex.html.beads
 			if (_model.source) {
 				loader = new Loader();
 				loader.contentLoaderInfo.addEventListener("complete",onComplete);
+                loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function
(e:IOErrorEvent):void {
+                    trace(e);
+                    e.preventDefault();
+                });
 				loader.load(new URLRequest(_model.source));
 			}
 		}


Mime
View raw message