This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MouseTrail.Interface | |
{ | |
private var pen:MovieClip; | |
public function Interface (root:MovieClip) | |
{ | |
var c:MovieClip= root.createEmptyMovieClip("test", root.getNextHighestDepth()); | |
// Do something | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
ROOT= ~/Desktop/TODO | |
mtasc $ROOT/mousetrail/src/MouseTrail/Main.as -main | |
-swf $ROOT/mousetrail/bin/mouseTrail.swf | |
-out $ROOT/mousetrail/bin/Interface.swf | |
-cp $ROOT/mousetrail/src | |
open $ROOT/mousetrail/bin/Interface.swf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MouseTrail.Interface; | |
class MouseTrail.Main | |
{ | |
private static var m:Main; | |
var int:Interface; | |
public function Main(root:MovieClip) | |
{ | |
int = new Interface(root); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// emptyMovieClip as a MovieClip - x & y at 0 | |
// Rectangle( x, y, width, height ) | |
var currentRect:Rectangle = new Rectangle( 0, 0, 50, 50 ); | |
var mc:MovieClip = emptyMovieClip.createEmptyMovieClip("mc", emptyMovieClip.getNextHighestDepth()); | |
drawRectangle( mc, currentRect.x, currentRect.y, currentRect.width, currentRect.height, 0x000000, 100, 1, 0x000000, 100 ); | |
private function drawRectangle(mc:MovieClip, rectX:Number, rectY:Number, rectWidth:Number, rectHeight:Number, fillColor:Number, fillAlpha:Number, lineThickness:Number, lineColor:Number, lineAlpha:Number) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function calculateDistance(xPos:Number, yPos:Number, xPos2:Number, yPos2:Number):Number | |
{ | |
var diffX:Number = xPos - xPos2; | |
var diffY:Number = yPos - yPos2; | |
var distance:Number = Math.sqrt(diffX * diffX + diffY * diffY); | |
if (distance < 0) | |
{ | |
distance *= 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function calculateAngle( xPos:Number, yPos:Number ):Number | |
{ | |
var pA:Point = new Point( 240, 180 ); | |
var pB:Point = new Point( xPos, yPos ); | |
var AP:Point = new Point( 0, 10 ); | |
var BP:Point = new Point( ( pA.x - pB.x ), ( pA.y - pB.y ) ); | |
var D:Number = ( AP.x * BP.x ) + ( AP.y * BP.y ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function rotate(mc:MovieClip):Point | |
{ | |
var o:Object = { x:mc.x, y:mc.y }; | |
var q:Object = {}; | |
var r:Number = mc.rotation; | |
r = r / 180 * Math.PI; | |
q.x = (Math.cos(r) * o.x) - (Math.sin(r) * o.y); | |
q.y = (Math.sin(r) * o.x) + (Math.cos(r) * o.y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function pickSide():Number | |
{ | |
stageSide = Random.choose(sides); | |
if(stageSide == lastSides) | |
{ | |
pickSide(); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var angle:Number = 0; | |
private var speed:Number = 5; | |
private var radius:Number = 30; | |
private function circularMotion():Void | |
{ | |
var rad:Number = (angle / 180) * Math.PI; | |
clip._x = clip._x + Math.cos(rad); | |
clip._y = clip._y - Math.sin(rad); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>TITLE</title> | |
<script> | |
function myfunction() | |
{ | |
alert("javascript is working!"); | |
} | |
</script> | |
</head> |
OlderNewer