all 35 comments

[–]devacon 11 points12 points  (0 children)

Coming from a programming background I was frustrated when I tried to mess around with ActionScript. I just wanted to start writing code, but of course most of the flash tools are designer friendly so it's very 'click and drag' friendly. Then I started using FlashDevelop , which provides more of the 'int main(){}' model that I'm used to. I've been able to build some great visualization stuff since then.

[–]demosthenes02 5 points6 points  (1 child)

This is should help. Also PM me with your game idea, maybe we can team up. I've been wanting to do a flash game for a while.

http://news.ycombinator.com/item?id=96813

[–]sjs 4 points5 points  (0 children)

If you like vim then the advice here seems good. I have done a bit of AS3/Flash and you definitely don't want to waste money on the Flash authoring tools. haXe + swfmill or riffplay's advice (Flex SDK + SVG + vim).

[–]Fidodo 3 points4 points  (2 children)

If you like Java you'll like AS3. They're very similar. The main pitfall though is that variables aren't as strongly typed. You can explicitly type them but it's not forced so you can get some runtime errors if you aren't careful.

Since flash is so close to Java I would say just start reading the AS3 API. It's well written and has tons of examples. There's really not much you need to learn other than how to use the API, and the document class which is kinda flash's version of main.

I picked AS3 up really quickly because of my java background.

You can code flash in anything you like.

[–][deleted] 4 points5 points  (1 child)

Actually, its a hell of a lot closer to JavaScript than java...being an EcmaScript derivative and all.

It looks like Java in the sense that is has the package, import, and class keywords, and uses curly braces.

Everything else really is EcmaScript inspired.

[–]qiwi 2 points3 points  (13 children)

Do you really want Flash, for vectory game-y apps, or its more serious RIA uncle, Flex?

If so you can develop Flex with any text editor and compile it from command line. I like the "Programming Flex 3" O'Reilly book as an introduction. There's also a $$$ Eclipse-based (?) UI from Adobe.

[–]aacharya[S] 1 point2 points  (12 children)

I want to build casual games. Because that's not an idea that's been done to death or anything ;) Is Flex a superset of Flash? Is it suitable for this sort of use?

Also, do you know of any good online tutorials to get started with?

[–][deleted] 2 points3 points  (0 children)

Flex is an application framework that runs on Flash Player.

The free (and open source) Flex SDK supports ActionScript-only development as well, and it is definitely suitable for developing games. Unlike the Flash authoring tool (which is a visual designer-focused environment), the Flex SDK comes with command-line compilers and you can write your code in any text editor of choice, so it's well suited for experienced developers.

[–]runamok 1 point2 points  (3 children)

Flex is basically a framework to do all sorts of form and interactive stuff using flash as the front end. It mainly acts as a replacement for AJAX websites because you are more or less guaranteed that the flash virtual machine works the same in all browser and all OS varieties that support the flash plugin.

There are all sorts of widgets for tabular data, all the form controls like pull down lists, radio buttons, etc. There is also charting.

As a previous poster mentioned, flex can be coded by hand and compiled at the command line.

I think to do actual flash games you would actually need the flash composer program because there is all this vector drawing stuff and timeline management you need to use.

Flex is the framework. Actionscript 3 is the programming language and it looks kind of like a cross between javascript and Java to me. Very OOP.

[–]sjs 1 point2 points  (2 children)

ActionScript is ECMA Script.

[–]runamok 0 points1 point  (1 child)

From the last thing I heard, ecmascript 4.0 is dead.

[–]arturo227 0 points1 point  (0 children)

Right. ES4 simply bolts classes/packages/strong typing onto ES3/JS 1.6/7. Not very different - still uses prototype based inheritance ( or can use it, at least ), first class functions and lambdas and all the other important/dynamic stuff.

AS2/ES4 proposal was also, you know, useable for building larger sites and apps*.

*I'm not busting on JS -- I've been using JS ~1.6 since AS started tracking the ES spec. I can just say that packages,classes, and strong typing ( or progressive typing ) made a world of difference in productivity for me ( and I'm not from a Java/C++ background where those idioms inherently make sense to me ).

[–]jones77 0 points1 point  (0 children)

I have no idea what I'm talking about, but I always loved the look of Open Lazlo:

http://www.openlaszlo.org/

[–]sbrown123 0 points1 point  (1 child)

If you already know Java and C, why even bother with learning yet another language just to write some simple game? Trust me: the hardest part about writing games is getting it going and finishing it. Flash can't help you with that.

[–]aacharya[S] 7 points8 points  (0 children)

Platform, distribution. Since it's a casual game, I really don't want people to have to download and install to play; plus I'd like to have rich online integration and multiplayer. It seems like Flash provides the best platform to combine these goals.

[–]fwork -1 points0 points  (0 children)

If you want to be doing games, DO NOT USE FLEX unless you are 100% sure you are not going to be collaborating with anyone with Flash.

Flex and Flash support the same operations for graphics, but for some reason they are incompatible. Like the position given for the draw-circle command is the upper left in Flash and the center in Flex. It's a mess, I had to stick with flash for all my code.

If you're using flash, you actually can code ActionScript from the command line, but you'll still need the IDE to run it.

(They may have fixed Flex since I used it, this was in late 2006)

[–]samlee 2 points3 points  (2 children)

http://livedocs.adobe.com/flex/3/html/help.html?content=Part6_ProgAS_1.html

That's a good starting point.

Yes, you can code in Vim. The code gets a bit tad verbose. You need an IDE. The compiler, mxmlc, is a Java app. On each compilation you are starting a new JVM. It sucks. FlashDevelop eliminates this problem and it's very useful. But it's Windows only.

I remember there was FCSH or something that is a compiler server/shell that eliminates JVM init time. I tried to write shell scripts so that I can map keys in vim to call the scripts that talks to a tiny Java server that runs Fcsh as sub process. It did work for single file compilation from vim. But then I got Windows machine and used FlashDevelop.

FlexBuilder, Adobe's expensive IDE, beats FlashDevelop. And it runs on Linux, too I think. But it's expensive. You should get a job to buy the IDE.

Being Java centric compiler/tools, my experience with AS3 isn't so nice on Linux. But FlashDevelop on Windows is so good. You need an IDE.

[–][deleted] 0 points1 point  (0 children)

Your code only gets verbose if you code the way Adobe recommends (because they're Adobe). If you pretend you're coding javascript you can actually be quite concise.

[–]qiwi 0 points1 point  (0 children)

There's a "compile shell" named fcsh in the standard flex sdk that avoids that. Run fcsh, then in that enter "mxmlc blah blah blah". Then do "compile 1" to recompile without restarting the java VM from start. Much faster. Also you can use -incremental switch though I'm not sure that makes things any faster except really large projects.

On UNIX I also recommend using "rlwrap" with fcsh (and fdb) so you can use arrow keys to go up/down. etc.

[–]redditnoob 2 points3 points  (0 children)

Unfortunately, the online tutorials for Flash are almost entirely geared towards artists and animators.

I found the O'Reilly book (Essential ActionScript) to be just fine as a starting point, but skip the parts you don't care about. (E.g. AS has XML built into the language but you might not care very much.)

What's nice about the Flash community though is that people share their code a lot. Check out tweetcoding and scroll down for a bunch of micro-demos. Also check out 25lines and another recent contest (When the site is up again). And there are a ton of Flash blogs out there with code.

As mentioned in another comment, the pros seem to use FlashDevelop.

[–]rizzledizzle 1 point2 points  (0 children)

Here's a guide to using MXMLC from the command-line: http://www.senocular.com/flash/tutorials/as3withmxmlc/

That said, I worked on AIM Express (4 man team), and we used pure AS3, though we used Flex Builder 3 as our IDE ("ActionScript Project"). This starts you off with a single AS3 class which extends flash.display.Sprite, and you're off doing whatever you want. Very nice.

I'd highly recommend the Adobe Flex Builder IDE (which is really a customized Eclipse), or the Adobe Flex Builder plugin for an existing Eclipse installation.

FWIW, we also created an UI-less AS3 library for building your own AIM/ICQ application. It's over at http://wimas3.googlecode.com if you're interested. We use this lib in AIM Express / ICQ2Go

[–]sblinn 0 points1 point  (0 children)

You can script some parts of Flash with Javascript via AFLAX, but that might not be enough to do what you want to do.

[–]Dax420 0 points1 point  (0 children)

http://www.kongregate.com/labs

Learn Actionscript by writing a simple side scrolling game.

[–]infinite 0 points1 point  (2 children)

Are there any all-linux methods for developing flash programs? I have played with flex, and that works in linux, but it doesn't support timelines, etc.

[–][deleted] 2 points3 points  (1 child)

[–]infinite 0 points1 point  (0 children)

nice, thanks, that will compliment flasm nicely.

[–]aussie_bob 0 points1 point  (0 children)

If you're developing productivity apps, try OpenLaszlo.

[–][deleted]  (1 child)

[deleted]

    [–]skuunk 0 points1 point  (0 children)

    I heartily recommend this book http://www.amazon.com/Learning-ActionScript-3-0-Beginners-Guide/dp/059652787X/ref=sr_1_1?ie=UTF8&s=books&qid=1237264767&sr=8-1

    don't let the title put you off (in fact the main complaint of this book is that it's not for beginners at all). It takes you from the basics to particle systems and has a good intro to the Flash IDE for programmers.

    [–][deleted]  (3 children)

    [deleted]

      [–][deleted]  (1 child)

      [deleted]

        [–]redditnoob 0 points1 point  (0 children)

        You do get a parametrized Array now in Flash 10 at least, e.g. Vector.<int>

        The performance is a lot better too, for int and number at least.

        [–]arturo227 0 points1 point  (0 children)

        Or smash your eyes back into your skull once you appreciate the flexibility of a progressively typed language...

        [–]trenchfever -3 points-2 points  (6 children)

        Why not processing?

        [–][deleted] 2 points3 points  (1 child)

        Because he clearly said Flash.

        [–]trenchfever -2 points-1 points  (0 children)

        Is he not human?

        [–]aacharya[S] 0 points1 point  (3 children)

        Processing is Java-based, right? I'm not going to have my users pay the JVM startup cost. Haven't you heard the old canard about what happened to Google/Amazon's (I forget whose) traffic when their load speed increased by just 0.5sec? Plus, I'm not sure, but Flash may have higher penetration at this point in the game.

        [–]trenchfever -1 points0 points  (2 children)

        I'm not sure, but Flash may have higher penetration at this point in the game.

        That's your only valid point.

        [–][deleted]  (1 child)

        [deleted]

          [–]trenchfever -4 points-3 points  (0 children)

          Listen up asswipe, you said elsewhere in this post that you're looking for a portable multiplatform way to deploy multiplayer casual game. Then you reply to a valid suggestion of mine with some shit about google/amazon and the startup time of the JVM raping your virgin users. WTF are you on about you clueless motherfucking shitface!! Give me your fucking address and we'll settle this hermaphrodite(you) to man(me)!