-
Line between 2 points
I am trying to create an activity which will test the user’s ability to identify the correct areas to measure between of 4 separate points. So they click once and that is position 1, they then click again and that is position 2. A line would then be draw dynamically between the two points. The user would then be required to click a 3rd and 4th time with a separate line being drawn between these points. The following code is almost right but it requires the user to click and hold the mouse down rather than click and release:
this.onMouseDown = function()
{
var n:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc" + n, n);
var x0:Number = _xmouse;
var y0:Number = _ymouse;
this.onMouseMove = function()
{
mc.clear();
mc.lineStyle(1);
mc.moveTo(x0,y0);
mc.lineTo(_xmouse,_ymouse);
updateAfterEvent();
};
};
this.onMouseUp = function()
{
delete this.onMouseMove;
};
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|