flex - Display HTML page in browser window upon clicking a button -


i have button on flex(air app). when click on button,has open browser window display html page.

create urlrequest web page, , open navigatetourl :

var urlrequest:urlrequest = new urlrequest("http://www.adobe.com/"); navigatetourl(urlrequest); 

example loading page upon click of button flex mxml:

<?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009"                xmlns:s="library://ns.adobe.com/flex/spark">      <fx:script>         <![cdata[             import flash.net.navigatetourl;              protected function clickhandler(event:mouseevent):void             {                 navigatetourl(new urlrequest("http://www.adobe.com"), "_blank");             }         ]]>     </fx:script>      <s:button label="open page"               click="clickhandler(event)" />  </s:application> 

navigatetourl():

opens or replaces window in application contains flash player container (usually browser). in adobe air, function opens url in default system web browser.

parameters

request:urlrequest — urlrequest object specifies url navigate to. content running in adobe air, when using navigatetourl() function, runtime treats urlrequest uses post method (one has method property set urlrequestmethod.post) using method.

window:string (default = null) — browser window or html frame in display document indicated request parameter. can enter name of specific window or use 1 of following values:

  • "_self" specifies current frame in current window.
  • "_blank" specifies new window.
  • "_parent" specifies parent of current frame.
  • "_top" specifies top-level frame in current window.

urlrequest():

creates urlrequest object. if system.usecodepage true, request encoded using system code page, rather unicode. if system.usecodepage false, request encoded using unicode, rather system code page.

parameters

url:string (default = null) — url requested. can set url later using url property.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -