Paste ID posted at 05/15/2008 09:03:02 AM GMT-8 - ActionScript formatting
Copy Content* • Download Text Version
/* How to Retrieve The URL For Your Running Flex Application http://userflex.wordpress.com/2008/05/15/running-app-url/ */ package com.userflex.sample.util { // import statements import flash.external.ExternalInterface; /** * The JSUtil class is an all-static class with methods for accessing * JavaScript values using ExternalInterface. You do not create * instances of JSUtil; instead you simply call static methods such as * the JSUtil.getWindowLocation() method. */ public class JSUtil { /** * Returns the current application URL. * * @return the current application URL */ public static function getWindowLocation () : String { var location : String = null; // checks if external interface is available if (ExternalInterface.available) { try { location = ExternalInterface.call ("window.location.href.toString"); } catch (error : Error) { location = null; } } return location; } } }
Copy Content* • Download Text Version
* Copy Content will display a textarea with the content and attempt to copy it to your clipboard.