dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Create Chatbubble Thingy?

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Posts
    272

    Create Chatbubble Thingy?

    Hey all,
    Kind of a random question... I'm working on a little game where a user walks around (an RPG) and I want to be able to have them enter some text into a field and upon hitting "return/enter", have it appear in bubble above their player's head and fade out after about 5 seconds. Any tips or ideas on this one? I just don't know how to send the data entered into a text field to a field and then have that field fade and anticipate a new data string. thanks!!
    Woody

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    one method -

    create bubble as a movieclip, with instance name - bubble
    give bubble clip a timeline length of 5 secs and stop the first frame.

    add a textfield to a layer of bubble, give it an instance name - bubble_txt
    add a layer above the textfield for your fade out
    at your fade point tween a shape ( same color as bubble background ) from
    _alpha:0 to _alpha:100 (cpu friendlier than fading embedded text)

    when you complete your input text, send it to the bubble clip textfield,
    and tell the clip appear and start -

    bubble.bubble_txt.text = myInput.text;
    bubble._visible = true;
    bubble.play();

    on the last frame of bubble clip, hide and reset -
    _visible = false;
    bubble_txt.text = "";
    gotoAndStop(1);

  3. #3
    Senior Member
    Join Date
    Feb 2002
    Posts
    272
    oohhh, gotcha. ok, I'm not sure how to "submit" the input though... send it to the text box. Thanks though dog! =D
    Woody

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    if you want to use the Enter key, add a Key Listener
    Code:
    keyWatch = new Object();
    Key.addListener(keyWatch);
    
    keyWatch.onKeyDown = function(){
    if(Key.getCode() == Key.ENTER){
    bubble._visible = true;
    }
    };
    test in the swf or browser( Enter is a command key in fla environment )

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