<?xml version="1.0" encoding="utf-8"?>[/INDENT]
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="1072" height="800" x="0" y="150"
horizontalCenter="0" verticalCenter="0">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.*;
[Bindable] public var imgArray:Array = new Array();
public function createDataProvider():ArrayList
{
//var imgArray:Array = new Array();
for(var i:int=0; i<9; i++)
{
imgArray = PathToMyImage();
}
return new ArrayList(imgArray);
}
private function PathToMyImage():String
{
return "http://arcgisonline.com/sharing/content/items/0bb40265b64a4b29ac3bccb774413357/info/thumbnail/global_wetlands.jpg";
}
]]>
</fx:Script>
<mx:Text id="PubMapTitle" text="FEATURED MAPS" fontSize="36" y="45" horizontalCenter="0"/>
<s:List id="pubmapList"
dragEnabled="false" dropEnabled="false" dragMoveEnabled="false"
dataProvider="{createDataProvider()}"
y="110" horizontalCenter="0">
<s:layout>
<s:TileLayout id="pubmapListTiles"
verticalGap="10" horizontalGap="10" horizontalAlign="center" verticalAlign="middle" />
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:DataRenderer>
<fx:Script>
<![CDATA[
import flash.net.getClassByAlias;
import mx.controls.Alert;
import mx.core.UIComponent;
public var uicomp:UIComponent;
protected function image1_mouseOverHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
//Alert.show("Map Info: " + "\n", "Map Details");
//rollOverTextArea.visible = true;
//rollOverTextArea.text = "Map Info";
//rollOverTextArea.x = pubMapThumb.width.valueOf() + 10;
pubMapThumb.toolTip = "Our Far South - Beyond Stewart Island (ArcGIS Viewer for Public)Live ArcGIS.com Map of the \"Our Far South\" Expedition to Antarctica";
}
protected function image1_mouseOutHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
//rollOverTextArea.visible = false;
//rollOverTextArea.text = "";
}
protected function pubMapThumb_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
//removeElement(uicomp);
uicomp = new UIComponent();
addElement(uicomp);
var mapmodule:MapModule = new MapModule();
mapmodule.setMapServer("http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer");
mapmodule.width = Capabilities.screenResolutionX;
mapmodule.height = Capabilities.screenResolutionY * .80 - 160;
uicomp.addChild(mapmodule);
}
]]>
</fx:Script>
<s:BorderContainer includeInLayout="true" id="imgBorderContainer" borderWeight="3" borderStyle="solid">
<s:Image id="pubMapThumb" source="{data}" height="200" width="300" mouseOver="image1_mouseOverHandler(event)" mouseOut="image1_mouseOutHandler(event)" click="pubMapThumb_clickHandler(event)"/>
</s:BorderContainer>
</s:DataRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:Group>
Solved! Go to Solution.
Hello,
As far as I know, you should only have one script block and all you methods in it. I've never seen Flex code with more that 1.
Joe