# Targeting .fla from a seperate .as?!?

**URL:** <https://forum.kirupa.com/t/targeting-fla-from-a-seperate-as/265490>\
**Category:** flash\
**Created:** [July 9, 2008, 3:49pm UTC](https://forum.kirupa.com/t/targeting-fla-from-a-seperate-as/265490 "2008-07-09T15:49:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddoyle85](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@ddoyle85](https://forum.kirupa.com/u/ddoyle85)\
**Post date:** [July 9, 2008, 3:49pm UTC](https://forum.kirupa.com/t/targeting-fla-from-a-seperate-as/265490/1 "2008-07-09T15:49:04Z")

</div>

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 Ⓜ

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!

---

<div class="post-metadata">

**Author:** ![jsn\_greenbag](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jsn\_greenbag](https://forum.kirupa.com/u/jsn_greenbag)\
**Post date:** [July 9, 2008, 7:55pm UTC](https://forum.kirupa.com/t/targeting-fla-from-a-seperate-as/265490/2 "2008-07-09T19:55:27Z")

</div>

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:

```auto

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

```

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

```auto

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

```

then on the timeline:

```auto

myClass.setTextBox1(myTextBox);

```

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

---

<div class="post-metadata">

**Author:** ![ddoyle85](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@ddoyle85](https://forum.kirupa.com/u/ddoyle85)\
**Post date:** [July 10, 2008, 9:22am UTC](https://forum.kirupa.com/t/targeting-fla-from-a-seperate-as/265490/3 "2008-07-10T09:22:16Z")

</div>

That worked a treat - thanks!!!
