0
votes

I have a slider component setup in my flash app. This slider has a few extra movieclips that I have created.

From the parent timeline, I would like to change the width of one of those movieclips in my slider.

I can't just access the child movieclip like I usually would (slider_mc.other_mc.width) because it sits in a slider so it gives me this error:

ReferenceError: Error #1069: Property other_mc not found on fl.controls.Slider and there is no default value. at play_fla::MainTimeline/frame1()

Does anyone know how I could do this?

Thanks

EDIT:

Just to explain further:

the slider component is a movieclip with the instance name slider_mc and other_mc sits inside the slider movieclip. I need to alter other_mc's width from the parent movieclip.

Hope that helps.

1

1 Answers

2
votes

You need to listen to events from the Slider. Something like this should work if both the slider and other mc are in the same timeline

import fl.events.SliderEvent;

slider_mc.addEventListener(SliderEvent.THUMB_DRAG, thumbDragHandler);

function thumbDragHandler(event:SliderEvent):void {
    other_mc.width = event.value;
}