Permalink
Browse files

fixing null errors in SetProperty

  • Loading branch information...
benstucki committed Oct 19, 2010
1 parent e18c8ac commit e96725c7f4f7bc6f76ade92cb30fcbe0183d0d08
Showing with 12 additions and 5 deletions.
  1. +9 −3 src/mx/states/SetProperty.as
  2. +3 −2 src/reflex/graphics/BitmapImage.as
@@ -16,12 +16,18 @@ package mx.states
}
public function apply(parent:Object):void {
- oldValue = parent[target][name];
- parent[target][name] = value;
+ if(parent == null || target == null) { return; }
+ var item:Object = parent[target];
+ if(item == null) { return; }
+ oldValue = item[name];
+ item[name] = value;
}
public function remove(parent:Object):void {
- parent[target][name] = oldValue;
+ if(parent == null || target == null) { return; }
+ var item:Object = parent[target];
+ if(item == null) { return; }
+ item[name] = oldValue;
oldValue = null;
}
@@ -6,10 +6,11 @@ package reflex.graphics
import flash.events.Event;
import flash.geom.Matrix;
import flash.net.URLRequest;
+ import flash.system.LoaderContext;
import reflex.binding.DataChange;
- import reflex.metadata.resolveCommitProperties;
import reflex.display.BitmapDisplay;
+ import reflex.metadata.resolveCommitProperties;
[Style(name="left")]
[Style(name="right")]
@@ -75,7 +76,7 @@ package reflex.graphics
if (source is String) {
var request:URLRequest = new URLRequest(source as String);
loader = new Loader();
- loader.load(request);
+ loader.load(request, new LoaderContext(true));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
} else if (source is Class) {
var display:Bitmap = new (source as Class)();

0 comments on commit e96725c

Please sign in to comment.