Hiya, I have written a function where a movieclip containing a dynamic text box is attached and a string is passed to it to display in the text box. My problem is that the message only displays the first time and then the text box does not display the messages the next time the function is called. i am using another function to clear the error message once the user clicks again.
Please would someone give me a bit of guidance as to how I can make the message display every time the function is called?
Thanks in advance,
Hectors
Here’s the code:
function error(theMessage:String) {
attachMovie("error2", "error2_mc", this.getNextHighestDepth(), {_x:_xmouse, _y:_root._ymouse});
error2_mc.error_txt.text = theMessage;
}
//function to clear error box on mouse down
function clearDisplay() {
error2_mc._visible = false;
error2_mc.removeMovieClip();
}
_root.onMouseDown = function() {
clearDisplay();
};
//validation
function validate():Boolean {
if (msg1_txt.text.length<=0 || msg1_txt.text == msgInit) {
error("Please enter your message");
return false;
} else if .......etc.