Skip to main content
Known Participant
October 5, 2009
Answered

Dyanamic Text Fields Working Funny

  • October 5, 2009
  • 1 reply
  • 593 views

Hello!

I am trying to get some dyanmic text fields to work in my flash movie. I got one to work and have had trouble getting more than one. I think I kinda got it but it works but works funny. I am trying to load text in two different places. When I click on the first instance (Philosophy Section) nothing shows up. When I check the other instance (Eco_Conscience) the text shows up and then when I go back to the Philosophy Section it works. BUT it doesn't work on the first try. I am attaching code and link. Can anyone see the problem and help me fix the code?

Thanks! Sandra

LINK:

http://www.sandraschmitt.com/coclico/index100.html

CODE ON FRAME 1:


//Loaded external text fields

var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest;


function textLoaded(event:Event):void {
    eco_txt.text = textLoader.data;
    philosophy_txt.text = textLoader.data;
}

CODE ON LOCAL FRAME FOR PHILOSOPHY TEXT:

textReq = new URLRequest("text_philosophy.txt");


textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);

CODE ON LOCAL FRAME FOR ECO TEXT:

textReq = new URLRequest("text_eco.txt");


textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);

This topic has been closed for replies.
Correct answer webqaflash

Just try this.

CODE ON FRAME 1:


//Loaded external text fields

var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest;

CODE ON LOCAL FRAME FOR PHILOSOPHY TEXT:

textReq = new URLRequest("text_philosophy.txt");


textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, philosophyTextLoaded);

function philosophyTextLoaded(event:Event):void {

    philosophy_txt.text = textLoader.data;
}

CODE ON LOCAL FRAME FOR ECO TEXT:

textReq = new URLRequest("text_eco.txt");


textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);

function ecoTextLoaded(event:Event):void {
     eco_txt.text = textLoader.data;
}

And your site looks beautiful!!!!!!!!!!!!!!1

1 reply

webqaflash
webqaflashCorrect answer
Inspiring
October 5, 2009

Just try this.

CODE ON FRAME 1:


//Loaded external text fields

var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest;

CODE ON LOCAL FRAME FOR PHILOSOPHY TEXT:

textReq = new URLRequest("text_philosophy.txt");


textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, philosophyTextLoaded);

function philosophyTextLoaded(event:Event):void {

    philosophy_txt.text = textLoader.data;
}

CODE ON LOCAL FRAME FOR ECO TEXT:

textReq = new URLRequest("text_eco.txt");


textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);

function ecoTextLoaded(event:Event):void {
     eco_txt.text = textLoader.data;
}

And your site looks beautiful!!!!!!!!!!!!!!1

Known Participant
October 5, 2009

Thank you so much for the code and the compliment. It's coming along slowly but surely... That part is working fine now!!!

Sandra

webqaflash
Inspiring
October 5, 2009

You are welcome.