Mini-Keyboard

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

Mini-Keyboard

Requirements

Widget Developed in Actionscript 3 and Flash 10.

Mini-Keyboard runs on:

Windows
OSX
Linux

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.

  1. package app{
  2.  
  3.         import flash.events.TouchEvent;
  4.         import flash.events.TUIO;
  5.  
  6.         import flash.display.*;
  7.         import flash.net.URLRequest;
  8.         import flash.events.Event;
  9.         import flash.text.TextField;
  10.  
  11.         public class KeyboardDemo extends MovieClip {
  12.                 public var newKeyboard:MovieClip=new MovieClip  ;
  13.                 public var anyTextField:TextField=new TextField  ;// connects TextField on Stage to this AS Script
  14.  
  15.                 public function KeyboardDemo() {
  16.                         TUIO.init(this,'localhost',3000,'',true);
  17.  
  18.                         var request:URLRequest=new URLRequest("Mini-Keyboard.swf");// loads Keyboard into Flash
  19.                         var loader:Loader=new Loader  ;
  20.                         loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
  21.                         loader.load(request);
  22.  
  23.                 }
  24.  
  25.                 private function completeHandler(loadEvent:Event):void {
  26.                         trace("completeHandler: "+loadEvent);
  27.                         addChild(loadEvent.currentTarget.content);
  28.                         var newObj:Object=loadEvent.currentTarget.content;
  29.                         trace(newObj);
  30.                         newObj.x=300;
  31.                         newObj.y=100;
  32.                         newObj.attachedTextField=anyTextField;
  33.  
  34.                 }
  35.  
  36.  
  37.         }
  38. }

Activity

6672 3 0 1
Get Adobe Flash player

Comments 0

Top Members
1,393 Points
Fairlane's picture
Fairlane
932 Points
lynnmarentette's picture
lynnmarentette
730 Points
DavidJKelley's picture
DavidJKelley
704 Points
tracyboyer's picture
tracyboyer
672 Points
falcon4ever's picture
falcon4ever
529 Points
Seth's picture
Seth
512 Points
joshblake's picture
joshblake
477 Points
tito's picture
tito
424 Points
hillbilly's picture
hillbilly
417 Points
Taha's picture
Taha
387 Points
dennda's picture
dennda
377 Points
cyancdesign's picture
cyancdesign
355 Points
schmuck's picture
schmuck
303 Points
johannes's picture
johannes
276 Points
sandor's picture
sandor
Who's New
vijay.betigiri's picture
vijay.betigiri
EPIK AMENRA's picture
EPIK AMENRA
argniest's picture
argniest
mcggupta's picture
mcggupta
rootstack's picture
rootstack
alejandro_oses's picture
alejandro_oses
Malek's picture
Malek
sujinesh's picture
sujinesh
antpgomes's picture
antpgomes
xabi's picture
xabi
joelgibby's picture
joelgibby
mojofat's picture
mojofat

About sparkon

sparkon is a social platform for people that are sparked (inspired) by creative and emergent technology. sparkon can be used to learn, share, create, promote, and meet people with similar interests and goals. We aim to have a friendly environment and involve not just people already sparked (inspired) by technology, but spark new people too. Learn more and get started today!

Promote Your Work

Do you have creative or emergent technology work you'd like to spark others with? Post your projects, frameworks, and applications on sparkon and promote your work! You can gain points for every post and climb the ranks of the community.