Groups | Blog | Home
all groups > flash (macromedia) > june 2004 >

flash (macromedia) : Type Text, letter and movie appear?


q5k
6/9/2004 9:04:44 PM
I am drawing a blank as how to approach this, so bear with me?..

I am trying to create a movie where when you type, the letter appears in the
flash movie. The hard part is that I want a movie (which is associated with the
letter you typed) to appear along with the typed letter.

Does this make sense?

It would look like this?..

I type ?h? on the keyboard and this appears? H [H?s associated movie]

Thanks,
-noah

urami_
6/10/2004 8:49:15 AM
[quoted text, click to view]

It cold be done with Key.getAscii(); or Key.getCode(); which return key value.
You could hard code each key to a movie but that is time consuming .

I show you very easy way with minimum of code.
Open the help - using flash , click search and key in the search :
"Letters A to Z and standard numbers 0 to 9"

This will give you the list of corresponding ASCII key code values that are used to identify
the keys in ActionScript.
Example, A is 65 , B is 66 , G is 71 and so on...
Now you want to load movie on key press A . Name the movie "movie_65.swf" .
Name them all is similar way , accordingly to key you press value.

Now all you need in flash is :

myListener = new Object();
myListener.onKeyDown = function() {
loadMovieNum("movie_"+Key.getCode()+".swf", 1);
};
Key.addListener(myListener);

the path is dynamic, the number get insert within the movie_ and .swf .

If you wanted to go to frame than :
gotoAndStop(Key.getCode());

if you wanted to jump to label

gotoAndStop("label_"+Key.getCode());

and so on ......







--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

q5k
6/10/2004 9:18:29 PM
THANK YOU, that saved me so much time and code.

Now I am trying to figure out how to make the movies display across the screen
as I type (the previous one stays put and the new letter/movie appears next to
it) so I can type words. Any thoughts?

I will use the "enter" key to reset the screen to blank.

THANK YOU SO MUCH
-n
q5k
6/10/2004 10:44:21 PM
I am loading the movies from outside. I have 26 seperate "movie_66.swf" like files that are all stored in the same folder.

thanks,
urami_
6/11/2004 6:27:56 AM
[quoted text, click to view]

Can you tell me do you load the movies , call from library or ... ?
How do you get them on stage ?




--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

urami_
6/11/2004 6:45:29 AM
[quoted text, click to view]

Ok , in such case load them all in same level or target.
They will than automatically replace each other .



--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

q5k
6/11/2004 2:59:49 PM
Actually, I am trying to have the movies NOT replace each other.

I would like the movies to appear next to each other. For example, I type one
letter and it?s corresponding movie appears. Then if I type another letter I
would like it?s corresponding movie to appear on the stage 20 pixels to the
right of the first movie. (Which is still on the screen)

Right now I type one letter and the movie appears but when I type the next
letter the first movie disappears and the new movie replaces it.

Thank you for all you help,
-n

AddThis Social Bookmark Button