by Josh Tynjala
With Apache FlexJS, we can build web apps and pages using ActionScript... no plugin required! HTML is the basic building block of the web, so it's important to understand how ActionScript can create it, modify it, and enhance it.
Let's learn how to combine transpiled ActionScript and HTML by building a simple HTML widget. It will be a loan payment calculator that takes some input values and calculates a result. We're going to build it three different ways, and in the process, we'll learn how well ActionScript can integrate with HTML in a web browser.
For this tutorial, you should install Apache FlexJS 0.6 or newer. Use the Apache Flex SDK Installer to download it.
In the first part, we'll build our HTML widget entirely in ActionScript code. We'll get learn how to create HTML elements in ActionScript and add them to the DOM.
Let's rebuild the same widget using real HTML markup and a style sheet, and we'll learn how to query the DOM with ActionScript to hook everything up.
Finally, let's restyle the widget using a popular CSS framework. We'll use Google's Material Design Lite, but Bootstrap and others are easy to integrate too!
Would you like to learn more about transpiling ActionScript? Please become a patron, and support the creation of a whole library of detailed, step-by-step tutorials — including video tutorials! Let's work together to teach the next generation of ActionScript developers.