Hi,
I have a problem that is driving me nuts. Essentially I am loading a swf dynamically into a class. (SlideControlsMC) I can access the movieclips within the swf, and change things like alpha, x etc. But when I come to put an eventlistener on an MC, it simply isn’t detecting it.
I checked the depth of the SlideControlsMC and it is above everything else. I have imported the requred flash.import.events and when I compile, I get no errors.
The following is the code I am using add the eventlistener.
_slider.buttonLeft.buttonMode = true;
_slider.buttonLeft.useHandCursor = true;
_slider.buttonLeft.addEventListener(MouseEvent.CLICK, functionName)
This is how I am bringing in the .swf
private function loadSlider():void {
_sliderLoader = new Loader();
_sliderLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,addSlider);
_sliderLoader.load(new URLRequest("interface/slidecontrols.swf"));
_sliderLoader.x = 0;
_sliderLoader.y = 0;
//addChild(_sliderLoader);
}
public function addSlider(e:Event):void {
_slider = new SlideControlsMC;
addChild(_slider);
// position slider
// hide all of the markers
for (var i=0; i<=9; i++) {
item_mc = MovieClip(_slider.getChildByName("s"+i));
item_mc.visible=false;
trace(_slider.getChildByName("s"+i));
}
showSliderElements();
}
Can anyone shed light on why I am not getting any response what so ever?
Thanks for your help.