dcsimg
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: SCROLLING LOADED TEXT??

  1. #21
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    it probably doesn't work because you need to be sure the variable is loaded before you try and use it.
    Which is why the LoadVars() object is so nice, that onLoad feature is just too easy.
    The only way to check that a text file (or other variables) have loaded with loadVariables is to use a moveiclips onClipEven(data) -
    in which case the movieclip will execute any actions within that handler only once the variables are loaded.
    Or you can use a 2 frame loop to continuously check the load status.

  2. #22
    Master Poo Flinger
    Join Date
    Sep 2000
    Posts
    318
    i did have the MC watch for the text file to load. its just some things just dont really need an event fired when its loaded. i just want the text box to get filled in automatically if the var in the textfile is the same as the one in the MC, not fill it in manually. you know what i mean?

  3. #23
    Junior Member
    Join Date
    Apr 2002
    Posts
    8

    Flash MX's UI-scrollbar & loading into dynamic textboxes

    To everybody having trouble with Flash MX's UI-scrollbar when loading textfiles into dynamic textboxes.

    I had this problem too and I first had to go to another section of the site and then return to the section with the textloader, then the scrollbar worked.

    But what I did to make it work was to put the loadingscript already in the first frame of the movie, so the variables were loaded in the beginning and then the scrollbars worked first time you got to the page/frame with the dynamic textbox & ****.

    So for me; in the first and the fifth frame in my flashmovie I have:

    loadVariablesNum("mytextfile.txt", 0);

    This way the textfile is loaded twice since the script is in both the first, and then in the frame which the textbox is. I belive this is some sort of a bug but this is the only way I have found out to fix it.

  4. #24
    Eat Rice!
    Join Date
    Sep 2000
    Posts
    299
    by default, the scrollbar is loaded before the text is. So when the scrollbar is loaded, there is no text to scroll, hence what you are getting.

    To get past this, i loaded the variables first, made a check in a later frame to see if the variable text was loaded, and then loaded the scrollbar.

  5. #25
    Junior Member
    Join Date
    Mar 2002
    Posts
    4

    uh

    uh, hasn't this subject of dynamic txt and scrollbar been posted quite a few times?

  6. #26
    I appreciate that you guys must be getting bored answering all these scrollbar component questions, but I am having REAL difficulties trying to follow all of these answers. is there a step by step somewhere??

    I am really struggling here... normally I get this sort of stuff pretty quick but I'm getting a headache!!!

    thanks alot folks in advance. dax

  7. #27
    Senior Member
    Join Date
    Jun 2000
    Location
    London
    Posts
    293

    not my code....

    but it works well
    Code:
    // Create new LoadVars object
    dataSet = new LoadVars();
    
    // Set the onLoad handler
    dataSet.onLoad = function(success) {
        // If the data was loaded... 
        if (success) {
            // ...set the text for the textbox
            _root.mytext.text = this.mytext;
        } else {
            // Otherwise, show an error
            _root.mytext.text = "Error loading";
        }
    }
    
    // Load the data file
    dataSet.load("news.txt");
    
    // Halt the movie
    stop();

  8. #28
    Senior Member
    Join Date
    Apr 2002
    Location
    Raleigh, NC
    Posts
    419

    simple solution

    I had a similar issue. Here is what fixed my problem.

    On the onClipEvent(data){} for the movie that is recieving the dynamic text you need to place the following code:
    [instanceNameOfScrollbar].onTextChanged();

    Thats it. For some reason flash mx does not register that event automatically when text is loaded with the loadVaraibles() function.

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