Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64CE7176F6 for ; Tue, 4 Nov 2014 19:15:52 +0000 (UTC) Received: (qmail 2166 invoked by uid 500); 4 Nov 2014 19:15:52 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 2130 invoked by uid 500); 4 Nov 2014 19:15:52 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 2120 invoked by uid 99); 4 Nov 2014 19:15:52 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Nov 2014 19:15:52 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E52868AE977; Tue, 4 Nov 2014 19:15:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bigosmallm@apache.org To: commits@flex.apache.org Date: Tue, 04 Nov 2014 19:15:51 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/22] git commit: [flex-examples] [refs/heads/develop] - added a slide to open and mouse drag to close Repository: flex-examples Updated Branches: refs/heads/develop 0cd6ec753 -> 44ddf534e added a slide to open and mouse drag to close Signed-off-by: OmPrakash Muppirala Project: http://git-wip-us.apache.org/repos/asf/flex-examples/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-examples/commit/7a933e28 Tree: http://git-wip-us.apache.org/repos/asf/flex-examples/tree/7a933e28 Diff: http://git-wip-us.apache.org/repos/asf/flex-examples/diff/7a933e28 Branch: refs/heads/develop Commit: 7a933e28389b6fb9741892b9a856babe415ea5a5 Parents: 0cd6ec7 Author: nasha001 Authored: Tue Jan 7 12:56:52 2014 -0500 Committer: OmPrakash Muppirala Committed: Tue Nov 4 11:07:23 2014 -0800 ---------------------------------------------------------------------- .project | 11 ++ tourdeflexmobile/src/TourDeFlexMobile.mxml | 203 ++++++++++++++++++------ 2 files changed, 168 insertions(+), 46 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-examples/blob/7a933e28/.project ---------------------------------------------------------------------- diff --git a/.project b/.project new file mode 100644 index 0000000..d160bcb --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + tourdeflexmobile + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-examples/blob/7a933e28/tourdeflexmobile/src/TourDeFlexMobile.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/TourDeFlexMobile.mxml b/tourdeflexmobile/src/TourDeFlexMobile.mxml index 6a9dc94..e49714c 100644 --- a/tourdeflexmobile/src/TourDeFlexMobile.mxml +++ b/tourdeflexmobile/src/TourDeFlexMobile.mxml @@ -19,14 +19,20 @@ limitations under the License. --> + xmlns:s="library://ns.adobe.com/flex/spark" + applicationDPI="160" + applicationComplete="init(event)"> lateralMenu.width && mouseY > 45) + { + _startX = mouseX; + stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp); + stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove); + } + } + + + protected function doSlide(event:TimerEvent):void + { + + var slideTimer:Timer = Timer(event.currentTarget); + var t:Number = slideTimer.currentCount/slideTimer.repeatCount; + navigators.x = (navigators.mouseEnabled ? (1-t) : t) * lateralMenu.width; + + } + + protected function slideComplete(event:TimerEvent):void + { + removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown); + navigators.mouseEnabled; + if (!navigators.mouseEnabled) + { + addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); + } + } + + protected function mouseMove(event:MouseEvent):void + { + navigators.x = Math.max(Math.min(mouseX - _startX + lateralMenu.width, lateralMenu.width), 0); + } + + protected function mouseUp(event:MouseEvent):void + { + + stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp); + stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove); + navigators.mouseEnabled = navigators.mouseChildren = mouseX < lateralMenu.width / 2; + _slideTimer.repeatCount = Math.max(navigators.mouseEnabled ? Math.floor(STEPS * navigators.x / lateralMenu.width) : Math.floor(STEPS * (1 - navigators.x / lateralMenu.width)), 1); + _slideTimer.reset(); + _slideTimer.start(); + + } + + + ]]> - - + + - - - - - - - - - + + + - + @@ -167,5 +272,11 @@ limitations under the License. - + + + + + + +