mako 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/mako +133 -0
- data/lib/mako/build.rb +336 -0
- data/lib/mako/data/flash_widget_dev_core/Dependencies.txt +10 -0
- data/lib/mako/data/flash_widget_dev_core/libs/Degrafa_.2.11.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoGraphics.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoSymbols.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/flash.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/ARLRDBD.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/FTD_____.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdana.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanab.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanai.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanaz.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc2.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc3.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/qa.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/so.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/kogLogo.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/creatorStyle.css +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/style.css +929 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/LICENSE.txt +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/CubeRotate.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Distortion.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/DistortionConstants.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Door.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Flip.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Gate.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Pop.as +53 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Push.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/SimpleDistortion.as +619 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/CubeRotateInstance.as +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DistortBaseInstance.as +258 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DoorInstance.as +116 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/FlipInstance.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/GateInstance.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PopInstance.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PushInstance.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBounds.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBoundsUtil.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/SimpleDisplayObjectBoundsUtil.as +60 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/HMAC.as +108 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5Stream.as +343 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA1.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA224.as +226 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA256.as +229 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/WSSEUsernameToken.as +100 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFade.as +107 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadeInstance.as +178 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadePopUpBlocker.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/errors/IllegalStateError.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Address.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Email.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Phone.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCard.as +47 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCardParser.as +234 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/BitString.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/JPGEncoder.as +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/PNGEncoder.as +133 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/DynamicURLLoader.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/IURIResolver.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/MimeTypeMap.as +192 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URI.as +2139 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URIEncodingBitmap.as +122 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/proxies/RFC2817Socket.as +179 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Database.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Definition.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Dict.as +322 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/DictionaryServer.as +50 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/MatchStrategy.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Response.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ConnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DatabaseEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DictionaryServerEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DisconnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ErrorEvent.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/NoMatchEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/CompleteResponseEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/SocketHelper.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSON.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONDecoder.as +303 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONEncoder.as +277 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONParseError.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONToken.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenType.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenizer.as +605 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/ArrayUtil.as +166 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DateUtil.as +657 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DictionaryUtil.as +73 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/IntUtil.as +85 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/NumberFormatter.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/StringUtil.as +220 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/XMLUtil.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/ServiceBase.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/URLLoaderBase.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/events/ServiceEvent.as +67 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/geom/ColorMatrix.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTween.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweenTimeline.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweener.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Back.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Bounce.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Circular.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Cubic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Elastic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Exponential.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Linear.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quadratic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quartic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quintic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Sine.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/AutoHidePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/BlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorAdjustPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/CurrentFramePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/IGTweenPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MatrixPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MotionBlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SmartRotationPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SnappingPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SoundTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/utils/SWFBridgeAS3.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/GUID.as +82 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/MathExt.as +114 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/OverwriteManager.as +143 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenFilterLite.as +502 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenLite.as +512 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenMax.as +987 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Back.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Bounce.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Circ.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Cubic.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Elastic.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Expo.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Linear.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quad.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quart.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quint.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Sine.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Strong.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/easing_readme.txt +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/events/TweenEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BevelFilterVars.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BlurFilterVars.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/ColorMatrixFilterVars.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/DropShadowFilterVars.as +66 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/GlowFilterVars.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenFilterLiteVars.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenLiteVars.as +269 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenMaxVars.as +103 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenEvent.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenObject.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenSingleton.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Constant.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlow.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlowFast.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Shake.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFast.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFastSlow.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ImageUtils.as +173 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ResizeStyle.as +52 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorBase.mxml +504 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorConfig.as +45 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorEvents.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/Dialog.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/MateriaButton.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/PopUpAlert.mxml +271 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/GradientBackground.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/PercentField.mxml +104 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/ScrollableSizableImage.mxml +654 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextAreaWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextInputWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/VertCenterTextRenderer.mxml +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/ImportEvent.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/itemRenderers/CheckBoxColumn.mxml +23 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDetails.mxml +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDisplay.mxml +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGrid.mxml +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGridEvent.as +20 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerColumn.as +13 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerDataGrid.mxml +692 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputItem.mxml +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputObject.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpBubble.mxml +245 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpDot.mxml +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpManager.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpObject.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/IHelpGuided.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/ImageCacherImage.mxml +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/MateriaUploader.as +61 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/Question.as +386 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionGroup.as +313 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionSet.as +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/CommonUtils.as +186 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/DateUtils.as +273 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/ImageCacher.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/Randomize.as +19 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/SimpleClone.as +32 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Color.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Draw.as +65 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dashed.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dotted.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Check.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Rect.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBevel.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBorder.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRound.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRoundBorder.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/TriangleEquilateral.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/X.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/ScoringError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/StorageError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/ButtonEvent.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/PayloadEvent.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/StandardEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/Question.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionGroup.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionSet.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/WidgetSettings.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerEvents.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerMessageEvent.as +31 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/logging/Log.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/scoring/Scoring.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageManager.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageTable.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/engines/EngineCore.as +222 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/geom/Dimension.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/Respondus.as +612 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusAnswer.as +11 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusError.as +18 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuestion.as +43 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuiz.as +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/AlertWindow.as +182 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/BlueButton.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button_base.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Component.as +98 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ContentBlocker.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FlexUIScaler.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FormInput.as +191 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/GrabZoomClip.as +305 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/HelpLayer.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Label.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List_Base.as +644 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProcessingBar.as +112 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar_base.as +69 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar_base.as +378 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollClip.as +468 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText_base.as +295 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/SimpleScrollBar.as +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StageRef.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTank.as +233 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTankHorizontal.as +109 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ToolTip.as +930 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/TweeningDragDropBankList.as +503 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window.as +144 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window_base.as +385 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/CenterScale.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowManager.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowStage.as +96 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/BitField.as +99 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/ObjPeek.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Objects.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Printer.as +548 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/StringUtil.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/FaultEvent.as +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingCall.as +211 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingConnection.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingService.as +214 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/ResultEvent.as +36 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/DistortImage.as +281 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/SandyPoint.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/Triangle.as +32 -0
- data/lib/mako/data/html/thistest.html +0 -0
- data/lib/mako/data/template_creator/src/Creator.mxml +138 -0
- data/lib/mako/data/template_creator/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/creatorStyle.css +63 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/style.css +1127 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditor.mxml +678 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditorToolbar.mxml +133 -0
- data/lib/mako/data/templates/html/README.md +11 -0
- data/lib/mako/data/templates/html/_creator/build.yaml +12 -0
- data/lib/mako/data/templates/html/_creator/creator.html +19 -0
- data/lib/mako/data/templates/html/_creator/css/creator.less +29 -0
- data/lib/mako/data/templates/html/_creator/js/creator.coffee +122 -0
- data/lib/mako/data/templates/html/_creator/test.html +0 -0
- data/lib/mako/data/templates/html/_engine/build.yaml +12 -0
- data/lib/mako/data/templates/html/_engine/css/widget.scss +18 -0
- data/lib/mako/data/templates/html/_engine/js/widget.coffee +143 -0
- data/lib/mako/data/templates/html/_engine/widget.html +21 -0
- data/lib/mako/data/templates/html/_icons/icon-275.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-394.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-60.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-92.png +0 -0
- data/lib/mako/data/templates/html/_score/score_module.php +48 -0
- data/lib/mako/data/templates/html/_score/test_score_module.php +157 -0
- data/lib/mako/data/templates/html/_screen-shots/1-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/1.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3.png +0 -0
- data/lib/mako/data/templates/html/build.yaml +4 -0
- data/lib/mako/data/templates/html/demo.yaml +7 -0
- data/lib/mako/data/templates/html/install.yaml +94 -0
- data/lib/mako/path.rb +48 -0
- data/lib/mako/scaffold.rb +69 -0
- metadata +597 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
/* See the file "LICENSE.txt" for the full license governing this code. */
|
2
|
+
package nm.ui {
|
3
|
+
import flash.display.MovieClip;
|
4
|
+
import flash.events.Event;
|
5
|
+
public class Component extends MovieClip
|
6
|
+
{
|
7
|
+
protected var _autoRedraw:Boolean;
|
8
|
+
protected var _height:Number
|
9
|
+
protected var _width:Number
|
10
|
+
protected var _isValid:Boolean;
|
11
|
+
private var _style:Object
|
12
|
+
public function Component(autoRedraw:Boolean = false, width:Number = 0, height:Number = 0)
|
13
|
+
{
|
14
|
+
_width = width;
|
15
|
+
_height = height;
|
16
|
+
_style = new Object();
|
17
|
+
_isValid = false;
|
18
|
+
this._autoRedraw = autoRedraw;
|
19
|
+
styleDefaults();
|
20
|
+
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
|
21
|
+
}
|
22
|
+
protected function onAddedToStage(event:Event):void
|
23
|
+
{
|
24
|
+
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
|
25
|
+
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage, false, 0, true);
|
26
|
+
if(!_isValid) draw();
|
27
|
+
}
|
28
|
+
protected function onRemovedFromStage(event:Event):void
|
29
|
+
{
|
30
|
+
removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
|
31
|
+
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
|
32
|
+
}
|
33
|
+
public function setStyle(propName:String, val:*):*
|
34
|
+
{
|
35
|
+
_style[propName] = val;
|
36
|
+
if(_autoRedraw && stage != null){ redraw();}
|
37
|
+
return val;
|
38
|
+
}
|
39
|
+
public function getStyle(propName:String):*
|
40
|
+
{
|
41
|
+
return _style[propName];
|
42
|
+
}
|
43
|
+
public function move(x:Number, y:Number):void
|
44
|
+
{
|
45
|
+
this.x = x;
|
46
|
+
this.y = y;
|
47
|
+
}
|
48
|
+
public function destroy():void
|
49
|
+
{
|
50
|
+
removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
|
51
|
+
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
|
52
|
+
dispatchEvent(new Event('destroy'));
|
53
|
+
}
|
54
|
+
protected function styleDefaults():void{}
|
55
|
+
public function draw():void{ _isValid = true }
|
56
|
+
public function redraw():void{}
|
57
|
+
public override function set width(val:Number):void
|
58
|
+
{
|
59
|
+
_width = val;
|
60
|
+
if(_autoRedraw){ redraw();}
|
61
|
+
}
|
62
|
+
public override function get width():Number
|
63
|
+
{
|
64
|
+
return _width
|
65
|
+
}
|
66
|
+
public function get actualWidth():Number{ return super.width; }
|
67
|
+
public function get actualHeight():Number{ return super.height; }
|
68
|
+
public override function set height(val:Number):void
|
69
|
+
{
|
70
|
+
_height = val;
|
71
|
+
if(_autoRedraw){ redraw();}
|
72
|
+
}
|
73
|
+
public override function get height():Number
|
74
|
+
{
|
75
|
+
return _height;
|
76
|
+
}
|
77
|
+
public function set style(newStyle:Object): void
|
78
|
+
{
|
79
|
+
for(var i:String in newStyle) _style[i] = newStyle[i];
|
80
|
+
}
|
81
|
+
public function get style():Object
|
82
|
+
{
|
83
|
+
return _style;
|
84
|
+
}
|
85
|
+
public function invalidate():void
|
86
|
+
{
|
87
|
+
_isValid = false;
|
88
|
+
}
|
89
|
+
public function validate():void
|
90
|
+
{
|
91
|
+
_isValid = true;
|
92
|
+
}
|
93
|
+
public function isValid():Boolean
|
94
|
+
{
|
95
|
+
return _isValid;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/* See the file "LICENSE.txt" for the full license governing this code. */
|
2
|
+
package nm.ui{
|
3
|
+
import nm.ui.Component
|
4
|
+
//import nm.draw.shapes.Rect
|
5
|
+
public class ContentBlocker extends Component{
|
6
|
+
public var color:Number
|
7
|
+
//public var alpha:Number
|
8
|
+
private var _blocking:Boolean
|
9
|
+
public function ContentBlocker(width:Number, height:Number, color:Number, alpha:Number){
|
10
|
+
super(true, width, height);
|
11
|
+
this.color = color;
|
12
|
+
this.alpha = alpha;
|
13
|
+
blocking = true;
|
14
|
+
draw()
|
15
|
+
}
|
16
|
+
public override function draw():void{
|
17
|
+
redraw();
|
18
|
+
}
|
19
|
+
public override function redraw():void{
|
20
|
+
this.graphics.clear()
|
21
|
+
//Rect.draw(this, 0, 0, width, height, color, alpha);
|
22
|
+
graphics.beginFill(color, alpha);
|
23
|
+
graphics.drawRect(0, 0, width, height);
|
24
|
+
}
|
25
|
+
public function set blocking(val:Boolean):void
|
26
|
+
{
|
27
|
+
_blocking = val
|
28
|
+
if(val){
|
29
|
+
//this.onRelease = undefined
|
30
|
+
//this.useHandCursor = false
|
31
|
+
}
|
32
|
+
//else delete this.onRelease
|
33
|
+
}
|
34
|
+
public function get blocking():Boolean{
|
35
|
+
return _blocking
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/* See the file "LICENSE.txt" for the full license governing this code. */
|
2
|
+
package nm.ui
|
3
|
+
{
|
4
|
+
import flash.display.DisplayObject;
|
5
|
+
import flash.events.Event;
|
6
|
+
import mx.core.Application;
|
7
|
+
import mx.core.IFlexDisplayObject;
|
8
|
+
import mx.managers.PopUpManager;
|
9
|
+
public class FlexUIScaler
|
10
|
+
{
|
11
|
+
protected var _scale:Number = 1
|
12
|
+
public function FlexUIScaler()
|
13
|
+
{
|
14
|
+
//Listen for when pop-ups are added via PopUpManager:
|
15
|
+
Application.application.systemManager.addEventListener(Event.ADDED, onPopupAdded);
|
16
|
+
}
|
17
|
+
protected function onScaleChange():void
|
18
|
+
{
|
19
|
+
Application.application.scaleX = Application.application.scaleY = _scale;
|
20
|
+
// Resize Popups
|
21
|
+
for(var i:int = 0; i < Application.application.systemManager.popUpChildren.numChildren; i++)
|
22
|
+
{
|
23
|
+
var p:DisplayObject = DisplayObject(Application.application.systemManager.popUpChildren.getChildAt(i));
|
24
|
+
if(p is IFlexDisplayObject)
|
25
|
+
{
|
26
|
+
p.scaleX = p.scaleY = _scale;
|
27
|
+
PopUpManager.centerPopUp(IFlexDisplayObject(p));
|
28
|
+
}
|
29
|
+
}
|
30
|
+
//Force the stage to send a resize event which will fix the modal window background.
|
31
|
+
//Without this, scaling the windows below 100% will result in a modal background that doesn't cover the entire application.
|
32
|
+
Application.application.stage.dispatchEvent(new Event(Event.RESIZE));
|
33
|
+
}
|
34
|
+
//Called when children are added to the systemManager. We look for any pop-ups added via the PopUpManager and scale those.
|
35
|
+
//We know we've found a pop-up when it is in the popUpChildren list and its parent is the systemManager.
|
36
|
+
//Note that this will only find pop-ups that are placed on the PopUpManagerChildList.POPUP child list.
|
37
|
+
protected function onPopupAdded(event:Event):void
|
38
|
+
{
|
39
|
+
var d:DisplayObject = DisplayObject(event.target.parent);
|
40
|
+
if(Application.application.systemManager.popUpChildren.contains(d) && d.parent == Application.application.systemManager)
|
41
|
+
{
|
42
|
+
d.scaleX = d.scaleY = _scale;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
public function set scale(newScale:Number):void
|
46
|
+
{
|
47
|
+
// trace(_scale)
|
48
|
+
if(_scale != newScale && newScale > 0)
|
49
|
+
{
|
50
|
+
_scale = newScale
|
51
|
+
onScaleChange();
|
52
|
+
}
|
53
|
+
}
|
54
|
+
public function get scale():Number
|
55
|
+
{
|
56
|
+
return _scale;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
@@ -0,0 +1,191 @@
|
|
1
|
+
/* See the file "LICENSE.txt" for the full license governing this code. */
|
2
|
+
package nm.ui{
|
3
|
+
import flash.events.FocusEvent;
|
4
|
+
import flash.text.TextField;
|
5
|
+
import flash.text.TextFormat;
|
6
|
+
public class FormInput extends Component{
|
7
|
+
private var __name:String;
|
8
|
+
private var _pass:Boolean;
|
9
|
+
private var _labelTF:TextField;
|
10
|
+
private var _inputTF:TextField;
|
11
|
+
private var _warnTF:TextField;
|
12
|
+
private var _inputTFormat:TextFormat;
|
13
|
+
private var _labelTFormat:TextFormat;
|
14
|
+
private var _warnTFormat:TextFormat;
|
15
|
+
private var _mode:Number;
|
16
|
+
private var hasFocus:Boolean = false;
|
17
|
+
public function FormInput(name:String, width:Number, password:Boolean=false, inputTextFormat:TextFormat=null, labelTextFormat:TextFormat=null, warnTextFormat:TextFormat=null){
|
18
|
+
super(false);
|
19
|
+
__name = name;
|
20
|
+
_width = width;
|
21
|
+
_pass = password == true // default to false
|
22
|
+
//if(inputTextFormat is TextFormat) setStyle('inputFormat', inputTextFormat);
|
23
|
+
//if(labelTextFormat is TextFormat) setStyle('labelFormat', labelTextFormat);
|
24
|
+
//if(warnTextFormat is TextFormat) setStyle('warnFormat', warnTextFormat);
|
25
|
+
_inputTFormat = getStyle('inputFormat')
|
26
|
+
_labelTFormat = getStyle('labelFormat')
|
27
|
+
_warnTFormat = getStyle('warnFormat');
|
28
|
+
_mode = 1
|
29
|
+
}
|
30
|
+
public override function draw():void {
|
31
|
+
super.draw();
|
32
|
+
//throw new Error((__name + " ERROR-----"), 0);
|
33
|
+
//_labelTF = createTextField('label_tf', 1, 0, 0, 1, 1);
|
34
|
+
_labelTF = new TextField(); addChild(_labelTF);
|
35
|
+
_labelTF.x=0; _labelTF.y=0; _labelTF.height=1; _labelTF.width=1;
|
36
|
+
//_labelTF.setNewTextFormat(_labelTFormat);
|
37
|
+
_labelTF.text = __name;
|
38
|
+
_labelTF.autoSize = "left"
|
39
|
+
_labelTF.selectable = false
|
40
|
+
_labelTF.setTextFormat(_labelTFormat);
|
41
|
+
_inputTF = new TextField(); addChild(_inputTF);
|
42
|
+
_inputTF.x=0; _inputTF.y=_pass? 1:0; _inputTF.height=20; width - _inputTF.width;
|
43
|
+
//_inputTF.setNewTextFormat(_inputTFormat);
|
44
|
+
_inputTF.setTextFormat(_inputTFormat);
|
45
|
+
//_inputTF.tabIndex = 1
|
46
|
+
//_inputTF.addListener(this);
|
47
|
+
_inputTF.type = 'input';
|
48
|
+
_inputTF.displayAsPassword = _pass;
|
49
|
+
_inputTF.addEventListener(FocusEvent.FOCUS_IN, handleFocus);
|
50
|
+
_inputTF.addEventListener(FocusEvent.FOCUS_OUT, handleFocus);
|
51
|
+
//EventTF.init(_inputTF);
|
52
|
+
//_inputTF.addEventListener('ALL', this, 'onTFEvent');
|
53
|
+
_warnTF = new TextField(); addChild(_warnTF);
|
54
|
+
_warnTF.x = 0; _warnTF.y = 0; _warnTF.width = width; _warnTF.height = 20;
|
55
|
+
_warnTF.setTextFormat(_warnTFormat);
|
56
|
+
_warnTF.selectable = false;
|
57
|
+
redraw();
|
58
|
+
}
|
59
|
+
public function setTabIndex(n:Number):void
|
60
|
+
{
|
61
|
+
_inputTF.tabIndex = n;
|
62
|
+
}
|
63
|
+
private function handleFocus(e:FocusEvent):void{
|
64
|
+
var tmpMode:Number = _mode;
|
65
|
+
switch(e.type){
|
66
|
+
case FocusEvent.FOCUS_IN:
|
67
|
+
hasFocus = true;
|
68
|
+
if(_mode != 3) _mode = 2;
|
69
|
+
break;
|
70
|
+
case FocusEvent.FOCUS_OUT:
|
71
|
+
hasFocus = false;
|
72
|
+
if(_mode != 3) _mode = 1;
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
if(tmpMode != _mode) drawbgBox()
|
76
|
+
}
|
77
|
+
/*
|
78
|
+
private function onTFEvent(event:Object){
|
79
|
+
var tmpMode:Number = _mode
|
80
|
+
if(_mode != 3){
|
81
|
+
switch(event.type){
|
82
|
+
case 'setFocus':
|
83
|
+
_mode = 2
|
84
|
+
break;
|
85
|
+
case 'killFocus':
|
86
|
+
_mode = 1
|
87
|
+
break;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
if(tmpMode != _mode) drawbgBox()
|
91
|
+
event.target = this
|
92
|
+
//dispatchEvent(event);
|
93
|
+
}
|
94
|
+
*/
|
95
|
+
public override function redraw():void {
|
96
|
+
drawbgBox()
|
97
|
+
_inputTF.x = _labelTF.width
|
98
|
+
_warnTF.y = _inputTF.height - 2;
|
99
|
+
}
|
100
|
+
public function giveFocus():void {
|
101
|
+
stage.focus = _inputTF;
|
102
|
+
_inputTF.setSelection(0, _inputTF.text.length - 1);
|
103
|
+
}
|
104
|
+
private function drawbgBox():void{
|
105
|
+
graphics.clear();
|
106
|
+
graphics.lineStyle(1, 0, 1);
|
107
|
+
graphics.beginFill(getColorByMode(), 1);
|
108
|
+
graphics.drawRect(0, 0, width, _inputTF.height);
|
109
|
+
}
|
110
|
+
/**
|
111
|
+
* Default function called by the stylealbe constructor to set up default styles
|
112
|
+
*/
|
113
|
+
protected override function styleDefaults():void{
|
114
|
+
setStyle('inputFormat', new TextFormat('Arial', 12, 0x000000));
|
115
|
+
setStyle('labelFormat', new TextFormat('Arial', 12, 0x999999, true));
|
116
|
+
setStyle('warnFormat', new TextFormat('Arial', 12, 0xF02020, true));
|
117
|
+
setStyle('restColor', 0xEEEEEE)
|
118
|
+
setStyle('activeColor', 0xFFFFFF)
|
119
|
+
setStyle('warnColor', 0xF2E6E1)
|
120
|
+
}
|
121
|
+
private function getColorByMode():Number{
|
122
|
+
switch(_mode){
|
123
|
+
case 1:
|
124
|
+
return getStyle('restColor')
|
125
|
+
case 2:
|
126
|
+
return getStyle('activeColor')
|
127
|
+
case 3:
|
128
|
+
return getStyle('warnColor');
|
129
|
+
}
|
130
|
+
return 0;
|
131
|
+
}
|
132
|
+
public function set warn(text:String):void{
|
133
|
+
if(text == ''){
|
134
|
+
if(hasFocus)_mode = 2;
|
135
|
+
else _mode = 1;
|
136
|
+
text = "";
|
137
|
+
//_mode = Selection.getFocus() == String(_inputTF) ? 2 : 1
|
138
|
+
}
|
139
|
+
else{
|
140
|
+
_mode = 3
|
141
|
+
}
|
142
|
+
drawbgBox();
|
143
|
+
_warnTF.text = text;
|
144
|
+
_warnTF.setTextFormat(_warnTFormat);
|
145
|
+
}
|
146
|
+
public function get warn():String{
|
147
|
+
return _warnTF.text
|
148
|
+
}
|
149
|
+
public function set password(val:Boolean):void{
|
150
|
+
_inputTF.displayAsPassword = _pass = val;
|
151
|
+
}
|
152
|
+
public function get password():Boolean{
|
153
|
+
return _pass;
|
154
|
+
}
|
155
|
+
public function set label(val:String):void{
|
156
|
+
_labelTF.text = val
|
157
|
+
_labelTF.setTextFormat(_labelTFormat);
|
158
|
+
redraw();
|
159
|
+
}
|
160
|
+
public function get label():String{
|
161
|
+
return _labelTF.text
|
162
|
+
}
|
163
|
+
public function set _enabled(val:Boolean):void{
|
164
|
+
//_inputTF.type = val == true ? 'input' : 'dynamic'; sorry, had to get rid of your fancy ternary operation
|
165
|
+
if (val == true) {
|
166
|
+
_inputTF.type = 'input';
|
167
|
+
_inputTF.selectable = true;
|
168
|
+
}
|
169
|
+
else {
|
170
|
+
_inputTF.type = 'dynamic';
|
171
|
+
_inputTF.selectable = false;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
public function get _enabled():Boolean{
|
175
|
+
return _inputTF.type == 'input';
|
176
|
+
}
|
177
|
+
public function set text(val:String):void{
|
178
|
+
_inputTF.text = val
|
179
|
+
_inputTF.setTextFormat(_inputTFormat);
|
180
|
+
}
|
181
|
+
public function get text():String{
|
182
|
+
return _inputTF.text
|
183
|
+
}
|
184
|
+
public function get input():TextField{
|
185
|
+
return _inputTF
|
186
|
+
}
|
187
|
+
public function get valid():Boolean{
|
188
|
+
return _warnTF.text == '';
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
@@ -0,0 +1,305 @@
|
|
1
|
+
/* See the file "LICENSE.txt" for the full license governing this code. */
|
2
|
+
package nm.ui
|
3
|
+
{
|
4
|
+
import flash.display.MovieClip;
|
5
|
+
import flash.events.MouseEvent;
|
6
|
+
import flash.geom.Point;
|
7
|
+
import flash.geom.Rectangle;
|
8
|
+
import gs.TweenLite;
|
9
|
+
/**
|
10
|
+
* ...
|
11
|
+
* @author Luis Estrada
|
12
|
+
*/
|
13
|
+
public class GrabZoomClip extends MovieClip
|
14
|
+
{
|
15
|
+
protected static const TRACE_STRING:String = "GrabZoomClip";
|
16
|
+
//--------------------------------------------------------------------------
|
17
|
+
//
|
18
|
+
// Variables
|
19
|
+
//
|
20
|
+
//--------------------------------------------------------------------------
|
21
|
+
private var _width:int;
|
22
|
+
private var _height:int;
|
23
|
+
private var _borderWidth:int;
|
24
|
+
private var _bgAlpha:Number;
|
25
|
+
private var _borderColor:Number = 0;
|
26
|
+
private var _aniStrength:int = 10;
|
27
|
+
private var _minZoom:Number = 0.2;
|
28
|
+
private var _maxZoom:Number = Number.MAX_VALUE;
|
29
|
+
//private var _zoomStep:int = 5;
|
30
|
+
private var click:MovieClip;
|
31
|
+
private var border:MovieClip;
|
32
|
+
private var drag:MovieClip;
|
33
|
+
private var _mask:MovieClip;
|
34
|
+
public var content:MovieClip;
|
35
|
+
//--------------------------------------------------------------------------
|
36
|
+
//
|
37
|
+
// Constructor
|
38
|
+
//
|
39
|
+
//--------------------------------------------------------------------------
|
40
|
+
public function GrabZoomClip(width:int, height:int)
|
41
|
+
{
|
42
|
+
_width = width;
|
43
|
+
_height = height;
|
44
|
+
draw();
|
45
|
+
click.buttonMode = true;
|
46
|
+
click.addEventListener(MouseEvent.MOUSE_UP, onContentRelease, false, 0, true);
|
47
|
+
click.addEventListener(MouseEvent.MOUSE_DOWN, onContentPress, false, 0, true);
|
48
|
+
click.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel, false, 0, true);
|
49
|
+
}
|
50
|
+
//--------------------------------------------------------------------------
|
51
|
+
//
|
52
|
+
// Member Functions
|
53
|
+
//
|
54
|
+
//--------------------------------------------------------------------------
|
55
|
+
public function draw():void
|
56
|
+
{
|
57
|
+
border = new MovieClip();
|
58
|
+
click = new MovieClip();
|
59
|
+
drag = new MovieClip();
|
60
|
+
content = new MovieClip();
|
61
|
+
_mask = new MovieClip();
|
62
|
+
this.addChild(border);
|
63
|
+
this.addChild(click);
|
64
|
+
drag.addChild(content);
|
65
|
+
click.addChild(drag);
|
66
|
+
this.addChild(click);
|
67
|
+
this.mask = _mask;
|
68
|
+
redraw();
|
69
|
+
}
|
70
|
+
public function redraw():void
|
71
|
+
{
|
72
|
+
with (border.graphics)
|
73
|
+
{
|
74
|
+
clear();
|
75
|
+
beginFill(_borderColor, _bgAlpha);
|
76
|
+
drawRect(0, 0, _width, _height);
|
77
|
+
endFill();
|
78
|
+
}
|
79
|
+
with (click.graphics)
|
80
|
+
{
|
81
|
+
clear();
|
82
|
+
beginFill(0xAA00FF, _bgAlpha);
|
83
|
+
drawRect(_borderWidth, _borderWidth, width - _borderWidth * 2, height - _borderWidth * 2);
|
84
|
+
endFill();
|
85
|
+
}
|
86
|
+
var bounds:Rectangle = this.getBounds(_mask);
|
87
|
+
with(_mask.graphics)
|
88
|
+
{
|
89
|
+
clear();
|
90
|
+
beginFill(0);
|
91
|
+
drawRect(bounds.topLeft.x, bounds.topLeft.y, _width, _height)
|
92
|
+
endFill();
|
93
|
+
}
|
94
|
+
}
|
95
|
+
protected var _isDraggingContent:Boolean = false;
|
96
|
+
private function onContentRelease(event:MouseEvent):void
|
97
|
+
{
|
98
|
+
//////trace(">>onContentRelease");
|
99
|
+
stage.removeEventListener(MouseEvent.MOUSE_UP, onContentRelease);
|
100
|
+
click.useHandCursor = false;
|
101
|
+
drag.stopDrag();
|
102
|
+
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
103
|
+
_isDraggingContent = false;
|
104
|
+
keepDragClipOnScreen(); // bugfix, was messing up on mouse up
|
105
|
+
}
|
106
|
+
protected function onMouseMove(e:MouseEvent):void
|
107
|
+
{
|
108
|
+
if(_isDraggingContent)
|
109
|
+
{
|
110
|
+
keepDragClipOnScreen();
|
111
|
+
}
|
112
|
+
}
|
113
|
+
protected function keepDragClipOnScreen():void
|
114
|
+
{
|
115
|
+
const minAmountShowing:Number = 80.0;
|
116
|
+
if(drag.x + drag.width < minAmountShowing) // content right bound cant go off left of screen
|
117
|
+
{
|
118
|
+
drag.x = minAmountShowing - drag.width;
|
119
|
+
}
|
120
|
+
else if( drag.x > _width -minAmountShowing) // content left bound cant go off right screen
|
121
|
+
{
|
122
|
+
drag.x = (_width -minAmountShowing);
|
123
|
+
}
|
124
|
+
if(drag.y > _height - minAmountShowing) // content top cant go off bottom of screen
|
125
|
+
{
|
126
|
+
drag.y = _height - minAmountShowing;
|
127
|
+
}
|
128
|
+
else if(drag.y + drag.height < minAmountShowing) // content bottom cant go off top of screen
|
129
|
+
{
|
130
|
+
drag.y = minAmountShowing - drag.height;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
private function onContentPress(event:MouseEvent):void
|
134
|
+
{
|
135
|
+
//////trace(">>onContentPress");
|
136
|
+
stage.addEventListener(MouseEvent.MOUSE_UP, onContentRelease, false, 0, true);
|
137
|
+
stopMovement();
|
138
|
+
click.useHandCursor = true;
|
139
|
+
_isDraggingContent = true;
|
140
|
+
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
|
141
|
+
//drag.startDrag(false, dragRect);
|
142
|
+
drag.startDrag(false);// checking bounds manually in onMouseMove
|
143
|
+
}
|
144
|
+
private function onMouseWheel(e:MouseEvent):void
|
145
|
+
{
|
146
|
+
//Find min/max zoom levels
|
147
|
+
var tZoomW:Number = _width/(content.width);
|
148
|
+
var tZoomH:Number = _height/(content.height);
|
149
|
+
var minScale:Number = (tZoomW > tZoomH ? tZoomH : tZoomW)*.6;
|
150
|
+
var newScale:Number = content.scaleX + (.07 * e.delta);
|
151
|
+
if(newScale < minScale) newScale = minScale;
|
152
|
+
//if(e.delta < 0 && newScale >= content.scaleX) return;
|
153
|
+
//if(e.delta < 0 && newScale > content.scaleX*.95 && newScale < content.scaleX * 1.05) return;
|
154
|
+
//Set other params
|
155
|
+
var frameTime:Number = .2;
|
156
|
+
var newPoint:Point = translatePoint(content.mouseX, content.mouseY, newScale);
|
157
|
+
//Zoom in/out
|
158
|
+
if(e.delta < 0)
|
159
|
+
{
|
160
|
+
//var percentX:Number = -drag.x/(content.width - _width);
|
161
|
+
//var percentY:Number = -drag.y/(content.height - _height);
|
162
|
+
//if(percentX < 0) percentX = .5;
|
163
|
+
//if(percentY < 0) percentY = .5;
|
164
|
+
//////trace("OLD: ", mouseX, newPoint.x);
|
165
|
+
//////trace("NEW: ", (width*percentX), newPoint.x);
|
166
|
+
//////trace("PERCS: ", percentX, percentY, " ", drag.x, content.width, content.scaleX);
|
167
|
+
//TweenLite.to(drag, frameTime, { x:(_width*percentX) - newPoint.x, y:(_height*percentY) - newPoint.y } );
|
168
|
+
//if(percentX >= 0 && percentY >= 0)
|
169
|
+
// TweenLite.to(drag, frameTime, { x:(_width*percentX) - newPoint.x, y:(_height*percentY) - newPoint.y } );
|
170
|
+
//TweenLite.to(drag, frameTime, { x:(mouseX) - newPoint.x, y:(mouseY) - newPoint.y } );
|
171
|
+
//newPoint = translatePoint(this.width/2, this.height/2, newScale);
|
172
|
+
//TweenLite.to(drag, frameTime, { x:((_width / 2) - newPoint.x)*newScale, y:((_height / 2) - newPoint.y)*newScale } );
|
173
|
+
//Forget perfection.... stick with teh hack fix
|
174
|
+
//var cushion:int = 30;
|
175
|
+
//if((content.width * newScale < _width + cushion) &&
|
176
|
+
// (content.height * newScale < _height + cushion))
|
177
|
+
//{
|
178
|
+
// var tZoomW:Number = _width/content.width;
|
179
|
+
// var tZoomH:Number = _height/content.height;
|
180
|
+
// var fitScale = (tZoomW > tZoomH ? tZoomH : tZoomW) * .75;
|
181
|
+
// aniZoomAndPosition(content.width / 2, content.height / 2, fitScale, .7, true);
|
182
|
+
//newPoint = translatePoint(content.width/2, content.height/2, newScale);
|
183
|
+
//TweenLite.to(drag, frameTime, { x:((_width / 2) - newPoint.x) - newPoint.x, y:((_height / 2) - newPoint.y) - newPoint.y } );
|
184
|
+
//TweenLite.to(drag, frameTime, { x:(mouseX) - newPoint.x, y:(mouseY) - newPoint.y } );
|
185
|
+
//}
|
186
|
+
//else
|
187
|
+
//{
|
188
|
+
// ////trace("W: ", (content.width * newScale), _width);
|
189
|
+
// ////trace("H: ", (content.height * newScale), _height);
|
190
|
+
aniZoom(newScale, frameTime);
|
191
|
+
TweenLite.to(drag, frameTime, { x:(mouseX) - newPoint.x, y:(mouseY) - newPoint.y } );
|
192
|
+
//}
|
193
|
+
}
|
194
|
+
else
|
195
|
+
{
|
196
|
+
//Position
|
197
|
+
aniZoom(newScale, frameTime);
|
198
|
+
TweenLite.to(drag, frameTime, { x:(mouseX) - newPoint.x, y:(mouseY) - newPoint.y } );
|
199
|
+
}
|
200
|
+
//aniZoomAndPosition(content.mouseX, content.mouseY, newScale, 1, false);
|
201
|
+
}
|
202
|
+
/**
|
203
|
+
* Moves and centers to the given position and zoom
|
204
|
+
*/
|
205
|
+
public function aniZoomAndPosition(x:Number, y:Number, targetZoom:Number, frameTime:Number, center:Boolean=true):void
|
206
|
+
{
|
207
|
+
// trace(TRACE_STRING + "::aniZoomAndPosition");
|
208
|
+
aniZoom(targetZoom, frameTime);
|
209
|
+
var newPoint:Point = translatePoint(x, y, targetZoom);
|
210
|
+
var xTarg:int, yTarg:int;
|
211
|
+
if (center == true)
|
212
|
+
{
|
213
|
+
xTarg = (_width / 2) - newPoint.x;
|
214
|
+
yTarg = (_height / 2) - newPoint.y;
|
215
|
+
}
|
216
|
+
else
|
217
|
+
{
|
218
|
+
xTarg = newPoint.x;
|
219
|
+
yTarg = newPoint.y;
|
220
|
+
}
|
221
|
+
//if(xTarg > 0) xTarg = 0; // what was this about? it was messing me up!
|
222
|
+
// trace("xTarg = " + xTarg + ", yTarg = " + yTarg);
|
223
|
+
TweenLite.to(drag, frameTime, { x:xTarg, y:yTarg } );
|
224
|
+
}
|
225
|
+
// Zoom and move to show the given rectangle.
|
226
|
+
// Parts of rect might end up being not shown, if it is too big for our maximum zoom out,
|
227
|
+
// but preferedZone will always be shown.
|
228
|
+
// It will try and move it as little as possible to make it good.
|
229
|
+
public function showRectangle(rect:Rectangle,preferredRect:Rectangle, frameTime:Number):void
|
230
|
+
{
|
231
|
+
stopMovement();
|
232
|
+
aniZoom(scaleX, frameTime); // not quite sure why this needs to be called first
|
233
|
+
// but it is important!
|
234
|
+
//aniZoomAndPosition(rect.x, rect.y, scaleX, frameTime, true);
|
235
|
+
//return;
|
236
|
+
// zoom to make it fit
|
237
|
+
// TODO
|
238
|
+
// make sure the preferred zone is showing
|
239
|
+
if( ! isRectangleVisibleAtZoom(preferredRect, scaleX) )
|
240
|
+
{
|
241
|
+
rect = translateRect(rect, scaleX);
|
242
|
+
var tx:Number = rect.x //+ ( rect.width / 2.0);
|
243
|
+
var ty:Number = rect.y //+ ( rect.height / 2.0);
|
244
|
+
tx = (_width / 2.0) - tx;
|
245
|
+
ty = (_height / 2.0) - ty;
|
246
|
+
//var g:GTween = new GTween(drag, frameTime, {x:xTarget, y:yTarget});
|
247
|
+
trace(" tx = " + tx + ", ty = " + ty);
|
248
|
+
TweenLite.to(drag, frameTime, { x:tx, y:ty } );
|
249
|
+
}
|
250
|
+
}
|
251
|
+
// check if the given retangle
|
252
|
+
protected function isRectangleVisibleAtZoom(rect:Rectangle, zoomLevel:Number):Boolean
|
253
|
+
{
|
254
|
+
return true;
|
255
|
+
}
|
256
|
+
public function aniZoom(targetZoom:Number, frameTime:Number):void
|
257
|
+
{
|
258
|
+
if(targetZoom > _minZoom && _minZoom < _maxZoom)
|
259
|
+
{
|
260
|
+
stopMovement();
|
261
|
+
TweenLite.to(content , frameTime, { scaleY:targetZoom, scaleX:targetZoom} );
|
262
|
+
}
|
263
|
+
}
|
264
|
+
public function stopMovement():void
|
265
|
+
{
|
266
|
+
TweenLite.killTweensOf(content);
|
267
|
+
TweenLite.killTweensOf(drag);
|
268
|
+
}
|
269
|
+
public function translatePoint(x:Number, y:Number, targetZoom:Number = NaN):Point
|
270
|
+
{
|
271
|
+
var scale:Number = isNaN(targetZoom) ? this.scaleX : targetZoom;
|
272
|
+
return new Point(translateX(x, scale), translateY(y, scale));
|
273
|
+
}
|
274
|
+
protected function translateRect(r:Rectangle, targetZoom:Number):Rectangle
|
275
|
+
{
|
276
|
+
var newPoint:Point = translatePoint(r.x, r.y, targetZoom);
|
277
|
+
var newWidth:Number = r.width * targetZoom;
|
278
|
+
var newHeight:Number = r.height * targetZoom;
|
279
|
+
var result:Rectangle = new Rectangle(newPoint.x, newPoint.y, newWidth, newHeight);
|
280
|
+
return result;
|
281
|
+
}
|
282
|
+
private function translateX(x:Number, z:Number):Number
|
283
|
+
{
|
284
|
+
return x*z;
|
285
|
+
//return drag.x - (x * z + (drag.x * z + this.x)) / z // simplified matrix conversion
|
286
|
+
}
|
287
|
+
private function translateY(y:Number, z:Number):Number
|
288
|
+
{
|
289
|
+
return y*z;
|
290
|
+
return drag.y - (y * z + (drag.y * z + this.y)) / z // simplified matrix conversion
|
291
|
+
}
|
292
|
+
//{ region Properties
|
293
|
+
public function get borderWidth():int { return _borderWidth; }
|
294
|
+
public function set borderWidth(value:int):void
|
295
|
+
{
|
296
|
+
_borderWidth = value;
|
297
|
+
}
|
298
|
+
public function get bgAlpha():Number { return _bgAlpha; }
|
299
|
+
public function set bgAlpha(value:Number):void
|
300
|
+
{
|
301
|
+
_bgAlpha = value;
|
302
|
+
}
|
303
|
+
//} endregion
|
304
|
+
}
|
305
|
+
}
|