A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: createTextField fails on server

  1. #1
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044

    createTextField fails on server

    In my movie 'aboutus.swf', I created a textfield like this:
    Code:
    this.loadVariables("texts/aboutus.txt");
    myFormat = new TextFormat();
    myFormat.font = "Verdana";
    myFormat.size = "10";
    myFormat.color = "0xFFFFFF";
    //-------------------------------
    this.createTextField("aboutus", 1, 120, 60, 585, 280);
    this.aboutus.multiline = true;
    this.aboutus.autoSize = true;
    this.aboutus.wordWrap = true;
    this.aboutus.selectable = false;
    this.aboutus.html = true;
    //-------------------------------
    this.onData = function() {
    	this.aboutus.htmlText = mytext;
    	this.aboutus.setTextFormat(myFormat);
    }
    The aboutus.swf is loaded into a movieclip into main.swf. Everything works great locally, but once I put it on the server, the createTextField fails. At least I think that is what fails.
    The aboutus.swf has definataly loaded.
    I can see the aboutus.txt in the browsers cache.
    I can see there is a textfield on the main.swf, because when I mouve the mouse in that area a textcursor shows up, although I set the textField NOT to be selectable.
    I used this code in the main.swf to make all characters show:
    Code:
    System.UseCodePage = true;
    Any help would be great.
    Check here to see what is does. Or does not do.
    http://www.thewizard.be/option/flash

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    405
    Are you sure the text file loads? I've tried to access the page twice and both times it hangs up and just sits there. All I see is a white box in the upper right corner of the page. THe page never fully loads.
    I've had trouble loading text files using relative urls. Try moving the text file to the same directory as the swf or using an absolute url.

    ...really cool code btw. Interesting....

  3. #3
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    I can see the textfile in the cache, so I'm pretty sure it loads.
    I tried composing the aboutus file manually. So I put a dynamic textbox on it myself and load the textfile into the textbox and it shows up as it should...

  4. #4
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    Thanks for your help, it gave me the push to dig into the files again and try and find out what was wrong.
    Feel a bit silly though as was a rather dumb thing that I had been overlooking. The createTextField code was OK, it what the index.html that still had the local path to the main.swf in stead of a relative path to the file on the server...
    Last edited by sofiebel; 12-26-2002 at 04:12 AM.

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