A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: scrolling text blues...

  1. #1
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756

    scrolling text blues...

    Hello...I have this code for scrolling external text in a text box... I want to trim it up and use only the parts need to scroll the external text. I am havig a problem following this code (new to AS)

    I am looking to make this (scrolling text) as easy as I can..and understand it too! Please help me understand it if you can. Here is my interpretation by section:
    Code:
    
    onClipEvent (load) {
        loadVariables ("textfile.txt", "");
        scrolling = 0;
        frameCounter = 1;
        speedFactor = 3;
        refreshRate = 12;
        refreshCounter = 0;
        refreshLastMaxScroll = 0;
        loaded = false;
    }
    
    On clip event we are just setting variables (which SOME I understand)

    The rest of the code seems difficult. I dont even have a draggable scroll bar...so I can I safely delete that section? Seem slike an alful lot of code..to scroll some external text with some buttons.

    Anyone can shed some light on this so I can write my own external text sroller ? Thanks Here is the full posting of the code...
    Code:
    onClipEvent (load) {
        loadVariables ("textfile.txt", "");
        scrolling = 0;
        frameCounter = 1;
        speedFactor = 3;
        refreshRate = 12;
        refreshCounter = 0;
        refreshLastMaxScroll = 0;
        loaded = false;
    }
    onClipEvent (enterFrame) {
        if (loaded) {
            if (refreshCounter%refreshRate == 0 && textbox.maxscroll != refreshLastMaxScroll) {
                // Scrollbar should be refreshed here
                refreshLastMaxScroll = textbox.maxscroll;
                refreshCounter = 0;
            }
            refreshCounter++;
        }
        if (frameCounter%speedFactor == 0) {
            if (scrolling == "up" && textbox.scroll>1) {
                textbox.scroll--;
            } else if (scrolling == "down" && textbox.scroll<textbox.maxscroll) {
                textbox.scroll++;
            }
            frameCounter = 0;
        }
        frameCounter++;
    }
    onClipEvent (data) {
        loaded = true;
    }
    help is appreciated.

    -whispers-

  2. #2
    Junior Member
    Join Date
    Apr 2001
    Posts
    12
    that lot looks a bit complicated for your purposes - and I suspect there is information missing from the code you published here.
    Why not try loading your external text in using the onClipEvent, then adding two simple scroll buttons with the most basic scroll commands:

    on (release){
    textfield.scroll--;
    }

    on (release){
    textfield.scroll++;
    }

    where textfield is the variable name you have assigned to your dynamic text box.

    on friendsofed.com you will find a book called php for flash (yes I know what you are doing does not involve php...). Download the free chapter (chapter 1) as a pdf. This has a little tutorial in it for loading dynamic content from text files. Also help with basic scrolling. Hope this helps,
    Paul

  3. #3
    Senior Member Wancieho's Avatar
    Join Date
    May 2002
    Posts
    370
    Here's a file I made up for you. It's a lot more simplified but it does also support html formatting:
    Download

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Thanks for trying to help... You must be using FLASH MX huh?..DO you mind saving it in FLASH 5 format for me?...so I can see what ya did?..

    Plus (it is hard for me to pick others .fla's apart) can you tell me where you put code?...

    I imagine on the actually MC and onthe buttons..but anywhere else??

    Thanks.

    Hope you reply soon

    -whispers-

  5. #5
    Senior Member Wancieho's Avatar
    Join Date
    May 2002
    Posts
    370
    You can grab the file from the same place:
    Download
    Once you have it i'll explain. Do you have icq at all?

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