Hi, ive been trying to wrap my brain around this problem for about ten hours, i cant find out what im doing wrong…
im loading an xml driven scroller (scroller.swf) into a movieclip (holderMC) like this:
var swfLoader:Loader = new Loader();
holderMC.addChild(swfLoader);
var bgURL:URLRequest=new URLRequest(“scroller.swf”);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
swfLoader.load(bgURL);
function loadProdComplete(e:Event):void {
trace(“file loaded”);
}
the xmlcode has htmltext which calls an event function on click:
<description><![CDATA[<a href=‘event:magicalFunction’>Click this text</a>]]></description>
the function as defined in the scroller.swf is this:
function magicalFunction(event:TextEvent):void {
MovieClip(root).clip.gotoAndPlay(2);
trace(“haha”);
}
and this works fine as long as i dont try to load scroller.swf into HolderMC, i.e. it works if i have my movieclip named ‘clip’ in scroller.swf… but that was just a test to see if i could even get the function called from the htmltext; soon as i load scroller.swf into HolderMC, even though ‘clip’ is where it should be (on a layer in the same timeline as HolderMC, in the root), it loads fine, but when i click the link in the scroller, it tells me magicalFunction isnt defined and has no properties…
Does this have something to do with how Im loading scroller.swf into HolderMC? Is this because of a child/parent thing?
Help would hugely appreciated!
Maybe im not describing this all well enough? I mean is this post even understandible?