This file contains hidden or 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 loader:Loader = new Loader(); | |
| var request:URLRequest = new URLRequest('YOUR_SWF_PATH'); | |
| loader = new Loader(); | |
| loader.load(request); | |
| loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete); | |
| private function onLoaderComplete(event:Event):void | |
| { | |
| var loader:LoaderInfo = event.currentTarget as LoaderInfo; |
This file contains hidden or 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
| git clone git://github.com/creationix/nvm.git ~/.nvm | |
| echo ". ~/.nvm/nvm.sh" >> ~/.zshrc | |
| zsh | |
| nvm install v0.10.0 | |
| nvm alias default v0.10.0 |
This file contains hidden or 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
| public static function shuffleArray(source:Array):Array | |
| { | |
| for (var i:int=source.length-1; i>=0; i--) | |
| { | |
| var randomIdx:int = Math.floor(Math.random()*(i+1)); | |
| var itemAtIdx:Object = source[randomIdx]; | |
| source[randomIdx] = source[i]; | |
| source[i] = itemAtIdx; | |
| } | |
| return source; |
This file contains hidden or 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 pausePosition:Number = 0; | |
| public function pause():void | |
| { | |
| pausePosition = soundChannel.position; | |
| } | |
| public function resume():void | |
| { | |
| soundChannel = sound.play(pausePosition); |
This file contains hidden or 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
| handleMovementTrace: function(res) { | |
| this.parent(res); | |
| this.handleCornerSmoothing(res, 'x'); | |
| this.handleCornerSmoothing(res, 'y'); | |
| }, | |
| handleCornerSmoothing: function(res, collisionAxies) { | |
| var axies, belowCenter, diff, mod, size; | |
| axies = collisionAxies === 'x' ? 'y' : 'x'; | |
| if (res.collision[collisionAxies]) { |
This file contains hidden or 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
| ####################################### | |
| # Syntax Coloring Map For Telegraph | |
| ####################################### | |
| ####################################### | |
| # Datatypes (KEYWORD1) | |
| ####################################### | |
| ClassName KEYWORD1 |
This file contains hidden or 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
| protected function fun1(...rest):void{ | |
| trace(rest); | |
| } | |
| protected function fun2(some:*, thing:*, here:*, ...rest):void{ | |
| var newArg:* = 1; | |
| fun2.apply(null, [some, thing, here, newArg].concat(rest)); | |
| } |
This file contains hidden or 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 ac:ArrayCollection = new ArrayCollection(); | |
| ac.addItem({id:1, name:'Amo', age:'26'}); | |
| ac.addItem({id:2, name:'Octocat', age:'16'}); | |
| ac.addItem({id:3, name:'Koala', age:'26'}); | |
| var sort:Sort = new Sort(); | |
| sort.fields = [new SortField('id'), new SortField('age')]; | |
| ac.sort = sort; | |
| ac.refresh(); |
This file contains hidden or 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
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
This file contains hidden or 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
| @namespace s "library://ns.adobe.com/flex/spark"; | |
| /* DPI specific styles */ | |
| s|Button{ | |
| color:#000000; | |
| fontWeight:bold; | |
| } | |
| @media (application-dpi:240) | |
| { | |
| s|Button{ |