So I am going off of an example I believe was in the tip of the day thread, although I could be mistaken. It is a fairly trivial example (I removed the non-essential modifications I’ve been adding to this) for loading one movie from another. The problem I am having is when I click on the movie, I get a rather generic error:
Error #2044: Unhandled StatusEvent:. level=error, code=
I tried using some try-catch logic, but wasn’t able to figure out what the problem was. Any advice?
// FILE 1
// AS2animation.fla
// one movie clip animation named animation_mc on the timeline
// local connection instance to receive events
var AVM_lc:LocalConnection = new LocalConnection();
// stopAnimation event handler
AVM_lc.stopAnimation = function(){
animation_mc.stop();
}
// listen for events for "AVM2toAVM1"
AVM_lc.connect("AVM2toAVM1");
//FILE 2
// AS2loader.fla
import flash.net.LocalConnection;
// local connection instance to communicate to AVM1 movie
var AVM_lc:LocalConnection = new LocalConnection();
// loader loads AVM1 movie
var loader:Loader = new Loader();
loader.load(new URLRequest("AS2animation.swf"));
addChild(loader);
// when AVM1 movie is clicked, call stopPlayback
loader.addEventListener(MouseEvent.CLICK, stopPlayback);
function stopPlayback(event:MouseEvent):void
{
// send stopAnimation event to "AVM2toAVM1" connection
AVM_lc.send("AVM2toAVM1", "stopAnimation");
trace("Should be stopping now");
}