Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[FailConf 2018] Сказки о мертвецах

[FailConf 2018] Сказки о мертвецах

Ссылки: http://bit.ly/as-fail

Vladimir Dementyev

May 12, 2018
Tweet

More Decks by Vladimir Dementyev

Other Decks in Programming

Transcript

  1. Actioncript 2 ECMAScript 3 + “классы” (сахар для prototype) и

    интерфейсы + опциональная типизация + зачатки метапрограммирования
  2. Интерфейсы public interface IDraggle extends IVisualElement, IBitmapDrawable { function getSnapshot():IDraggleSnapshot;

    /** * @see ru.teachbase.behaviors.DragBehavior */ function get dragBehavior():DragBehavior; /** * @see ru.teachbase.behaviors.DragState */ function get dragState():String; }
  3. Proxy public class JSClient extends Proxy{ private var _target:String; public

    function JSClient(target:String) { _target = target; } internal function _wrap(body:String):String { return '(function(){ return '+body+';})'; } internal function _tojs(value:*):String { … } override flash_proxy function callProperty(name:*, …parameters):* { return ExternalInterface.call( _wrap(_target+"."+name+".apply("+_target+","+_tojs(parameters)+")") ); } }
  4. Пример class PopupContainer extends MovieClip { private var popups:Dictionary =

    new Dictionary(true); function PopupContainer() { addEventListener( MouseEvent.MOUSE_DOWN, // тип события onMouseDown, // обработчик (метод класса) true, // capture EventPriority.CURSOR_MANAGEMENT, // приоритет true // weakref ); } }
  5. Worker [Embed(source=" ../swfs/BgWorker.swf", mimeType="application/octet-stream")] private static var BgWorker_ByteClass:Class; private function

    createWorker():void { // create the background worker var workerBytes:ByteArray = new BgWorker_ByteClass(); var bgWorker:Worker = WorkerDomain.current.createWorker(workerBytes); // listen for worker state changes to know when the worker is running bgWorker.addEventListener(Event.WORKER_STATE, workerStateHandler); // set up communication between workers using // setSharedProperty(), createMessageChannel(), etc. // ... (not shown) bgWorker.start(); }
  6. ActionScript 4 function foo(i :int, s :String) // :double {

    let x = 2; // x :int var r = x; // r :double r *= 0.5; return r; } let f = foo; // f :(int, String) => double var d = f(1, "Hello"); // d :double
  7. Пример <?xml version="1.0"?> <s:Application xmlns:fx="http: //ns.adobe.com/mxml/2009" xmlns:s="library: //ns.adobe.com/flex/spark" addedToStage="init()"> <fx:Script><![CDATA[

    import ru.teachbase.utils.helpers.dummyBytes; import ru.teachbase.utils.helpers.lambda; protected function init():void { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; // ... } ]]> </fx:Script> <s:VGroup width="100%" id="controls" visible="false"> <s:HGroup > <s:Button label="connection" click="checkConnection()" /> <s:Button label="latency" click="checkLatency()" /> </s:HGroup> <s:RichText id="resultTxt" width="100%" height="300" /> </s:VGroup> </s:Application>
  8. Состояния <s:states> <s:State name="PreLoginState" /> <s:State name="AuthorizationState" /> <s:State name="LoggedInState"

    /> </s:states> <s:Button id=“button1” label.PreLoginState=“loading…" label.AuthorizationState=“Login" /> <s:Button id=“button2” includeIn="AuthorizationState" /> <s:Button id=“button3" excludeFrom="PreLoginState" />
  9. The main selling point of React Native is fast, iterative

    development, and a promise that the same code will run on both leading mobile platforms. Often, the pitch goes as far as to say that your existing team of front- end developers, already well-versed in JavaScript, can build a companion mobile app with just minimal training. тут должен был быть скрин из блога