]> git.saurik.com Git - wxWidgets.git/blob - samples/flash/form.mxml
fixing RTTI
[wxWidgets.git] / samples / flash / form.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Name: form.mxml
4 Purpose: Simple form in Flash
5 Author: Vadim Zeitlin
6 Created: 2009-01-13
7 RCS-ID: $Id$
8 Copyright: (c) 2009 Vadim Zeitlin
9 Licence: wxWindows licence
10
11 This file can be compiled to SWF using the mxmlc free compiler from Flex SDK.
12
13 You then can call SetText() and GetText() functions from the C++ flash sample.
14 -->
15 <mx:Application
16 xmlns:mx="http://www.adobe.com/2006/mxml"
17 xmlns:adl="*"
18 preinitialize="preinit();"
19 horizontalAlign="left" verticalAlign="top"
20 layout="absolute"
21 backgroundAlpha="1"
22 backgroundColor="0xaaaaaa"
23 width="100%">
24 <mx:Script>
25 <![CDATA[
26 import flash.external.ExternalInterface;
27
28 private function preinit():void
29 {
30 ExternalInterface.addCallback("SetText", DoSetText);
31 ExternalInterface.addCallback("GetText", DoGetText);
32 }
33
34 private function DoSetText(str: String):void {
35 txt.text = str;
36 }
37
38 private function DoGetText():String {
39 return txt.text;
40 }
41
42 public function onok():void {
43 fscommand("call_fscommand_form", "button");
44 }
45 ]]>
46 </mx:Script>
47 <mx:Canvas width="100%">
48 <mx:VBox width="100%">
49 <mx:Form borderColor="0x0" borderStyle="solid" width="100%">
50 <mx:Label text="Simple Flash Form" />
51 <mx:FormItem label="Type any text here:">
52 <mx:TextInput id="txt" text="Hello wxWidgets!" width="100%"/>
53 </mx:FormItem>
54 <mx:FormItem label="Click button to generate event">
55 <mx:Button id="formbutton" label="OK" click="onok();"/>
56 </mx:FormItem>
57 </mx:Form>
58 </mx:VBox>
59 </mx:Canvas>
60 </mx:Application>