A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: getting text to scroll in dynamic text box

  1. #1
    Junior Member
    Join Date
    Dec 2001
    Posts
    19

    getting text to scroll in dynamic text box

    I posted in a previous thread about getting text to load in a text box. I was finally able to get it to load properly but can't seem to scroll it. The text shows up within the given area but the remaining text doesn't show or scroll. Is there something I'm missing??

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    either the coding has syntax errors or the path to the variable isn't right.
    Can you post both the scrolling script and describe the structure of the swf?
    gparis

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Posts
    19
    Ok, here goes.
    The code for the first 4 frames of the movie clip is as follows:
    Frame 1- _level0.news_clip.loadVariables("news.txt");
    Frame 2(named load)- if (text ne "") {
    gotoAndStop ("end");
    }
    Frame 3- gotoAndPlay ("load");
    Frame 4 (named end)- stop ();

    I have a dynamic text box set up to load text from an external file.
    I am using arrows to control the scroll the code for them is as follows:

    Up arrow -
    on (press) {
    tellTarget ("uptrigger") {
    gotoAndPlay (2);
    }
    }
    on (release) {
    tellTarget ("uptrigger") {
    gotoAndStop (1);
    }
    }

    Down Arrow-
    on (press) {
    tellTarget ("downtrigger") {
    gotoAndPlay (2);
    }
    }
    on (release) {
    tellTarget ("downtrigger") {
    gotoAndStop (1);
    }
    }

    The triggers are blank movie clips with script and are placed in the movieclip next to the arrows as small circles.
    First frame of clip- stop ();
    second frame- /text:scroll = /text:scroll-1;
    third fame- gotoAndPlay (2);

    I'm not getting any code errors when testing the movie.
    Hope that helps.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    the variable text (textfield) is inside _level0.news_clip, right? so the path to the variable is _level0.news_clip.text

    /text:scroll = /text:scroll-1;
    is flash4 syntax for:
    _root.text.scroll (which is the wrong path)

    on the scrolling script it should be:

    _level0.news_clip.text.scroll-=1; (to scroll up)
    and
    _level0.news_clip.text.scroll+=1; (to scroll down)

    gparis

  5. #5
    Junior Member
    Join Date
    Dec 2001
    Posts
    19
    gparis you are my hero. Finally got it to work. Replacing my old actionscript with what you suggested worked. Thank you thank you!!

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