Feb 10, 2005 #1 CLEUTA Programmer Joined Feb 1, 2005 Messages 13 Location RO Hi Anybody knows how the mouse efect is realised in Flsh on http://www.portalweb.3x.ro.thanks
Feb 10, 2005 1 #2 wangbar Programmer Joined Jul 23, 2001 Messages 1,906 Location GB Something like this,alter the speed variable and lengths of the lines to suit your needs: Code: function followMouse() { x += (_xmouse-x)/speed; y += (_ymouse-y)/speed; this.clear(); this.lineStyle(1, 0x000000); this.moveTo(x, 0); this.lineTo(x, 400); this.moveTo(0, y); this.lineTo(550, y); updateAfterEvent(); } // speed = 10; x = y=0; this.onEnterFrame = followMouse;code] Upvote 0 Downvote
Something like this,alter the speed variable and lengths of the lines to suit your needs: Code: function followMouse() { x += (_xmouse-x)/speed; y += (_ymouse-y)/speed; this.clear(); this.lineStyle(1, 0x000000); this.moveTo(x, 0); this.lineTo(x, 400); this.moveTo(0, y); this.lineTo(550, y); updateAfterEvent(); } // speed = 10; x = y=0; this.onEnterFrame = followMouse;code]
Feb 10, 2005 #3 wangbar Programmer Joined Jul 23, 2001 Messages 1,906 Location GB oops... Code: function followMouse() { x += (_xmouse-x)/speed; y += (_ymouse-y)/speed; this.clear(); this.lineStyle(1, 0x000000); this.moveTo(x, 0); this.lineTo(x, 400); this.moveTo(0, y); this.lineTo(550, y); updateAfterEvent(); } // speed = 10; x = y=0; this.onEnterFrame = followMouse; Upvote 0 Downvote
oops... Code: function followMouse() { x += (_xmouse-x)/speed; y += (_ymouse-y)/speed; this.clear(); this.lineStyle(1, 0x000000); this.moveTo(x, 0); this.lineTo(x, 400); this.moveTo(0, y); this.lineTo(550, y); updateAfterEvent(); } // speed = 10; x = y=0; this.onEnterFrame = followMouse;