Permalink
Browse files

fix image flickering

  • Loading branch information...
1 parent a656eb9 commit 7ed23ed795bef08308360594c43da6ef57d56312 Lee Byron committed May 23, 2009
View
@@ -62,7 +62,6 @@ package fb.util {
case 3: return n + 'rd';
default: return n + 'th';
}
- //return n + 'th';
}
}
}
View
@@ -104,7 +104,7 @@ package fb.util {
var i:Number = -1;
var x:Number, y:Number;
- while(++i < input.length) {
+ while (++i < input.length) {
// Decode utf-16 surrogate pairs
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
View
@@ -87,7 +87,7 @@
nativeWindow.y = windowData.y;
nativeWindow.height = windowData.height;
}
-
+
// Trigger the load of anything else preferences wise
ProfileCache.opening();
@@ -22,7 +22,7 @@
<util:LinkImage id="linkImage"
styleName="mediaImage"
- source="{StringUtil.extractURL(data.src)}"
+ source="{imgSrc}"
url="{data.href}"
maxWidth="{maxImageWidth}"
maxHeight="{maxImageHeight}" />
@@ -55,12 +55,14 @@
[Bindable] public var maxImageHeight:Number;
[Bindable] private var showPhotoFrame:Boolean = false;
[Bindable] private var showVideoBadge:Boolean = false;
+ [Bindable] private var imgSrc:String;
override public function set data(new_data:Object):void {
super.data = new_data;
showPhotoFrame = (data.type == PhotoType);
showVideoBadge = (data.type == VideoType);
+ imgSrc = StringUtil.extractURL(data.src);
}
public function recycle():void {
@@ -69,6 +69,7 @@ package fbair.util.display {
if (text == focusOutText) text = "";
stage.addEventListener(MouseEvent.MOUSE_UP, prepareUp, true);
}
+
private function prepareUp(event:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_UP, prepareUp, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, stageDown, true);
@@ -52,7 +52,7 @@ package fbair.util.display {
}
private function statusChanged(event:StatusEvent):void {
- Output.error("Image Status changed: " + urlMonitor.available +
+ Output.error("Image Status changed: " + urlMonitor.available +
" for source: " + origSource);
if (urlMonitor.available) reload();
}
@@ -63,13 +63,11 @@ package fbair.util.display {
}
override public function set source(new_source:Object):void {
- Output.log("Image Setting source: " + new_source);
if (new_source.constructor == Class) {
Output.error("Image re-setting source to crap: " + new_source
+ " from " + source);
- super.source = '';
- }
- else {
+ super.source = null;
+ } else {
if (urlMonitor) urlMonitor.stop();
urlMonitor = new URLMonitor(new URLRequest(String(new_source)));
urlMonitor.addEventListener(StatusEvent.STATUS, statusChanged);

0 comments on commit 7ed23ed

Please sign in to comment.