I completely messed up my code and did not change the Movieclip names when copying it into StackOverflow, so it made no sense.
I am wondering if there is a better way to accomplish the following as3:
//THREE EVENT LISTENERS
shoe_icon.addEventListener(MouseEvent.MOUSE_DOWN, shoeApp);
top_icon.addEventListener(MouseEvent.MOUSE_DOWN, topApp);
bottom_icon.addEventListener(MouseEvent.MOUSE_DOWN, bottomApp);
//THREE FUNCTIONS THAT ALL CALL THE SAME FUNCTION BUT PASS A DIFFERENT VALUE
function shoeApp(event:MouseEvent):void{
buildSlider("Shoe");
}
function topApp(event:MouseEvent):void{
buildSlider("Top");
}
function bottomApp(event:MouseEvent):void{
buildSlider("Bottom");
}
//THIS IS MY MAIN FUNCTION WHICH IS ALL BASED ON THE SLIDERTYPE VARIABLE IT RECEIVES
function buildSlider(sliderType:String):void{
}
Not sure what you want to do here. Because listener all listeners are added to stage wow on MOUSE_DOWN you’ll call all 3 functions anyway. At this point you can handle this by single function which will call buildSlider 3 times with different params.
Maybe you want to handle this depends on what you MOUSE_DOWN? In this case you should add listeners to different objects instead of stage.