r7507 - dumbhippo/trunk/server/web/flash



Author: marinaz
Date: 2008-09-15 11:15:39 -0500 (Mon, 15 Sep 2008)
New Revision: 7507

Modified:
   dumbhippo/trunk/server/web/flash/hippo.as
   dumbhippo/trunk/server/web/flash/nowPlaying.as
   dumbhippo/trunk/server/web/flash/nowPlaying.swf
   dumbhippo/trunk/server/web/flash/userSummary.as
   dumbhippo/trunk/server/web/flash/userSummary.swf
Log:
Add linkUrl to the loadImage function to have the link be opened when the image is clicked.

Use that for making icons in the online accounts ribbon clickable.

Modified: dumbhippo/trunk/server/web/flash/hippo.as
===================================================================
--- dumbhippo/trunk/server/web/flash/hippo.as	2008-09-12 18:27:06 UTC (rev 7506)
+++ dumbhippo/trunk/server/web/flash/hippo.as	2008-09-15 16:15:39 UTC (rev 7507)
@@ -164,12 +164,12 @@
 }
 
 // caution, this can synchronously call the "on all loaded completed" callback
-var loadImage = function(tracker:Object, target:MovieClip, fullUrl:String, fallbackUrl:String) {
+var loadImage = function(tracker:Object, target:MovieClip, fullUrl:String, fallbackUrl:String, linkUrl:String) {
 	trace("loading to " + target._name + " url " + fullUrl);
 	
 	// happens if no image url was provided at all by the xml
 	if (!fullUrl) {
-		loadImage(tracker, target, fallbackUrl, null);
+		loadImage(tracker, target, fallbackUrl, null, linkUrl);
 		return;
 	}
 	
@@ -179,13 +179,19 @@
 		// note, we could be replaced as the loadingMovie already
 		trace("failed to load " + fullUrl + " to " + target._name);
 		if (fallbackUrl != null)
-			loadImage(tracker, target, fallbackUrl, null); // increments pending image loads
+			loadImage(tracker, target, fallbackUrl, null, linkUrl); // increments pending image loads
 		recordOneImageLoadCompleted(tracker);
 	}
 	listener.onLoadComplete = function(targetClip:MovieClip) {
 		// note, we could be replaced as the loadingMovie already
 		trace("completed load of " + fullUrl + " to " + target._name);
-		recordOneImageLoadCompleted(tracker);
+		recordOneImageLoadCompleted(tracker);
+                targetClip.onRelease = function() {
+                        trace("released");
+                        if (linkUrl) {
+                                getURL(linkUrl, "_blank");
+                        }
+                };
 	}
 	loader.addListener(listener);
 	
@@ -207,9 +213,9 @@
 	return clip.imageTracker;
 }
 
-var addImageToClip = function(clip:MovieClip, target:MovieClip, fullUrl:String, fallbackUrl:String) {
+var addImageToClip = function(clip:MovieClip, target:MovieClip, fullUrl:String, fallbackUrl:String, linkUrl:String) {
 	var tracker:Object = getImageTracker(clip);
-	loadImage(tracker, target, fullUrl, fallbackUrl);
+	loadImage(tracker, target, fullUrl, fallbackUrl, linkUrl);
 }
 
 var setAllImagesLoadedCallback = function(clip:MovieClip, callback:Function) {

Modified: dumbhippo/trunk/server/web/flash/nowPlaying.as
===================================================================
--- dumbhippo/trunk/server/web/flash/nowPlaying.as	2008-09-12 18:27:06 UTC (rev 7506)
+++ dumbhippo/trunk/server/web/flash/nowPlaying.as	2008-09-15 16:15:39 UTC (rev 7507)
@@ -139,7 +139,7 @@
 button.lineTo(0, 0);
 button.onRelease = function() {
 	trace("released");
-	getURL(baseUrl + "/person?who=" + who, "_self");
+	getURL(baseUrl + "/person?who=" + who, "_blank");
 }
 
 var fadeTime:Number = 1000;
@@ -350,7 +350,7 @@
 	// albumArtUrl may be undefined, in which case we fall back
 	trace("setSong() adding album art " + song.albumArtUrl);
 	addImageToClip(songClip, songClip.albumArt, song.albumArtUrl,
-				   baseUrl + "/images/no_image_available75x75light.gif");
+				   baseUrl + "/images/no_image_available75x75light.gif", null);
 }
 
 var setTheme = function(clip:MovieClip, theme:Object) {
@@ -404,11 +404,11 @@
 	
 	if (theme.activeImageUrl) {
 		trace("theme loading active image");
-		addImageToClip(themeClip, themeClip.activeBackground, baseUrl + theme.activeImageUrl, null);
+		addImageToClip(themeClip, themeClip.activeBackground, baseUrl + theme.activeImageUrl, null, null);
 	}
 	if (theme.inactiveImageUrl) {
 		trace("theme loading inactive image");
-		addImageToClip(themeClip, themeClip.inactiveBackground, baseUrl + theme.inactiveImageUrl, null);
+		addImageToClip(themeClip, themeClip.inactiveBackground, baseUrl + theme.inactiveImageUrl, null, null);
 	}
 }
 

Modified: dumbhippo/trunk/server/web/flash/nowPlaying.swf
===================================================================
(Binary files differ)

Modified: dumbhippo/trunk/server/web/flash/userSummary.as
===================================================================
--- dumbhippo/trunk/server/web/flash/userSummary.as	2008-09-12 18:27:06 UTC (rev 7506)
+++ dumbhippo/trunk/server/web/flash/userSummary.as	2008-09-15 16:15:39 UTC (rev 7507)
@@ -140,12 +140,12 @@
 	var photo:MovieClip = topStuff.createEmptyMovieClip("photo", topStuff.getNextHighestDepth());
 	photo._x = 0;
 	photo._y = 0;
-	addImageToClip(viewRoot, photo, summary.photo, null);
+	addImageToClip(viewRoot, photo, summary.photo, null, null);
 
 	var presenceIcon:MovieClip = topStuff.createEmptyMovieClip("presenceIcon", topStuff.getNextHighestDepth());
 	presenceIcon._x = photo._x + headshotSize + 5;
 	presenceIcon._y = 0;
-	addImageToClip(viewRoot, presenceIcon, summary.onlineIcon, null);
+	addImageToClip(viewRoot, presenceIcon, summary.onlineIcon, null, null);
 	
 	var rightEdgeOfPresenceIcon = presenceIcon._x + presenceIconSize;
 	
@@ -185,11 +185,8 @@
 		var account:Object = summary.accounts[i];
 		var accountButton:MovieClip = ribbon.createEmptyMovieClip("account" + i, ribbon.getNextHighestDepth());
 		accountButton._x = nextX;
-		accountButton._y = 0;
-                accountButton.onRelease = function() {
-                    getURL(account.link, "_blank");
-                }
-		addImageToClip(viewRoot, accountButton, account.icon, null);
+		accountButton._y = 0;
+		addImageToClip(viewRoot, accountButton, account.icon, null, account.link);
 		nextX = nextX + ribbonIconSize + 3;
 	}
 

Modified: dumbhippo/trunk/server/web/flash/userSummary.swf
===================================================================
(Binary files differ)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]