A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [RESOLVED] [Help] Scroll text in Dynamic Textbox

  1. #1
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546

    [RESOLVED] [Help] Scroll text in Dynamic Textbox

    Hi all, as the title already suggested, I would like to know if it's possible to scroll text inside a dynamic textbox?
    I'm making a little mp3 player to put on the bottom of my site and I would like to show Artist - Title in a little textbox (to spare some space).

    Has anyone already done this or does anyone know how to do this?
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    I've created a simple example, but don't know if this is what you're looking for:
    code:

    my_txt.text = "line 1\n";
    my_txt.text += "line 2\n";
    my_txt.text += "line 3\n";
    my_txt.text += "line 4\n";
    //
    setInterval(function ()
    {
    if (my_txt.scroll < my_txt.maxscroll - 1)
    {
    my_txt.scroll += 1;
    }
    else
    {
    my_txt.scroll = 1;
    }
    }, 2 * 1000);


    This uses a single line text field on the stage, but it can have more than one line.

    Is a vertical scroll like this that you're looking for?

    Sometimes horizontal scrollers are used. In this case, I'd suggest placing the text inside a movie clip, and scroll the movie clip itself.
    Attached Files Attached Files

  3. #3
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    That perfect!
    But one thing: is it possible that the last line never shows up? Because even when I fill in 15, it only shows 14 ...
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  4. #4
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Ok, solved it!
    Something else: can I put in something like "artist: " + currentBand (this is a variable), being followed by "track: " + currentTrack ?
    I tried fitting it in but i won't work
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  5. #5
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    I'm not sure if I follow.
    You want:
    code:

    my_txt.text += "artist: " + currentBand + " track: " + currentTrack;


    ?
    To get this, all you need is that the width of the text field is big enough...

  6. #6
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    It's alright, I tried something stupid and it actually works (Why do I keep doubting myself?): my_text = "artist" + currentBand + "\n";

    Just one more thing of which I'm sure I won't find it after having posted a question ... Can I change the time between the "scrolles"?
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  7. #7
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    That's in the setInterval().
    Now it's for 2 seconds: 2 * 1000.

  8. #8
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Thanks a lot for your help, my mp3-player is finally running smooth!
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

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