A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [F8] Externally loaded text works 99% right

  1. #1
    Member
    Join Date
    Dec 2003
    Location
    Philadelphia, PA
    Posts
    57

    [F8] Externally loaded text works 99% right

    I'm having a small, annoying issue with an externally loaded text file into a dynamic text field. Basically, these symbols don't work:

    &



    What's the problem with these? Is there a way to get around this issue? I've tried character embedding, but that doesn't change

  2. #2
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    External text? XML? If so, its because Flash interprets this as a XML command.

  3. #3
    Member
    Join Date
    Dec 2003
    Location
    Philadelphia, PA
    Posts
    57

    txt

    is there a way to get around that?

    It's linking to and loading variables from a .txt file that is plain text file.

    Up to this point, I've just been switching '&' with 'and', and finding quick fixes like that, but Ideally I'd like to know that any and all text dumped in there will work without having to double check it, or for the convenience of allowing the client to change it

  4. #4
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    Hmmm. I don't know. Let me check. I may be able to find something.

  5. #5
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    Could you email me the fla?
    My email is: asrdoc {AT} tds {DOT} net

  6. #6
    Member
    Join Date
    Dec 2003
    Location
    Philadelphia, PA
    Posts
    57

    sent

    I just sent the fla and the linked txt file..

  7. #7
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    ok.

  8. #8
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    What exactly are you loading? Because I can't find any text loading script in the fla.....

  9. #9
    Member
    Join Date
    Dec 2003
    Location
    Philadelphia, PA
    Posts
    57

    hidden

    it's slightly hidden.
    If you double click the movie clip "scroller_mc" the as in that button - so it automatically adjusts the length of the scrollbar with the amount of text loaded...

    The code reads like this:

    Code:
    // declare new function with name of "loadVarFunction"
    function loadVarFunction() {
    	//start the load variables object code
    	myVars = new LoadVars();
    	myVars.onLoad = function (success) {
    		if (success) {
    			_parent.hell_txt.html = true;
    			_parent.hell_txt.htmlText = (myVars.txt);  //txt = variable in text file
    		} else {
    			_parent.hell_txt.htmlText = "Error loading text file";
    		}
    	}
    	myVars.load("http://www.equal7.com/www/bleedthedream/content/btdnews.txt");
    	
    	//set variables for the scrollBar 
    	initialX = this._x ;
    	initialY = this._y;
    	endY = _parent.hell_txt._y + _parent.hell_txt._height - this._height;
    }
    //call the function we made above
    loadVarFunction();
    
    //code for updating the text/scrollBar when you move it
    this.onEnterFrame = function() {
    	scrollLength=Math.abs(endY-initialY);
    	maxScroll=_parent.hell_txt.maxscroll;
    	current=((this._y - initialY)/scrollLength*maxScroll);
    	_parent.hell_txt.scroll = current+1;
    }
    
    this.onPress = function() {
    	this.startDrag(false, initialX ,initialY, initialX, endY);
    }
    this.onRelease = function() {
    	stopDrag();
    	}

  10. #10
    -_-
    Join Date
    Oct 2005
    Location
    US
    Posts
    1,694
    Yep. Its the XML alright. I don't know if you can stop it from reading it as a command though. I think you can't. Maybe ATG knows.

  11. #11
    Senior Member
    Join Date
    May 2004
    Location
    East Yorkshire, England
    Posts
    423
    try swapping & for &
    Not sure about the codes for the others but " is possibly "
    Feeling chatty?
    http://www.mitsuku.com

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