Hacker News new | ask | show | jobs
by a_a_r_o_n 5260 days ago
I have absolutely no idea how I would write Hello World in Flash. What compiler do I need. Do I need a compiler. Do I need to buy it? Is that all I need?

Compared to:

    $ vim helo.html
    <script>
    alert("hellooooo");
    </script>
And if you can't write that from scratch, ViewSource on most web pages will give you a good clue.

That looks like trump for mindshare, disputed performance questions aside.

3 comments

A couple of months ago I was looking at Flex. It's a complete nightmare to try and play around with. I downloaded the SDK and tried to make some kind of hello world thing but just trying to make a module with a single function and then call that function was not straightforward at all. I didn't even want a module but I have to have one. Fine. How do I make one? The docs don't even cover this sort of thing. There is basically no tutorial or documentation I could find that told me how to do this. I gave up.

Oh, and that was after I had to add manifest types everywhere like I was writing Java, without a free IDE to complete that junk for me. All the docs I found assumed you have the Flex IDE or Flash Builder whatever it is. Which costs over $500. Apparently it's still 1995 at Adobe Inc.

And people say Haskell is hard to use. I had no trouble getting started with Haskell. `ghci<return>` and away you go.

(I'd like to think that it wasn't my fault. Maybe I'm not as capable as I think I am, but I have written compilers and interpreters in C, Haskell, and Lisp. I have written an x86 assembler in Ruby that emits real x86 machine code as Mach-O binaries. I can write hello world in at least 10 languages. I feel like I have the capacity to understand this stuff. Hello world with an existing compiler should be a piece of cake, not an exercise in frustration.)

edit: Ok, I searched for "flex hello world" and did find something that looks like what I want. I deleted Flex and can't try to run it now though. Still don't like all the complexity but it does look like what I said I couldn't find: http://livedocs.adobe.com/flex/3/html/help.html?content=02_G...

With no Flash experience I had no trouble building a few Flex apps, and it was the same for a team member that quickly build a performant Flex app using their table widgets (which kills something like jQuery data tables plugin even on Chrome).

I did read O'Reilly's Flex book first though. I'm not sure people code Flex for fun, so good documentation costs money.

Was this your first time writing code for a GUI toolkit? Flex has an interesting model that merges XML definition of a UI with module-based code. I don't find it particular complex compared to say, writing an MFC application or C Win32 code to write a UI. I actually prefer it to the jungle of HTML, CSS, JS and dozens of JS libraries which aren't really geared for a professional type UI and fall down when you want to display 10,000 items in your table.

Not my first GUI code. I've done lots of web development in the past 15 years. Front and back. I've written an OS X app, several iOS apps including some universal ones, a few Android apps, a few webOS apps, and one Windows Phone 7 app. In a previous life I made games and utilities with Visual Basic and played around with Gtk+ in C (but quickly ran away).
I've never used Flex in my Flash projects, I just use straight AS3 with FlashDevelop. Requires the Flex SDK to compile but none of the code.

You do not need to purchase anything from Adobe to compile a AS3 project.

edit: I don't mean for this post to be as negative sounding as it may appear, it's not a comment on your abilities.

You don't need to buy anything. Here is an excellent free open source AS3 (and other languages) editor/debugger (for Windows):

http://www.flashdevelop.org/

Download that and the free Flex SDK from Adobe, create a new Flex 4 project and stick this in the Application tag in the generated Main.mxml file and you are done:

    <s:Label text="Hello, world!" />
Use an AIR Flex 4 project instead with the same label control and now your app runs on both Macs and PCs (and Linux but not as cleanly) in its own native window with full access to the native file system and the Internet without any AJAX proxy issues.

I admit its not as nice as instant browser compilation but for some class of applications Flash/Flex is very nice.

File -> New
Costs about $700 for that privilege.