| Package | examples.toolkit1 |
| Class | public class WebViewExample01 |
| Inheritance |
WebViewExample01
View
|
A sample of the WebView component.
Author:
| Variable | Defined by | |||
|---|---|---|---|---|
|
webView
: WebView
The WebView component
|
WebViewExample01 | |||
| Variable | Defined by | |||
|---|---|---|---|---|
|
theText
: String
|
WebViewExample01 | |||
| Method | Defined by | |||
|---|---|---|---|---|
|
startup( event:Event ) : void
|
WebViewExample01 | |||
|
view1_viewActivateHandler( event:ViewNavigatorEvent ) : void
|
WebViewExample01 | |||
|
webView_completeHandler( event:Event ) : void
|
WebViewExample01 | |||
| webView | variable |
public var webView : WebViewThe WebView component
| theText | variable |
protected var theText : StringThis property can be used as the source for data binding.
| startup() | method |
protected function startup( event:Event ) : void
| view1_viewActivateHandler() | method |
protected function view1_viewActivateHandler( event:ViewNavigatorEvent ) : void
| webView_completeHandler() | method |
protected function webView_completeHandler( event:Event ) : void
<?xml version="1.0" encoding="utf-8"?>
<!--
@LICENSE@
-->
<!--
WebViewExample01.mxml
@PROJECT_BLOCK@
-->
<!---
* A sample of the WebView component.
*
* @title WebView Example 1
* @source
* @front
* @mobile
* @image assets/examples/toolkit1/WebViewExample01_160.png
* @author Michael Schmalle
* @copyright Teoti Graphix, LLC
-->
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:tg="http://tg.teotigraphix.com/flex4"
viewActivate="view1_viewActivateHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import spark.events.ViewNavigatorEvent;
[Bindable]
protected var theText:String = "<html><head><title>WebView Example from HTML</title>" +
"</head><body bgcolor=\"#CCCCCC\" style=\"padding:50\"><div>Hello <code>WebView</code>!</div>" +
"</body></html>";
protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
{
navigator.addEventListener(FlexEvent.TRANSITION_START, startup);
//webView.url = "http://www.google.com";
webView.text = theText;
}
protected function startup(event:Event):void
{
webView.visible = false;
}
protected function webView_completeHandler(event:Event):void
{
title = webView.title;
}
]]>
</fx:Script>
<!--- The WebView component -->
<tg:WebView id="webView"
top="5" left="0" right="0" bottom="0"
complete="webView_completeHandler(event)"/>
</s:View>