An update on Livecoding in ActionScript

Once upon a time, that famous Bret Victor talk hit the twitter and everyone went crazy about the idea for a week. Then everyone moved on, except few people around the world who set to create tools like that for web developers. Over the time, quite a few livecoding tools popped up, from LiveReload to recently Loom engine, but none for ActionScript. If you’re ActionScript developer, you should see why this kind of technology could not be developed overnight. AS3 VM is not really livecoding friendly, already loaded classes have priority over new stuff you load in. But, with enough efforts nothing is impossible, and last year Eugene Potapenko demonstrated it on ITSea event. This is an old story, however, so why this post? Well, because we have some news for you.

iOS support

Even though Adobe doesn’t think it’s important, there is increasing shift among AS3 developers to mobile, and Adobe’s AIR provides easiest way to do so. For months we were struggling to provide livecoding for iOS AIR apps, but there was always something in the way. This week, with great help of Nimisha Shukla, we’ve finally got it working there for the first time. Just check it out:

What I have here is simple painting app running on iPad with iOS v6. On the right, I edit its code in our CodeOrchestra IDE, and my changes get loaded into running app on the fly. Even better, my app does not get reloaded at all, and maintains its state! This is unlike anything you guys have experienced so far :)

“I’m sold, where’s the download link ?”

Well, it goes like this: CodeOrchestra IDE is not only about livecoding. It is big monster with a lot of tools, like AS3 to JS convertor for web and recently Node.JS, or domain specific language support allowing you to extend AS3 language itself. As such, there is a lot of stuff to test and a lot of bugs to fix, before it ships. So, to share this AS3 livecoding technology with you as soon as possible, it will be released in about a month as a separate product, that will work with whatever IDE you’re using right now. Please sit tight, we’re about to change the way you code forever :)

The scoop

Once you know how does the magic work, it is no longer magical. What happens here is every time you write new code, it gets compiled to small SWF file that then is loaded into main app’s ApplicationDomain. You can interact with new code naturally using your app logic, or you can subscribe to live updates event and do something special. There is no problem with this on the desktop, but iOS was the pain you know where. Because Apple is so paranoid about loading external code, Adobe had to simply turn this feature off in AIR, and there was nothing we could do about it, until AIR 3.5 beta came out with their “multiple SWFs” feature – suddenly it was possible to load SWFs on iOS. We were very excited about that, and were just about to release iOS livecoding demo, when Apple shot us down with their iOS v6 release, which made it impossible for us to drop new SWF files into running app folder. Since then we were contacting various people at Adobe and begging for workaround, but it was Nimisha who listened to us and, in the end, helped us to solve the issue. Were we more lucky, you’d see this post half of year ago. Any way, I’m happy we’re past this, finally.

18 Responses to “An update on Livecoding in ActionScript”

  1. 1 Jackson Dunstan April 6, 2013 at 00:01

    This looks really cool! I remember watching that video and naturally thinking of how it’d apply to Flash and AS3. Can’t wait for that working download link ;-)

  2. 2 Nick Collins April 6, 2013 at 02:54

    What will the migration path be for those of us who purchased Realaxy and never saw the roadmap for 1.x fully materialize?

    • 3 makc3d April 6, 2013 at 11:11

      If I were in charge, I would give you guys free updates for life. But I’m not, so please contact Eugene with this question. Update: Eugene says existing RASE customers will get free update to CodeOrchestra v2.

  3. 4 elliotgeno April 6, 2013 at 03:23

    Sweet dude! Can’t wait!

  4. 5 Jason April 6, 2013 at 04:40

    “Even though Adobe doesn’t think it’s important, there is increasing shift among AS3 developers to mobile, and Adobe’s AIR provides easiest way to do so.”

    Are you kidding me with this sentence? “Adobe doesn’t think AS3 is important so I’m gonna use this easy method provided by Adobe to do it.” This article would have a lot more credibility with less whining.

  5. 7 Jason Langdon April 6, 2013 at 05:15

    Am I correct in saying that this will only work for IPA’s created using interpreter mode? If this is the case, the live coding won’t work for Stage3D apps as they need to be compiled using ad-hoc mode.

    • 8 makc3d April 6, 2013 at 11:05

      I have tried starling-based platformer and noticed no problems in interpreter mode. Any way, you are supposed to use this only during development, so your final build will not be interpreted.

      • 9 Jason Langdon April 7, 2013 at 00:30

        In my experience with Starling, using interpreter mode gets me about 10-15fps whereas ad-hoc will get the full 60fps.

        • 10 makc3d April 7, 2013 at 11:37

          Sure, that’s what it says in FlashBuilder’s packaging method dialog: “application runs significantly slower than a release build”. I don’t see where that implies that “live coding won’t work for Stage3D apps”, however. You could say, “live coding won’t work for performance tuning”, and that’s true. But there are many other things you could tweak in no time with this, and it’s great.

  6. 11 Jason Langdon April 7, 2013 at 23:55

    Sorry, let me clarify – it’s not that it won’t work, it’s just that you won’t want to test like that is all. If you’ve ever tried to get any sense of how your app is performing when using Starling exported in interpreter mode you’ll know what I mean ;-)

  7. 12 James April 25, 2013 at 02:13

    Nice. :)

    So it works on the desktop’s flash plugin as well right ?Just to make sure :)

    Also will it be a free or paid app ? And will it run on Windows as well or just Mac ?


  8. 14 James April 25, 2013 at 16:17

    Thanxalot. I’ll definitely give it a try then.

    I’ll make sure to be watching this blog since I don’t know the “official” address :)

  9. 15 Semiramis April 27, 2013 at 17:19

    Hi, that’s pretty interesting !

    So you are compiling small SWFs on the fly.

    Will you allow custom compile commands ? I would like to use Haxe compiler.

    • 16 makc3d April 27, 2013 at 17:30

      Sorry, compiling these small SWFs requires the code to be transformed beforehand, and this transformation logic is currently tied to asc compiler :( so no haxe.

  10. 17 Semiramis May 4, 2013 at 14:50

    And I suppose it is not open source so I won’t be able to make it support Haxe myself.

    Okay too bad then, but still kudos for that tool ! Pretty cool initiative.

    If you want help to make it support Haxe, just tell me here :)

  11. 18 Monster Blade hack download June 25, 2014 at 04:41

    It’s a shame you don’t have a donate button! I’d most certainly donate to this excellent blog!
    I guess for now i’ll settle for bookmarking and adding
    your RSS feed to my Google account. I look forward to brand new updates and will talk about
    this blog with my Facebook group. Talk soon!

Leave a Reply to Jason Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Old stuff

April 2013
« Mar   May »

Oh, btw…

%d bloggers like this: