Problem with .visible
Hi All,
I am creating a comment box in my training tracking tool. General idea was something like that :
1. click icon -> comment box appear
2. enter text -> click 'ok' or 'cancel' button -> close comment box and add to flash coockie.
3. change icon colour if any comment in it.
I created all instances and the issue is that, when you click the icon "Comm1a" (empty) or "Comm1b" (with comment) comment box appear just for milisecond and disappear. I copy whole code to the new file and it works. Don't know why in original file it doesn't.
Please note that:
CommentBox1 - is TextArea for comment
Comm1a - is button for comment box w/o comment
Comm1b - is button for comment box with comment
Comm1ton - is button with mouse over for adding comment
Comm1non - is button with mouse away for deleting comment
Comm1tout - is movie clip on Comm1ton to change graphic depends from mouse position
Comm1nout - is movie clip on Comm1non to change graphic depends from mouse position
import flash.events.Event;
import flash.ui.Mouse;
import flash.events.MouseEvent;
Comm1a.addEventListener(MouseEvent.CLICK,clickComm1a);
Comm1b.addEventListener(MouseEvent.CLICK,clickComm1a);
Comm1ton.addEventListener(MouseEvent.CLICK,AddComm1);
Comm1non.addEventListener(MouseEvent.CLICK,RemoveComm1);
Comm1tout.addEventListener(MouseEvent.ROLL_OVER,over1ok);
Comm1ton.addEventListener(MouseEvent.ROLL_OUT,out1ok);
Comm1nout.addEventListener(MouseEvent.ROLL_OVER,over1no);
Comm1non.addEventListener(MouseEvent.ROLL_OUT,out1no);
var so = SharedObject.getLocal("frm1","/"); // SO
Comm1b.visible = false;
CommentBox1.visible = false;
Comm1tout.visible = false;
Comm1ton.visible = false;
Comm1nout.visible = false;
Comm1non.visible = false;
function clickComm1a(event:MouseEvent):void{
CommentBox1.visible = true;
Comm1tout.visible = true;
Comm1nout.visible = true;
}
function over1ok (event:MouseEvent):void{
Comm1tout.visible = false;
Comm1ton.visible = true;
}
function out1ok (event:MouseEvent):void{
Comm1tout.visible = true;
Comm1ton.visible = false;
}
function over1no (event:MouseEvent):void{
Comm1nout.visible = false;
Comm1non.visible = true;
}
function out1no (event:MouseEvent):void{
Comm1nout.visible = true;
Comm1non.visible = false;
}
function AddComm1(event:MouseEvent):void{
CommentBox1.visible = false;
Comm1tout.visible = false;
Comm1ton.visible = false;
Comm1nout.visible = false;
Comm1non.visible = false;
so.data.CommentBox1=CommentBox1.text;
so.flush();
Comm1a.visible = false;
Comm1b.visible = true;
}
function RemoveComm1(event:MouseEvent):void{
CommentBox1.visible = false;
Comm1tout.visible = false;
Comm1ton.visible = false;
Comm1nout.visible = false;
Comm1non.visible = false;
so.data.CommentBox1=null;
so.flush();
CommentBox1.text == null;
Comm1a.visible = true;
Comm1b.visible = false;
}
Plus new issue appear. When you press "ok" or "cancel" button which triggers RemoveComm1 or AddComm1, the button you clicked stays visible.
Thanks in advance for any suggestions.
