<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. | |
--> | |
<mx:Box xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" | |
width="100%" height="100%"> | |
<fx:Script> | |
<![CDATA[ | |
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> | |
<mx:SWFLoader id="myLoader" width="100%" height="100%" horizontalAlign="center" verticalAlign="middle" /> | |
</mx:Box> |