# Passing data from parent swf to child swf

**URL:** <https://forum.kirupa.com/t/passing-data-from-parent-swf-to-child-swf/250491>\
**Category:** flash\
**Created:** [January 30, 2008, 12:01am UTC](https://forum.kirupa.com/t/passing-data-from-parent-swf-to-child-swf/250491 "2008-01-30T00:01:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon4341189](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anon4341189](https://forum.kirupa.com/u/anon4341189)\
**Post date:** [January 30, 2008, 12:01am UTC](https://forum.kirupa.com/t/passing-data-from-parent-swf-to-child-swf/250491/1 "2008-01-30T00:01:15Z")

</div>

hi guys,

I have written a class to load external SWFs into the parent SWF using the loader class. What i wish to do, is to set up a function to pass data to the child SWF.

Currently, I have the following issues:

I want to be able to pass the data to a function, but only have the data passed to the child SWF once it has completed loading (if it hasn’t been loaded yet).

Also, I need the child SWF to be able to detect when data is passed so that it can act accordingly.

Currently, I have the following:

-To detect the change, the loader class must dispatch an event and have the child swf listen for the event.

-To wait for the oncomplete, i’d need to listen for the onComplete event. But how does one wait until the onCompleteEvent before doing something?

Any ideas and input appreciated.

Cheers 🙂
