mako 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. data/bin/mako +133 -0
  2. data/lib/mako/build.rb +336 -0
  3. data/lib/mako/data/flash_widget_dev_core/Dependencies.txt +10 -0
  4. data/lib/mako/data/flash_widget_dev_core/libs/Degrafa_.2.11.swc +0 -0
  5. data/lib/mako/data/flash_widget_dev_core/libs/KogneatoGraphics.swc +0 -0
  6. data/lib/mako/data/flash_widget_dev_core/libs/KogneatoSymbols.swc +0 -0
  7. data/lib/mako/data/flash_widget_dev_core/libs/flash.swc +0 -0
  8. data/lib/mako/data/flash_widget_dev_core/src/assets/images/RichTextEditor.png +0 -0
  9. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/ARLRDBD.TTF +0 -0
  10. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/FTD_____.TTF +0 -0
  11. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdana.ttf +0 -0
  12. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanab.ttf +0 -0
  13. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanai.ttf +0 -0
  14. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanaz.ttf +0 -0
  15. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/DefaultError.png +0 -0
  16. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barbgfill.png +0 -0
  17. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barshadow.png +0 -0
  18. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bold.png +0 -0
  19. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bullets.png +0 -0
  20. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/center.png +0 -0
  21. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/close-x.png +0 -0
  22. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/fullscreenPopup_close.png +0 -0
  23. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc.png +0 -0
  24. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc2.png +0 -0
  25. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc3.png +0 -0
  26. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/qa.png +0 -0
  27. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/so.png +0 -0
  28. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/importIcon.png +0 -0
  29. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/italic.png +0 -0
  30. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/justify.png +0 -0
  31. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/kogLogo.png +0 -0
  32. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/left.png +0 -0
  33. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href-disabled.png +0 -0
  34. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href.png +0 -0
  35. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
  36. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink.png +0 -0
  37. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-delete.png +0 -0
  38. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
  39. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-edit.png +0 -0
  40. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip.png +0 -0
  41. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/pencil.png +0 -0
  42. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/right.png +0 -0
  43. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/underline.png +0 -0
  44. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayButton.png +0 -0
  45. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
  46. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
  47. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
  48. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
  49. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
  50. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
  51. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/creatorStyle.css +57 -0
  52. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/style.css +929 -0
  53. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/embeddedfonts.swf +0 -0
  54. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/helpBubble.swf +0 -0
  55. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
  56. data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/videobg.swf +0 -0
  57. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/LICENSE.txt +27 -0
  58. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/CubeRotate.as +48 -0
  59. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Distortion.as +168 -0
  60. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/DistortionConstants.as +16 -0
  61. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Door.as +57 -0
  62. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Flip.as +62 -0
  63. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Gate.as +57 -0
  64. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Pop.as +53 -0
  65. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Push.as +48 -0
  66. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/SimpleDistortion.as +619 -0
  67. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/CubeRotateInstance.as +94 -0
  68. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DistortBaseInstance.as +258 -0
  69. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DoorInstance.as +116 -0
  70. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/FlipInstance.as +79 -0
  71. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/GateInstance.as +163 -0
  72. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PopInstance.as +91 -0
  73. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PushInstance.as +76 -0
  74. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBounds.as +64 -0
  75. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBoundsUtil.as +42 -0
  76. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/SimpleDisplayObjectBoundsUtil.as +60 -0
  77. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/HMAC.as +108 -0
  78. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5.as +250 -0
  79. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5Stream.as +343 -0
  80. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA1.as +250 -0
  81. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA224.as +226 -0
  82. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA256.as +229 -0
  83. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/WSSEUsernameToken.as +100 -0
  84. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFade.as +107 -0
  85. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadeInstance.as +178 -0
  86. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadePopUpBlocker.as +88 -0
  87. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/errors/IllegalStateError.as +57 -0
  88. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Address.as +41 -0
  89. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Email.as +34 -0
  90. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Phone.as +34 -0
  91. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCard.as +47 -0
  92. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCardParser.as +234 -0
  93. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/BitString.as +34 -0
  94. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/JPGEncoder.as +584 -0
  95. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/PNGEncoder.as +133 -0
  96. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/DynamicURLLoader.as +48 -0
  97. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/IURIResolver.as +70 -0
  98. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/MimeTypeMap.as +192 -0
  99. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URI.as +2139 -0
  100. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URIEncodingBitmap.as +122 -0
  101. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/proxies/RFC2817Socket.as +179 -0
  102. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Database.as +55 -0
  103. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Definition.as +59 -0
  104. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Dict.as +322 -0
  105. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/DictionaryServer.as +50 -0
  106. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/MatchStrategy.as +55 -0
  107. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Response.as +59 -0
  108. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ConnectedEvent.as +44 -0
  109. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DatabaseEvent.as +54 -0
  110. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionEvent.as +55 -0
  111. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +55 -0
  112. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DictionaryServerEvent.as +55 -0
  113. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DisconnectedEvent.as +44 -0
  114. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ErrorEvent.as +64 -0
  115. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchEvent.as +54 -0
  116. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +56 -0
  117. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/NoMatchEvent.as +44 -0
  118. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/CompleteResponseEvent.as +55 -0
  119. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/SocketHelper.as +70 -0
  120. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSON.as +76 -0
  121. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONDecoder.as +303 -0
  122. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONEncoder.as +277 -0
  123. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONParseError.as +79 -0
  124. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONToken.as +79 -0
  125. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenType.as +49 -0
  126. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenizer.as +605 -0
  127. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/ArrayUtil.as +166 -0
  128. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DateUtil.as +657 -0
  129. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DictionaryUtil.as +73 -0
  130. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/IntUtil.as +85 -0
  131. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/NumberFormatter.as +63 -0
  132. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/StringUtil.as +220 -0
  133. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/XMLUtil.as +148 -0
  134. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/ServiceBase.as +39 -0
  135. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/URLLoaderBase.as +93 -0
  136. data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/events/ServiceEvent.as +67 -0
  137. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/geom/ColorMatrix.as +1 -0
  138. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTween.as +1 -0
  139. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweenTimeline.as +1 -0
  140. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweener.as +1 -0
  141. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Back.as +1 -0
  142. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Bounce.as +1 -0
  143. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Circular.as +1 -0
  144. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Cubic.as +1 -0
  145. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Elastic.as +1 -0
  146. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Exponential.as +1 -0
  147. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Linear.as +1 -0
  148. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quadratic.as +1 -0
  149. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quartic.as +1 -0
  150. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quintic.as +1 -0
  151. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Sine.as +1 -0
  152. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/AutoHidePlugin.as +1 -0
  153. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/BlurPlugin.as +1 -0
  154. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorAdjustPlugin.as +1 -0
  155. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorTransformPlugin.as +1 -0
  156. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/CurrentFramePlugin.as +1 -0
  157. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/IGTweenPlugin.as +1 -0
  158. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MatrixPlugin.as +1 -0
  159. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MotionBlurPlugin.as +1 -0
  160. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SmartRotationPlugin.as +1 -0
  161. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SnappingPlugin.as +1 -0
  162. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SoundTransformPlugin.as +1 -0
  163. data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/utils/SWFBridgeAS3.as +83 -0
  164. data/lib/mako/data/flash_widget_dev_core/src/etc/GUID.as +82 -0
  165. data/lib/mako/data/flash_widget_dev_core/src/etc/MathExt.as +114 -0
  166. data/lib/mako/data/flash_widget_dev_core/src/gs/OverwriteManager.as +143 -0
  167. data/lib/mako/data/flash_widget_dev_core/src/gs/TweenFilterLite.as +502 -0
  168. data/lib/mako/data/flash_widget_dev_core/src/gs/TweenLite.as +512 -0
  169. data/lib/mako/data/flash_widget_dev_core/src/gs/TweenMax.as +987 -0
  170. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Back.as +14 -0
  171. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Bounce.as +22 -0
  172. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Circ.as +14 -0
  173. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Cubic.as +14 -0
  174. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Elastic.as +27 -0
  175. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Expo.as +16 -0
  176. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Linear.as +16 -0
  177. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quad.as +14 -0
  178. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quart.as +14 -0
  179. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quint.as +14 -0
  180. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Sine.as +14 -0
  181. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Strong.as +14 -0
  182. data/lib/mako/data/flash_widget_dev_core/src/gs/easing/easing_readme.txt +14 -0
  183. data/lib/mako/data/flash_widget_dev_core/src/gs/events/TweenEvent.as +26 -0
  184. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BevelFilterVars.as +63 -0
  185. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BlurFilterVars.as +42 -0
  186. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/ColorMatrixFilterVars.as +86 -0
  187. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/DropShadowFilterVars.as +66 -0
  188. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/GlowFilterVars.as +57 -0
  189. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenFilterLiteVars.as +93 -0
  190. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenLiteVars.as +269 -0
  191. data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenMaxVars.as +103 -0
  192. data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenEvent.as +17 -0
  193. data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenObject.as +27 -0
  194. data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenSingleton.as +86 -0
  195. data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Constant.as +7 -0
  196. data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlow.as +7 -0
  197. data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlowFast.as +8 -0
  198. data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Shake.as +12 -0
  199. data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFast.as +7 -0
  200. data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFastSlow.as +8 -0
  201. data/lib/mako/data/flash_widget_dev_core/src/jac/image/ImageUtils.as +173 -0
  202. data/lib/mako/data/flash_widget_dev_core/src/jac/image/ResizeStyle.as +52 -0
  203. data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorBase.mxml +504 -0
  204. data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorConfig.as +45 -0
  205. data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorEvents.as +38 -0
  206. data/lib/mako/data/flash_widget_dev_core/src/materia/Dialog.as +35 -0
  207. data/lib/mako/data/flash_widget_dev_core/src/materia/MateriaButton.as +35 -0
  208. data/lib/mako/data/flash_widget_dev_core/src/materia/PopUpAlert.mxml +271 -0
  209. data/lib/mako/data/flash_widget_dev_core/src/materia/components/GradientBackground.as +41 -0
  210. data/lib/mako/data/flash_widget_dev_core/src/materia/components/PercentField.mxml +104 -0
  211. data/lib/mako/data/flash_widget_dev_core/src/materia/components/ScrollableSizableImage.mxml +654 -0
  212. data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextAreaWithDefaultText.mxml +94 -0
  213. data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextInputWithDefaultText.mxml +94 -0
  214. data/lib/mako/data/flash_widget_dev_core/src/materia/components/VertCenterTextRenderer.mxml +37 -0
  215. data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/ImportEvent.as +22 -0
  216. data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/itemRenderers/CheckBoxColumn.mxml +23 -0
  217. data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDetails.mxml +68 -0
  218. data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDisplay.mxml +38 -0
  219. data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGrid.mxml +247 -0
  220. data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGridEvent.as +20 -0
  221. data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerColumn.as +13 -0
  222. data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerDataGrid.mxml +692 -0
  223. data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputItem.mxml +584 -0
  224. data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputObject.as +28 -0
  225. data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/KogneatoToolTip.as +196 -0
  226. data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/TipManager.as +150 -0
  227. data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpBubble.mxml +245 -0
  228. data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpDot.mxml +21 -0
  229. data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpManager.as +92 -0
  230. data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpObject.as +33 -0
  231. data/lib/mako/data/flash_widget_dev_core/src/materia/help/IHelpGuided.as +7 -0
  232. data/lib/mako/data/flash_widget_dev_core/src/materia/media/ImageCacherImage.mxml +56 -0
  233. data/lib/mako/data/flash_widget_dev_core/src/materia/media/MateriaUploader.as +61 -0
  234. data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/Question.as +386 -0
  235. data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionGroup.as +313 -0
  236. data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionSet.as +21 -0
  237. data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/KogneatoToolTip.as +196 -0
  238. data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/TipManager.as +150 -0
  239. data/lib/mako/data/flash_widget_dev_core/src/materia/utils/CommonUtils.as +186 -0
  240. data/lib/mako/data/flash_widget_dev_core/src/materia/utils/DateUtils.as +273 -0
  241. data/lib/mako/data/flash_widget_dev_core/src/materia/utils/ImageCacher.as +93 -0
  242. data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/Randomize.as +19 -0
  243. data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/SimpleClone.as +32 -0
  244. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Color.as +102 -0
  245. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Draw.as +65 -0
  246. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dashed.as +48 -0
  247. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dotted.as +83 -0
  248. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Check.as +27 -0
  249. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Rect.as +12 -0
  250. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBevel.as +35 -0
  251. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBorder.as +39 -0
  252. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRound.as +33 -0
  253. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRoundBorder.as +62 -0
  254. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/TriangleEquilateral.as +25 -0
  255. data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/X.as +28 -0
  256. data/lib/mako/data/flash_widget_dev_core/src/nm/errors/ScoringError.as +10 -0
  257. data/lib/mako/data/flash_widget_dev_core/src/nm/errors/StorageError.as +10 -0
  258. data/lib/mako/data/flash_widget_dev_core/src/nm/events/ButtonEvent.as +25 -0
  259. data/lib/mako/data/flash_widget_dev_core/src/nm/events/PayloadEvent.as +14 -0
  260. data/lib/mako/data/flash_widget_dev_core/src/nm/events/StandardEvent.as +26 -0
  261. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/Question.as +72 -0
  262. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionGroup.as +87 -0
  263. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionSet.as +35 -0
  264. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/WidgetSettings.as +14 -0
  265. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerEvents.as +17 -0
  266. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerMessageEvent.as +31 -0
  267. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/logging/Log.as +92 -0
  268. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/scoring/Scoring.as +87 -0
  269. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageManager.as +91 -0
  270. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageTable.as +72 -0
  271. data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/engines/EngineCore.as +222 -0
  272. data/lib/mako/data/flash_widget_dev_core/src/nm/geom/Dimension.as +76 -0
  273. data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/Respondus.as +612 -0
  274. data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusAnswer.as +11 -0
  275. data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusError.as +18 -0
  276. data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuestion.as +43 -0
  277. data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuiz.as +68 -0
  278. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/AlertWindow.as +182 -0
  279. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/BlueButton.as +102 -0
  280. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button.as +88 -0
  281. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button_base.as +168 -0
  282. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Component.as +98 -0
  283. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ContentBlocker.as +38 -0
  284. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FlexUIScaler.as +59 -0
  285. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FormInput.as +191 -0
  286. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/GrabZoomClip.as +305 -0
  287. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/HelpLayer.as +55 -0
  288. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Label.as +25 -0
  289. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List.as +62 -0
  290. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List_Base.as +644 -0
  291. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProcessingBar.as +112 -0
  292. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar.as +35 -0
  293. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar_base.as +69 -0
  294. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar.as +163 -0
  295. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar_base.as +378 -0
  296. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollClip.as +468 -0
  297. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText.as +29 -0
  298. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText_base.as +295 -0
  299. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/SimpleScrollBar.as +247 -0
  300. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StageRef.as +34 -0
  301. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTank.as +233 -0
  302. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTankHorizontal.as +109 -0
  303. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ToolTip.as +930 -0
  304. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/TweeningDragDropBankList.as +503 -0
  305. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window.as +144 -0
  306. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window_base.as +385 -0
  307. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/CenterScale.as +27 -0
  308. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowManager.as +163 -0
  309. data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowStage.as +96 -0
  310. data/lib/mako/data/flash_widget_dev_core/src/nm/util/BitField.as +99 -0
  311. data/lib/mako/data/flash_widget_dev_core/src/nm/util/ObjPeek.as +148 -0
  312. data/lib/mako/data/flash_widget_dev_core/src/nm/util/Objects.as +49 -0
  313. data/lib/mako/data/flash_widget_dev_core/src/nm/util/Printer.as +548 -0
  314. data/lib/mako/data/flash_widget_dev_core/src/nm/util/StringUtil.as +12 -0
  315. data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/FaultEvent.as +37 -0
  316. data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingCall.as +211 -0
  317. data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingConnection.as +41 -0
  318. data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingService.as +214 -0
  319. data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/ResultEvent.as +36 -0
  320. data/lib/mako/data/flash_widget_dev_core/src/sandy/util/DistortImage.as +281 -0
  321. data/lib/mako/data/flash_widget_dev_core/src/sandy/util/SandyPoint.as +29 -0
  322. data/lib/mako/data/flash_widget_dev_core/src/sandy/util/Triangle.as +32 -0
  323. data/lib/mako/data/html/thistest.html +0 -0
  324. data/lib/mako/data/template_creator/src/Creator.mxml +138 -0
  325. data/lib/mako/data/template_creator/src/assets/images/RichTextEditor.png +0 -0
  326. data/lib/mako/data/template_creator/src/assets/materia/images/DefaultError.png +0 -0
  327. data/lib/mako/data/template_creator/src/assets/materia/images/barbgfill.png +0 -0
  328. data/lib/mako/data/template_creator/src/assets/materia/images/barshadow.png +0 -0
  329. data/lib/mako/data/template_creator/src/assets/materia/images/bold.png +0 -0
  330. data/lib/mako/data/template_creator/src/assets/materia/images/bullets.png +0 -0
  331. data/lib/mako/data/template_creator/src/assets/materia/images/center.png +0 -0
  332. data/lib/mako/data/template_creator/src/assets/materia/images/close-x.png +0 -0
  333. data/lib/mako/data/template_creator/src/assets/materia/images/fullscreenPopup_close.png +0 -0
  334. data/lib/mako/data/template_creator/src/assets/materia/images/importIcon.png +0 -0
  335. data/lib/mako/data/template_creator/src/assets/materia/images/italic.png +0 -0
  336. data/lib/mako/data/template_creator/src/assets/materia/images/justify.png +0 -0
  337. data/lib/mako/data/template_creator/src/assets/materia/images/left.png +0 -0
  338. data/lib/mako/data/template_creator/src/assets/materia/images/oml-href-disabled.png +0 -0
  339. data/lib/mako/data/template_creator/src/assets/materia/images/oml-href.png +0 -0
  340. data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
  341. data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink.png +0 -0
  342. data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-delete.png +0 -0
  343. data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
  344. data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-edit.png +0 -0
  345. data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip.png +0 -0
  346. data/lib/mako/data/template_creator/src/assets/materia/images/pencil.png +0 -0
  347. data/lib/mako/data/template_creator/src/assets/materia/images/right.png +0 -0
  348. data/lib/mako/data/template_creator/src/assets/materia/images/underline.png +0 -0
  349. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayButton.png +0 -0
  350. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
  351. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
  352. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
  353. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
  354. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
  355. data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
  356. data/lib/mako/data/template_creator/src/assets/materia/styles/creatorStyle.css +63 -0
  357. data/lib/mako/data/template_creator/src/assets/materia/styles/style.css +1127 -0
  358. data/lib/mako/data/template_creator/src/assets/materia/swf/embeddedfonts.swf +0 -0
  359. data/lib/mako/data/template_creator/src/assets/materia/swf/helpBubble.swf +0 -0
  360. data/lib/mako/data/template_creator/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
  361. data/lib/mako/data/template_creator/src/assets/materia/swf/videobg.swf +0 -0
  362. data/lib/mako/data/template_creator/src/components/SmallRichTextEditor.mxml +678 -0
  363. data/lib/mako/data/template_creator/src/components/SmallRichTextEditorToolbar.mxml +133 -0
  364. data/lib/mako/data/templates/html/README.md +11 -0
  365. data/lib/mako/data/templates/html/_creator/build.yaml +12 -0
  366. data/lib/mako/data/templates/html/_creator/creator.html +19 -0
  367. data/lib/mako/data/templates/html/_creator/css/creator.less +29 -0
  368. data/lib/mako/data/templates/html/_creator/js/creator.coffee +122 -0
  369. data/lib/mako/data/templates/html/_creator/test.html +0 -0
  370. data/lib/mako/data/templates/html/_engine/build.yaml +12 -0
  371. data/lib/mako/data/templates/html/_engine/css/widget.scss +18 -0
  372. data/lib/mako/data/templates/html/_engine/js/widget.coffee +143 -0
  373. data/lib/mako/data/templates/html/_engine/widget.html +21 -0
  374. data/lib/mako/data/templates/html/_icons/icon-275.png +0 -0
  375. data/lib/mako/data/templates/html/_icons/icon-394.png +0 -0
  376. data/lib/mako/data/templates/html/_icons/icon-60.png +0 -0
  377. data/lib/mako/data/templates/html/_icons/icon-92.png +0 -0
  378. data/lib/mako/data/templates/html/_score/score_module.php +48 -0
  379. data/lib/mako/data/templates/html/_score/test_score_module.php +157 -0
  380. data/lib/mako/data/templates/html/_screen-shots/1-thumb.png +0 -0
  381. data/lib/mako/data/templates/html/_screen-shots/1.png +0 -0
  382. data/lib/mako/data/templates/html/_screen-shots/2-thumb.png +0 -0
  383. data/lib/mako/data/templates/html/_screen-shots/2.png +0 -0
  384. data/lib/mako/data/templates/html/_screen-shots/3-thumb.png +0 -0
  385. data/lib/mako/data/templates/html/_screen-shots/3.png +0 -0
  386. data/lib/mako/data/templates/html/build.yaml +4 -0
  387. data/lib/mako/data/templates/html/demo.yaml +7 -0
  388. data/lib/mako/data/templates/html/install.yaml +94 -0
  389. data/lib/mako/path.rb +48 -0
  390. data/lib/mako/scaffold.rb +69 -0
  391. metadata +597 -0
@@ -0,0 +1,548 @@
1
+ /* See the file "LICENSE.txt" for the full license governing this code. */
2
+ package nm.util
3
+ {
4
+ import flash.display.Bitmap;
5
+ import flash.display.BitmapData;
6
+ import flash.display.BlendMode;
7
+ import flash.display.PixelSnapping;
8
+ import flash.display.Sprite;
9
+ import flash.geom.Matrix;
10
+ import flash.geom.Rectangle;
11
+ import flash.printing.PrintJob;
12
+ import flash.printing.PrintJobOptions;
13
+ import flash.text.TextField;
14
+ import flash.text.TextFormat;
15
+ import jac.image.ImageUtils;
16
+ import nm.ui.layout.CenterScale;
17
+ //import .CrosswordSpace;
18
+ /**
19
+ * A class that handles all printing in Flash so you don't have to.
20
+ *
21
+ * @author Scott Rapp
22
+ */
23
+ public class Printer
24
+ {
25
+ //--------------------------------------------------------------------------
26
+ //
27
+ // Variables
28
+ //
29
+ //--------------------------------------------------------------------------
30
+ /**
31
+ * Keeps track of updates between previewing. Keeps buffer preview up to date when printing occurs.
32
+ */
33
+ private var hasPreviewed:Boolean;
34
+ //----------------------------------
35
+ // References
36
+ //----------------------------------
37
+ private var headerMC:Sprite;
38
+ private var footerMC:Sprite;
39
+ //----------------------------------
40
+ // Virtual Page Dimensions
41
+ //----------------------------------
42
+ private var PAGEWIDTH:Number;
43
+ private var PAGEHEIGHT:Number;
44
+ private var bitmapResolution:Number = 2880;
45
+ //----------------------------------
46
+ // data storage
47
+ //----------------------------------
48
+ /**
49
+ * References to the sprites requested to be printed
50
+ */
51
+ private var sourcePages:Array;
52
+ /**
53
+ * holder sprites generated by the preview function,
54
+ * used for output to the printer, contains a content clip where the bitmap is drawn
55
+ */
56
+ private var renderedPages:Array;
57
+ //private var bitmapData:Array;
58
+ /**
59
+ * Array of bitmapData objects for each page
60
+ */
61
+ private var bitmapDataPages:Array;
62
+ //----------------------------------
63
+ // margin sizes
64
+ //----------------------------------
65
+ /**
66
+ * NOT the actual margins. Used in temporary margin calculation and storage.
67
+ * This is because someone can ditch the footer or header and the margin should not reset to zero.
68
+ */
69
+ private var topMargin:Number;
70
+ private var bottomMargin:Number;
71
+ /**
72
+ * These are the ACTUAL margin sizes
73
+ */
74
+ private var topPgMargin:Number;
75
+ private var bottomPgMargin:Number;
76
+ private var leftPgMargin:Number;
77
+ private var rightPgMargin:Number;
78
+ //----------------------------------
79
+ // set/update margins
80
+ //----------------------------------
81
+ private var headerMargin:Number;
82
+ private var headerHeight:Number;
83
+ private var footerMargin:Number;
84
+ private var footerHeight:Number;
85
+ //--------------------------------------------------------------------------
86
+ //
87
+ // Constructor
88
+ //
89
+ //--------------------------------------------------------------------------
90
+ /**
91
+ * Creates the printer object and sets custom heights and widths for a virtual page used as a reference.
92
+ *
93
+ * @usage var Printer:printer = new printer (printArea, 0, 1100, 800);
94
+ * @param print_mc Sprite. This is a Sprite that will be used to create all printing BitmapData on.
95
+ * @param depthNum Number. A free depth in the print_mc to create the BitmapData.
96
+ * @param customHeight Number. Optional. Send a custom height to the printer class, changing the height of the virtual page.
97
+ * @param customWidth Number. Optional. Send a custom width to the printer class, changing the width of the virtual page.
98
+ */
99
+ public function Printer(pageWidth:Number = 612, pageHeight:Number = 792)
100
+ {
101
+ //Initialization.
102
+ this.pageWidth = pageWidth;
103
+ this.pageHeight = pageHeight;
104
+ reset();
105
+ }
106
+ //--------------------------------------------------------------------------
107
+ //
108
+ // Member Functions
109
+ //
110
+ //--------------------------------------------------------------------------
111
+ /**
112
+ * This function correctly disposes of BitmapData, clears the arrays of Sprites and BitmapData, resets the margins and previews, and calls resetPrintingData.
113
+ *
114
+ * @usage Printer.resetBuffer();
115
+ */
116
+ public function reset():void
117
+ {
118
+ //reset all variables
119
+ cleanUp();
120
+ sourcePages = new Array();
121
+ topPgMargin = bottomPgMargin = leftPgMargin = rightPgMargin = 0;
122
+ topMargin = bottomMargin = 0;
123
+ headerMargin = headerHeight = footerMargin = footerHeight = 0;
124
+ }
125
+ /**
126
+ * Special internal function that clears the Printing bitmap data after each printing.
127
+ */
128
+ public function cleanUp():void
129
+ {
130
+ for(var i:* in bitmapDataPages) bitmapDataPages[i].dispose();
131
+ bitmapDataPages = new Array();
132
+ for(var j:* in renderedPages) removeSprite(renderedPages[i]);
133
+ renderedPages = new Array();
134
+ hasPreviewed = false;
135
+ }
136
+ /**
137
+ * This function sets the margins to any width in pixels. The default is 0.
138
+ * A top and bottom margin may not be smaller than the header or footer, and is automatically resized.
139
+ * All margins tend to be accurate except when both sets of opposing margins do not match:
140
+ * Ex. 30, 40, 50, 60. Unknown, but negligable, errors seem to occur.
141
+ *
142
+ * @usage Printer.setMargins(20, 20, 10, 10);
143
+ * @param top Number. Optional. The pixel amount of the Top Margin.
144
+ * @param bottom Number. Optional. The pixel amount of the Bottom Margin.
145
+ * @param left Number. Optional. The pixel amount of the Left Margin.
146
+ * @param right Number. Optional. The pixel amount of the Right Margin.
147
+ */
148
+ public function setMargins(top:Number = 0, bottom:Number = 0, left:Number = 0, right:Number = 0):void
149
+ {
150
+ topMargin = top;
151
+ bottomMargin = bottom;
152
+ leftPgMargin = left;
153
+ rightPgMargin = right;
154
+ //topMargin and bottomMargin stored in case header or footer is destroyed later
155
+ topPgMargin = topMargin;
156
+ bottomPgMargin = bottomMargin;
157
+ var txt:TextField;
158
+ //redraw header
159
+ if(headerMC)
160
+ {
161
+ txt = TextField(headerMC.getChildByName('txt'));
162
+ setHeader(headerHeight, headerMargin, txt.text, txt.getTextFormat());
163
+ }
164
+ //redraw footer
165
+ if(footerMC)
166
+ {
167
+ txt = TextField(footerMC.getChildByName('txt'));
168
+ setFooter(footerHeight, footerMargin, txt.text, txt.getTextFormat());
169
+ }
170
+ hasPreviewed = false;
171
+ }
172
+ /**
173
+ * Removes the given sprite from its parent
174
+ */
175
+ public function removeSprite(mc:Sprite):Sprite
176
+ {
177
+ if(mc && mc.parent) mc.parent.removeChild(mc);
178
+ return mc;
179
+ }
180
+ /**
181
+ * This places a header on the printing page, and automatically makes the top margin large enough to hold it.
182
+ * The text and format are not necessary, and creating a new header destroys the old one.
183
+ * Margin is the width from the top the header is moved down, while size is the size of the text field.
184
+ *
185
+ * @usage Printer.setHeader ( 25, 10, "Created by New Media.", headerFormat);
186
+ * @param size Number. The total size of the header in pixels.
187
+ * @param margin Number. The amount of space in pixels from the top of the header the text begins.
188
+ * @param text String. Optional. The text to appear in the header.
189
+ * @param textFormat TextFormat. Optional. A special format for the text in the header.
190
+ */
191
+ public function setHeader(height:Number, margin:Number, text:String, textFormat:TextFormat):void
192
+ {
193
+ headerHeight = height;
194
+ headerMargin = margin;
195
+ if(height + margin > topPgMargin) topPgMargin = margin + height;
196
+ else topPgMargin = topMargin;
197
+ if(headerMC != null)
198
+ {
199
+ removeSprite(headerMC);
200
+ headerMC = null;
201
+ }
202
+ if(text.length > 0)
203
+ {
204
+ headerMC = new Sprite();
205
+ headerMC.name = "header";
206
+ var txt:TextField = new TextField();
207
+ txt.name = "txt";
208
+ txt.x = leftPgMargin;
209
+ txt.y = margin;
210
+ txt.width = PAGEWIDTH - rightPgMargin - leftPgMargin;
211
+ txt.height = height;
212
+ if(textFormat) txt.defaultTextFormat = textFormat;
213
+ txt.text = text;
214
+ headerMC.addChild(txt);
215
+ }
216
+ hasPreviewed = false;
217
+ }
218
+ /**
219
+ * This places a footer on the printing page, and automatically makes the bottom margin large enough to hold it.
220
+ * The text and format are not necessary, and creating a new footer destroys the old one.
221
+ * Margin is the width from the top the footer is moved down, while size is the size of the text field.
222
+ *
223
+ * @usage Printer.setFooter ( 25, 10, "Created by New Media.", footerFormat);
224
+ * @param size Number. The total size of the footer in pixels.
225
+ * @param margin Number. The amount of space in pixels from the top of the footer the text begins.
226
+ * @param text String. Optional. The text to appear in the footer.
227
+ * @param textFormat TextFormat. Optional. A special format for the text in the footer.
228
+ */
229
+ public function setFooter(height:Number, margin:Number, text:String, textFormat:TextFormat):void
230
+ {
231
+ footerHeight = height;
232
+ footerMargin = margin;
233
+ if(margin + height > bottomPgMargin) bottomPgMargin = margin + height;
234
+ else bottomPgMargin = bottomMargin;
235
+ if(footerMC != null)
236
+ {
237
+ removeSprite(footerMC);
238
+ footerMC = null;
239
+ }
240
+ if(text.length > 0)
241
+ {
242
+ //create the footer
243
+ footerMC = new Sprite();
244
+ footerMC.name = "footer";
245
+ //Add a text field to the footer
246
+ var txt:TextField = new TextField();
247
+ txt.name = "txt";
248
+ txt.x = leftPgMargin;
249
+ txt.y = PAGEHEIGHT - height;
250
+ txt.width = PAGEWIDTH - rightPgMargin - leftPgMargin;
251
+ txt.height = height;
252
+ if(textFormat) txt.defaultTextFormat = textFormat;
253
+ txt.text = "";
254
+ txt.text = text;
255
+ footerMC.addChild(txt);
256
+ }
257
+ hasPreviewed = false;
258
+ }
259
+ /**
260
+ * Returns how many pages the sent sprite will take up
261
+ *
262
+ * @usage var myMCpages:Number = Printer.howManyPages(myMC);
263
+ * @param mc Sprite. This is a reference to a Sprite whose dimensions vs. the virtual page determine the number of pages needed.
264
+ * @return Number. The number of pages this sprite will take to print based off the current virtual page.
265
+ */
266
+ public function calcNumPages(mc:Sprite):Number
267
+ {
268
+ return (Math.ceil(mc.height/PAGEHEIGHT)*Math.ceil(mc.width/PAGEWIDTH));
269
+ }
270
+ /**
271
+ * Returns how many pages are in the buffer.
272
+ *
273
+ * @usage var totalPages:Number = Printer.pageTotal();
274
+ * @return Number. The number of pages in the entire buffer.
275
+ */
276
+ public function pageTotal():Number
277
+ {
278
+ var count:Number = 0;
279
+ var numSourcePages:Number = sourcePages.length;
280
+ for(var i:Number = 0; i < numSourcePages; i++)
281
+ {
282
+ count += calcNumPages(sourcePages[i]);
283
+ }
284
+ return count;
285
+ }
286
+ /**
287
+ * Adds the sprite to the sprite array for printing. Any changes to the sprite will be reflected at printing.
288
+ *
289
+ * @usage Printer.addPage(page3_mc);
290
+ * @param mc_page Sprite. This is a reference to the Sprite that is to be added to the buffer.
291
+ */
292
+ public function addPage(mc_page:Sprite):void
293
+ {
294
+ ////trace('adding page ' + mc_page)
295
+ sourcePages.push(mc_page);
296
+ hasPreviewed = false;
297
+ }
298
+ /**
299
+ * Removes the specified sprite from buffer. If no sprite is specified, the last page is removed.
300
+ *
301
+ * @usage Printer.removePage(2);
302
+ * @param i Number. Optional. The number of the buffer page to be removed, starting at 0.
303
+ */
304
+ public function removePage(index:Number):void
305
+ {
306
+ if(index) index = sourcePages.length-1;
307
+ sourcePages.splice(index,1);
308
+ hasPreviewed = false;
309
+ }
310
+ /**
311
+ * Returns a specific page from the buffer. If no page is specified, the entire buffer Array is returned.
312
+ *
313
+ * @usage var sixthPage:Sprite = Printer.viewPage(5);
314
+ * @param i Number. Optional. The number of the page in the buffer you want a reference to.
315
+ * @return Number or Array. If i is defined, that Sprite is returned as a reference. If not, an Array of all the references is returned.
316
+ */
317
+ public function getPage(index:Number):Sprite
318
+ {
319
+ if(index) return sourcePages[index];
320
+ else return new Sprite();
321
+ }
322
+ /**
323
+ * The preview function is automatically called by the print function if it is not called. The preview function sets up
324
+ * the BitmapData and final printing pages for the print function. In addition, the preview function can be called at
325
+ * any time with an object called preOb. This optional variable contains an array with information about sending a copy
326
+ * of the Bitmap Data to any sprite you would like as a print preview of each page buffered. Be wary
327
+ * of using this function for large print jobs too far ahead of the print function, as every page in the
328
+ * buffer has a BitmapData cached for it which is not removed until resetBuffer or print functions are called.
329
+ *
330
+ * @usage Printer.preview(previewInfo);
331
+ */
332
+ public function preview():void
333
+ {
334
+ cleanUp();
335
+ //All of the sprites are made into bitmap data for resizing, and the BitmapData size is maxed out
336
+ //and scaled back down for higher resolution.
337
+ var scaler:Number;
338
+ var bodyScale:Number;
339
+ var mPage:Matrix = new Matrix();
340
+ var xCenter:Number = leftPgMargin;
341
+ var yCenter:Number = topPgMargin;
342
+ //Used for scaling down
343
+ var bodyH:Number = PAGEHEIGHT + topPgMargin + bottomPgMargin;
344
+ var bodyW:Number = PAGEWIDTH + leftPgMargin + rightPgMargin;
345
+ //Used for scaling up
346
+ var maxH:Number = PAGEHEIGHT - (topPgMargin + bottomPgMargin);
347
+ var maxW:Number = PAGEWIDTH - (rightPgMargin + leftPgMargin);
348
+ //The highest level If statement determines whether the page's height or width is longer.
349
+ //The nested If statement determines whether the determines whether the difference between
350
+ //the page width and body width (size of page once margins are subtracted) or the page height
351
+ //and body height is greater. A ratio is then determined for scaling up and down successfully,
352
+ //thus faking margins when the process is complete and the bitmap is copied.
353
+ if(PAGEHEIGHT < PAGEWIDTH)
354
+ { // tall page
355
+ scaler = bitmapResolution / PAGEWIDTH;
356
+ if((PAGEHEIGHT/maxH) < (PAGEWIDTH/maxW))
357
+ {
358
+ bodyScale = bitmapResolution/bodyW;
359
+ yCenter = (((maxH-(maxH*(maxW/PAGEWIDTH)))-(topPgMargin+bottomPgMargin))/2)+topPgMargin;
360
+ }
361
+ else{
362
+ bodyScale = bitmapResolution / ((PAGEWIDTH*PAGEHEIGHT)/maxH);
363
+ xCenter = (((PAGEWIDTH-(PAGEWIDTH*(bodyScale/scaler)))-(rightPgMargin+leftPgMargin))/2)+leftPgMargin;
364
+ }
365
+ }
366
+ else
367
+ { // wide page
368
+ scaler = bitmapResolution / PAGEHEIGHT;
369
+ if((PAGEHEIGHT/maxH) < (PAGEWIDTH/maxW))
370
+ {
371
+ bodyScale = bitmapResolution/((PAGEWIDTH*PAGEHEIGHT)/maxW);
372
+ yCenter = (((PAGEHEIGHT-(PAGEHEIGHT*(bodyScale/scaler)))-(topPgMargin+bottomPgMargin))/2)+topPgMargin;
373
+ }
374
+ else
375
+ {
376
+ bodyScale = bitmapResolution/bodyH;
377
+ xCenter = (((maxW-(maxW*(maxH/PAGEHEIGHT)))-(rightPgMargin+leftPgMargin))/2)+leftPgMargin;
378
+ }
379
+ }
380
+ //Sets up the scaling/translating done to the header, footer, and body.
381
+ var mHeader:Matrix
382
+ if(headerMC)
383
+ {
384
+ mHeader = new Matrix();
385
+ mHeader.scale(scaler, scaler);
386
+ }
387
+ mPage.scale(bodyScale, bodyScale);
388
+ mPage.translate(xCenter*scaler, yCenter*scaler);
389
+ var mFooter:Matrix;
390
+ if(footerMC)
391
+ {
392
+ mFooter = new Matrix();
393
+ mFooter.scale(scaler, scaler);
394
+ }
395
+ //This is used to split a larger sprite into smaller ones to print on multiple pages
396
+ var rectClip:Rectangle = new Rectangle(xCenter*scaler, yCenter*scaler, maxW*scaler, maxH*scaler);
397
+ var numPages:Number = sourcePages.length
398
+ for(var i:Number = 0; i < numPages; i++)
399
+ {
400
+ //The first two for loops are used to determine how many pages each clip will take up, and creates them
401
+ //seperately.
402
+ var pagesHigh:Number = Math.ceil(sourcePages[i].height/PAGEHEIGHT)
403
+ var pagesWide:Number = Math.ceil(sourcePages[i].width/PAGEWIDTH)
404
+ // loop through pages high
405
+ for(var j:Number = 0; j < pagesHigh; j++)
406
+ {
407
+ // loop through pages wide
408
+ for(var k:Number = 0; k < pagesWide; k++)
409
+ {
410
+ var index:Number = bitmapDataPages.length
411
+ var bitmapObject:Bitmap = new Bitmap(new BitmapData(PAGEWIDTH*scaler, PAGEHEIGHT*scaler, false), PixelSnapping.NEVER, true);
412
+ //Create holder for the new bitmap
413
+ var holder:Sprite = new Sprite()
414
+ holder.name = "printingPage";
415
+ //printing_mc.addChild(holder);
416
+ //Create the new bitmap
417
+ var content:Sprite = new Sprite();
418
+ content.name = "content";
419
+ holder.addChild(content);
420
+ //push this page onto the printing data array
421
+ bitmapDataPages.push(bitmapObject.bitmapData);
422
+ //push a reference to the holder
423
+ renderedPages.push(holder);
424
+ content.addChild(bitmapObject)
425
+ //Header, footer, and body are all drawn onto the same page
426
+ if(headerMC != null)
427
+ {
428
+ bitmapObject.bitmapData.draw(headerMC, mHeader, null, BlendMode.NORMAL, null, true); // draw header onto the bitmapdata
429
+ }
430
+ mPage.translate(-(k*maxW)*scaler, -(j*maxH)*scaler);
431
+ bitmapObject.bitmapData.draw(sourcePages[i], mPage, null, BlendMode.NORMAL, rectClip, true); // draw page onto the bitmapdata
432
+ // content.graphics.lineStyle(5,0xff0000);
433
+ // content.graphics.moveTo(0,0);
434
+ // content.graphics.lineTo(500,500);
435
+ if(footerMC != null)
436
+ {
437
+ bitmapObject.bitmapData.draw(footerMC, mFooter, null, BlendMode.NORMAL, null, true); // draw footer onto the bitmapdata
438
+ }
439
+ //Scaling down
440
+ content.width /= scaler;
441
+ content.height /= scaler;
442
+ bitmapObject.smoothing = true;
443
+ }
444
+ }
445
+ }
446
+ hasPreviewed = true;
447
+ }
448
+ public function renderPreviewPage(pageNum:Number, height:Number, width:Number):Sprite
449
+ {
450
+ var ret:Sprite = new Sprite();
451
+ if(!hasPreviewed)
452
+ {
453
+ preview();
454
+ }
455
+ if(renderedPages[pageNum])
456
+ {
457
+ var scalled:BitmapData = ImageUtils.resizeImage(bitmapDataPages[pageNum], width, height, "constrainProportions")
458
+ ret.addChild(new Bitmap(scalled, PixelSnapping.NEVER, true))
459
+ //ret.addChild(new Bitmap(bitmapDataPages[pageNum], PixelSnapping.NEVER, true));
460
+ //CenterScale.scale(ret, height, width);
461
+ }
462
+ return ret;
463
+ }
464
+ /**
465
+ * Prints all pages in the buffer and clears the temperary printing buffer. The buffer with the pages in it remains intact.
466
+ *
467
+ * @usage Printer.print();
468
+ */
469
+ public function print():void
470
+ {
471
+ //This creates a preview if one has not been created. The preview is what is sent to the printer.
472
+ if(!hasPreviewed)
473
+ {
474
+ preview();
475
+ }
476
+ //Set up variables
477
+ var widthUsed:Number = PAGEWIDTH;
478
+ var heightUsed:Number = PAGEHEIGHT;
479
+ var scaled:Number = 1;
480
+ var printJob:PrintJob = new PrintJob();
481
+ //If user selects a printer and confirms print (printJob.start() opens print dialog)
482
+ if(printJob.start())
483
+ {
484
+ //Check for Portrait or Landscape to use as much of the page as possible.
485
+ if((printJob.orientation == "landscape" && widthUsed < heightUsed) || (printJob.orientation == "portrait" && widthUsed > heightUsed))
486
+ {
487
+ var temp:Number = widthUsed;
488
+ widthUsed = heightUsed;
489
+ heightUsed = temp;
490
+ }
491
+ //Checks to see if the height and width are larger than the printer's printable area.
492
+ if(heightUsed > printJob.pageHeight || widthUsed > printJob.pageWidth)
493
+ {
494
+ if((heightUsed/printJob.pageHeight) > (widthUsed/printJob.pageWidth)) scaled = (printJob.pageHeight/heightUsed);
495
+ else scaled = (printJob.pageWidth/widthUsed);
496
+ heightUsed *= scaled;
497
+ widthUsed *= scaled;
498
+ }
499
+ //Goes through the buffer printing the pages and scaling them if the printer has its own margins.
500
+ var pages:Number = renderedPages.length
501
+ for(var i:Number = 0; i < pages; i++)
502
+ {
503
+ var backgroundSprite:Sprite = new Sprite();
504
+ var jj:Sprite = new Sprite();
505
+ jj.addChild(renderedPages[i]);
506
+ backgroundSprite.addChild(jj);
507
+ printJob.addPage(backgroundSprite, new Rectangle(0,0,PAGEWIDTH, PAGEHEIGHT), new PrintJobOptions(false));
508
+ }
509
+ printJob.send();
510
+ //The buffer is then cleared.
511
+ cleanUp();
512
+ }
513
+ }
514
+ public function set pageHeight(val:Number):void
515
+ {
516
+ if(!isNaN(val))
517
+ {
518
+ var prevVal:Number = PAGEHEIGHT
519
+ PAGEHEIGHT = val
520
+ if(prevVal != val) hasPreviewed = false;
521
+ }
522
+ }
523
+ public function get pageHeight():Number
524
+ {
525
+ return PAGEHEIGHT;
526
+ }
527
+ public function set pageWidth(val:Number):void
528
+ {
529
+ if(!isNaN(val)){
530
+ var prevVal:Number = PAGEWIDTH;
531
+ PAGEWIDTH = val
532
+ if(prevVal != val) hasPreviewed = false
533
+ }
534
+ }
535
+ public function get pageWidth():Number
536
+ {
537
+ return PAGEWIDTH;
538
+ }
539
+ public function get contentHeight():Number
540
+ {
541
+ return PAGEHEIGHT - headerMargin - headerHeight - footerMargin - footerHeight
542
+ }
543
+ public function get contentWidth():Number
544
+ {
545
+ return PAGEWIDTH - leftPgMargin - rightPgMargin;
546
+ }
547
+ }
548
+ }
@@ -0,0 +1,12 @@
1
+ /* See the file "LICENSE.txt" for the full license governing this code. */
2
+ package nm.util
3
+ {
4
+ public class StringUtil
5
+ {
6
+ static public function trim(text:String):String
7
+ {
8
+ if (text == null) return "";
9
+ return text.replace(/^\s+|\s+$/g, "");
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,37 @@
1
+ // Copyright (c) 2007 rubyamf.org (aaron@rubyamf.org)
2
+ // License - http://www.gnu.org/copyleft/gpl.html
3
+ package org.rubyamf.remoting.ssr
4
+ {
5
+ import flash.events.ErrorEvent;
6
+ import flash.events.Event;
7
+ public class FaultEvent extends ErrorEvent
8
+ {
9
+ public static const FAULT:String = "FAULT";
10
+ public static const CONNECTION_ERROR:String = "CONNECTION_ERROR";
11
+ public static const AUTHENTICATION_FAILED:String = "AUTHENTICATION_FAILED";
12
+ public var fault:Object;
13
+ /*
14
+ * Constructor
15
+ * @param type:String
16
+ * @param bubbles:Boolean
17
+ * @param cancelable:Boolean
18
+ * @param result:Object
19
+ */
20
+ public function FaultEvent(type:String, bubbles:Boolean, cancelable:Boolean, fault:Object)
21
+ {
22
+ super(type, bubbles, cancelable, "");
23
+ this.fault = fault;
24
+ }
25
+ /*
26
+ * toString - duh
27
+ */
28
+ public override function toString():String
29
+ {
30
+ return "org.rubyamf.remoting.ssr.FaultEvent";
31
+ }
32
+ public override function clone():Event
33
+ {
34
+ return new FaultEvent(type, bubbles, cancelable, fault);
35
+ }
36
+ }
37
+ }