Here is how my project looks:
I have three layers:
Layer 1.… Here is movieclip (instance name: :“clip” ) contains seven buttons (inst. name “btn1”…".btn 3"…till …".btn7")
Layer2…Here is UILoader component inserted on stage (instance name " ui" )
Layer3…Here is in Frame1 …Actionscript
Problem is, when click on any button, no image from external file appears and ERROR shows up: Access of undefined property btn1, btn2,…btn7 ,should be script placed in layer3 or somewhere else? Will you help me?
Actionscript in Layer 3:
/**buttons
/
btn1.addEventListener(MouseEvent.CLICK, showImg1);
btn2.addEventListener(MouseEvent.CLICK, showImg2);
.
.
.
btn7.addEventListener(MouseEvent.CLICK, showImg7);
**/funkctions
/
function showImg1 (e:MouseEvent):void{
ui.source = “…/Images/img1.jpg”;
}
function showImg2 (e:MouseEvent):void{
ui.source = “…/Images/img2.jpg”;
}
.
.
.
function showImg7 (e:MouseEvent):void{
ui.source = “…/Images/img7.jpg”;
}