BETA ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Hide Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes

Language Reference only
Filters: AIR 32.0 and earlier, Flash Player 32.0 and earlier, Flash Lite 4
None
Hide Filters
com.adobe.mosaic.om.interfaces 

IApplication  - AS3 ADEP Composite Application

Packagesx

Top Level
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.consulting.pst.vo
com.adobe.dct.event
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.impl
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.importexport
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.mosaic.core
com.adobe.mosaic.core.events
com.adobe.mosaic.core.validators
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skins.aqua
com.adobe.mosaic.skins.aqua.organizer
com.adobe.mosaic.skins.aqua.tile
com.adobe.mosaic.skins.aqua.util
com.adobe.mosaic.skins.aqua.view
com.adobe.mosaic.skins.aqua.viewManager
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.endpoint
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses

Language Elements

Global Constants
Global Functions
Operators
Statements, Keywords & Directives
Special Types

Appendixes

What's New
Compiler Errors
Compiler Warnings
Run-Time Errors
Migrating to ActionScript 3
Supported Character Sets
MXML Only Tags
Motion XML Elements
Timed Text Tags
List of deprecated elements
Accessibility Implementation Constants
How to Use ActionScript Examples
Legal notices
(Beta)
Packagecom.adobe.mosaic.om.interfaces
Interfacepublic interface IApplication extends IMosaicNode , IMessageBus

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 9.5
Runtime Versions: AIR 2.0.2, Flash Player 10.1

The IApplication interface provides access to the DOM for an application, and provides methods for adding views, panels, and tiles, as well as querying aspects of the application's environment.

View the examples



Public Properties
 PropertyDefined By
  catalogs : Array
[read-only] Returns an array representing the catalogs referenced by the application.
IApplication
  context : IContext
[read-only] Returns the context interface for the application.
IApplication
  environment : IEnvironment
[read-only] Returns information about the current server the application is using.
IApplication
  stylesheets : Array
[read-only] Returns an array of URLs representing each stylesheet the application references.
IApplication
  user : IUser
[read-only] Returns information about the current user of the application.
IApplication
  userViews : Array
[read-only] Returns the list of views that a user has saved for this application.
IApplication
  views : Array
[read-only] Returns an array of views that are available within the application.
IApplication
Public Methods
 MethodDefined By
  
Adds a view to the application.
IApplication
  
Creates a new blank panel - that is, the panel does not have a layout assigned - in the application.
IApplication
  
Creates a new blank view - that is, the view does not have a layout assigned - in the application.
IApplication
  
Creates a new layout in the application.
IApplication
  
Deletes a view saved by a user.
IApplication
  
Locates a particular node in the DOM based on the node's unique ID.
IApplication
  
Returns a catalog that has been deployed to the server.
IApplication
  
Removes the specified view from the application.
IApplication
Property Detail
Method Detail
IApplication_example.mxml
<?xml version="1.0" encoding="utf-8"?>
<mc:ModuleTile xmlns:mx="http://www.adobe.com/2006/mxml" 
               layout="absolute" width="100%" height="150" 
               backgroundColor="#000000" backgroundAlpha="1.0"
               backgroundImage="@Embed('./Assets/HubbleWallpaperB.jpg')"
               backgroundSize="100%"
               xmlns:mc="com.adobe.mosaic.core.*"
               creationComplete="initApp()">
    
    <mx:Script>
        <![CDATA[
            import com.adobe.mosaic.core.events.Message;
            import com.adobe.mosaic.om.interfaces.*;
            import com.adobe.mosaic.core.*;
            
            import mx.collections.XMLListCollection;
            import mx.events.*;
            import mx.events.MenuEvent;
            import mx.rpc.events.ResultEvent;
            import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            
            [Bindable] private var viewArray:ArrayCollection;
            [Bindable] private var panelArray:ArrayCollection;
            [Bindable] private var catalogArray:ArrayCollection;
            private var globalContext:IContext;
            
            public var cascadeStyles:Dictionary;
            [Bindable] 
            private var menuBarCollection:XMLListCollection;
            
            [Bindable]
            private var pingName:String = "";
            
            private var newViews:int = 0;
            private var newPanels:int = 0;
            private var userViewsCount:int = 0;
            
            // Use this for pointing the application to a new data server
            private var defaultServer:String = "http://localhost:8080";
            private var currServer:String;
            
            // List of script tests to run; checked automatically on startup.
            private var testCatalog:String = "/mosaic/catalogs/galaxy_catalog/resources/";
            private var testBatchFile:String = "ScriptTests.xml";
            private var testList:ArrayCollection;
            private var testIndex:int;
            [Bindable]    private var currTestsURL:String;
            
            
            private var menuData:XMLList =
                <>
                    <menuitem label="Add Tiles">
                        <menuitem label="Ledger" data="Ledger"/>
                        <menuitem label="LedgerDetail" data="LedgerDetail"/>
                        <menuitem label="InvoiceDetail" data="InvoiceDetail"/>
                        <menuitem label="ExpenseReport" data="ExpenseReport"/>
                        <menuitem label="ExpenseDetail" data="ExpenseDetail"/>
                    </menuitem>    
                    <menuitem label="Select Language">
                        <menuitem label="English" data="English" />
                        <menuitem label="Spanish" data="Spanish" />
                        <menuitem label="Chinese" data="Chinese" />
                    </menuitem>    
                    <menuitem label="Select Style">
                        <menuitem label="iPhone" data="/IphoneStyles.swf" />
                        <menuitem label="Plain" data="/PlainStyles.swf" />
                    </menuitem>    
                    <menuitem label="Select Month">
                        <menuitem label="Aug" data="August" />
                        <menuitem label="Sep" data="September" />
                    </menuitem>    
                    <menuitem label="Info">
                        <menuitem label="About" data="About" />
                        <menuitem label="Views" data="Views" />
                        <menuitem label="Panels" data="Panels"/>
                        <menuitem label="Catalogs" data="Catalogs"/>
                        <menuitem label="User" data="User" />
                        <menuitem label="Stylesheets" data="Stylesheets" />
                        <menuitem label="Image Credits" data="ImageCredits" />
                    </menuitem>    
                    <menuitem label="Add/Save">
                        <menuitem label="Add View" data="addView" />
                        <menuitem label="Add Panel" data="addPanel" />
                        <menuitem label="Save View" data="saveView1" />
                        <menuitem label="Save View GUI" data="saveView2" />
                        <menuitem label="Delete View" data="deleteView" />
                    </menuitem>
                    <menuitem label="TestLongMenu">
                        <menuitem label="item 1" data="test 1" />
                        <menuitem label="item 2" data="test 2" />
                        <menuitem label="item 3" data="test 3" />
                        <menuitem label="item 4" data="test 4" />
                        <menuitem label="item 5" data="test 5" />
                        <menuitem label="item 6" data="test 6" />
                        <menuitem label="item 7" data="test 7" />
                        <menuitem label="item 8" data="test 8" />
                        <menuitem label="item 9" data="test 9" />
                        <menuitem label="item 10" data="test 10" />
                    </menuitem>
                    <menuitem label="test" >
                        <menuitem label="Set Data Server" data="setDataServer" />
                        <menuitem label="Open DOM Crawler" data="openDOMcrawler" />
                        <menuitem label="Scripting" data="Scripting" />
                    </menuitem>
                </>;
            
            private function initApp():void {
                
                var env:IEnvironment = this.mosaicApp.environment;
                var server:String = env.url;
                currServer = server;
                
                menuBarCollection = new XMLListCollection(menuData);
                // runtime.setGlobalContextAttribute("currMonth", "August");
                var defaultStyle:String = "/IphoneStyles.swf";
                
                globalContext = this.mosaicApp.context;
                globalContext.setAttribute("currMonth", "August");
                globalContext.setAttribute("currLanguage", "English");
                globalContext.setAttribute("currGlobalStyle", defaultStyle);
                globalContext.setAttribute("currGalaxyServer",currServer);
                
                // To listen for ping replies...
                mosaicApp.addMessageListener("com.adobe.mosaic","pingReply",onPingReply);
                // To listen for script test completion...
                mosaicApp.addMessageListener("com.adobe.mosaic","testReply",onTestReply);
                
                // We need to check for any script tests in this catalog's resource
                // folder.  The file should be named "ScriptTests.xml"
                //
                // Extract each entry (a test script file) and send to Script tile
                // We simply call the HTTPService to GET our test list; it's resulthandler
                // will send the first message; subsequent tests (messages) are handled
                // by the MessageListener "onTestReply"
                // Later... we can add menu items to change the Test folder URL and to
                // start a new sequence of tests.
                
                // Last thing to do is start HTTPService request for XML data
                currTestsURL = currServer + testCatalog + testBatchFile;
                srv.send();            
            }
            
            private function showUserInfo():void {
                var uInfo:IUser = this.mosaicApp.user;
                var uName:String = uInfo.username;
                var uFullName:String = uInfo.fullname;
                var uAuth:String = uInfo.authentication;
                Alert.show("User Information:" + "\n"
                    + "\tuser name:" + uName + "\n"
                    + "\tfull name:" + uFullName + "\n"
                    + "\tauthentication:" + uAuth, "User", 4, this);
                
            }
            private function showEnvironment():void {
                
                var env:IEnvironment = this.mosaicApp.environment;
                //  env.url,  env.version, env.build, env.copyright
                
                Alert.show("Environment Information:" + "\n"
                    + "\tURL:" + env.url + "\n"
                    + "\tVersion:" + env.version + "\n"
                    + "\tBuild:" + env.build + "\n"
                    + "\tCopyright:" + env.copyright, "Environment", 4, this);
            }
            
            // If a Tile replies to ping, display the reply
            // Later we can return more interesting reply data (e.g. what view/panel it is in)
            // There are built-in means to find a tile, this is just to exercise the Message
            // functionality.
            private function onPingReply(message:Message):void {
                pingName = message.payload;
            }
            
            
            // When a script test has completed, it signals back here.
            // If there are more tests in the list of script files,
            // create next URL and send it in another message to the Script tile.
            private function onTestReply(message:Message):void {
                testIndex++;
                var tempStr:String = currServer + testCatalog;
                
                if (testIndex < testList.length){
                    var obj:Object = testList.getItemAt(testIndex,0);
                    var testName:String = obj.file.toString();
                    if ((testName != null)||(testName != "")){
                        // now we can send a message to Scripting tile
                        tempStr += testName;
                        var stringMessage:Message = new Message("com.adobe.mosaic", "runTest", tempStr);
                        mosaicApp.sendMessage(stringMessage);
                    }
                }        
            }
            
            // Send a Ping to all active application tiles, if Tile is open it will reply.
            // pingName is the id of the Bindable string used for TextArea
            private function onPingRequest():void {
                var stringData:String = "";
                var pingMsg:String = "";
                if (tileName.text != ""){
                    stringData = tileName.text;
                    pingName = " Pinging: " + stringData;
                    pingMsg = "ping" + stringData;
                    var stringMessage:Message = new Message("com.adobe.mosaic", pingMsg, stringData);
                    mosaicApp.sendMessage(stringMessage);
                }
            }
            
            private function onMyClick(event:MenuEvent):void{
                var menuData:String = event.item.@label;
                var currView:IView = this.mosaicApp.activeView;
                var currPanel:IPanel = this.mosaicApp.activePanel;
                var strTemp:String = "";
                var i:int = 0;
                
                switch (menuData){
                    case "Ledger":
                    case "LedgerDetail":
                    case "InvoiceDetail":
                    case "ExpenseReport":
                    case "ExpenseDetail":
                        var c:ICatalog = this.mosaicApp.getCatalog("galaxy_catalog");
                        var t:ITile = c.getTile(event.item.@label);
                        mosaicApp.activePanel.addTile(t);
                        break;
                    case "English":
                    case "Spanish":
                    case "Chinese":
                        // set global appLanguage attribute for all Tiles to respond.
                        globalContext.setAttribute("currLanguage", event.item.@data);
                        break;
                    case "iPhone":
                    case "Plain":
                        // set global appStyle attribute for all Tiles to respond.
                        var newStyle:String = event.item.@data;
                        globalContext.setAttribute("currGlobalStyle", newStyle);
                        break;
                    case "Aug":
                    case "Sep":
                        globalContext.setAttribute("currMonth", event.item.@data);
                        break;
                    case "User":
                        showUserInfo();
                        break;
                    case "About":
                        showEnvironment();
                        break;
                    case "Views":
                        var appViews:Array = this.mosaicApp.views;
                        var viewsInfo:String = "Application views: \n";
                        for (i = 0; i < appViews.length; i++){
                            var view:IView = appViews[i];
                            viewsInfo += "\t " + view.nodeLabel + 
                                ", Num Panels: " + view.childrenNodes.length + "\n";
                        }
                        viewsInfo += "\t Active View: " + currView.nodeLabel;
                        viewsInfo += "\nUser Views: \n";
                        var userViews:Array = this.mosaicApp.userViews;
                        if (userViews == null) {
                            viewsInfo += "\t null user views";
                            Alert.show(viewsInfo, "Views", 4, this);
                            break;
                        }
                        if (userViews.length == 0){
                            viewsInfo += "\t user views length = 0";
                            Alert.show(viewsInfo, "Views", 4, this);
                            break;
                        }
                        for (i = 0; i <userViews.length; i++) {
                            var uView:IView = userViews[i];
                            viewsInfo += "\t " + uView.nodeLabel + 
                                ", Num Panels: " + uView.childrenNodes.length + "\n";
                        }
                        Alert.show(viewsInfo, "Views", 4, this);
                        break;
                    case "Panels":
                        
                        var allPanels:Array = currView.panels;
                        var numTiles:int = 0;
                        var panelsInfo:String = "Current view Panels: \n";
                        for (i = 0; i < allPanels.length; i++){
                            var panel:IPanel = allPanels[i];
                            panelsInfo += "\t " + panel.nodeLabel + 
                                ", Num Tiles: " + panel.childrenNodes.length + "\n";
                            numTiles += panel.childrenNodes.length;
                        }
                        panelsInfo += "\t Active Panel: " + currPanel.nodeLabel + ", Total tiles: " + numTiles ;
                        Alert.show(panelsInfo, "Panels", 4, this);
                        break;
                    case "Catalogs":
                        var allCatalogs:Array = this.mosaicApp.catalogs;
                        var catInfo:String = "Application Catalogs: \n";
                        for (i = 0; i < allCatalogs.length; i++){
                            var cat:ICatalog = allCatalogs[i];
                            catInfo +=    "\t URI: " + cat.uri + "\n";
                        }
                        Alert.show(catInfo, "Catalogs", 4, this);
                        break;
                    case "Stylesheets":
                        var allStyles:Array = this.mosaicApp.stylesheets;
                        var styleInfo:String = "Application Stylesheets: \n";
                        for (i = 0; i < allStyles.length; i++){
                            styleInfo +=    "\t" + allStyles[i] + "\n";
                        }
                        Alert.show(styleInfo, "Stylesheets",4,this);
                        
                        break;
                    case "Image Credits":
                        var imageInfo:String = " Images courtesy of STSci (hubblesite.org)\n";
                        imageInfo += "\nThe Tadpole Galaxy UGC 10214 \n";
                        imageInfo += "  Credit:NASA, H. Ford (JHU), G. Illingworth (UCSC/LO),";
                        imageInfo += "  M. Clampin (STSci), G. Hartig (STSci), ";
                        imageInfo += "  The ASC Science Team, and ESA\n";
                        imageInfo += "\nCold Hydrogen Clouds in the Carina Nebula \n";
                        imageInfo += "  Credit:NASA, ESA, N. Smith (University of California,";
                        imageInfo += "  Berkeley) and The Hubble Heritage Team (STSci/AURA) ";
                        Alert.show(imageInfo, "Image Credits",4,this);
                        break;
                    case "Add View":
                        var vLabel:String;
                        if (tileName.text != ""){
                            vLabel = tileName.text + " " + newViews++;
                        }else {
                            vLabel = "New View " + newViews++;
                        }
                        
                        var vView:Iview = this.mosaicApp.createBlankView();
                        vView.nodeLabel = vLabel;
                        this.mosaicApp.addView(vView);
                        break;
                    case "Add Panel":
                        var pLabel:String;
                        if (tileName.text != ""){
                            pLabel = tileName.text + " " + newPanels++;
                        }else {
                            pLabel = "New Panel " + newPanels++;
                        }    
                        
                        var pPanel:IPanel = this.mosaicApp.createBlankPanel();
                        pPanel.nodeLabel = pLabel;
                        this.mosaicApp.activeView.addPanel(pPanel);
                        break;
                    case "Save View" :
                        if (tileName.text != ""){
                            strTemp = tileName.text + userViewsCount++;
                        }else {
                            strTemp = "userView" + userViewsCount++;
                        }                        
                        currView.save(strTemp, "current view saved from menubar", onSaveUserViewOK, onSaveUserViewFail);
                        break;
                    case "Save View GUI" :
                        currView.requestSave();
                        break;
                    case "Delete View" :
                        var aView:IView;
                        var allUserViews:Array = this.mosaicApp.userViews;
                        // just pick first one for now
                        if (allUserViews.length > 0){
                            aView = allUserViews[0];
                            strTemp = aView.nodeLabel;
                            this.mosaicApp.deleteUserView(aView);
                            Alert.show("deleted user view: " + strTemp, "Result", 4, this);
                        } else {
                            Alert.show("no user views to delete", "Result", 4, this);
                        }
                        break;
                    case "Set Data Server" :
                        currServer = tileName.text;
                        globalContext.setAttribute("currGalaxyServer",currServer);
                        break;
                    case "Open DOM Crawler" :
                        var domCatalog:ICatalog = this.mosaicApp.getCatalog("galaxy_catalog");
                        var domTile:ITile = domCatalog.getTile("DOMCrawler");
                        mosaicApp.activePanel.addTile(domTile);
                        break;
                    case "Scripting" :
                        var c2:ICatalog = this.mosaicApp.getCatalog("galaxy_catalog");
                        var t2:ITile = c2.getTile("Scripting");
                        mosaicApp.activePanel.addTile(t2);
                        break;
                }
                
            }
            
            private function onSaveUserViewOK(event:Event):void {
                Alert.show("User View saved OK", "Result", 4, this);
            }
            private function onSaveUserViewFail(event:Event):void {
                Alert.show("User View save FAILED", "Result", 4, this);
            }
            
            // get a Script test file (if exists) from catalog resources folder
            private function resultHandler(event:ResultEvent):void
            {
                try {
                    testList = event.result.batch.test;
                    var str:String = testList.toString();
                    if (testList == null) return;
                    processList(testList);
                    
                    // Format:
                    //    <batch>
                    //       <test>
                    //          <file>Test1.xml</file>
                    //       </test>
                    //    </batch>    
                } catch (e:Error){
                    // Do nothing...
                    // If there is no batch file of tests, then there is
                    // nothing to do.
                    //Alert.show("Try-catch error " + e +" ", "HTTP Service", 4, this);
                }
            }
            
            // extract first batch script file from the list
            private function processList(list:ArrayCollection):void {
                testIndex = 0; // keeps track of tests which have run
                var tempStr:String = currServer + testCatalog;
                var testName:String;
                var obj:Object;
                
                if (list.length > 0) {
                    obj = list.getItemAt(testIndex,0);
                    testName = obj.file.toString();
                    if ((testName != null)||(testName != "")){
                        // now we can send a message to Scripting tile
                        tempStr += testName;
                        var stringMessage:Message = new Message("com.adobe.mosaic", "runTest", tempStr);
                        mosaicApp.sendMessage(stringMessage);
                    }
                }                
            }
            
            
        ]]>
    </mx:Script>
    
    <mx:Style source="Assets/IphoneStyles.css" />
    <mx:HTTPService id="srv" 
                    url="{currTestsURL}" result="resultHandler(event)"/>
    
    <mx:VBox >
        
        <mx:Canvas width="100%" height="60"   >
            <mx:Label text="Galaxy Reports" styleName="ledgerTitles"  x="15" y="8" width="238"/>
            <mx:MenuBar  left="283" top="10" bottom="31" right="86" 
                         labelField="@label" dataProvider="{menuBarCollection}" 
                         cornerRadius="8" borderColor="#000000"
                         itemClick="{onMyClick(event)}" />
            
            
        </mx:Canvas>
        <mx:HBox>
            <mx:Label/>
            <mx:Button label="Ping..." click="onPingRequest()" 
                       color="#000000" themeColor="#000000"/>
            <mx:TextArea id="tileName" height="50" 
                         editable="true" text="{pingName}" cornerRadius="4"  width="180"/>
            
        </mx:HBox>        
    </mx:VBox>
    
</mc:ModuleTile>