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
// Cuepoints for non flvs | |
var dirtyVideoListerner:Function = function (_ns:NetStream, _time:Number, _func:Function):void | |
{ | |
this.addEventListener(Event.ENTER_FRAME, checkTime); | |
var callingMC:MovieClip = this; | |
function checkTime():void | |
{ | |
if (_ns.time > _time) |
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
drawDottedLine( new Point( 0, 0 ), new Point( 500, 100 ), 0x000000, 1, 3, 0, 1 ); | |
function drawDottedLine( _p1:Point, _p2:Point, _color:uint = 0x000000, _thickness:Number = 1, _gap:Number = 10, _offset:Number = 0, _percent:Number = 1 ):void{ | |
var line:MovieClip = new MovieClip(); | |
addChild( line ); | |
var distance:Number = distance( _p1, _p2 ); |
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
function roundToDecimal( number, decimalPlaces ){ | |
var multiplier = Math.pow( 10, decimalPlaces ); | |
return Math.round( number * multiplier ) / multiplier; | |
} | |
function roundNearest( number, nearest ){ | |
return Math.round( number / nearest ) * nearest; | |
} |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
function centerTo(_object:DisplayObject, _ref:DisplayObject):void{ | |
if (_object != null){ | |
var _wString:String = "width"; | |
var _hString:String = "height"; | |
if (_ref == stage){ | |
_wString = "stageWidth"; | |
_hString = "stageHeight"; | |
trace("stage"); | |
} | |
var _refWidth:Number = _ref[_wString]; |
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 flash.external.ExternalInterface; | |
public static function log(msg:String, caller:Object = null):void{ | |
var str:String = ""; | |
if(caller){ | |
str = getQualifiedClassName(caller); | |
str += ":: "; | |
} | |
str += msg; | |
trace(str); |
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
var rotationdifference:Number = Math.atan2(Math.sin(targetrotation-originalrotation),Math.cos(targetrotation-originalrotation)); |
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
stage.addEventListener(Event.ENTER_FRAME, centerIt); | |
function centerIt(e:Event){ | |
var boundsRect:Rectangle = mc.getBounds( this ); | |
targetX = ( ( stage.stageWidth - mc.width ) / 2 ) - ( boundsRect.left - mc.x ); | |
targetY = ( ( stage.stageHeight - mc.height ) / 2 ) - ( boundsRect.top - mc.y ); | |
mc.x += ( targetX - mc.x ) / 4; |
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
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough banksean@gmail.com | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
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
myMovieClip.addEventListener(MouseEvent.CLICK, handleClick); | |
function handleClick(e:MouseEvent):void { | |
var interactiveObject:InteractiveObject = e.target as InteractiveObject; | |
var li:LoaderInfo = LoaderInfo(interactiveObject.root.loaderInfo); | |
var url:String = li.parameters.clickTag; | |
if (url) { | |
if (ExternalInterface.available) { | |
var userAgent:String = ExternalInterface.call('function(){ return navigator.userAgent; }'); |