A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Url for txt file in dynamic text field?

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    16

    Url for txt file in dynamic text field?

    Hi, I have a problem with a dynamic text field, which displays a txt file.

    If I hardcode the file name in the code, then it works fine. This is on the first frame of my movie, which holds the dynamic text field.

    Code:
    myData = new LoadVars();
    myData.onLoad = function(success)
    {
    	if (success)
    	{
    		mytxt.htmlText = this.txt;
    	}
    };
    
    myData.load("test.txt);
    
    stop();
    But if I try to define the url of the text with a variable, and try to send it the url in the browser (.swf?txturl=http://www.myurl.com/), it doesn't work:

    Code:
    myData = new LoadVars();
    myData.onLoad = function(success)
    {
    	if (success)
    	{
    		mytxt.htmlText = this.txt;
    	}
    };
    
    link = _root.txturl + "test.txt";
    
    myData.load(link);
    
    stop();
    Is there a trick to defining url's for dynamic text fields? Because if I hardcode the path from the server, it works locally, but again not on the server...

    Any ideas? Thanks!

  2. #2
    Senior Member
    Join Date
    Jun 2003
    Location
    Kent, WA
    Posts
    536
    Nothing initially catch my eye as being wrong in code. Does it work if you hardcode the full path? ie

    Code:
    myData.load("http://www.myurl.com/test.txt");

  3. #3

Tags for this Thread

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