# \_root inside target

**URL:** <https://forum.kirupa.com/t/-root-inside-target/19557>\
**Category:** flash\
**Created:** [April 29, 2003, 8:28am UTC](https://forum.kirupa.com/t/-root-inside-target/19557 "2003-04-29T08:28:59Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![xzyfer](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@xzyfer](https://forum.kirupa.com/u/xzyfer)\
**Post date:** [April 29, 2003, 8:28am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/1 "2003-04-29T08:28:59Z")

</div>

ive loaded a movie into another and postitioned it…  
[AS]  
\_root.abc.\_x=“400”;  
\_root.abc.\_y=“200”;  
\_root.abc.loadMovie(“trig\_sub.swf”);  
[/AS]  
but once it is loaded where ever i have used \_root in the loaded movie (trig\_sub.swf) it nolonger works  
eg…  
on a button i have  
[AS]  
on(rollOver){  
\_root.menu.stop();  
}[/AS]

bnut this dosent work when it has been loaded into instance “abc” in the main movie…  
wat do i have to use instead of root to point at an instance?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 8:39am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/2 "2003-04-29T08:39:43Z")

</div>

yup… you’ll need to fix the addressing. :-\

here’s a little trick [http://www.kirupa.com/developer/actionscript/tricks/relativeaddressing.asp](http://www.kirupa.com/developer/actionscript/tricks/relativeaddressing.asp)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:19am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/3 "2003-04-29T09:19:41Z")

</div>

ok…  
heres i understand wat is being said…  
in the main time line of the movie to be loaded (trig\_sub.swf) i place: [AS] \_global.myAppMain = this; [/AS]  
and then everywhere i used [AS]\_root[/AS] i just delete the \_root and put myAppMain instead.?

have i got this right, because i cant get it working…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:23am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/4 "2003-04-29T09:23:45Z")

</div>

yes. you got it right… and it works. :-\

keep trying. or attach your files. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:25am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/5 "2003-04-29T09:25:19Z")

</div>

question…  
if i have a dynamic textbox with the var name “bob”.  
and i later state  
[AS] myAppMain.bob=“hello”;[/AS]  
this should work right\>…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:29am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/6 "2003-04-29T09:29:16Z")

</div>

is “bob” the instance name of the TextField or you assigned “bob” to the variable of the TextField?

if it’s the variable… it should work.  
if it’s the instance name… you use

```auto
myAppMain.bob.text = "hello";

```

=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:34am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/7 "2003-04-29T09:34:55Z")

</div>

nah i have created a dynamic text box…made it non-selectable and insisde an MC with the instance name “menu” i have put  
myAppMain.bob=“hello”;  
and the varible name of the text box, under properties, is bob.  
but it just turns up blank.  
aslo in \_root\>menu\>1-10 i have a button and i told it one mouse over to myAppMain=“goodbye?”;  
neither of which have any affect…  
y?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:36am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/8 "2003-04-29T09:36:17Z")

</div>

i menat to put myAppMain.bob=“goodbye?”;

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:39am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/9 "2003-04-29T09:39:39Z")

</div>

well, obviously there’s a problem… could you attach the files? 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:40am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/10 "2003-04-29T09:40:35Z")

</div>

ijm not familer with that…  
how would i do it…?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 9:44am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/11 "2003-04-29T09:44:38Z")

</div>

click here \<a href=“newreply.php?s=&action=newreply&threadid=21919”\>\<img alt=“you’ll be able to attach your files if you click here” src=“images/post\_reply.gif” border=“0” width=“90” height=“25”\>\</a\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 10:07am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/12 "2003-04-29T10:07:40Z")

</div>

sorr y i though he ment in flash…  
i cant load them their too big put u can get them here…  
[http://144.136.39.3/flash/](http://144.136.39.3/flash/)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 11:16am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/13 "2003-04-29T11:16:41Z")

</div>

any luck guys?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 5:39pm UTC](https://forum.kirupa.com/t/-root-inside-target/19557/14 "2003-04-29T17:39:31Z")

</div>

sorry, i can’t download the files… i got a **gateway timeout**. :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2003, 6:08am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/15 "2003-04-30T06:08:16Z")

</div>

sorry about that guys…  
alls better now…  
[http://144.136.39.3/flash](http://144.136.39.3/flash)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2003, 7:13am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/16 "2003-04-30T07:13:08Z")

</div>

also useful (sometimes more so) is the “\_parent” property.

\_parent refers to the timeline that contains the timeline with the \_parent reference.

ie mc1 contains mc2 which contains mc3  
from mc3, \_parent.\_parent.\_name would return “mc1”

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2003, 7:27am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/17 "2003-04-30T07:27:40Z")

</div>

you have to publish the swf to flash 6 version, not flash 5. :-\

otherwise you’ll need to use \_parent, as david suggested. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2003, 8:16am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/18 "2003-04-30T08:16:06Z")

</div>

yer i finally figure it out…  
thx guys/…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2003, 8:29am UTC](https://forum.kirupa.com/t/-root-inside-target/19557/19 "2003-04-30T08:29:11Z")

</div>

no problem. 😛 =)
