A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Bringing text from an outside source

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    22

    Bringing text from an outside source

    Here's my setup

    I have a text box, set to dynamic multiline text. In the variable (name I guess) I have news.


    My problem

    I want to upload a .txt file to the web, then I want my flash file to go out and get that .txt file, read the text, and make that the text of my textbox. I need to do this so I don't have to alter my flash movie, export, and reupload my movie every time I want to change my website.

    Thanks,
    Untwisted
    http://www.untwisted.net

  2. #2
    Junior Member
    Join Date
    Jul 2001
    Posts
    16
    If I understand your question...

    You want to make dynamic changes to your flash movie using a text file.

    here's an example.

    loadVariables ("Apps/Office.txt", "_root.MOVAppBank");
    define the source and destination

    Apps is a folder containing the Office.txt file. Inside the text file I have a variable called _root.MovAppBank. In the text file simply right _root.MovAppBank = Today's news blah blah blah....

    This example is a text box inside a movie clip inside your flash movie. If the text box is directly on your movie then leave the level to 0 in source. In this case I made a movie clip, called it Movbank in the instance panel then from load variable I used the Target to make the source path.

    hope it helps

    you can find that tutorial everywhere... ie: http://www.flashkit.com , http://www.actionscript.net


  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    22

    Bah

    It didn't work, I put a .txt file called news in the same folder as my project, then I added this code:

    on (press) {
    loadVariables ("news.txt", "news._root");
    }


    to my button

    and this code:

    news._root = Test!

    to my text file. I also made sure that the text and the background weren't the same color, and I checked everything else I could possibly check :-/

    Thanks!

  4. #4
    Junior Member
    Join Date
    May 2001
    Posts
    20
    try this

    loadVariables ("news.txt", "");

  5. #5
    Junior Member
    Join Date
    May 2001
    Posts
    20
    sorry should probably be more specific....

    on (press) {
    loadVariables ("news.txt", "");
    }


    and this code:

    news = Test!

    let me know if that doesn't fix it.

  6. #6
    Junior Member
    Join Date
    Oct 2001
    Posts
    22

    beh

    Ok, problem with this code.. I'm still very new with actionscript, but with my experiences with other languages (namely Visual Basic) this doesn't tell the text to load in my text box does it?

  7. #7
    Junior Member
    Join Date
    May 2001
    Posts
    20
    OK,

    If you have a dynamic text field in your flash movie with the variable name news. Then when you loadVariable(news.txt) you declare in that text file that news=your content.

    I have only done this with scrollers in the past. I have a couple tutorial files that I could send you that you could pick apart. Maybe It would be helpful. post your email and I will send them to you.

    Midntrdr

  8. #8
    Junior Member
    Join Date
    Oct 2001
    Posts
    22

    here

    untwisted@untwisted.net, thanks!

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