Book Image

HTML5 for Flash Developers

By : Matthew Fisher
Book Image

HTML5 for Flash Developers

By: Matthew Fisher

Overview of this book

As the support for HTML5 within modern web browsers grows, the appeal of HTML5 development, especially for Flash developers, is at an all-time high. From 3D interactive multi-user content to high definition video streaming, HTML5 can deliver it all, to almost all modern web browsers, desktops, and mobile platforms. HTML5 for Flash Developers is a practical, targeted guide for developers with previous experience in developing applications in Flash who would like to add HTML5 development to their skill set. By understanding key aspects that make HTML5 development different from Flash you will be able to integrate your current skill set into the HTML5 development paradigm. Starting with identifying the key technologies that make up the HTML5 development stack and how they are utilized to create HTML5 content, HTML5 for Flash Developers will cover the traditional HTML5 application development flow chapter by chapter, while covering many other common tools that are regularly used in HTML5 today.In addition to understanding and writing dependency-free HTML5 code, you will also learn how to build your HTML5 applications on top of popular libraries and frameworks such as jQuery and CreateJS. This book covers how to prepare all of your content and media for integration into your HTML5 application using applications such as the Miro Video Converter or Adobe Photoshop. You will learn ways to not only continue to use Adobe Flash in your HTML5 application content preparation flow, but also how to port your existing Flash content right over to HTML5.Once you understand what it takes to build HTML5 content, you will finish up by learning how to debug, optimize, and prepare your content for release on the Web.
Table of Contents (17 chapters)
HTML5 for Flash Developers
Credits
About the Author
About the Reviewers
www.packtpub.com
Preface
Index

Preface

HTML5 for Flash Developers has been specifically written for Flash developers ready to dive right into HTML5 development. Starting off by analyzing each of the elements that make up HTML5, we will then begin learning how to utilize them by comparing their features to typical Flash development.

What this book covers

Chapter 1, Why HTML5?, begins by answering why learning how to develop in HTML5 can be an incredibly important skillset to acquire. We will continue with a complete overview of all of the different technologies that make up HTML5 and how they are utilized.

Chapter 2, Preparing for the Battle, covers the important process of preparing assets such images, audio, and video for the web. This chapter also covers many of the important aspects of JavaScript development and how they differ from ActionScript 3.

Chapter 3, Scalability, Limitations, and Effects, aims to inform you about many of the limitations that HTML5 developers regularly encounter while developing for the web today. We will also take our first detailed look into the newest addition of Cascading Style Sheets, CSS3. Finally we will overview some of the most interesting new additions to HTML development by looking at HTML5 Web Workers, Web Sockets, the Canvas element, and finally WebGL.

Chapter 4, Building Robust Applications with HTML5, continues to look deeper into JavaScript development by aiming to structure code in an object-oriented manner. Comparisons to ActionScript 3 class structure, usage, and syntax are made as well as an overview of some libraries and frameworks to aid in building robust HTML5 applications.

Chapter 5, Code Once, Release Everywhere, looks at applications and code libraries that enabled developers to easily target multiple platforms with a single application build, minimizing development time and maximizing public usage. We will spend a good portion of our time diving into the CreateJS framework and all of its packages. Finally we will cover how CSS3 media queries can allow for targeted element styling on a wide variety of screens.

Chapter 6, HTML5 Frameworks and Libraries, continues to dig into the wide variety of amazing framework and libraries available to you when developing your next HTML5 application. We begin by checking out one of the most popular libraries online today, that is jQuery. Along with the jQuery JavaScript library, we will look at how the jQuery Mobile project can transform a simple HTML document into a mobile-friendly user interface. Finally we will check out other open source projects such as Google V8, Node.js, and Three.js.

Chapter 7, Choosing How You Develop, looks at many of the popular code editing platforms that are available to HTML5 developers. We will overview many of the absolute necessities most developers require from coding environments when developing for the web. We will also take some time to check out the Adobe Edge Animate platform which brings a Flash-like user interface for creating HTML5 animations.

Chapter 8, Exporting to HTML5, continues to look at more software that allows you to write your HTML5 applications in platforms like Adobe Flash and compile them directly into HTML5. We will overview many popular platforms that export to HTML5 such as Jangaroo, Haxe, and Google's Dart.

Chapter 9, Avoiding the Roadblocks, attempts to display and discuss many of the typical issues developers face when working with many of the new additions to HTML5. In this chapter, we will develop a simple 2D side scrolling game and examine where common issues occur.

Chapter 10, Preparing for Release, concludes this book by discussing many of the common tasks usually performed on HTML5 applications prior to publishing them on the Internet. We will discuss proper browser testing methods and the utilization of "nightly" web browser releases. We will discuss many ways to benchmark your HTML5 content with external applications and browser plugins to enable you to inspect for runtime issues. Finally we will discuss methods to automate processes that web developers find themselves doing repeatedly by using applications like Grunt.

What you need for this book

For a complete understanding of the book, the following software are required:

Access to the Internet to download up to date versions of open source libraries and frameworks.

Who this book is for

This book has been specifically targeted at developers with experience with developing web application and games in Adobe Flash who are ready to add HTML5 development to their skillset.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

  this.setX = function(x) { _xVal = x; }
  this.setY = function(y) { _yVal = y; }
  this.currentX = function() { return _xVal; }
  this.currentY = function() { return _yVal; }
  this.currentWidth = function() { return _widthVal; }
  this.currentHeight = function() { return _heightVal; }

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

  this.setX = function(x) { _xVal = x; }
  this.setY = function(y) { _yVal = y; }
  this.currentX = function() { return _xVal; }
  this.currentY = function() { return _yVal; }
  this.currentWidth = function() { return _widthVal; }
  this.currentHeight = function() { return _heightVal; }

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/3325OT_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.