topleft

PureMVC

larger smaller reset larger Futurescale, Inc.
  • fixed-width
  • fluid-width
  • Home
  • About
  • Code
  • Docs
  • FAQ
  • Forums
  • News
  • Showcase
  • Contact
  • Jobs
topright
Demo_AS3_Flex_StopWatch
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Browse Source

Context Navigation

  • Start Page
  • Index
  • History
  • Last Change

TracNav

  •  PureMVC Manifold...

  •  Contributors
  •  Repositories
  • Ports...

  •  ActionScript 2
  • ActionScript 3
  •  C #
  •  ColdFusion
  •  Haxe
  •  Java
  •  JavaScript
  •  Objective C
  •  PHP
  •  Python
  •  Ruby
  •  Propose a Port

TracNav

  •  AS3 STD /  AS3 MC :  StopWatch...

  • Downloads
  • Installation
  • Release Notes
  •  Live Demo
  •  View Source
  •  Discussion
  • Project Owner...

  •  Cliff Hall
  • Utilities Used...

  •  StateMachine

Demo - Flex / StopWatch

This demo illustrates the use of the  StateMachine Utility to define and navigate the states of a  Finite State Machine or FSM of a working StopWatch.

Features in 1.0

  • The following is a  Harel StateChart describing the FSM of a classic stopwatch: Harel State Chart for the !StopWatch originally at from http://en.wikipedia.org/wiki/SCXML
  • The demo implements this the above FSM as a working stopwatch, as  defined elsewhere and widely referred to as a familiar way to explain state machines in general.
  • If you're confused what 'split/unsplit' mean, it is when you have the timer running, and you split the display to show a frozen lap time as of the moment you hit split, along with a continuing counter. This lets a coach easily note the lap times of individual runners in a race, for instance.
  • It makes use of the FSMInjector which accepts an XML representation of the FSM for a stopwatch, registers the resultant StateMachine with the Facade.
  • Check out the InjectFSMCommand for to see how easy it is to define the FSM and have it injected into your app.
  • The question will certainly arise:
    • Why wasn't  SCXML chosen to define the FSM?
    • Several reasons:
      • Much more complex than we wanted to attempt.
      • Conditional logic is ugly because you have to escape ampersands in xml.
      • We wanted entering and exiting notifications for each state.
      • The word 'event' would inevitably cause confusion to the Flash community, so we chose 'action'.

Attachments

  • stopwatch_fsm.jpg Download (13.6 KB) - added by puremvc 21 months ago. Harel State Chart for the StopWatch originally at from  http://en.wikipedia.org/wiki/SCXML

Download in other formats:

  • Plain Text

Trac Powered

Powered by Trac 0.11.7
By Edgewall Software.

Powered by the Subversion, Trac & Bugzilla Hosting Experts, Codesion.com

Copyright © 2006-2008 Futurescale, Inc.