Trying to get a button in a loaded swf to perform the same function as button in main swf using a local connection. Loaded swf is home page content with nav buttons for a scrolling web page. Tried to copy and paste some code I found but it is not working.
original working code for button in main swf:
btnProducts_mc.onRelease = function () {
this.enabled=false;
var result_tween:Object = new Tween(scroll_mc,"_x",Regular.easeOut,scroll_mc._x,-1560,1.5,true);
result_tween.onMotionFinished=function(){
btnProducts_mc.enabled=true;
}
local connection code for button in loaded swf:
on (release) {
salesLC = new LocalConnection();
salesLC.send(“sales_lc”, “goToProducts”, btnProducts);
}
local connection code in main swf:
salesLC = new LocalConnection();
salesLC.goToProducts = function(btnProducts) {
this.enabled=false;
var result_tween:Object = new Tween(scroll_mc,"_x",Regular.easeOut,scroll_mc._x,-1560,1.5,true);
result_tween.onMotionFinished=function(){
result_tween_mc.enabled=true;
};
listeningLC.connect(“sales_lc”);
}
Any enlightenment would be greatly appreciated.