I write here, because after looking for a solution, I could not resolve my error…
var test:MovieClip;
var sign:Loader = new Loader();
sign.contentLoaderInfo.addEventListener(Event.COMPLETE, completSIGN);
sign.load(new URLRequest("http://files.zebest-3000.com/278374/3011/3011.swf"));
function completSIGN(e:Event):void
{
test = MovieClip(e.target.content);
addChild(test);
}
This is the error:
TypeError: Error #1009: Il est impossible d’accéder à la propriété ou à la méthode d’une référence d’objet nul. at Main::StateManager()
So, the movie (some videos work perfectly and others not) does not want to load in my container ; it seems there is a problem in the mapping… and can’t modify the distant movie.
- Is there an other method of loading a movie inside one other (I have try also to load with bytearray, but it’s the same)?
- Can we catch this error and relocate the instance to help him to find the correct way?
Based on your comment I assume that
StateManager()is called from the constructor of the document class of the remote SWF and it tries to accessstageusing something likethis.stageorthis.root.stage. Now, it’ll work without any issues when run as a standalone SWF because thestageproperty would’ve been set by the time document class’s constructor is called. When loaded remotelystageis set only after you add it in the complete handler.I’m not sure about this, but try calling
addChild(sign);before you callsign.load– you can remove those two lines from thecompleteSignmethod.