dcsimg
A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: dynamic text box & scrollbars = not working

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    18

    dynamic text box & scrollbars = not working

    Scrollbars aren't working...

    Here's the setup:
    I have a 4 frame movie with a text box and a scrollbar (attached) on the stage across all 4 frames. Very simple. The scrollbar works if I'm not pulling in text from a mySQL db.

    FRAME 1 ACTION:
    Code:
    loadVariablesNum("http://www.server.com/file_to_load.php", 0, "POST");
    loading = "YES";
    gotoAndPlay(2);
    FRAME 2 ACTION: none

    FRAME 3 ACTION:
    Code:
    if (loading eq "YES") {
    	gotoAndPlay(2);
    } else {
    	gotoAndStop(4);
    }
    FRAME 4 ACTION:
    Code:
    stop();
    Any suggestions as to what I'm doing wrong would be appreciated.

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    Not knowing if you use MX (I suppose you do) here is little example:
    http://www.macromedia.com/support/fl...t_scrollmx.htm

    Maybe you are not assigning text to the Text field instance correctly after text has been loaded.

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Posts
    18
    Yep, using MX. The text will load, just not scroll. The example you provided didn't work.

    Thanks for the reply

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Posts
    18
    Doesn't *anybody* know how to do this???

    I just want a dynamic textbox to pull in data from a sql db and have the box scroll.

    The text inserts, the scollbars just don't work.

    Bueller?
    Last edited by tgavin; 08-13-2003 at 06:58 PM.

  5. #5
    Member
    Join Date
    Aug 2001
    Location
    Hawaii
    Posts
    64
    Did you try searching the board? I found plenty of examples including my post from a few months ago. Hope this helps.
    light4u.


    Here is what I did.
    -------------------------------------------------------------------
    Frame 1
    stop();
    anews1 = "Loading...";
    loadVariablesNum("loadvalues.asp", 0);
    success = "no";
    holdTime = 6000;
    stopTime = getTimer()+holdTime;
    this.onEnterFrame = function() {
    showTimer = getTimer();
    secCounter = int(stopTime/1000)-int(showTimer/1000);
    trace(showTimer);
    if (getTimer()>=stopTime) {
    gotoAndStop("timedOut")
    errorMessage = "Variables attempted to load for "+holdTimeSec+" seconds without success.\rHalting script and exiting now!";
    delete (this.onEnterFrame);
    trace("your variables attempted\rto load for "+holdTimeSec+" seconds without success.\rHalting script and exiting now!");
    }
    if (_root.success == "yes") {
    gotoAndStop("content");
    secCounter = "completed";
    }
    };


    Frame 2
    stop();

    Frame 3
    stop();
    ---------------------------------------------------------------

    Added this to my ASP code:

    &success=<%="yes"%> &anews1=<%=Server.URLEncode(guestbook.Fields.Item( "news")
    .Value)%>&
    Design & Marketing
    http://www.dreamteammedia.com

  6. #6
    Junior Member
    Join Date
    Jun 2001
    Posts
    18
    Thanks for the reply lights.

    Yep, I've searched the board - I've Googled until my fingers are numb and I can't find ONE simple example of getting scrollbars to work with dynamic text - unless it's a .txt file, which is not an option. For me, it's either Flash or a .php page to display the data. I'd rather use Flash.

    Scrollbars still not working.

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    I dont think there is much difference, what you use to load your text. Once its loaded into Flash (loading using loadvariables or PHP script or even typing into text box directly) and variable has got the value to show in the text box, they all work same way.

    Its hard to help, if all the information you give, is "it doesnt work". Perhaps if you describe better, what is the value of variable, once its loaded and how have you set up your text box and scrollbars, someone might have better idea.

  8. #8
    Junior Member
    Join Date
    Jun 2001
    Posts
    18
    Sorry, I thought I did give the info in my first post.

    I've moved things around a bit and now the scrollbars work - only after reloading the browser.

    I've attached the .fla file and .php file. Hopefully this will shed some light.

    Thanks much!
    Attached Files Attached Files

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    After you have loaded the variable successfully, try adding:

    contentBox.text=content;

    content is the name of the variable that is loaded I think.

  10. #10
    Junior Member
    Join Date
    Jun 2001
    Posts
    18
    Thanks, things are closer now

    The only problem that I see at this point is when the text show on the stage (frame 3) I see all of the HTML formatting in the textbox - which is then immediately replaced by the actual text.

    Any ideas?

    Thanks again!

  11. #11
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    I am not very good with MX text properties, but try

    contentBox.htmlText=text;

    If that doesnt help, then perhaps try renaming variable with the text box (content).

    Hope this helps

  12. #12
    Member
    Join Date
    Aug 2001
    Location
    Hawaii
    Posts
    64
    I am not loading text from a text file. I am calling the text directly from a database. I will have a look at your .fla
    light4u
    Design & Marketing
    http://www.dreamteammedia.com

  13. #13
    Junior Member
    Join Date
    Jun 2001
    Posts
    18
    Thanks light, I appreciate that.

    Apparently I'm still stuck. The scrollbar still doesn't scroll unless I reload the page.

    I must not be getting all of the data loaded before presenting the scrollbar. Frustrated...

    Thanks all

  14. #14
    Senior Member
    Join Date
    Jun 2003
    Location
    La Mirada California
    Posts
    396
    hey!!!! i figured it out!!!
    ive been trying to figure this out for a while too... looking everywhere but couldnt find answers....
    ok so...
    its not working cause its trying to scroll the empty text box... so what i did was... i made a variable send to the flash movie so i know when its done loading. so i have php send &status="read";
    then on frame 2 in the movie i have it check when its done loading and when it is i tell it to stop at 3... and at frame 3... i have the scroll bar in a different layer only on frame 3. so just make a new layer and frame on 3 and drag the bar over the text so it snaps and it should work!!!! =)
    tell me if that helps or if you cant get it i can send you the file

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