# Child SWF access Parent SWF variables

**URL:** <https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995>\
**Category:** flash\
**Created:** [June 21, 2008, 5:54pm UTC](https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995 "2008-06-21T17:54:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)\
**Post date:** [June 21, 2008, 5:54pm UTC](https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995/1 "2008-06-21T17:54:12Z")

</div>

What do I need to do?

The external swf is located at: [www.website.com/folder/folder/child.swf](http://www.website.com/folder/folder/child.swf)

In the parent.swf, I put System.security.allowDomain(“[www.website.com](http://www.website.com)”);  
When you click a button on the child.swf it’s suppose to trace data from the parent.swf, but it returns undefined.

What am I doing wrong? I MUST access data from the parent.swf

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [June 21, 2008, 5:58pm UTC](https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995/2 "2008-06-21T17:58:08Z")

</div>

Most likely an issue with referencing the data than security. Are you sure you got the path right?

---

<div class="post-metadata">

**Author:** ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)\
**Post date:** [June 21, 2008, 6:03pm UTC](https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995/3 "2008-06-21T18:03:06Z")

</div>

Yes. 100%.

I tried calling the variable by using \_global, \_root, \_level0, to no avail.

I googled up a useful link, maybe if someone understands what this guy is saying: [http://www.outside-media.co.uk/blog/?page\_id=5](http://www.outside-media.co.uk/blog/?page_id=5)

---

<div class="post-metadata">

**Author:** ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)\
**Post date:** [June 21, 2008, 6:10pm UTC](https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995/4 "2008-06-21T18:10:26Z")

</div>

Apparently the problem resides in crossdomains, I believe, because when the parent.swf is uploaded on the website, it works fine.

-edit-

Nevermind. Crossdomain.xml changed nothing. The problem still resides that if the parent.swf is not on the server (which it will be eventually, but for testing purposes it’s not efficient) it doesn’t work.

---

<div class="post-metadata">

**Author:** ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)\
**Post date:** [June 21, 2008, 7:11pm UTC](https://forum.kirupa.com/t/child-swf-access-parent-swf-variables/263995/5 "2008-06-21T19:11:24Z")

</div>

Alright, I’m pissed.

The problem was because my variable used freaking “\_GLOBAL” and it can’t.

Thanks alot \*\*\*\*ty Flash Docs. :mario:
