# Global stage reference problems when loading SWFs

**URL:** https://forum.kirupa.com/t/global-stage-reference-problems-when-loading-swfs/248766
**Category:** flash
**Created:** [January 11, 2008, 12:40pm UTC](https://forum.kirupa.com/t/global-stage-reference-problems-when-loading-swfs/248766 "2008-01-11T12:40:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![schmichael](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@schmichael](https://forum.kirupa.com/u/schmichael)
#### Post date: [January 11, 2008, 12:40pm UTC](https://forum.kirupa.com/t/global-stage-reference-problems-when-loading-swfs/248766/1 "2008-01-11T12:40:45Z")

</div>

Hi there, I have built an application using an animation class called Boostworthy from Ryan Taylor [www.booostworthy.com](http://www.boostworthy.com/blog/?p=170), it works great and has smooth animation and my published swf runs great.

My problem is that when I load this swf into another one it won’t run and I get the error:  
//Renderer (WARNING) :: startEnterFrame :: Unable to add a listener to the enter frame event because a global stage reference does not exist.

The animation classes require that I add a global stage reference and I have added that in my main App class that is the document class in my animation swf like this:  
[AS]  
import com.boostworthy.core.Global;  
Global.stage = stage;[/AS]  
This works fine when the swf runs on its own but when I load it into another movie I get the error mentioned above. I’ve tried setting this reference in different classes (my animation swf uses a number of classes) but no dice. I think that I might need to pass a reference to the stage from the top-level movie to the animation swf though I don’t know how to do this.  
I have tried like this:  
[AS]//code on top level movie  
var myApp:App = new App(this);  
//code inside App class (main class used for animation)  
import com.boostworthy.core.Global;  
public function App(mc:MovieClip){  
Global.stage = mc.stage  
}[/AS]  
but I get the same error message ☹  
I’m really stuck with this and I need to solve it as I have a project on that requires me to load my swfs into others.  
Any help really, really appreciated!  
Thanks in advance,  
Schm
