A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: undefined when loading textfile

  1. #1
    Member
    Join Date
    May 2004
    Posts
    33

    undefined when loading textfile

    hello,

    im making an exercise where i load a textfile in a textarea
    and format it with a css page but everytime i test my movie
    i only get undefined in the textarea
    i did exactly what was written in my book so i dont understand
    why this isnt working

    heres the code
    Code:
    var flash_css = new TextField.StyleSheet();
    flash_css.load("styles.css");
    flash_css.onLoad = function(success:Boolean) {
    	if (success) {
    		news_txt.styleSheet = flash_css;
    	} else {
    		trace("error loading css file");
    	}
    };
    var news_lv:LoadVars = new LoadVars();
    news_lv.load("newspage.txt");
    news_lv.onLoad = function(success:Boolean) {
    	if (success) {
    		news_txt.text = news_lv.content;
    	} else {
    		trace("unable to load text file");
    	}
    };
    news_txt.html= true;
    news_txt.editable= false;
    the textarea has the instancename news_txt

  2. #2
    Member
    Join Date
    Nov 2004
    Location
    Pasig City, Philippines
    Posts
    68
    Is your newsPage.txt like this:
    Code:
    content=....contents here....
    If not, then change the name to content.
    "Life is unfair... but beautiful."

    Scarlette Krimson
    marte_raphael.soliza@up.edu.ph

  3. #3
    Member
    Join Date
    May 2004
    Posts
    33
    ah thanks i needed to add that to my textfile thank you

    can i ask one little other thing

    i know how to use the loadmovie method

    to load an swf into a specific target but how do i
    achieve this when the button that loads the swf is on another
    level then the target

    i tried something like loadmovie("test.swf", _root.screen)

    screen being the istance name of my target mc but that didnt
    work
    Last edited by amaterasu; 12-08-2004 at 03:58 PM.

  4. #4
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    what you have is correct. you may have more luck with the method tho
    code:

    _root.screen.loadMovie("test.swf");


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