Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6616047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:32:10+00:00 2026-05-25T20:32:10+00:00

I had created an HTML5 Canvas WebGL game in January for the Mozilla Game

  • 0

I had created an HTML5 Canvas WebGL game in January for the Mozilla Game On 2010 competition (pretty late, I know – I never released it until yesterday). Now I want to port it to Flash ActionScript 3.0 for a college assignment.

I’m well versed with both static languages like C/C++ and Java; and dynamic languages like Python and JavaScript. However I don’t know ActionScript, but since it’s a subset of ECMAScript it should be pretty easy to understand.

I want to learn programming in ActionScript 3.0 so that I may be able to port my game in Flash. To be more specific, I want to know more about:

  • How is ActionScript different from Browser and Server-Side JavaScript, and basics.
  • OpenGL programming in ActionScript (including loading textures, shaders, etc).
  • How to create a HUD in Flash using a 2D HTML5 Canvas like API (in my game I have 2 canvases, one for the 3D game and another overlaying it for the heads-up display).
  • Support for vector and matrix calculations in ActionScript.
  • How to load assets like audio and sprites in Flash.

I would appreciate it if you would provide me a link to a page from where I can learn more about these topics. A more direct hands-on approach would be preferable.

It would be even more helpful if you would check my source code in JavaScript and suggest the best possible way for me to tackle this problem.

The code for the main game engine and the game itself may be found in my Github repository.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:32:10+00:00Added an answer on May 25, 2026 at 8:32 pm

    ActionScript and JavaScript are very similar at their core. In some ways you can think of ActionScript as more like a robust library layered on top of ECMAScript. There are a few differences (namely ActionScript likes to think of itself as a class-based oop, where as JavaScript is prototype-based), but if you are comfortable with one, then you should be pretty at ease with the other.

    ActionScript has a class based inheritance system and supports interfaces (but you can still do some prototypical magic if you want, but its not recommended). It also supports strongly-typed objects.

    var object:MovieClip = new MovieClip();
    

    This will strongly type the object variable as a instance of the MovieClip class.

    If your game is very 3D intensive, then you’ll want to look into the new Flash 11 Stage3D and Context3D classes. These expose a low level GPU accelerated API that before Flash 11 wasn’t possible. You can do interesting 3D stuff with Flash 10, but you are usually using drawTriangles(), which was not hardware accelerated. Flash 11 is currently in beta, but it should be out very soon. There are beta versions of the Flex SDK that should let you compile targeting the Flash 11 player.

    There are also quite a few 3D libraries that are built on-top of these low-level api. If you goggle around for them, they are easy to find. But I would recommend getting a solid understanding of how ActionScript works before diving into the 3D libraries.

    The HUD stuff in flash is simple whether you go with Flash 11 or Flash 10. For “classic” flash, you’ll want to get familiar with the display tree concept they use in flash. Just make sure the display order is correct, and your HUD DisplayObject will always be “on-top” of your rendering DisplayObject

    For Flash 11, StageVideo and Stage3D objects sit directly above the stage, but behind all normal flash DisplayObjects that are attached to the stage. So in that case, I would let the Stage3D api take care of all of your heavy rendering lifting, and use the traditional display stack for your HUD elements.

    You’ll probably also want to grab yourself Flash Builder over Flash CS5.5. If you are a programmer (which I am assuming you are since you are posting here), it wont make your eyes bleed trying to code. FB is based off eclipse, and its pretty decent but not perfect. But if you grab yourself the free Flex SDK, and don’t mind using the command line, you can get started compiling swfs pretty quick and cheap (aka free).

    Also, look into FlashDevelop. I haven’t used it in a while, since switching to FB for its built in profiler, but it might be of use to you.

    Importing images and audio is pretty straight-forward with the Flex SDK.

    [Embed(source="logo.gif")]
    public var LogoBitmapData:Class;
    

    and then later instantiate the class:

     var bitmapData:BitmapData = (new LogoBitmapData()) as BitmapData;
    

    And then use it where ever you want to.

    Just a note about the Flex. Flex is a set of UI libraries built on top of the normal Flash API, the Flex SDK includes the libraries and tools to compile MXML and ActionScript code files. So, despite it sounding like you should use the Flex SDK to compile Flex apps, you can use it to compile straight ActionScript code as well.

    There are built in classes for Vector3D and Matrix3D.

    As far as tutorials or references, I don’t have any to offer really. I’ve found that most of the information on the internet about ActionScript programming is pretty hit or miss (when you can find something thats not written by a graphic designer). I’d dig around in here and see if you can find anything that makes sense to you.

    There is obviously a lot more I could go into about this stuff, but hopefully this will give you a push in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to change the size of an HTML5 canvas element created by the
I'm working on a simple JavaScript game using HTML5 canvas. It's a very typical
I had created one HTML page for my experiance. In this i had use
I had created a zip file (together with directory) under Windows as follow (Code
Doug McCune had created something that was exactly what I needed ( http://dougmccune.com/blog/2007/05/10/analyze-your-actionscript-code-with-this-apollo-app/ )
I have a smallish utility library I made that I had created in TFS
If a set of controls on a WinForm have had DataBindings created and attached
In one of my builds for an iPhone app, I had inadvertently created a
I created a simple test page on my website www.xaisoft.com and it had no
Assuming you had some kind of factory-created resource that would still belong to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.