10 type alist = (int * string) list
18 | `PlaceObject of int * int * SwfBaseType.matrix
19 | `FrameLabel of string * bool
22 | `ExportAssets of alist
23 | `ImportAssets of string * alist
24 | `EnableDebuger of string
25 | `EnableDebugger2 of string
26 | `ScriptLimits of int * int
27 | `SetTabIndex of int * int
28 | `FileAttributes of file_attrs
29 | `ImportAssets2 of string * alist
30 | `SymbolClass of alist
32 | `DefineScalingGrid of rect
33 | `DefineSceneAndFrameLabelData of (int * string) list * (int * string) list
35 | `SetBackgroundColor of int * int * int
36 | `DoABC of bool * string * int list
40 let symbol (id,name) =
41 [`Ui16 id; `Str name] in
43 [`Ui16 (List.length xs)];
44 HList.concat_map symbol xs]
49 let to_base : t -> int*SwfBaseOut.s list = function
50 `PlaceObject (id,depth,matrix) ->
56 | `FrameLabel (name,anchor) ->
58 tag 43 [`Str name; `Ui8 1]
67 | `ImportAssets (url, xs) ->
68 tag 57 @@ (`Str url)::alist xs
69 | `EnableDebuger passwd ->
71 | `EnableDebugger2 passwd ->
72 tag 64 [`Ui16 0; `Str passwd]
73 | `ScriptLimits (recursion, timeout) ->
74 tag 65 [`Ui16 recursion; `Ui16 timeout]
75 | `SetTabIndex (depth, order) ->
76 tag 66 [`Ui16 depth; `Ui16 order]
79 | `SetBackgroundColor(r,g,b) ->
81 | `FileAttributes {is_metadata; is_as3; use_network} ->
85 UB(1 , if is_metadata then 1 else 0);
86 UB(1 , if is_as3 then 1 else 0);
88 UB(1 , if use_network then 1 else 0);
91 | `ImportAssets2 (url, xs) ->
92 tag 71 @@ (`Str url)::`Ui8 1::`Ui8 0::alist xs
97 | `DefineScalingGrid {left;right;top;bottom} ->
98 tag 78 [`Rect (left,right,top,bottom)]
99 | `DefineSceneAndFrameLabelData (scenes, frames) ->
101 (`EUi32 (Int32.of_int @@ List.length xs))::
102 HList.concat_map (fun (x,y) -> [`EUi32 (Int32.of_int x); `Str y]) xs in
103 tag 86 @@ List.concat [
107 | `DoABC (lazyInit, name, data) ->
108 tag 82 @@ List.concat [
109 [if lazyInit then `Ui32 1l else `Ui32 0l;
111 List.map (fun n -> `Ui8 n) data ]