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,654 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300"
3
+ xmlns:local="*" clipContent="true"
4
+ horizontalScrollPolicy="off" verticalScrollPolicy="off"
5
+ >
6
+
7
+ <mx:Metadata>
8
+ [Event(name="repositionDone", type="flash.events.Event")]
9
+ [Event(name="imageLoaded", type="flash.events.Event")]
10
+ </mx:Metadata>
11
+
12
+ <mx:Image id="displayedImage" source="{_sourceImageBytes}"
13
+ mouseDown="{mouseDownFunction()}"
14
+ maintainAspectRatio="true"
15
+ scaleContent="true"
16
+ complete="{trace('complete'); imageLoaded()}" smoothBitmapContent="true"
17
+ />
18
+
19
+ <mx:SWFLoader id="drawingClip" source="{new MovieClip()}" />
20
+
21
+ <!-- removing scale slider -> not needed -->
22
+ <!--
23
+ <mx:Canvas width="300"
24
+ visible="{_isCurrentlyEditing}"
25
+ bottom="0"
26
+ horizontalCenter="0">
27
+ <mx:HBox width="100%">
28
+ <mx:Label text="Image Scale" color="0x000000"/>
29
+ <mx:HSlider id="imageScaleSlider"
30
+ minimum="{MINIMUM_SCALE}"
31
+ maximum="2.0"
32
+ value="1.0"
33
+ change="{scaleSliderChange();}"/>
34
+ </mx:HBox>
35
+ </mx:Canvas>
36
+ -->
37
+
38
+ <mx:Button id="buttonDone" visible="{_isCurrentlyEditing}" label="Done" click="{dispatchEvent(new Event('repositionDone'))}" styleName="gameButton"
39
+ />
40
+
41
+ <mx:Script>
42
+ <![CDATA[
43
+ import nm.draw.lines.Dotted;
44
+
45
+ // NOTE: making this assuming it is going to have a set size that doesnt move around
46
+
47
+ public static const EVENT_IMAGE_LOAD_COMPLETE:String = "EVENT_IMAGE_LOAD_COMPLETE";
48
+
49
+ protected static const MINIMUM_SCALE:Number = 0.2;
50
+
51
+ protected static const SQUARE_SIZE:Number = 10.0;
52
+
53
+ public var loaded:Boolean = false;
54
+
55
+ [Bindable]
56
+ protected var _sourceImageBytes:*; // note: not using a byte array anymore TODO rename
57
+
58
+ // NOTE: for some reason, i need to do both width and height even tho i have maintainAspectRatio="true"
59
+ protected var _originalImageHeight:Number = 0.0;
60
+ protected var _originalImageWidth:Number = 0.0;
61
+
62
+ [Bindable]
63
+ protected var _isCurrentlyEditing:Boolean = false;
64
+
65
+ protected var _isScalingBlocksInit:Boolean = false
66
+ protected var _squareTopLeft:MovieClip;
67
+ protected var _squareTopRight:MovieClip;
68
+ protected var _squareBottomLeft:MovieClip;
69
+ protected var _squareBottomRight:MovieClip;
70
+
71
+ // a previous image location so they can cancel to undo image moves
72
+ protected var _hasPreviousLocation:Boolean = false;
73
+ protected var _prevImageWidth:Number;
74
+ protected var _prevImageHeight:Number;
75
+ protected var _prevImageX:Number;
76
+ protected var _prevImageY:Number;
77
+
78
+ protected var _imageScale:Number = 1.0;
79
+
80
+ // if they try to set the scale before the image is loaded
81
+ // we need to remember it for when it is loaded
82
+ protected var _needToReScaleOnLoad:Boolean = false;
83
+ protected var _rescaleOnLoadScale:Number = 1.0;
84
+
85
+ // used by classes that extend this class that don't want dragging enabled
86
+ protected var _allowDragging:Boolean = true;
87
+
88
+ public function resetImage():void
89
+ {
90
+ if(displayedImage.content != null)
91
+ {
92
+ // if the image is too large, scale it down to fix
93
+
94
+ var imageWidth:Number = _originalImageWidth;
95
+ var imageHeight:Number = _originalImageHeight;
96
+ var containerWidth:Number = this.width - SQUARE_SIZE * 2;
97
+ var containerHeight:Number = this.height - SQUARE_SIZE * 2;
98
+
99
+ var scaleChange:Number;
100
+ // fix width
101
+ if(imageWidth > containerWidth)
102
+ {
103
+ scaleChange = (imageWidth - containerWidth)/ imageWidth;
104
+ imageWidth = containerWidth;
105
+ imageHeight -= imageHeight * scaleChange;
106
+ }
107
+
108
+ // fix height
109
+ if(imageHeight > containerHeight)
110
+ {
111
+ scaleChange = (imageHeight - containerHeight) / imageHeight;
112
+ imageHeight = containerHeight;
113
+ imageWidth -= imageWidth * scaleChange;
114
+ }
115
+
116
+ displayedImage.content.width = imageWidth;
117
+ displayedImage.content.height = imageHeight;
118
+
119
+ // vertically / horizontally center the image
120
+
121
+ displayedImage.x = (this.width - displayedImage.content.width) / 2.0;
122
+ displayedImage.y = (this.height - displayedImage.content.height) / 2.0;
123
+
124
+ imageScale = displayedImage.content.width / _originalImageWidth;
125
+
126
+ positionDoneButton();
127
+ }
128
+ }
129
+
130
+ public function set allowScrollingAndSizing(allow:Boolean):void
131
+ {
132
+ if(! _isCurrentlyEditing && allow)
133
+ {
134
+ startScaling();
135
+ }
136
+ else if(_isCurrentlyEditing && ! allow)
137
+ {
138
+ stopScaling();
139
+ }
140
+
141
+ _isCurrentlyEditing = allow;
142
+
143
+ }
144
+
145
+
146
+ public function storeCurrentImageSize():void
147
+ {
148
+ _hasPreviousLocation = true;
149
+ _prevImageWidth = displayedImage.content.width;
150
+ _prevImageHeight = displayedImage.content.height;
151
+ _prevImageX = displayedImage.x;
152
+ _prevImageY = displayedImage.y;
153
+ }
154
+
155
+ public function loadPreviousImageSize():void
156
+ {
157
+ if(_hasPreviousLocation)
158
+ {
159
+ displayedImage.content.width = _prevImageWidth;
160
+ displayedImage.content.height = _prevImageHeight;
161
+ displayedImage.x = _prevImageX;
162
+ displayedImage.y = _prevImageY;
163
+ }
164
+ }
165
+
166
+ protected function startScaling():void
167
+ {
168
+ showScalingBlocks();
169
+ positionDoneButton();
170
+ }
171
+
172
+
173
+ protected function showScalingBlocks():void
174
+ {
175
+ // dont do anything if we dont have an image
176
+ if(displayedImage.content == null)
177
+ {
178
+ return;
179
+ }
180
+
181
+ // draw the scaling boxes and show the scaling slider
182
+
183
+ if(! _isScalingBlocksInit)
184
+ {
185
+ _squareTopLeft = new MovieClip();
186
+ _squareTopRight = new MovieClip();
187
+ _squareBottomLeft = new MovieClip();
188
+ _squareBottomRight = new MovieClip();
189
+
190
+ const squares:Array = [_squareTopLeft,_squareTopRight,_squareBottomLeft,_squareBottomRight]
191
+
192
+ var clip:MovieClip = drawingClip.source as MovieClip;
193
+
194
+ for(var i:int = 0; i< squares.length; i++)
195
+ {
196
+ var sq:MovieClip = squares[i];
197
+
198
+ drawSquare(sq, SQUARE_SIZE);
199
+ clip.addChild(sq);
200
+ sq.addEventListener(MouseEvent.MOUSE_DOWN, resizeSquareMouseDown, false, 0, true);
201
+ sq.buttonMode = true;
202
+ }
203
+
204
+ _isScalingBlocksInit = true;
205
+ }
206
+ else
207
+ {
208
+ _squareTopLeft.visible = true;
209
+ _squareTopRight.visible = true;
210
+ _squareBottomLeft.visible = true;
211
+ _squareBottomRight.visible = true;
212
+ }
213
+
214
+ positionScalingBlocks();
215
+
216
+ }
217
+
218
+ protected var _draggingResizeSquare:MovieClip;
219
+ protected function resizeSquareMouseDown(e:MouseEvent):void
220
+ {
221
+ stage.addEventListener(MouseEvent.MOUSE_UP, resizeSquareMouseUp, false,0, true);
222
+ stage.addEventListener(MouseEvent.MOUSE_MOVE, resizeSquareMouseMove, false,0, true);
223
+
224
+ _draggingResizeSquare = (e.target as MovieClip);
225
+
226
+ // note: not doing start drag because it will behave a little differently
227
+ // see resizeSquareMouseMove
228
+ }
229
+
230
+ protected function resizeSquareMouseUp(e:MouseEvent):void
231
+ {
232
+ stage.removeEventListener(MouseEvent.MOUSE_UP, resizeSquareMouseUp);
233
+ stage.removeEventListener(MouseEvent.MOUSE_MOVE, resizeSquareMouseMove);
234
+
235
+ _draggingResizeSquare = null
236
+
237
+ //_draggingResizeSquare.stopDrag();
238
+ //resizeSquareMouseMove();
239
+ }
240
+
241
+ protected function resizeSquareMouseMove(e:MouseEvent):void
242
+ {
243
+ // NOTE: this should never be called when _draggingResizeSquare == null
244
+
245
+ var originalDraggingSquareX:Number = _draggingResizeSquare.x;
246
+ var originalDraggingSquareY:Number = _draggingResizeSquare.y;
247
+
248
+ var p:Point = drawingClip.globalToLocal(new Point(e.stageX, e.stageY));
249
+
250
+ var center:Point = getResizeSquareCenter();
251
+
252
+ var distFromCenterX:Number = p.x - center.x;
253
+ var distFromCenterY:Number = p.y - center.y;
254
+
255
+ _draggingResizeSquare.x = p.x;
256
+ _draggingResizeSquare.y = p.y;
257
+
258
+ var oppositeResizeSquare:MovieClip = getOppositeResizeSquare(_draggingResizeSquare);
259
+
260
+ oppositeResizeSquare.x = center.x - distFromCenterX;
261
+ oppositeResizeSquare.y = center.y - distFromCenterY;
262
+
263
+ // resize / position the image based on the dragging
264
+ keepResizeSquareASquare(_draggingResizeSquare);
265
+ keepResizeSquareASquare(oppositeResizeSquare);
266
+
267
+ var w:Number = getResizeSquaresWidth();
268
+ var h:Number = getResizeSquaresHeight();
269
+
270
+ var newScale:Number;
271
+ var scaleChanged:Boolean = false;
272
+
273
+ if( w / _originalImageWidth < h / _originalImageHeight)
274
+ {
275
+ newScale = w / _originalImageWidth;
276
+
277
+ if(newScale < MINIMUM_SCALE)
278
+ {
279
+ newScale = MINIMUM_SCALE;
280
+ }
281
+
282
+ scaleChanged = _setImageScale(newScale);
283
+ }
284
+ else
285
+ {
286
+ newScale = h / _originalImageHeight;
287
+
288
+ if(newScale < MINIMUM_SCALE)
289
+ {
290
+ newScale = MINIMUM_SCALE;
291
+ }
292
+
293
+ scaleChanged = _setImageScale(newScale);
294
+ }
295
+
296
+ if(! scaleChanged)
297
+ {
298
+ // i cant remember why this was here?
299
+ // move everything back -> no change was made
300
+
301
+ _draggingResizeSquare.x = originalDraggingSquareX;
302
+ _draggingResizeSquare.y = originalDraggingSquareY;
303
+
304
+ keepResizeSquareASquare(_draggingResizeSquare);
305
+ }
306
+ else
307
+ {
308
+ //keepResizeSquareToAspectRatio(_originalImageWidth, _originalImageHeight);
309
+ //positionScalingBlocks(); // NOTE: not behaving quite right?
310
+ //positionScalingSquaresFromDraggingSquare(_draggingResizeSquare);
311
+
312
+ // note: we have to restrict the image to the original aspect ratio
313
+ // so, dont trust getResizeSquaresX alone, compute the image x,y based on the center of the resizer squares
314
+ displayedImage.x = getResizeSquaresX() + (getResizeSquaresWidth() - displayedImage.content.width)/ 2.0;
315
+ displayedImage.y = getResizeSquaresY() + (getResizeSquaresHeight() - displayedImage.content.height)/ 2.0;
316
+
317
+ //displayedImage.x = getResizeSquaresX();
318
+ //displayedImage.y = getResizeSquaresY();
319
+
320
+ positionScalingBlocks();
321
+
322
+ //drawDottedLines();
323
+
324
+ }
325
+
326
+ positionDoneButton();
327
+
328
+ }
329
+
330
+ protected function positionDoneButton():void
331
+ {
332
+ buttonDone.x = int(displayedImage.x + (displayedImage.content.width - buttonDone.width) / 2);
333
+ buttonDone.y = int(displayedImage.y + (displayedImage.content.height - buttonDone.height) / 2);
334
+ }
335
+
336
+ protected function getOppositeResizeSquare(square:MovieClip):MovieClip
337
+ {
338
+ if( square == _squareTopLeft) return _squareBottomRight;
339
+ else if( square == _squareBottomRight) return _squareTopLeft;
340
+ else if( square == _squareTopRight) return _squareBottomLeft;
341
+ else // if( square == _squareBottomLeft)
342
+ return _squareTopRight;
343
+ }
344
+
345
+ protected function drawDottedLines():void
346
+ {
347
+ (drawingClip.source as MovieClip).graphics.clear();
348
+ drawLinesBetween([_squareTopLeft, _squareTopRight, _squareBottomRight, _squareBottomLeft]);
349
+ drawLinesBetween([_squareTopLeft, _squareBottomLeft] ); // bug with dotted line not drawing straigt up
350
+ }
351
+
352
+ protected function drawLinesBetween(clips:Array):void
353
+ {
354
+ var g:Graphics = (drawingClip.source as MovieClip).graphics;
355
+
356
+ g.lineStyle( 1,0x000000);
357
+
358
+ for(var i:int =0; i< clips.length-1; i++)
359
+ {
360
+ Dotted.lineTo(g, clips[i].x, clips[i].y, clips[i+1].x, clips[i+1].y, 5);
361
+ }
362
+ }
363
+
364
+ protected function getResizeSquaresWidth():Number
365
+ {
366
+ return _squareTopRight.x - _squareTopLeft.x;
367
+ }
368
+
369
+ protected function getResizeSquaresHeight():Number
370
+ {
371
+ return _squareBottomLeft.y - _squareTopLeft.y;
372
+ }
373
+
374
+ protected function getResizeSquaresX():Number
375
+ {
376
+ return _squareTopLeft.x;
377
+ }
378
+
379
+ protected function getResizeSquaresY():Number
380
+ {
381
+ return _squareTopLeft.y;
382
+ }
383
+
384
+ protected function getResizeSquareCenter():Point
385
+ {
386
+ var p:Point = new Point();
387
+ p.x = getResizeSquaresX() + getResizeSquaresWidth() / 2.0;
388
+ p.y = getResizeSquaresY() + getResizeSquaresHeight() / 2.0;
389
+
390
+ return p;
391
+ }
392
+
393
+ protected function keepResizeSquareASquare(movedSquare:MovieClip):void
394
+ {
395
+ // move some of the other resize handels based on the moving of the given handle
396
+
397
+ if(movedSquare == _squareTopLeft)
398
+ {
399
+ _squareTopRight.y = movedSquare.y;
400
+ _squareBottomLeft.x = movedSquare.x;
401
+ }
402
+ else if( movedSquare == _squareTopRight)
403
+ {
404
+ _squareTopLeft.y = movedSquare.y;
405
+ _squareBottomRight.x = movedSquare.x;
406
+ }
407
+ else if( movedSquare == _squareBottomLeft)
408
+ {
409
+ _squareTopLeft.x = movedSquare.x;
410
+ _squareBottomRight.y = movedSquare.y;
411
+ }
412
+ else // if( square == _squareBottomRight) // default to this square
413
+ {
414
+ _squareBottomLeft.y = movedSquare.y;
415
+ _squareTopRight.x = movedSquare.x;
416
+ }
417
+ }
418
+
419
+ protected function positionScalingBlocks():void
420
+ {
421
+ if(! _isScalingBlocksInit)
422
+ {
423
+ showScalingBlocks();
424
+ }
425
+ else
426
+ {
427
+ const xPlusWidth:Number = displayedImage.x + displayedImage.content.width;
428
+ const yPlusHeight:Number = displayedImage.y + displayedImage.content.height;
429
+
430
+ _squareTopLeft.x = displayedImage.x;
431
+ _squareTopLeft.y = displayedImage.y;
432
+
433
+ _squareTopRight.x = xPlusWidth;
434
+ _squareTopRight.y = displayedImage.y;
435
+
436
+ _squareBottomLeft.x = displayedImage.x;
437
+ _squareBottomLeft.y = yPlusHeight;
438
+
439
+ _squareBottomRight.x = xPlusWidth;
440
+ _squareBottomRight.y = yPlusHeight;
441
+
442
+ drawDottedLines();
443
+
444
+ }
445
+ }
446
+
447
+ // this wont work quite right for when we scale from the center
448
+ // NOTE: not using this function, should be ok to delete it
449
+ protected function positionScalingSquaresFromDraggingSquare(draggedSquare:MovieClip):void
450
+ {
451
+ // Make the squares fit the image, taking into account we are dragging one
452
+ // NOTE: the dragged one is the one that will move from its original position the most
453
+ // NOTE: the image is not going to be lined up with the scaling squares
454
+ // it will be lined up later -> just put the scaling squares in the right places
455
+
456
+ var widthDifference:Number = getResizeSquaresWidth() - displayedImage.content.width;
457
+ var heightDifference:Number = getResizeSquaresHeight() - displayedImage.content.height;
458
+
459
+ if(draggedSquare == _squareTopLeft)
460
+ {
461
+ draggedSquare.x += widthDifference;
462
+ draggedSquare.y += heightDifference;
463
+ }
464
+ else if( draggedSquare == _squareTopRight)
465
+ {
466
+ draggedSquare.x -= widthDifference;
467
+ draggedSquare.y += heightDifference;
468
+ }
469
+ else if( draggedSquare == _squareBottomLeft)
470
+ {
471
+ draggedSquare.x += widthDifference;
472
+ draggedSquare.y -= heightDifference;
473
+ }
474
+ else // if( draggedSquare == _squareBottomRight) // default to this square
475
+ {
476
+ draggedSquare.x -= widthDifference;
477
+ draggedSquare.y -= heightDifference;
478
+ }
479
+
480
+ keepResizeSquareASquare(draggedSquare);
481
+
482
+ }
483
+
484
+ protected static function drawSquare(clip:MovieClip, theSize:Number):void
485
+ {
486
+ clip.graphics.clear();
487
+
488
+ clip.graphics.beginFill(0xffffff);
489
+ clip.graphics.drawRect( -theSize, -theSize, theSize*2, theSize*2);
490
+
491
+ theSize -= 2.0
492
+
493
+ clip.graphics.beginFill(0x000000);
494
+ clip.graphics.drawRect(-theSize,-theSize, theSize*2, theSize*2);
495
+
496
+ theSize -= 2.0;
497
+
498
+ clip.graphics.beginFill(0xffffff);
499
+ clip.graphics.drawRect( -theSize, -theSize, theSize*2, theSize*2);
500
+
501
+ clip.graphics.endFill();
502
+ }
503
+
504
+ protected function stopScaling():void
505
+ {
506
+ // hide the scaling boxes and hide the scaling slider
507
+ if(_isScalingBlocksInit)
508
+ {
509
+ _squareTopLeft.visible = false;
510
+ _squareTopRight.visible = false;
511
+ _squareBottomLeft.visible = false;
512
+ _squareBottomRight.visible = false;
513
+ }
514
+
515
+ (drawingClip.source as MovieClip).graphics.clear();
516
+ }
517
+
518
+ public function get source():*
519
+ {
520
+ return _sourceImageBytes;
521
+ }
522
+
523
+ public function set source(imageData:*):void
524
+ {
525
+ allowScrollingAndSizing = false;
526
+
527
+ //_sourceImageBytes = null;// so it actually re-sets the size of it
528
+
529
+ if(_sourceImageBytes == imageData)
530
+ {
531
+ resetImage();
532
+ }
533
+ else
534
+ {
535
+ _sourceImageBytes = imageData;
536
+ }
537
+ }
538
+
539
+ protected function imageLoaded():void
540
+ {
541
+ trace("Image Loaded");
542
+ loaded = true;
543
+ dispatchEvent(new Event('imageLoaded'));
544
+ _originalImageWidth = displayedImage.content.width;
545
+ _originalImageHeight = displayedImage.content.height;
546
+
547
+ // set the scale, incase it was changed before the image loaded
548
+ //imageScale = _imageScale;
549
+
550
+ if(_needToReScaleOnLoad == true)
551
+ {
552
+ imageScale = _rescaleOnLoadScale;
553
+ _needToReScaleOnLoad = false;
554
+ }
555
+ else
556
+ {
557
+ resetImage();
558
+ }
559
+
560
+ dispatchEvent(new Event(EVENT_IMAGE_LOAD_COMPLETE) );
561
+ }
562
+
563
+ public function set imageScale(s:Number):void
564
+ {
565
+ // note: image will maintain its aspect ratio
566
+ if(displayedImage.content != null)
567
+ {
568
+ _setImageScale(s);
569
+ }
570
+ else
571
+ {
572
+ _needToReScaleOnLoad = true;
573
+ _rescaleOnLoadScale = s;
574
+ }
575
+
576
+ _imageScale = s;
577
+
578
+ if(_isCurrentlyEditing)
579
+ {
580
+ positionScalingBlocks();
581
+ // removing scale slider
582
+ //imageScaleSlider.value = s;
583
+ }
584
+ }
585
+
586
+ /*
587
+ // removing scale slider
588
+ protected function scaleSliderChange():void
589
+ {
590
+ _setImageScale( imageScaleSlider.value);
591
+ positionScalingBlocks();
592
+ }
593
+ */
594
+
595
+ // set the scale without positioning the blocks
596
+ protected function _setImageScale(s:Number):Boolean
597
+ {
598
+
599
+ var success:Boolean = false;
600
+
601
+ if( s >= MINIMUM_SCALE )
602
+ {
603
+ const newWidth:Number = _originalImageWidth * s;
604
+ const newHeight:Number = _originalImageHeight * s;
605
+
606
+ displayedImage.content.width = newWidth;
607
+ displayedImage.content.height = newHeight;
608
+ // removing scale slider
609
+ //imageScaleSlider.value = s;
610
+
611
+ _imageScale = s;
612
+
613
+ success = true;
614
+ }
615
+
616
+ return success;
617
+ }
618
+
619
+ public function get imageScale():Number
620
+ {
621
+ return _imageScale;
622
+ }
623
+
624
+
625
+ protected function mouseDownFunction():void
626
+ {
627
+ if(_isCurrentlyEditing)
628
+ {
629
+ if(_allowDragging) displayedImage.startDrag(false);
630
+ this.stage.addEventListener(MouseEvent.MOUSE_MOVE, imageDragged, false, 0, true);
631
+ this.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpFunction, false, 0, true);
632
+ //this.addEventListener(MouseEvent.MOUSE_MOVE, imageDragged, false, 0, true);
633
+ }
634
+ }
635
+
636
+ protected function mouseUpFunction(event:MouseEvent):void
637
+ {
638
+ if(_allowDragging) displayedImage.stopDrag();
639
+ this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, imageDragged);
640
+ this.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpFunction);
641
+
642
+ //One last position update (for old time's sake):
643
+ imageDragged(event);
644
+ }
645
+
646
+ protected function imageDragged(e:MouseEvent):void
647
+ {
648
+ positionScalingBlocks();
649
+ positionDoneButton();
650
+ }
651
+
652
+ ]]>
653
+ </mx:Script>
654
+ </mx:Canvas>