Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Flash-Phone ActionScript Problem
From: Bawol, Brian
Date: Wed, 1 Nov 2000 20:22:20 GMT

Hello peoples,
I am in need of some "should-be" simple action script help. I am creating
an interactive flash presentation for a web-phone program we have.
Essentially I need to use the phone keypad on the bitmap image as if it were
really the phone's keypad to type in letters. ie. pressing the number "2" 2
times would give you the letter "B", and 3 times would give the letter "C",
then clicking the right arrow button would move to the next letter.

What I have is a dynamic text field on the phone's screen which will simply
be updating the variable as people hit the keys. I have included the code
below and was wondering if anybody could tell me if I am attempting to do
something not allowed in flash or what? Here goes...




======= variables declared in the keyframe that the button is initiated on
=========
stop ();
txtUserName = ""; //this is the dynamic text field
temp = ""; //temporary storage to incriment
the variable
userlength = 0; //I will only allow the variable to
reach 5 chars.
num2 = 0; //How many times the "2" button has
been pressed on phone




======= Actions within the "2" button on the phone =========
on (press) {
num2 = num2 + 1;
if (num2 > 3) { //Make sure the number does not
exceed 3
num2 = 1;
}
trace ("num2 = " + num2);
if (num2 = 1) {
temp = "A";
} else if (num2 = 2) {
temp = "B";
} else if (num2 = 3) {
temp = "C";
}
txtUserName = temp; //Stored in temp until the user
hits right arrow to move to next letter
trace ("temp is " + temp + " and txtUserName =" + txtUserName);

}


======= When I keep clicking the "2" button in the test-scene this is my
TRACE output =======
num2 = 1
temp is A and txtUserName =A
num2 = 2
temp is A and txtUserName =A
num2 = 2
temp is A and txtUserName =A
num2 = 2
temp is A and txtUserName =A
num2 = 2
temp is A and txtUserName =A
num2 = 2
temp is A and txtUserName =A

//Note how num2 does not increment past 2





Thank you very much, any help is appreciated!
Grazie,
Brian

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: Flash-Phone ActionScript Prob, Benoit Martin

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]