Welcome, Have a Nice Friday


Display A Keypress - Swishmax

Learn how to display the character of the key you pressed on screen using swishmax.




Instructions

Click on the movie above to set the focus, and then press any key on your keyboard to display that character on screen.




First Of All

You will need the latest build of swishmax installed on you system to do the following tutorial.
for the sake of this tutorial i have used a movie size of 190 x 170 pixels with a frame rate of 25fps.
on a white background.


Step.1

Using the text tool and set as dynamic text i created a box with a font size of 96 and centered text and black in colour #000000, name this pressed.



Step.2

now create another dynamic text box using a font size of 14 and colour of black #000000 and name it info, place it underneath the pressed text box, you should have something looking like fig.1 below.
Fig.1



Step.3

Now on Scene_1 add the following code.

Code:
onEnterFrame() {
/*Code by Craig Lowe
http://www.swish-designs.co.uk
09:30 01-09-07*/
ascii = Key.getAscii();
pressed = String.fromCharCode(ascii);
if(pressed==""){
info="Press A Key To Display It";
}else{
info="you pressed "+pressed;
}
}
onLoad() {
stage.showMenu = false;
}

 

Latest Submissions

Site Overview

swish-designs.co.uk
relies on donations and purchases from users
to enable too keep this site running. as the site has grown in its content and reputation so has the cost of keeping this site going, thank you to all who help and have helped me achieve this goal. still many files are offered for free in the download center to help others learn and understand swishmax.
however files that acompany tutorials have a download fee as do shop files which help towards the the sites running costs, happy swishing.


Contact Me

You can use the following information
to either find or contact me.

Blog:www.loweonline.co.uk
Facebook: Facebook Group
E-mail: craig@swishdesigns.co.uk

Find Me At

Swishzone:Find Me There
Loweonline: Find Me There