I have a small chat application and I really need to have a small whiteboard. I want to be able to have a small rectangle shape (with a custom made border) and inside of that border I need the whiteboard to sit.
I know there are several ways to accomplish this (I've tried several and none work properly). What I have now is one swf containing the whiteboard (seen below) and another swf containing the chat application. I can load the whiteboard swf into the chat but then I can draw all over the place. I have also placed two conditional statements in the whiteboard to keep it from going outside the edges of the clip but it doesn't seem to work.
The code in whiteboard.swf:
"
this.lineStyle(2, 0xff0000, 100);
var clip = this._parent;
this.onMouseDown = function() {
if( (_xmouse >= clip._x && _xmouse<= (clip._x+clip._width) && _ymouse >= clip._y && _ymouse <= (clip._y+clip._height)))
{
moveTo(_xmouse, _ymouse);
onMouseMove = function() {
if( (_xmouse >= clip._x && _xmouse<= (clip._x+clip._width) && _ymouse >= clip._y && _ymouse <= (clip._y+clip._height)))
{
lineTo(_xmouse, _ymouse);
}
}
}
}
this.onMouseUp = function() {
this.onMouseMove = noLine;
}
"
Does anyone out there know how to have this simple whiteboard code inside of a movie clip? I've been searching for days and can't find an answer anywhere. Most tutorials are too simple and don't tackle this problem.
Thanks in advance.