A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Why doesn't this script work??

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Location
    Holland - Den Haag
    Posts
    131

    Why doesn't this script work??

    I have a script that make a tekstfield and put a scrollbar next to it.
    the text comes from a *.txt file.
    but it doesn't seem to work.

    Code:
    _root.loadVariables("1.txt"); // txt loader
    drawWekomsTekst = function(){
    	
    // welkoms content
    _root.createTextField("myTextField", 1, 0, 0, 50, 200);
    myTextField.wordWrap = true;
    myTextField.text = textField;
    initialization = {_targetInstanceName:"myTextField", horizontal:false};
    _root.attachMovie("FScrollBarSymbol", "myScrollbar", 2, initialization);
    myScrollBar._x = myTextField._width;
    myScrollBar.setSize(myTextField._height);
    
    	clearInterval (drawWekomsTekstfunc);
    }
    
    //intervals
    drawWekomsTekstfunc = setInterval( drawWekomsTekst, 100);
    i hope that somebody can help me with it. if i don't load the text from *.txt and insert directly with "myTextField.text = "text";
    it works fine.

    thanx

    grafx::..

  2. #2
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817
    what's not working? Post the FLA...

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Location
    Holland - Den Haag
    Posts
    131
    it doesn't scroll the tekst loaded in to the tekstfield..
    Attached Files Attached Files

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Location
    Pittsburgh
    Posts
    252
    Hi grafx,

    try this:

    Code:
    mydepth =100 // z depth
    s = new LoadVars();
    s.onLoad = drawWekomsTekst;
    s.load("1.txt");
    
    function drawWekomsTekst(){
    _root.createTextField("myTextField", 1, 0, 0, 50, 200);
    myTextField.wordWrap = true;
    myTextField.text = this.textField;
    initialization = {_targetInstanceName:"myTextField", horizontal:false};
    _root.attachMovie("FScrollBarSymbol", "myScrollbar", 2, initialization);
    myScrollBar._x = myTextField._width;
    myScrollBar.setSize(myTextField._height);
    myScrollBar.setScrollContent("myTextField");
    }
    Hope this helps some,
    Dunc

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Location
    Holland - Den Haag
    Posts
    131
    thanx alot.
    it wasn't easy to put in the movie where it should be but it works now.

    thanx

    grafx::..

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