You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/11/08 01:40:23 UTC

git commit: [flex-utilities] [refs/heads/apache-tour-de-flex-1.2] - Add support for image embedding for third party components

Repository: flex-utilities
Updated Branches:
  refs/heads/apache-tour-de-flex-1.2 58d0ea657 -> 93be453d5


Add support for image embedding for third party components


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/93be453d
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/93be453d
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/93be453d

Branch: refs/heads/apache-tour-de-flex-1.2
Commit: 93be453d58d289649f894f529730b3951a248a10
Parents: 58d0ea6
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Fri Nov 7 16:39:04 2014 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Fri Nov 7 16:39:04 2014 -0800

----------------------------------------------------------------------
 TourDeFlex/TourDeFlex3/src/3rdparty.xml     |  2 +-
 TourDeFlex/TourDeFlex3/src/explorer.mxml    |  9 +++++++--
 TourDeFlex/TourDeFlex3/src/loaderPanel.mxml | 24 ++++++++++++++++++++++--
 3 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/93be453d/TourDeFlex/TourDeFlex3/src/3rdparty.xml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/3rdparty.xml b/TourDeFlex/TourDeFlex3/src/3rdparty.xml
index 1224d16..97b6b48 100755
--- a/TourDeFlex/TourDeFlex3/src/3rdparty.xml
+++ b/TourDeFlex/TourDeFlex3/src/3rdparty.xml
@@ -19,7 +19,7 @@
 <compTree>
 	<node label="3rd Party Components">
 		<node label="Ardisia">
-			<node thirdParty="true" label="Ardisia Component Library" app="http://www.ardisialabs.com/swfs/TourDeFlex.swf" src="" />
+			<node thirdParty="true" label="Ardisia Component Library" app="http://www.ardisialabs.com/tourDeFlex/tour-de-flex.jpg" src="" link="http://www.ardisialabs.com/tour-de-flex" />
 		</node>
 		<node label="Flexicious">
 			<node thirdParty="true" label="Dashboard Framework" app="http://www.flexicious.com/resources/demo/FlexiciousClassic.swf" src="" />

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/93be453d/TourDeFlex/TourDeFlex3/src/explorer.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/explorer.mxml b/TourDeFlex/TourDeFlex3/src/explorer.mxml
index 9cdeb2f..03808a6 100755
--- a/TourDeFlex/TourDeFlex3/src/explorer.mxml
+++ b/TourDeFlex/TourDeFlex3/src/explorer.mxml
@@ -80,12 +80,13 @@
         private function treeChanged(event:Event):void
         {
             var nodeApp:String = compLibTree.selectedItem.@app;
+			var link:String = compLibTree.selectedItem.@link;
 			var thirdParty:Boolean = compLibTree.selectedItem.hasOwnProperty("@thirdParty")
 				&& compLibTree.selectedItem.@thirdParty == "true";
 			
             if (nodeApp != null && nodeApp != "")
             {
-				loadApp(nodeApp, compLibTree.selectedItem.@src, thirdParty);
+				loadApp(nodeApp, compLibTree.selectedItem.@src, thirdParty, link);
             }
             else
             {
@@ -93,11 +94,15 @@
             }
         }
 			
-		private function loadApp(application:String, source:String, thirdParty:Boolean):void
+		private function loadApp(application:String, source:String, thirdParty:Boolean, link:String=""):void
 		{
 			if (application.indexOf(".swf") > 0) {
 				swfLoader.loadApp(application);
 			}
+			else if(application.indexOf(".jpg") > 0 || application.indexOf(".png") > 0)
+			{
+				swfLoader.loadApp(application,link);
+			}
 			else {
 				swfLoader.loadApp(application + ".swf");
 			}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/93be453d/TourDeFlex/TourDeFlex3/src/loaderPanel.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/loaderPanel.mxml b/TourDeFlex/TourDeFlex3/src/loaderPanel.mxml
index bd09faf..02209c9 100755
--- a/TourDeFlex/TourDeFlex3/src/loaderPanel.mxml
+++ b/TourDeFlex/TourDeFlex3/src/loaderPanel.mxml
@@ -21,11 +21,31 @@
 		  width="100%" height="100%">
     <fx:Script>
      <![CDATA[
-     
-	public function loadApp(swfApp:String):void
+		 import flash.net.navigateToURL;
+    private var _link:String;
+	//For third party components, we are loading an image.  Clicking on the image 
+	//would take the user to the demo app on the third party website
+	public function loadApp(swfApp:String, link:String=""):void
     {
     	myLoader.source = swfApp;
+		if(link != "")
+		{
+			_link = link;
+			myLoader.addEventListener(MouseEvent.CLICK, handleClick);
+			myLoader.buttonMode = myLoader.useHandCursor = true;
+		}
+		else
+		{
+			myLoader.removeEventListener(MouseEvent.CLICK, handleClick);
+			myLoader.buttonMode = myLoader.useHandCursor = false;
+		}
+		
     }
+		 
+	private function handleClick(event:MouseEvent):void
+	{
+		navigateToURL(new URLRequest(_link),"_blank");
+	}
     
     ]]>
   </fx:Script>


Re: git commit: [flex-utilities] [refs/heads/apache-tour-de-flex-1.2] - Add support for image embedding for third party components

Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Nov 7, 2014 7:32 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:
>
> Hi,
>
> > +                     var link:String = compLibTree.selectedItem.@link;
>
> May need to check if link attribute exists otherwise may run issues
around the property not existing vs having an empty value.

Will do, when I get a chance over the weekend.

Thanks,
Om

>
> Thanks,
> Justin

Re: git commit: [flex-utilities] [refs/heads/apache-tour-de-flex-1.2] - Add support for image embedding for third party components

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> +			var link:String = compLibTree.selectedItem.@link;

May need to check if link attribute exists otherwise may run issues around the property not existing vs having an empty value.

Thanks,
Justin