WP-Syntax
Отличный плагин, теперь код в моем блоге будет иметь привычный вид и подсветку.
Actionscript 3:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | package { import flash.display.Sprite; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; /** * @author Snut * @version 1.0 * @playerversion Flash 9 * @langversion 3.0 */ public class Test extends Sprite { //------------------------ // // Constructor // //------------------------ /** * Contructor */ public function Test() { super.stage.addEventListener(Event.ADDED_TO_STAGE, this.handler_added); } private function handler_added(event:Event):void { super.stage.removeEventListener(Event.ADDED_TO_STAGE, this.handler_added ); super.stage.addEventListener(MouseEvent.CLICK, this.handler_click); super.stage.addEventListener(Event.REMOVED_FROM_STAGE, this.handler_removed); } private function handler_removed(event:Event):void { super.stage.removeEventListener(MouseEvent.CLICK, this.handler_click); super.stage.removeEventListener(Event.REMOVED_FROM_STAGE, this.handler_removed); } public function myMethod(string:String):void { trace (string); } private function handler_click(evt:MouseEvent):void { this.myMethod('WP-syntax'); } } } |
Objective-C:
1 2 3 4 5 6 7 8 9 10 | #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; // insert code here... NSLog(@"Hello, World!"); [pool drain]; return 0; } |