PDA

View Full Version : How would I recreate this?


Afterwork
01-31-2002, 11:51 AM
Hello,
I am curious to learn how to create something similar to what this person has done.
http://yugop.com/ver2 - Flash design at its finest, absolutely fantastic work. There is a link on the bottom right that is called "sign". It takes you to a guest book that allows you to type in real time. You have to see it.

Question:
I am attempting to sort of recreate this "typewriter" with a new twist. I've been able to figure out how to type the text (or certain characters anyway) in real time and have the text fly out of the users Mouse pointer, landing in a specific location. But that's boring, so to further the effect, I would like to add graphic elements and buttons like Yugo Nakamura has done.

1. The only problem is, how? Has anyone attempted to try and learn how Yugo has done this? Each button reacts to the users keypress and the letters or numbers fly into place on the stage?

2. Does anyone know of where I can get ASCII character info or "keyboard map" for the standard PC keyboard? So that I can create newArrays for each character in my current animation? I am missing some characters from the keyboard. i.e. ( - . : ; ? / \ = or +)????

The character scripting part is almost finished. Adding graphics like Yugo has done is where it is going to get tricky for me.
Any ideas folks?
thanks alot,
Tom

jimburton
01-31-2002, 12:59 PM
There's a full list of keycodes in appendix b of actionscript reference (online help or book).

In theory, should be doable. Set an x,y point object as the target for flying characters then each time the user presses a key the function that animates it then increments the target (moves the "cursor" along)...

Like you say, awesome design (so good it could be dangerously discouraging and, in my case, should be avoided unless you're feeling full of confidence).

Tink
01-31-2002, 01:04 PM
this might help u out for the ASCII here (http://www.efn.org/~gjb/asciidec.html)

isn't the script telling the individual letters that make up whatever text u type to come from a certain _x and _y position instead of telling all characters to come from the mouse pointer???

:confused: BLEEDA

Afterwork
01-31-2002, 10:36 PM
Ok so I am kind of new to this sort of thing. ;)
Here is what I have so far, or at least some of the code anyway, as it is just too long for me to post the whole thing.

So,
In the main timeline, I have all of the elements placed into one MC that has the following code in one of my "action" frames.
code:

speed = 1.5;
friction = .50;

for (i=1; i<=num_chars; i++) {
if (characters[i].moving == true) {
Xmove = (characters[i].x_pos-characters[i]._x);
Ymove = (characters[i].y_pos-characters[i]._y);
characters[i].x_rate += (Xmove/speed);
characters[i].y_rate += (Ymove/speed);
characters[i].x_rate *= friction;
characters[i].y_rate *= friction;
characters[i]._x += characters[i].x_rate;
characters[i]._y += characters[i].y_rate;
if (characters[i].x_pos == characters[i]._x && characters[i].y_pos == characters[i]._y) {
characters[i].moving = false;

//the statement "Xmove & Ymove = (characters", starts off the _x & _y properties does it not?

Now in this MC, I also have an empty MC called "theWatcher" that watches out for the keypress from the users keyboard. The following code is part of the Objects Actions and is in the middle of my script.

code:
_parent.characters[_parent.num_chars].x_pos = 18+_parent.StageBounds.xMin+_parent.hz_offset;
_parent.characters[_parent.num_chars].y_pos = 60+_parent.StageBounds.yMin+(35*_parent.line_count );
_parent.characters[_parent.num_chars]._x = _xmouse;
_parent.characters[_parent.num_chars]._y = _ymouse;

//the numbers 18, 60 & 35 are just samples I used for this question and are spacers that help determine where the characters are going to be placed)

This code above is used for the _x & _y properties - _x = _xmouse; and _y = ymouse;. So my question is, how can I create a graphic for a point of where the letters come out (instead of the Mouse pointer) and reference it in the script?

This is where I have tried it but it didn't work, because I think I placed the wrong code and possibly in the wrong place as well.

Instead of _x & _y = _mouse (I used _x & _y = _parent.ejector) by putting a graphic on the main timeline of the MC in its own layer and instance naming it "ejector". That did not work....

Any ideas folks?
Thanks for the replies and I will check out that ASCII site you referred to later....
Tom