Package examples.toolkit1
Class public  class WebViewExample01
Inheritance WebViewExample01 Inheritance View

A sample of the WebView component.

Author:

Michael Schmalle
Copyright:

Teoti Graphix, LLC
Images:


Public Variables
    Variable Defined by
     
webView : WebView
The WebView component
WebViewExample01
Protected Variables
    Variable Defined by
     
theText : String
WebViewExample01
Protected Methods
    Method Defined by
     
startup( event:Event ) : void
WebViewExample01
     
view1_viewActivateHandler( event:ViewNavigatorEvent ) : void
WebViewExample01
     
webView_completeHandler( event:Event ) : void
WebViewExample01
Public Variable detail
webView variable  
public var webView : WebView

The WebView component

Protected Variable detail
theText variable  
protected var theText : String

This property can be used as the source for data binding.

Protected Method detail
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

Source Code:
<?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>
Mobile UI Toolkit1 v1.0.x Documentation - Thu Dec 15 10:21:33 EST 2011