# Code only executes in test movie

**URL:** <https://forum.kirupa.com/t/code-only-executes-in-test-movie/263243>\
**Category:** flash\
**Created:** [June 13, 2008, 5:48pm UTC](https://forum.kirupa.com/t/code-only-executes-in-test-movie/263243 "2008-06-13T17:48:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![goodlie](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@goodlie](https://forum.kirupa.com/u/goodlie)\
**Post date:** [June 13, 2008, 5:48pm UTC](https://forum.kirupa.com/t/code-only-executes-in-test-movie/263243/1 "2008-06-13T17:48:23Z")

</div>

Hello  
My code below executes fine in test movie mode (cntrl-enter), but when I publish and open the .swf file nothing happens. What am I doing wrong?  
:crying:  
stop();  
import flash.display.Loader;  
import flash.display.LoaderInfo;  
import flash.net.URLRequest;  
import flash.events.Event;  
///  
var myLoader:Loader = new Loader();  
var myUrlReq:URLRequest = new URLRequest(“Prius.swf”);  
myLoader.load(myUrlReq);  
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);  
function onLoaded(event:Event):void  
{  
holder\_mc.x = 0;  
holder\_mc.y = 120;  
holder\_mc.addChild(myLoader.content);  
}
