Using ActionScript without MXML in FlashDevelop

Most people using ActionScript 3 uses MXML. I don’t like that very much, as Flex is a strange proprietary language, and ActionScript 3 is a regular, Java-like programming language. MXML is fast for setting up a GUI using standard components in a RIA and the like, but most of my projects will not use standard components, but will be simple scripting experiments or customly designed games and apps.

Thus I’ve tried setting up an environment in which I will use ActionScript 3 only and not use any MXML if possible.

  1. Firstly, I downloaded and installed FlashDevelop.
  2. Then I found Keith Peters’ guides to enabling AS3-support in FlashDevelop at his blog.
  3. Then I downloaded some of the standard libraries for ActionScript 3 (including a unit testing framework) from Adobe Labs.
  4. Last order of business is to create a way to initiate GUI in FlexUnit without using MXML. Still working on that part. I will upload experiments and soon as possible.

My first project will be a simple Tetris game (as I’ve promised to build one for my girlfriend for some time). It is a simple game with well-known rules and complexity, but should give enough challenge to make a decent project. It will of course be available here once finished.

3 Comments so far »

  1. Robert said

    at April 5 2007 @ 14:20

    Morten,

    Have you gotten FlexUnit to work with FlashDevelop at all? I am using an Ant build script to try to build the FlexUnit demo on Darron Schall’s blog, but have been unsuccessful at doing so. When I run the Ant build script I got from Keith Peter’s blog, it looks like it is compiling successfully, but the swf is not generated. So instead I ran the compiler from the command line using:

    C:\Documents and Settings\Me>mxmlc -sp=”C:/Flex2/flex_2_sdk/frameworks/source/mx
    /core” -library-path=”C:/Flex2/flexunit/bin/flexunit.swc” -default-frame-rate=24
    -default-background-color=0xFFFFFF -default-size 550 400 -o=”C:/SVN/AgCg/Action
    Script3/Projects/FlexUnitDemo/deploy/ExampleTestRunner.swf” — “C:/SVN/AgCg/ActionScript3/Projects/FlexUnitDemo/src/ExampleTestRunner.mxml”

    and got this:

    Error: Can not resolve a multiname reference unambiguously. mx_internal (from C:\Flex2\flex_2_sdk\frameworks\source\mx\core\mx_internal.as) and mx.core:mx_internal
    (from C:\Flex2\flexunit\bin\flexunit.swc(mx/core/mx_internal)) are available.

    Just wondering if you’d had the same problem.

    Alternatively, have you tried using ASUnit? If you can get that to run, then you wouldn’t have to use mxml at all.

  2. Robert said

    at April 6 2007 @ 02:49

    A friend helped me out. I should have been using -include-libraries to reference the swc file instead of using -library-path like the documentation, http://livedocs.adobe.com/flex/201/html/compilers_123_29.html, says to do.

  3. Barklund said

    at April 10 2007 @ 18:30

    Well, I did not look further at FlexUnit, but will probably have a look again given your above hints. Thanks :)

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: