A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Simple Dynamic Data in ScrollPane

  1. #1
    Member
    Join Date
    Jun 2005
    Posts
    33

    Simple Dynamic Data in ScrollPane

    Hi, I am a newbie to using dynamic data in Flash

    I am building a site for a client that will have a News
    section, where news text will live inside a ScrollPane
    and I need to set up the RIA in a way for the company
    to update this news text down the line, without them
    having me re-authoring it in Flash

    What is the simplest, most pain-free way for me to do
    this without doing complex database work and do I
    need to see if their ISP has specific data/server specs
    to facilitate this?

    thank you

  2. #2
    Senior Member random25's Avatar
    Join Date
    Apr 2002
    Posts
    566
    You can load the text from a text file
    This is how i do it:
    Last edited by random25; 03-25-2006 at 01:44 PM.

    If you want to make an apple pie from scratch, you must first create the universe. Carl Sagan

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    simplest method is to load a text file, in MX6 i'd use -

    Code:
    lv = new LoadVars();
    lv.onLoad = function(){
    news = lv.news;
    makeTheNews();
    }
    lv.load("news.txt");
    
    function makeTheNews(){
    mat = new TextFormat();  
    mat.font = "web"; // Library Linkage ID
    createEmptyMovieClip("cl",100);
    cl.createTextField("tx",200,0,0,200,20);
    cl.tx.autoSize = cl.tx.multiline =
    cl.tx.wordWrap = cl.tx.html = true;
    cl.tx.embedFonts = true;
    cl.tx.htmlText = news;
    cl.tx.setTextFormat(mat);
    this.attachMovie("FScrollPaneSymbol","pane",1,
    {_x:150,_y:110});
    h = pane.getPaneHeight();
    w = pane.getPaneWidth();
    pane.setSize(w+130, h+50);
    pane.setScrollContent(cl);
    };
    in news.txt -

    &news=Note ActionScript doesn't update<br>the information inside a for loop<br>until the entire loop is finished.<br> <font color='#FF0000'>Only when the loop is finished</font><br>does the script return control<br>(and the information it has created.)<br><font color='#0000FF'>Note ActionScript doesn't update </font><br>the information inside a for loop<br>until the entire loop is finished.<br><p align='center'>Only when the loop is<br>finished does the script<br>return control<br>(and the information it has created.)&

  4. #4
    Member
    Join Date
    Jun 2005
    Posts
    33

    Will try loading text

    Thank you kindly for the examples
    I will try this out

    cheers,
    snurg

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