A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: mc responding to inputted messages?

  1. #1
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261

    mc responding to inputted messages?

    i was just wondering if i could make an mc respond to inputted words by users such as: inputted text: walk
    Mc: will start walking.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Guess it could be done!
    You would have to have some constantly looping control movie clip, checking the value of the input text box, and then have the movie clip reacting accordingly.

  3. #3
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261
    could you explain some funtions that might help me? or any codes?

  4. #4
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261
    im not sure but is double posting allowed?

  5. #5
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261
    old newbie you there? can someone give me a link to where i might be able to find help?

  6. #6
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    well, suppose your input text box has an instance name of "action"
    on your movie clip that you want to respond:

    Code:
    onClipEvent(enterFrame) {
       if (_root.action.text.toLowerCase() == "walk") {
          gotoAndPlay("walk");
          _root.action.text = "";
       }else{
          if (_root.action.text.toLowerCase() == "jump") {
              gotoAndPlay("jump"); 
               _root.action.text = ""
          }
    }
    this would kinda work, i guess.. All theory.. I added the _root.action.text="" , otherwise, everyframe pass the MC would go back to the specified frame label without completing the animation..

    i'm sure somebody will come along with some cleaner code, but this should at least help in getting started..

    good luck
    -myk

  7. #7
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261
    hmm i tested this to work like making a password and it seems to work well. I'm thinking i'll keep at the password thing until i come up with errors then i'll try your way.

    my problem is getting him to move a direction. See i'm trying to get the hero to do everything by itself, but you can help out by telling it some stuff to do.

    i'm also wondering how i can make him say something if he doesn't recognize what u typed in.
    Last edited by NewbieMaster; 08-06-2003 at 03:55 PM.

  8. #8
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261
    how can make the hero say something if he doesn't recognize what you typed in.

  9. #9
    Angry Panda fokused's Avatar
    Join Date
    Sep 2002
    Location
    ol' Virginnie
    Posts
    66
    i suppose after all of the other ifs and elses to recognize certain words you could have the last else goto and play a parked movie clip that has the hero speaking...the way im thinking of it it would work, but could we see what youre trying to do?

  10. #10
    Navi Specialist NewbieMaster's Avatar
    Join Date
    Jul 2003
    Posts
    261
    hmm but the parked hero is of him in a stance and i need each attack to go back to it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center