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,930 @@
|
|
1
|
+
/* See the file "LICENSE.txt" for the full license governing this code. */
|
2
|
+
package nm.ui {
|
3
|
+
import flash.display.DisplayObject;
|
4
|
+
import flash.display.Sprite;
|
5
|
+
import flash.events.Event;
|
6
|
+
import flash.events.EventDispatcher;
|
7
|
+
import flash.events.MouseEvent;
|
8
|
+
import flash.events.TimerEvent;
|
9
|
+
import flash.geom.Point;
|
10
|
+
import flash.utils.Timer;
|
11
|
+
public class ToolTip
|
12
|
+
{
|
13
|
+
/**
|
14
|
+
* Constant for determining showDelay in the showToolTip function
|
15
|
+
*/
|
16
|
+
private static const AUTO:int = -1;
|
17
|
+
/**
|
18
|
+
* Constant for timerState when timer is inactive
|
19
|
+
*/
|
20
|
+
private static const INACTIVE:int = 0;
|
21
|
+
/**
|
22
|
+
* Constant for timerState when timer is preparing to hide the tooltip
|
23
|
+
*/
|
24
|
+
private static const HIDE:int = 2;
|
25
|
+
/**
|
26
|
+
* Constant for timerState when timer is preparing to show the tooltip
|
27
|
+
*/
|
28
|
+
private static const SHOW:int = 1;
|
29
|
+
/**
|
30
|
+
* True when an item with a tooltip is being dragged.
|
31
|
+
* Tooltips are usually disabled when this is true.
|
32
|
+
*/
|
33
|
+
private static var _draggingToolTipItem:Boolean = false;
|
34
|
+
/**
|
35
|
+
* List of references to items with tooltips attached to them.
|
36
|
+
*/
|
37
|
+
private static var itemList:Array = new Array();
|
38
|
+
/**
|
39
|
+
* The actual toolTip bubble that shows when a tooltip is made visible.
|
40
|
+
* Yes, there is only one. That's all we need to display tooltips universally.
|
41
|
+
*/
|
42
|
+
private static var tipBubble:TipBubble;
|
43
|
+
/**
|
44
|
+
* Timer used to enforce showDelay and hideDelay
|
45
|
+
*/
|
46
|
+
private static var bubbleTimer:Timer;
|
47
|
+
/**
|
48
|
+
* Keeps track of what the timer is being used for.
|
49
|
+
* Possibilities are 0 - INACTIVE, 1 - SHOW, 2 - HIDE
|
50
|
+
*/
|
51
|
+
private static var timerState:int = INACTIVE;
|
52
|
+
/**
|
53
|
+
* Keeps track of the point where the mouse was pressed. Used to detect if
|
54
|
+
* the user is dragging an object or not (in which case, the bubble fades away
|
55
|
+
*/
|
56
|
+
private static var mouseDownPoint:Point;
|
57
|
+
/**
|
58
|
+
* This class acts as a singleton. Use Tooltip.add()
|
59
|
+
* @see add()
|
60
|
+
*/
|
61
|
+
public function ToolTip(doNotInstantiate:SingletonEnforcer):void {}
|
62
|
+
/**
|
63
|
+
* Creates a tooltip that is shown whenever user hovers mouse over given target.
|
64
|
+
* Make sure to always remove tooltips when you're done with them using ToolTip.remove()
|
65
|
+
*
|
66
|
+
* @param target
|
67
|
+
* @param text
|
68
|
+
* @param options Object containing options that control the given tooltip
|
69
|
+
* direction:String - ["auto"|"up"|"down"|"left"|"right"|"center"]; default is "auto"
|
70
|
+
* directionPriority:String - ["up"|"down"|"left"|"right"|"center"]; first direction to try when direction is auto; default is "up";
|
71
|
+
* anchor:String - ["mouse"|"object"]; base position off mouse or object; default is "object"
|
72
|
+
* width:Number - the width of the bubble; default: 200
|
73
|
+
* xOffset:Number - number of fudge bubble's position along the x-axis
|
74
|
+
* yOffset:Number - number of fudge bubble's position along the y-axis
|
75
|
+
* fadeTime:int - fade delay in milliseconds; default: 150
|
76
|
+
* showDelay:int - time to wait before showing tooltip; default: 300
|
77
|
+
* hideDelay:int - time to wait before hiding tooltip; default: 200
|
78
|
+
* showCallback:Function - function to call whenever tip bubble is shown
|
79
|
+
* hideCallback:Function - function to call whenever tip bubble is hidden
|
80
|
+
* @param style Object containing styling options for customizing the tooltip's appearance
|
81
|
+
* textColor:Number - the color of the text displayed in this tooltip; default: 0xffffff
|
82
|
+
* htmlText:Boolean - if true, the tooltip will display text as html; default: false
|
83
|
+
* fontFamily:String - name of font to be used (i.e. 'Verdana'); default: 'Verdana'
|
84
|
+
* fontSize:int - the size of the font to be used; default: 12
|
85
|
+
* fontStyle:int - [normal|bold|italic|bold-italic]; default: normal
|
86
|
+
* textAlign:String - alignment style for text: [left|right|center|justify]; default: center
|
87
|
+
* padding:Number - padding between edge of bubble and text (all directions); default: 5
|
88
|
+
* backgroundColor:Number - a color to paint the background of this tooltip; default: 0x232323
|
89
|
+
* backgroundAlpha:Number - a number between 0 and 1 (inclusive) that determines transparency; default: 0.3
|
90
|
+
* borderThickness:Number - the desired size (in pixels) of the tooltip's border; default: 5
|
91
|
+
* borderColor:Number - the color to be used for the border of this tooltip; default: 0xffffff;
|
92
|
+
* borderAlpha:Number - a number between 0 and 1 (inclusive) that determines transparency of the border; default: 0.3
|
93
|
+
* borderRadius:Number - the desired curvature for the rounded corners; default: 4
|
94
|
+
*/
|
95
|
+
public static function add(target:DisplayObject, text:String, options:Object = null, style:Object = null):void
|
96
|
+
{
|
97
|
+
if(text == null || text.length == 0) { return; }
|
98
|
+
target.addEventListener(MouseEvent.ROLL_OVER, onMouseOver, false, 0, true);
|
99
|
+
itemList.push(new TipObject(target, text, options, style));
|
100
|
+
}
|
101
|
+
/**
|
102
|
+
* Removes the tooltip assigned to the given component
|
103
|
+
* @param target The item to remove a tooltip for
|
104
|
+
* @param cycleAll Tries to save performance by stopping the search loop as soon as target is found. Good to disable if item has only one tooltip and you're sure you didn't add more by mistake.
|
105
|
+
*/
|
106
|
+
public static function remove(target:DisplayObject, cycleAll:Boolean = true):void
|
107
|
+
{
|
108
|
+
for(var i:int = 0; i < itemList.length; i++)
|
109
|
+
{
|
110
|
+
if(itemList[i].target == target)
|
111
|
+
{
|
112
|
+
// remove the element from itemList
|
113
|
+
itemList.splice(i, 1);
|
114
|
+
// remove listeners associated with this object
|
115
|
+
target.removeEventListener(MouseEvent.ROLL_OVER, onMouseOver);
|
116
|
+
target.removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
|
117
|
+
target.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
118
|
+
removeTimer();
|
119
|
+
// destroy tipBubble and remove any associated listeners
|
120
|
+
if(tipBubble != null && tipBubble.tipObject.target == target)
|
121
|
+
{
|
122
|
+
if(tipBubble.visible)
|
123
|
+
{
|
124
|
+
tipBubble.hide(true);
|
125
|
+
tipBubble.removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
|
126
|
+
tipBubble.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
127
|
+
tipBubble.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
128
|
+
if(tipBubble.tipObject.target.stage!= null) tipBubble.tipObject.target.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
129
|
+
if(tipBubble.tipObject.target.stage!= null) tipBubble.tipObject.target.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpStage);
|
130
|
+
}
|
131
|
+
tipBubble.parent.removeChild(tipBubble);
|
132
|
+
// eliminate dragging listeners (only necessary if in the middle of dragging)
|
133
|
+
if(_draggingToolTipItem)
|
134
|
+
{
|
135
|
+
tipBubble.tipObject.target.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
136
|
+
_draggingToolTipItem = false;
|
137
|
+
}
|
138
|
+
tipBubble = null;
|
139
|
+
}
|
140
|
+
if(!cycleAll) break;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
/**
|
145
|
+
* Removes tooltips for all components
|
146
|
+
*/
|
147
|
+
public static function removeAll():void
|
148
|
+
{
|
149
|
+
// trace("ToolTip:removeAll()");
|
150
|
+
// delete pending timers if they exist
|
151
|
+
removeTimer();
|
152
|
+
// remove every item in the list
|
153
|
+
while(itemList.length)
|
154
|
+
{
|
155
|
+
remove(TipObject(itemList[0]).target);
|
156
|
+
}
|
157
|
+
}
|
158
|
+
/**
|
159
|
+
* Shows the tooltip for the given target (if it exists) without the delay.
|
160
|
+
*/
|
161
|
+
public static function showNow(target:DisplayObject):void
|
162
|
+
{
|
163
|
+
showToolTip(DisplayObject(target), 0, new Point(0, 0));
|
164
|
+
}
|
165
|
+
/**
|
166
|
+
* Returns a reference to the settings object for the tooltip associated
|
167
|
+
* with the given target. Used for editing tooltip options.
|
168
|
+
* Returns null if the given target doesn't have a tooltip associated with it.
|
169
|
+
*/
|
170
|
+
public static function getOptionsForTarget(target:DisplayObject):Object
|
171
|
+
{
|
172
|
+
// find the tipObject associated with the target and return options for it
|
173
|
+
for(var i:int = 0; i < itemList.length; i++)
|
174
|
+
{
|
175
|
+
var item:TipObject = TipObject(itemList[i]);
|
176
|
+
if(item.target == target)
|
177
|
+
{
|
178
|
+
return item.options;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
// target does not have tooltip, return null
|
182
|
+
return null;
|
183
|
+
}
|
184
|
+
/**
|
185
|
+
* Returns a reference to the style object for the tooltip associated
|
186
|
+
* with the given target. Used for editing tooltip options.
|
187
|
+
* Returns null if the given target doesn't have a tooltip associated with it.
|
188
|
+
*/
|
189
|
+
public static function getStyleForTarget(target:DisplayObject):Object
|
190
|
+
{
|
191
|
+
// find the tipObject associated with the target and return style for it
|
192
|
+
for(var i:int = 0; i < itemList.length; i++)
|
193
|
+
{
|
194
|
+
var item:TipObject = TipObject(itemList[i]);
|
195
|
+
if(item.target == target)
|
196
|
+
{
|
197
|
+
return item.style;
|
198
|
+
}
|
199
|
+
}
|
200
|
+
// target does not have tooltip, return null
|
201
|
+
return null;
|
202
|
+
}
|
203
|
+
/**
|
204
|
+
* @private
|
205
|
+
* Called when user moves mouse over an object with a tooltip attached to it
|
206
|
+
*/
|
207
|
+
private static function onMouseOver(e:MouseEvent):void
|
208
|
+
{
|
209
|
+
showToolTip(DisplayObject(e.currentTarget), AUTO, new Point(e.stageX, e.stageY));
|
210
|
+
}
|
211
|
+
private static function showToolTip(target:DisplayObject, delay:Number, mousePoint:Point):void
|
212
|
+
{
|
213
|
+
// trace("ToolTip::showToolTip()");
|
214
|
+
/* ignore tooltips if we're dragging */
|
215
|
+
if(_draggingToolTipItem) { return; }
|
216
|
+
/* create new bubble if it does not exist */
|
217
|
+
if(tipBubble == null)
|
218
|
+
{
|
219
|
+
tipBubble = new TipBubble();
|
220
|
+
target.stage.addChild(tipBubble);
|
221
|
+
}
|
222
|
+
else /* remove listeners for old bubble if we're re-assigning it */
|
223
|
+
{
|
224
|
+
removeTimer();
|
225
|
+
tipBubble.tipObject.target.removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
|
226
|
+
}
|
227
|
+
/* Find matcing TipObject */
|
228
|
+
for(var i:int = 0; i < itemList.length; i++)
|
229
|
+
{
|
230
|
+
var item:TipObject = TipObject(itemList[i]);
|
231
|
+
if(item.target == target)
|
232
|
+
{
|
233
|
+
tipBubble.tipObject = item;
|
234
|
+
tipBubble.mousePoint = mousePoint;
|
235
|
+
removeTimer();
|
236
|
+
bubbleTimer = new Timer((delay == AUTO ? tipBubble.tipObject.options.showDelay:delay), 1);
|
237
|
+
bubbleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onShowTimerComplete, false, 0, true);
|
238
|
+
timerState = SHOW;
|
239
|
+
bubbleTimer.start();
|
240
|
+
item.target.addEventListener(MouseEvent.ROLL_OUT, onMouseOut, false, 0, true);
|
241
|
+
item.target.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
|
242
|
+
break;
|
243
|
+
}
|
244
|
+
}
|
245
|
+
}
|
246
|
+
/**
|
247
|
+
* @private
|
248
|
+
* Called when user moves mouse off an object with a tooltip attached to it
|
249
|
+
*/
|
250
|
+
private static function onMouseOut(e:MouseEvent):void
|
251
|
+
{
|
252
|
+
e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
|
253
|
+
e.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
254
|
+
removeTimer();
|
255
|
+
bubbleTimer = new Timer(tipBubble.tipObject.options.hideDelay, 1);
|
256
|
+
bubbleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onHideTimerComplete, false, 0, true);
|
257
|
+
timerState = HIDE;
|
258
|
+
bubbleTimer.start();
|
259
|
+
}
|
260
|
+
/**
|
261
|
+
* Event triggered fucntion. Called when the mouse is pressed (assumes this
|
262
|
+
* is the beginning of a drag). Disables tooltip until mouse is lifted.
|
263
|
+
*/
|
264
|
+
private static function onMouseDown(e:MouseEvent):void
|
265
|
+
{
|
266
|
+
mouseDownPoint = new Point(e.stageX, e.stageY);
|
267
|
+
e.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
268
|
+
e.currentTarget.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
269
|
+
e.currentTarget.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUpStage);
|
270
|
+
e.currentTarget.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
|
271
|
+
}
|
272
|
+
/**
|
273
|
+
* Event triggered function. Called when the mouse is moved while the mouse
|
274
|
+
* button is pressed (a drag). Will be considered a drag if mouse is a certain
|
275
|
+
* distance from the original mouse down point.
|
276
|
+
*/
|
277
|
+
private static function onMouseMove(e:MouseEvent):void
|
278
|
+
{
|
279
|
+
// check current mouse position
|
280
|
+
var currentPoint:Point = new Point(e.stageX, e.stageY);
|
281
|
+
// compare to mouse down position
|
282
|
+
var dist:Number = Math.sqrt(Math.pow(currentPoint.x - mouseDownPoint.x, 2) + Math.pow(currentPoint.y - mouseDownPoint.y, 2));
|
283
|
+
if(dist > 30)
|
284
|
+
{
|
285
|
+
_draggingToolTipItem = true;
|
286
|
+
e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
|
287
|
+
removeTimer();
|
288
|
+
/* check for and deal with stray listener */
|
289
|
+
if(tipBubble == null)
|
290
|
+
{
|
291
|
+
e.currentTarget.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
292
|
+
}
|
293
|
+
else
|
294
|
+
{
|
295
|
+
/* hide the tip bubble */
|
296
|
+
tipBubble.hide();
|
297
|
+
}
|
298
|
+
}
|
299
|
+
}
|
300
|
+
/**
|
301
|
+
* @private
|
302
|
+
* Event triggered fucntion. Called when drag ends and mouse IS over target object.
|
303
|
+
* Removes drag listeners, adds back Roll Over listener, and displays tooltip
|
304
|
+
*/
|
305
|
+
private static function onMouseUp(e:MouseEvent):void
|
306
|
+
{
|
307
|
+
_draggingToolTipItem = false;
|
308
|
+
e.currentTarget.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
309
|
+
e.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
310
|
+
e.currentTarget.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpStage);
|
311
|
+
if(!_draggingToolTipItem) // wasn't dragging
|
312
|
+
{
|
313
|
+
e.currentTarget.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
|
314
|
+
}
|
315
|
+
else // was dragging
|
316
|
+
{
|
317
|
+
e.currentTarget.addEventListener(MouseEvent.ROLL_OVER, onMouseOver, false, 0, true);
|
318
|
+
// Display tooltip again if we're still hovering at the end of our drag
|
319
|
+
onMouseOver(e);
|
320
|
+
}
|
321
|
+
}
|
322
|
+
/**
|
323
|
+
* @private
|
324
|
+
* Event triggered function. Called when drag ends and mouse is not over target object
|
325
|
+
* Removes drag listeners, and adds back Roll Over listener
|
326
|
+
*/
|
327
|
+
private static function onMouseUpStage(e:MouseEvent):void
|
328
|
+
{
|
329
|
+
var stage:EventDispatcher = EventDispatcher(e.currentTarget);
|
330
|
+
_draggingToolTipItem = false;
|
331
|
+
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
332
|
+
if(tipBubble == null) return;
|
333
|
+
tipBubble.tipObject.target.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
334
|
+
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpStage);
|
335
|
+
// trace("ToolTip:onDragEndStage");
|
336
|
+
if(!_draggingToolTipItem)
|
337
|
+
{
|
338
|
+
e.currentTarget.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
|
339
|
+
}
|
340
|
+
}
|
341
|
+
/**
|
342
|
+
* @private
|
343
|
+
* Deletes and dereferences any timer that might be in existence as well as its listeners
|
344
|
+
*/
|
345
|
+
private static function removeTimer():void
|
346
|
+
{
|
347
|
+
if(bubbleTimer != null)
|
348
|
+
{
|
349
|
+
// Make best attempt to hide old tip ubble
|
350
|
+
if(tipBubble != null)
|
351
|
+
{
|
352
|
+
tipBubble.hide();
|
353
|
+
}
|
354
|
+
switch(timerState)
|
355
|
+
{
|
356
|
+
case SHOW: // waiting for timer to show bubble
|
357
|
+
bubbleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onShowTimerComplete);
|
358
|
+
break;
|
359
|
+
case HIDE:
|
360
|
+
bubbleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onHideTimerComplete);
|
361
|
+
break;
|
362
|
+
}
|
363
|
+
bubbleTimer.stop();
|
364
|
+
bubbleTimer = null;
|
365
|
+
timerState = INACTIVE;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
/**
|
369
|
+
* @private
|
370
|
+
* Called when showDelay has expired and bubble needs to be shown.
|
371
|
+
* Shows the tooltip.
|
372
|
+
*/
|
373
|
+
private static function onShowTimerComplete(e:Event):void
|
374
|
+
{
|
375
|
+
bubbleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onShowTimerComplete);
|
376
|
+
bubbleTimer = null;
|
377
|
+
tipBubble.show();
|
378
|
+
timerState = INACTIVE;
|
379
|
+
}
|
380
|
+
/**
|
381
|
+
* @private
|
382
|
+
* Called when hideDelay has expired and bubble needs to be hidden.
|
383
|
+
* Hides the tooltip.
|
384
|
+
*/
|
385
|
+
private static function onHideTimerComplete(e:Event):void
|
386
|
+
{
|
387
|
+
bubbleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onHideTimerComplete);
|
388
|
+
bubbleTimer = null;
|
389
|
+
tipBubble.hide();
|
390
|
+
timerState = INACTIVE;
|
391
|
+
}
|
392
|
+
}/* End Class */
|
393
|
+
}/* End Package */
|
394
|
+
///////////////////////////////////////////////////////////////////////////////
|
395
|
+
//
|
396
|
+
// BEGIN INTERNAL CLASSES
|
397
|
+
//
|
398
|
+
///////////////////////////////////////////////////////////////////////////////
|
399
|
+
import com.gskinner.motion.GTween;
|
400
|
+
import flash.display.CapsStyle;
|
401
|
+
import flash.display.DisplayObject;
|
402
|
+
import flash.display.JointStyle;
|
403
|
+
import flash.display.Sprite;
|
404
|
+
import flash.events.MouseEvent;
|
405
|
+
import flash.geom.Point;
|
406
|
+
import flash.geom.Rectangle;
|
407
|
+
import flash.text.TextField;
|
408
|
+
import flash.text.TextFieldAutoSize;
|
409
|
+
import flash.text.TextFormat;
|
410
|
+
/**
|
411
|
+
* TipBubble
|
412
|
+
* The sprite that shows up on the screen with the tip in it
|
413
|
+
*/
|
414
|
+
class TipBubble extends Sprite
|
415
|
+
{
|
416
|
+
private const MARGIN_ANCHOR:Number = 20;
|
417
|
+
private const MOUSE_WIDTH:Number = 16;
|
418
|
+
private const MOUSE_HEIGHT:Number = 16;
|
419
|
+
private const TIP_WIDTH:Number = 24;
|
420
|
+
private const TIP_HEIGHT:Number = 16;
|
421
|
+
public var tipObject:TipObject;
|
422
|
+
public var mousePoint:Point;
|
423
|
+
private var tf:TextField;
|
424
|
+
private var fadeTween:GTween;
|
425
|
+
public function TipBubble()
|
426
|
+
{
|
427
|
+
this.mouseEnabled = false;
|
428
|
+
tf = new TextField();
|
429
|
+
tf.mouseEnabled = false;
|
430
|
+
tf.selectable = false;
|
431
|
+
tf.background = false;
|
432
|
+
tf.border = false;
|
433
|
+
tf.wordWrap = true;
|
434
|
+
addChild(tf);
|
435
|
+
}
|
436
|
+
public function show(fromMouseMove:Boolean = false):void
|
437
|
+
{
|
438
|
+
// Adjust position to account for padding
|
439
|
+
tf.x = tipObject.style.padding;
|
440
|
+
tf.y = tipObject.style.padding;
|
441
|
+
// Call the show callback function
|
442
|
+
if(tipObject.options.showCallback != null)
|
443
|
+
{
|
444
|
+
tipObject.options.showCallback.apply();
|
445
|
+
}
|
446
|
+
/* Update the Text */
|
447
|
+
if(tipObject.style.htmlText) tf.htmlText = tipObject.text;
|
448
|
+
else tf.text = tipObject.text;
|
449
|
+
/* Update the Options */
|
450
|
+
tf.width = tipObject.options.width;
|
451
|
+
tf.autoSize = TextFieldAutoSize.CENTER;
|
452
|
+
tf.setTextFormat(new TextFormat(tipObject.style.fontFamily, tipObject.style.fontSize, tipObject.style.textColor, tipObject.style.bold, tipObject.style.italic, false, null, null, tipObject.style.textAlign));
|
453
|
+
/* Calculate Width/Height of Box */
|
454
|
+
var w:Number = tf.width + tipObject.style.borderThickness * 2 + tipObject.style.padding * 2;
|
455
|
+
var h:Number = tf.height + tipObject.style.padding * 2;
|
456
|
+
graphics.clear();
|
457
|
+
/* Find The Anchor */
|
458
|
+
var anchorPoint:Point;
|
459
|
+
var direction:String;
|
460
|
+
var anchorObject:Rectangle;
|
461
|
+
if(tipObject.options.anchor == "mouse")
|
462
|
+
{
|
463
|
+
anchorObject = new Rectangle(mousePoint.x - MOUSE_WIDTH / 2, mousePoint.y - MOUSE_HEIGHT / 2, MOUSE_WIDTH, MOUSE_HEIGHT);
|
464
|
+
if(!fromMouseMove) stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
|
465
|
+
}
|
466
|
+
else
|
467
|
+
{
|
468
|
+
var objPoint:Point = tipObject.target.parent.localToGlobal(new Point(tipObject.target.x, tipObject.target.y));
|
469
|
+
anchorObject = new Rectangle(objPoint.x, objPoint.y, tipObject.target.getBounds(tipObject.target).width, tipObject.target.getBounds(tipObject.target).height);
|
470
|
+
}
|
471
|
+
/* Determine Direction */
|
472
|
+
// if direction is set to auto, try to find the right direction that fits based on trial error sequence
|
473
|
+
// if there is no direction that fits perfectly, try to find the direction that fits best
|
474
|
+
if(tipObject.options.direction == null || tipObject.options.direction == "auto" || tipObject.options.direction == "")
|
475
|
+
{
|
476
|
+
var secondary:String = null;
|
477
|
+
var secondaryDiff:Number = -9999;
|
478
|
+
var leftDiff:Number = anchorObject.x - w - MARGIN_ANCHOR;
|
479
|
+
var topDiff:Number = anchorObject.y - h - MARGIN_ANCHOR;
|
480
|
+
var bottomDiff:Number = stage.stageHeight - (anchorObject.y + anchorObject.height + MARGIN_ANCHOR + h);
|
481
|
+
var rightDiff:Number = stage.stageWidth - (anchorObject.x + anchorObject.width + MARGIN_ANCHOR + w);
|
482
|
+
var centerHDiff:Number = Math.min(anchorObject.x + anchorObject.width / 2 - w / 2, stage.stageWidth - (anchorObject.x + anchorObject.width / 2 + w / 2));
|
483
|
+
var centerVDiff:Number = Math.min(anchorObject.y + anchorObject.height / 2 - h / 2, stage.stageHeight - (anchorObject.y + anchorObject.height / 2 + h / 2))
|
484
|
+
// try up
|
485
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "up")
|
486
|
+
{
|
487
|
+
if(topDiff >= 0)
|
488
|
+
{
|
489
|
+
if(centerHDiff > 0)
|
490
|
+
{
|
491
|
+
direction = "up";
|
492
|
+
}
|
493
|
+
else if(centerHDiff > secondaryDiff)
|
494
|
+
{
|
495
|
+
secondary = "up";
|
496
|
+
secondaryDiff = centerHDiff;
|
497
|
+
}
|
498
|
+
}
|
499
|
+
else if(topDiff > secondaryDiff)
|
500
|
+
{
|
501
|
+
secondary = "up";
|
502
|
+
secondaryDiff = topDiff;
|
503
|
+
}
|
504
|
+
}
|
505
|
+
// try down
|
506
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "down")
|
507
|
+
{
|
508
|
+
if(bottomDiff >= 0)
|
509
|
+
{
|
510
|
+
if(centerHDiff > 0)
|
511
|
+
{
|
512
|
+
direction = "down";
|
513
|
+
}
|
514
|
+
else if(centerHDiff > secondaryDiff)
|
515
|
+
{
|
516
|
+
secondary = "down";
|
517
|
+
secondaryDiff = centerHDiff;
|
518
|
+
}
|
519
|
+
}
|
520
|
+
else if(bottomDiff > secondaryDiff)
|
521
|
+
{
|
522
|
+
secondary = "down";
|
523
|
+
secondaryDiff = bottomDiff;
|
524
|
+
}
|
525
|
+
}
|
526
|
+
// try left
|
527
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "left")
|
528
|
+
{
|
529
|
+
if(leftDiff >= 0)
|
530
|
+
{
|
531
|
+
if(centerVDiff > 0)
|
532
|
+
{
|
533
|
+
direction = "left";
|
534
|
+
}
|
535
|
+
else if(centerVDiff > secondaryDiff)
|
536
|
+
{
|
537
|
+
secondary = "left";
|
538
|
+
secondaryDiff = centerVDiff;
|
539
|
+
}
|
540
|
+
}
|
541
|
+
else if(leftDiff > secondaryDiff)
|
542
|
+
{
|
543
|
+
secondary = "left";
|
544
|
+
secondaryDiff = leftDiff;
|
545
|
+
}
|
546
|
+
}
|
547
|
+
// try right
|
548
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "right")
|
549
|
+
{
|
550
|
+
if(rightDiff >= 0)
|
551
|
+
{
|
552
|
+
if(centerVDiff > 0)
|
553
|
+
{
|
554
|
+
direction = "right";
|
555
|
+
}
|
556
|
+
else if(centerVDiff > secondaryDiff)
|
557
|
+
{
|
558
|
+
secondary = "right";
|
559
|
+
secondaryDiff = centerVDiff;
|
560
|
+
}
|
561
|
+
}
|
562
|
+
else if(rightDiff > secondaryDiff)
|
563
|
+
{
|
564
|
+
secondary = "right";
|
565
|
+
secondaryDiff = rightDiff;
|
566
|
+
}
|
567
|
+
}
|
568
|
+
/* try diagonals (if we don't have a perfect fit yet) */
|
569
|
+
// try top-left
|
570
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "top-left")
|
571
|
+
{
|
572
|
+
if(topDiff >= 0 && leftDiff>= 0)
|
573
|
+
{
|
574
|
+
direction = "top-left";
|
575
|
+
}
|
576
|
+
else if(Math.min(topDiff, leftDiff) > secondaryDiff)
|
577
|
+
{
|
578
|
+
secondary = "top-left";
|
579
|
+
secondaryDiff = Math.min(topDiff, leftDiff);
|
580
|
+
}
|
581
|
+
}
|
582
|
+
// try top-right
|
583
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "top-right")
|
584
|
+
{
|
585
|
+
if(direction == null && topDiff >= 0 && rightDiff >= 0)
|
586
|
+
{
|
587
|
+
direction = "top-right";
|
588
|
+
}
|
589
|
+
else if(Math.min(topDiff, rightDiff) > secondaryDiff)
|
590
|
+
{
|
591
|
+
secondary = "top-right";
|
592
|
+
secondaryDiff = Math.min(topDiff, rightDiff);
|
593
|
+
}
|
594
|
+
}
|
595
|
+
// try bottom-right
|
596
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "bottom-right")
|
597
|
+
{
|
598
|
+
if(direction == null && bottomDiff >= 0 && rightDiff >= 0)
|
599
|
+
{
|
600
|
+
direction = "bottom-right";
|
601
|
+
}
|
602
|
+
else if(Math.min(bottomDiff, rightDiff) > secondaryDiff)
|
603
|
+
{
|
604
|
+
secondary = "bottom-right";
|
605
|
+
secondaryDiff = Math.min(bottomDiff, rightDiff);
|
606
|
+
}
|
607
|
+
}
|
608
|
+
// try bottom-left
|
609
|
+
if(direction == null || tipObject.options.directionPriority.toLowerCase() == "bottom-left")
|
610
|
+
{
|
611
|
+
if(direction == null && bottomDiff >= 0 && leftDiff >= 0)
|
612
|
+
{
|
613
|
+
direction = "bottom-left";
|
614
|
+
}
|
615
|
+
else if(Math.min(bottomDiff, leftDiff) > secondaryDiff)
|
616
|
+
{
|
617
|
+
secondary = "bottom-left";
|
618
|
+
secondaryDiff = Math.min(bottomDiff, leftDiff);
|
619
|
+
}
|
620
|
+
}
|
621
|
+
// if there is no perfect fit, try to get the "best" possible fit fit from secondary
|
622
|
+
if(direction == null)
|
623
|
+
{
|
624
|
+
if(secondary != null)
|
625
|
+
{
|
626
|
+
direction = secondary;
|
627
|
+
}
|
628
|
+
// resort to center if no other fits work (should never get here)
|
629
|
+
else
|
630
|
+
{
|
631
|
+
direction = "center";
|
632
|
+
}
|
633
|
+
}
|
634
|
+
}
|
635
|
+
else
|
636
|
+
{
|
637
|
+
direction = tipObject.options.direction;
|
638
|
+
}
|
639
|
+
/* Draw according to direction */
|
640
|
+
var tipW2:Number = Math.sqrt(Math.pow(TIP_WIDTH, 2)/2); // width/height of tip at an angle (pythagorean's theorem)
|
641
|
+
var tipAngle:Number; // For Diagonal Bubbles, the direction the tip will be pointing
|
642
|
+
var tipPointX:Number; // For Diagonal Bubbles, the x position of the end-point of the tip
|
643
|
+
var tipPointY:Number; // For Diagonal Bubbles, the y position of the end-point of the tip
|
644
|
+
graphics.beginFill(tipObject.style.backgroundColor, tipObject.style.backgroundAlpha);
|
645
|
+
graphics.lineStyle(tipObject.style.borderThickness, tipObject.style.borderColor, tipObject.style.borderAlpha, true);
|
646
|
+
switch(direction)
|
647
|
+
{
|
648
|
+
case "up":
|
649
|
+
this.x = anchorObject.x + anchorObject.width / 2 - w / 2;
|
650
|
+
this.y = anchorObject.y - MARGIN_ANCHOR - h;
|
651
|
+
// tip must point down
|
652
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
653
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
654
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
655
|
+
graphics.lineTo(w, h - tipObject.style.borderRadius);
|
656
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
657
|
+
graphics.lineTo(w / 2 + TIP_WIDTH / 2, h);
|
658
|
+
graphics.lineTo(w / 2, h + TIP_HEIGHT);
|
659
|
+
graphics.lineTo(w / 2 - TIP_WIDTH / 2, h);
|
660
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
661
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
662
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
663
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
664
|
+
graphics.endFill();
|
665
|
+
break;
|
666
|
+
case "down":
|
667
|
+
this.x = anchorObject.x + anchorObject.width / 2 - w / 2;
|
668
|
+
this.y = anchorObject.y + anchorObject.height + MARGIN_ANCHOR;
|
669
|
+
// tip must point up
|
670
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
671
|
+
graphics.lineTo(w / 2 - TIP_WIDTH / 2, 0);
|
672
|
+
graphics.lineTo(w / 2, -TIP_HEIGHT);
|
673
|
+
graphics.lineTo(w / 2 + TIP_WIDTH / 2, 0);
|
674
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
675
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
676
|
+
graphics.lineTo(w, h - tipObject.style.borderRadius);
|
677
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
678
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
679
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
680
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
681
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
682
|
+
graphics.endFill();
|
683
|
+
break;
|
684
|
+
case "left":
|
685
|
+
this.x = anchorObject.x - MARGIN_ANCHOR - w;
|
686
|
+
this.y = anchorObject.y + anchorObject.height / 2 - h / 2;
|
687
|
+
// tip must point right
|
688
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
689
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
690
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
691
|
+
graphics.lineTo(w, h / 2 - TIP_WIDTH / 2);
|
692
|
+
graphics.lineTo(w + TIP_HEIGHT, h / 2);
|
693
|
+
graphics.lineTo(w, h / 2 + TIP_WIDTH / 2);
|
694
|
+
graphics.lineTo(w, h - tipObject.style.borderRadius);
|
695
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
696
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
697
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
698
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
699
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
700
|
+
graphics.endFill();
|
701
|
+
break;
|
702
|
+
case "right":
|
703
|
+
this.x = anchorObject.x + anchorObject.width + MARGIN_ANCHOR;
|
704
|
+
this.y = anchorObject.y + anchorObject.height / 2 - h / 2;
|
705
|
+
// tip must point left
|
706
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
707
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
708
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
709
|
+
graphics.lineTo(w, h - tipObject.style.borderRadius);
|
710
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
711
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
712
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
713
|
+
graphics.lineTo(0, h / 2 + TIP_WIDTH / 2);
|
714
|
+
graphics.lineTo(-TIP_HEIGHT, h / 2);
|
715
|
+
graphics.lineTo(0, h / 2 - TIP_WIDTH / 2);
|
716
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
717
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
718
|
+
graphics.endFill();
|
719
|
+
break;
|
720
|
+
case "top-left":
|
721
|
+
tipAngle = 7 * Math.PI / 4;
|
722
|
+
this.x = anchorObject.x - w - MARGIN_ANCHOR / 2 * Math.cos(tipAngle + Math.PI);
|
723
|
+
this.y = anchorObject.y - h - MARGIN_ANCHOR / 2 * (-Math.sin(tipAngle + Math.PI));
|
724
|
+
// tip must point bottom right
|
725
|
+
tipPointX = w + TIP_HEIGHT / 2 * Math.cos(tipAngle);
|
726
|
+
tipPointY = h + TIP_HEIGHT / 2 * (-Math.sin(tipAngle));
|
727
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
728
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
729
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
730
|
+
graphics.lineTo(w, h - tipW2);
|
731
|
+
graphics.lineTo(tipPointX, tipPointY);
|
732
|
+
graphics.lineTo(w - tipW2, h);
|
733
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
734
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
735
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
736
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
737
|
+
graphics.endFill();
|
738
|
+
break;
|
739
|
+
case "top-right":
|
740
|
+
tipAngle = 5 * Math.PI / 4;
|
741
|
+
this.x = anchorObject.x + anchorObject.width + MARGIN_ANCHOR / 2 * Math.cos(tipAngle + Math.PI);
|
742
|
+
this.y = anchorObject.y - h + MARGIN_ANCHOR / 2 * (-Math.sin(tipAngle + Math.PI));
|
743
|
+
// tip must point bottom left
|
744
|
+
tipPointX = TIP_HEIGHT / 2 * Math.cos(tipAngle);
|
745
|
+
tipPointY = h + TIP_HEIGHT / 2 * (-Math.sin(tipAngle));
|
746
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
747
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
748
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
749
|
+
graphics.lineTo(w, h - tipObject.style.borderRadius);
|
750
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
751
|
+
graphics.lineTo(tipW2, h);
|
752
|
+
graphics.lineTo(tipPointX, tipPointY);
|
753
|
+
graphics.lineTo(0, h - tipW2);
|
754
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
755
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
756
|
+
graphics.endFill();
|
757
|
+
break;
|
758
|
+
case "bottom-left":
|
759
|
+
tipAngle = Math.PI / 4
|
760
|
+
this.x = anchorObject.x - w + MARGIN_ANCHOR / 2 * Math.cos(tipAngle + Math.PI);
|
761
|
+
this.y = anchorObject.y + anchorObject.height + MARGIN_ANCHOR / 2 * (-Math.sin(tipAngle + Math.PI));
|
762
|
+
// tip must point top right
|
763
|
+
tipPointX = w + TIP_HEIGHT / 2 * Math.cos(tipAngle);
|
764
|
+
tipPointY = TIP_HEIGHT / 2 * (-Math.sin(tipAngle));
|
765
|
+
graphics.beginFill(tipObject.style.backgroundColor, tipObject.style.backgroundAlpha);
|
766
|
+
graphics.lineStyle(tipObject.style.borderThickness, tipObject.style.borderColor, tipObject.style.borderAlpha, true);
|
767
|
+
graphics.moveTo(tipObject.style.borderRadius, 0);
|
768
|
+
graphics.lineTo(w - tipW2, 0);
|
769
|
+
graphics.lineTo(tipPointX, tipPointY);
|
770
|
+
graphics.lineTo(w, tipW2);
|
771
|
+
graphics.lineTo(w, y - tipObject.style.borderRadius);
|
772
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
773
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
774
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
775
|
+
graphics.lineTo(0, tipObject.style.borderRadius);
|
776
|
+
graphics.curveTo(0, 0, tipObject.style.borderRadius, 0);
|
777
|
+
graphics.endFill();
|
778
|
+
break;
|
779
|
+
case "bottom-right":
|
780
|
+
tipAngle = 3 * Math.PI / 4;
|
781
|
+
this.x = anchorObject.x + anchorObject.width + MARGIN_ANCHOR / 2 * Math.cos(tipAngle + Math.PI);
|
782
|
+
this.y = anchorObject.y + anchorObject.height + MARGIN_ANCHOR / 2 * (-Math.sin(tipAngle + Math.PI));
|
783
|
+
// tip must point top-left
|
784
|
+
tipAngle = 3 * Math.PI / 4;
|
785
|
+
tipPointX = TIP_HEIGHT / 2 * Math.cos(tipAngle);
|
786
|
+
tipPointY = - TIP_HEIGHT / 2 * Math.sin(tipAngle);
|
787
|
+
graphics.moveTo(tipW2, 0);
|
788
|
+
graphics.lineTo(w - tipObject.style.borderRadius, 0);
|
789
|
+
graphics.curveTo(w, 0, w, tipObject.style.borderRadius);
|
790
|
+
graphics.lineTo(w, h - tipObject.style.borderRadius);
|
791
|
+
graphics.curveTo(w, h, w - tipObject.style.borderRadius, h);
|
792
|
+
graphics.lineTo(tipObject.style.borderRadius, h);
|
793
|
+
graphics.curveTo(0, h, 0, h - tipObject.style.borderRadius);
|
794
|
+
graphics.lineTo(0, tipW2);
|
795
|
+
graphics.lineTo(tipPointX, tipPointY);
|
796
|
+
graphics.lineTo(tipW2, 0);
|
797
|
+
graphics.endFill();
|
798
|
+
var t:DisplayObject = tipObject.target;
|
799
|
+
// trace(t.width, t.height, " || ", t.getBounds(t).width, t.getBounds(t).height);
|
800
|
+
break;
|
801
|
+
default: // center
|
802
|
+
this.x = anchorObject.x + anchorObject.width / 2 - w / 2;
|
803
|
+
this.y = anchorObject.y + anchorObject.height / 2 - h / 2;
|
804
|
+
// no tip pointer
|
805
|
+
graphics.drawRoundRect(0, 0, w, h, tipObject.style.borderRadius);
|
806
|
+
graphics.endFill();
|
807
|
+
break;
|
808
|
+
}
|
809
|
+
this.x += tipObject.options.xOffset;
|
810
|
+
this.y += tipObject.options.yOffset;
|
811
|
+
if(!fromMouseMove && tipObject.options.fadeTime != 0)
|
812
|
+
{
|
813
|
+
resetFadeTween();
|
814
|
+
this.alpha = 0;
|
815
|
+
fadeTween = new GTween(this, tipObject.options.fadeTime / 1000, {alpha: 1});
|
816
|
+
}
|
817
|
+
this.visible = true;
|
818
|
+
}
|
819
|
+
public function hide(force:Boolean = false):void
|
820
|
+
{
|
821
|
+
// Call the hide bubble callback
|
822
|
+
if(tipObject.options.hideCallback != null)
|
823
|
+
{
|
824
|
+
tipObject.options.hideCallback.apply();
|
825
|
+
}
|
826
|
+
// remove the listener
|
827
|
+
if(tipObject.options.anchor == "mouse")
|
828
|
+
{
|
829
|
+
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
830
|
+
}
|
831
|
+
if(!force && tipObject.options.fadeTime != 0)
|
832
|
+
{
|
833
|
+
resetFadeTween();
|
834
|
+
fadeTween = new GTween(this, tipObject.options.fadeTime / 1000, {alpha: 0});
|
835
|
+
var instance:TipBubble = this;
|
836
|
+
fadeTween.onComplete = function():void { instance.visible = false; }
|
837
|
+
}
|
838
|
+
else
|
839
|
+
{
|
840
|
+
this.visible = false;
|
841
|
+
}
|
842
|
+
}
|
843
|
+
public function onMouseMove(e:MouseEvent):void
|
844
|
+
{
|
845
|
+
mousePoint = new Point(e.stageX, e.stageY);
|
846
|
+
show(true);
|
847
|
+
}
|
848
|
+
public function resetFadeTween():void
|
849
|
+
{
|
850
|
+
if(fadeTween != null)
|
851
|
+
{
|
852
|
+
fadeTween.end();
|
853
|
+
fadeTween.onComplete = null;
|
854
|
+
fadeTween = null;
|
855
|
+
}
|
856
|
+
}
|
857
|
+
}
|
858
|
+
/**
|
859
|
+
* TipObject
|
860
|
+
* Contains the information used in TipBubble
|
861
|
+
*/
|
862
|
+
class TipObject
|
863
|
+
{
|
864
|
+
public var target:DisplayObject;
|
865
|
+
public var text:String;
|
866
|
+
public var options:Object;
|
867
|
+
public var style:Object;
|
868
|
+
public function TipObject(target:DisplayObject, text:String, options:Object = null, style:Object = null)
|
869
|
+
{
|
870
|
+
this.target = target;
|
871
|
+
this.text = text == null? "" : text;
|
872
|
+
/*
|
873
|
+
* Remember to Change Documentation of ToolTip.add() if you change any default values here
|
874
|
+
*/
|
875
|
+
// set default options
|
876
|
+
this.options = options == null ? new Object() : options;
|
877
|
+
if(this.options.fadeTime == null) { this.options.fadeTime = 150; }
|
878
|
+
if(this.options.width == null) { this.options.width = 200; }
|
879
|
+
if(this.options.xOffset == null) { this.options.xOffset = 0; }
|
880
|
+
if(this.options.yOffset == null) { this.options.yOffset = 0; }
|
881
|
+
if(this.options.showDelay == null) { this.options.showDelay = 300; }
|
882
|
+
if(this.options.hideDelay == null) { this.options.hideDelay = 200; }
|
883
|
+
if(this.options.directionPriority == null) { this.options.directionPriority = "up"; }
|
884
|
+
/*
|
885
|
+
* Remember to Change Documentation of ToolTip.add() if you change any default values here
|
886
|
+
*/
|
887
|
+
// set default styles
|
888
|
+
this.style = style == null ? new Object() : style;
|
889
|
+
if(this.style.textColor == null) { this.style.textColor = 0xffffff; }
|
890
|
+
if(this.style.htmlText == null) { this.style.htmlText = false; }
|
891
|
+
if(this.style.fontFamily == null) { this.style.fontFamily = 'Verdana'; }
|
892
|
+
if(this.style.fontSize == null) { this.style.fontSize = 12; }
|
893
|
+
if(this.style.fontStyle == null) { this.style.boldFont = false; this.style.italicFont = false; }
|
894
|
+
else
|
895
|
+
{
|
896
|
+
switch(this.style.fontStyle)
|
897
|
+
{
|
898
|
+
case 'bold':
|
899
|
+
this.style.bold = true;
|
900
|
+
break;
|
901
|
+
case 'italic':
|
902
|
+
this.style.italic = true;
|
903
|
+
break;
|
904
|
+
case 'bold-italic':
|
905
|
+
this.style.bold = true;
|
906
|
+
this.style.italic = true;
|
907
|
+
break;
|
908
|
+
default:
|
909
|
+
this.style.bold = false;
|
910
|
+
this.style.italic = false;
|
911
|
+
}
|
912
|
+
}
|
913
|
+
if(this.style.textAlign == null) { this.style.textAlign = "center"; }
|
914
|
+
if(this.style.backgroundColor == null) { this.style.backgroundColor = 0x232323; }
|
915
|
+
if(this.style.backgroundAlpha == null) { this.style.backgroundAlpha = 0.95; }
|
916
|
+
if(this.style.borderThickness == null) { this.style.borderThickness = 5; }
|
917
|
+
if(this.style.borderColor == null) { this.style.borderColor = 0xffffff; }
|
918
|
+
if(this.style.borderAlpha == null) { this.style.borderAlpha = 0.3; }
|
919
|
+
if(this.style.borderRadius == null) { this.style.borderRadius = 4; }
|
920
|
+
if(this.style.padding == null) { this.style.padding = 5; }
|
921
|
+
/*
|
922
|
+
* Remember to Change Documentation of ToolTip.add() if you change any default values here
|
923
|
+
*/
|
924
|
+
}
|
925
|
+
}
|
926
|
+
/**
|
927
|
+
* SingletonEnforcer
|
928
|
+
* Empty class used to enforce Singleton.
|
929
|
+
*/
|
930
|
+
class SingletonEnforcer {}
|