# "Variable addChild is not defined."

**URL:** <https://forum.kirupa.com/t/variable-addchild-is-not-defined/299677>\
**Category:** flash\
**Created:** [November 9, 2009, 4:11pm UTC](https://forum.kirupa.com/t/variable-addchild-is-not-defined/299677 "2009-11-09T16:11:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![activa](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@activa](https://forum.kirupa.com/u/activa)\
**Post date:** [November 9, 2009, 4:11pm UTC](https://forum.kirupa.com/t/variable-addchild-is-not-defined/299677/1 "2009-11-09T16:11:10Z")

</div>

I’ve got a utility function to load swfs. It places a progress bar onscreen for user feedback: “marker = addChild (new Preloader).”

When I migrated the function to an external class:

public static function loadFile (…) {  
marker = addChild (new Preloader).

I get an error “Variable addChild is not defined.”

I’m guessing this is a context issue–how does flash know what to attach the new child to?
