This is a sample application that was built with AS3JS. It's an engine for an elevator simulator built with ActionScript 3.0 source code that executes in HTML5 without the Flash Player. For kicks I've included a Flash SWF just to demonstrate how easy it is to port. If you want to compile the Flash version yourself via the Flash IDE, you can grep the .as files for the text "For AS3" to find the code lines you'll need to modify.
The bulk of the setup for initializing the engine goes like this:
var engine = new ElevatorEngine({
entranceFloor: /* Reference to the entrance floor object */,
elevators: [ /* Array of Elevator objects */ ],
floors: [ /* Array of Floor objects */ ],
people: [ /* Array of People objects */ ]
});
//Start the engine
engine.start();
You can explore the source code to see how to initialize the individual Floors, People, and Elevators. But please note this project is mainly designed for demonstration purposes, so there is limited configuration.
With Node.js installed on your system, run npm install
from within the project folder to install its dependencies. Then elevator.js
can be recompiled via the following this command:
node build
Open elevator.htm
to view.
Copyrighted © 2015 by Greg McLeod
GitHub: https://github.com/cleod9