Targeting .fla from a seperate .as?!?

Hi all, first of all you must excuse me if none of this makes any sense, but here goes!

I have been given a project using AS3, which involves a flash app querying a web service before receiving a result and displaying it. I have joined on with this quite late on and most of the stuff is in place and working, except for this issue which is driving me crazy!

The main .fla file has three text boxes created on the stage using actionscript (named firstPlace, secondPlace and thirdPlace). There is a seperate AS file that gets the results from the web service (it pulls them from an XML) and creates variables out of them. But when I try to populate the three text boxes on the stage it does not work :m:

How do I go about passing the variables from this seperate AS file back to the stage?

Thanks in advance!

P.S. Sorry if this has already been asked elsewhere!

you need to send a reference of the text boxes - or their container - to the class. one way to do it could be to create a variable in the class:


private var text1:TextField; //(or whatever type it is)

and then a function that sets the variable to the text box on the stage:


public function setTextBox1(tf:TextField):void
{
  text1 = tf;
}

then on the timeline:


myClass.setTextBox1(myTextBox);

now you can use text1 in your class to set the text…

That worked a treat - thanks!!!