dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Need help with strings...

Threaded View

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    84

    Need help with strings (dynamic text box)...

    Hi - I'm trying to make a flash movie that will display a new text phrase every 10 seconds in a dynamic text box.

    Here's what I did..

    In the first frame I have a dynamic Text box with the var as "mess". On the actions scripts layer I have this:

    getTimer();
    x=getTimer();
    i=0;
    if (Number(getTimer())<(Number(x)+5000)) {
    mess="hi. How are you.";
    };
    mess1="I'm doing fine.";
    mess2="could you help me with that?";

    The first "if" statement sets up the text box to read "hi how are you".

    In frame 2 I have this code:


    getTimer();
    x=getTimer();
    i++;

    In the 4th frame I have this code:

    if (Number(getTimer())>(Number(x)+10000)) {
    mess = mess+i;
    gotoAndPlay(2);
    } else {
    prevFrame();
    play();
    }

    [b] Here's my problem. since mess is a var on the dynamic text box, whatever is inside the quotation marks gets displayed in the text box.
    But I need to do a string addition so that every time 1 is added to i, the "mess" will become equal to the next "mess" (ie.. mess1,mess2,mess3...) and thus display the next message in line.
    Right now, it will only display "hi how are you1", "hi how are you12", "hi how are you 123", etc, instead of the actual string value of "mess1","mess2",....

    I've attached the fla file in case this gets too confusing.
    Thanks for your help.
    tony
    Attached Files Attached Files
    Last edited by 98blacksnake; 01-29-2004 at 04:46 PM.

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