AS3-Navigator

I’m pleased to announce my first library for ActionScript!

AS3-Navigator Site

AS3-Navigator is a FSM with views control in mind, it offers:
  • Fluent API
  • Guards
  • Hooks
  • Redirect

It makes easy handling the transition of the state of your application. You can block the request of a new state with a guard, execute your code when entering some state with a hook or redirect a state to another.

Let’s make some examples
Hook to load usersData when entering /usersList/
1
navigator.onEnterTo("/usersList/").addHooks(LoadUsers);
When entering detail state /usersList/user/* use a guard to check that the user exist and then load userData
1
2
3
navigator.onExitFrom("/usersList/").to("/usersList/user/*")
.addGuards(checkUserExist)
.addHooks(LoadUserData);
Redirect to / on exit from /about/
1
navigator.onExitFrom("/about/").redirectTo("/");

For more examples refer to the README.md on Github

Last but not least it makes use of state of the art technology: