Description
Using the Touchlib based TUIO AS3 TouchEvent, this is a utility component. All that is needed for implementation is to us the Loader/URLRequest with an Event.COMPLETE event listener to load the external SWF. Then identify the TextField you want the user to type into.
Media
Requirements
Widget Developed in Actionscript 3 and Flash 10.
Mini-Keyboard runs on:
Instructions
This is the code used for the included demo SWF, Mini-Keyboard-Demo.swf. This code uses a TextField already added to the stage via the Flash CS4 GUI.
- package app{
- import flash.events.TouchEvent;
- import flash.events.TUIO;
- import flash.display.*;
- import flash.net.URLRequest;
- import flash.events.Event;
- import flash.text.TextField;
- public class KeyboardDemo extends MovieClip {
- public var newKeyboard:MovieClip=new MovieClip ;
- public var anyTextField:TextField=new TextField ;// connects TextField on Stage to this AS Script
- public function KeyboardDemo() {
- TUIO.init(this,'localhost',3000,'',true);
- var request:URLRequest=new URLRequest("Mini-Keyboard.swf");// loads Keyboard into Flash
- var loader:Loader=new Loader ;
- loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
- loader.load(request);
- }
- private function completeHandler(loadEvent:Event):void {
- trace("completeHandler: "+loadEvent);
- addChild(loadEvent.currentTarget.content);
- var newObj:Object=loadEvent.currentTarget.content;
- trace(newObj);
- newObj.x=300;
- newObj.y=100;
- newObj.attachedTextField=anyTextField;
- }
- }
- }



On sparkon, you'll find projects demonstrating the latest interactive techniques, applications, software frameworks, case studies, and blog articles relating to creative and emergent technology.
sparkon can be used to learn, share, create, promote, and meet people with similar interests and goals. Learn more and get started today!