A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: dynamic text flow into two text boxes

  1. #1
    Senior Member
    Join Date
    May 2000
    Posts
    814

    dynamic text flow into two text boxes

    i've found this code on the web that works well and need help migrating from as2 to as3?

    i just don't know what the equivalent codes are?

    PHP Code:
    var lorem_lv:LoadVars = new LoadVars();

    lorem_lv.onData = function(src:String) {
        if (
    src != undefined) {
            
    txtCol1.text src;
            if (
    txtCol1.maxscroll != 1) {
                
    txtCol2.text txtCol1.text;
                for (
    0txtCol1.bottomScrolli++) {
                    
    txtCol2.text += "\n";
                }
                
    txtCol2.scroll txtCol1.bottomScroll 1;
            }
        } else {
            
    txtCol1.text "Unable to load external file.";
        }
    };


    lorem_lv.load("http://websitetips.com/articles/copy/lorem/ipsum.txt"); 

  2. #2
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    Actionscript Code:
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, varsLoaded);

    function varsLoaded (event:Event):void {
    }

    loader.load(new URLRequest("http://websitetips.com/articles/copy/lorem/ipsum.txt"));
    This is the start of what you're looking at, question for you. Do you want it to wait until everything is loaded or to have it checking while it's loading. That's the difference between Complete and onData.
    .

  3. #3
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    seriously, most of what you are looking for is in the documentation for as3.

    is the issue how to load the information, or the textfield logic?
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  4. #4
    Senior Member
    Join Date
    May 2000
    Posts
    814
    I want to create a dynamic loading text into a two column text box.
    I've been investigating the CS5 TLF text boxes, but i'm not having any luck with a solution yet. (I'm an average as3 coder).

    Rat

  5. #5
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    you need to give more information ratboy...

    do you not understand how to load the text?
    are you forced with using TLF? (or can you use classic)
    can you not figure out how to overflow text into another textfield?
    which part of this do you not understand?
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  6. #6
    Senior Member
    Join Date
    May 2000
    Posts
    814
    Hi Baby Minion
    I do know how to load text.
    And I don't need to use TLF text box.
    I cant figure out how to overflow text into another textfield.

    cheers
    Ratboy

  7. #7
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    did you look at what swak wrote?

    that is the basic code for loading a file, could you get that to work?
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


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