Alchemy installation problems under OSX

I’m writing this little issue I discovered today in the alchemy installation under OSX, in case someone else is having the same problem…

In fact, today I decided to makes a little swc library for an actionscript project using alchemy ( because of the lacks of union in flash ), so I downloaded the alchemy toolkit for OSX.


I spent a couple of hours trying to make it working on my Snow Leopard and because I’m not a shell and perl expert I finally moved to the linux toolkit under ubuntu ( even if on linux the Flex builder is really far to be usable!)
Anyway, this evening I decided to spend some more time trying to understand why when I was trying to execute the alchemy “gcc” script ( the ones inside the achacks folder, which is a perl script) nothing happened.
After long time with old style “print” debugging strategy, at the end I discovered an error in the “config” script in the main alchemy installation folder.
At this line (line 33):
if echo $MACHTYPE | grep darwin &> /dev/null; then
I had to modify it into:
if echo $MACHTYPE | grep -i darwin &> /dev/null; then
because the command “echo $MACHTYPE” outputs “x86_64-Apple-Darwin“, with the uppercase “D”.
In fact, after that modification everything finally worked!

Flash Player 10.1 and global error handling

Well, it seems that the upcoming flashplayer 10.1 (first half of 2010?) has been completely designed to fill the gap that the current flashplayer has with the smartphones world (multitouch, accelerometer, screen orientation, sleep mode, out-of-memory management, etc..).

There will be a lot of new useful features, if you look at the release note pdf: http://labs.adobe.com/technologies/flashplayer10/releasenotes.pdf
But the most important feature, for me (as I asked a little time ago), is indeed the global error handling!
Unfortunately the global error handling feature hasn’t been already implemented in the current prerelease public version. I hope they will enable this feature soon, I really miss this option!


Thoughts about flash on the iPhone

I didn’t have the chance yet to try out Flash CS5, but I’m still a bit concerned about the new feature that makes users able to compile their own application into valid iPhone apps.

Things look really good if you look at the examples and if you talk with the people that already had the chance to try this feature out. But I must remember that usually the excitement for a new – and let’s say outstanding – feature usually cannot guarantee the final result to be acceptable. I fear that this feature might evolve the same – bad – way as Alchemy did: they started with a promising project that then felt down to a side project because many users shown that it was possible to achieve the same or better results by just using plain AS.

A few weeks ago I started spending my free time on experimenting with generating a valid iPhone app from a SWF file. I didn’t know anything about the fact that the Adobe would have put the same feature in Flash CS5.
My approach wasn’t too sophisticated: basically, as long as I didn’t have so much time to spend on writing a full binary converter, I was parsing the SWF and then generating static Objective-C/C++ (well mostly C++ and I’ve used Objective-C as glue where strictly required) code that then was compiled by Xcode to a working iPhone application.

I stopped once I figured out that Adobe was going to promote a similar thing (even if their approach is better and probably more powerful), but I had time to figure out a few issues that they may encounter (or maybe they already encountered):

  • Generated applications are really big in size, mostly because there is a lot of glue code generated and because you need to replicate the FPL API in C++ to be able to easilly convert the SWF into an iPhone app;
  • ActionScript is a dynamic language, and this dynamicity must be taken into account when generating binary code (or source code in my situation). Even if using LLVM probably helped with this, you will always need to generate additional dynamic checks that slow down a lot the execution;
  • The FPL doesn’t support (yet) threading API, nor the AIR version does. So, if they want to preserve the portability of a flash game so it can be run with AIR or on the iPhone without any change, they are limiting the developers on building just quite simple games;
  • The same can be said for all the other native APIs. AIR for instance has multitouch API, which are however at a lower level then the ones provided by the iPhone;
  • The other big issue is rendering performance. When I was working on my project, I’ve tried many different approaches to figure out which one was the best to render decent vector graphics with a good framerate on the iPhone. Core Graphics is not an option, as long as it is as slow as hell. Using OpenGL to render the graphics increases a lot the performances, but adds a few limits to the rendering quality. The best approach I found was to mix caching and OpenGL rendering together, but that was not working fine with rapidly changing graphics. But I must say I didn’t have the same knowledge as the FPL developers on this topic and I didn’t have months to work on that too …
  • iPhone developers must take special care for memory and resource management; probably having a huge bootstrapping code and transition structures won’t help.

What I fear most actually is that they’ll be able sooner or later to solve all the issues and create a good product, but probably that product won’t be suitable for complex applications, that will be always developed directly using XCode.

That said, I think that probably a better approach would have been to figure out a way for Adobe to include the Flash Player on the iPhone. It’s already ready and I really can’t understand why they don’t release it (it must be Apple, and probably because having a Virtual Machine on the system will break the basis the App Store has been built over).
Having the FPL on the iPhone will still limit us, but it will open up a brighter future for AS developers who want to release apps that runs on the iPhone too (Did you ever heard about compile once, run everywhere?).

So let’s wait and see what happens. What I’ve seen so far on the app store are really simple games that don’t use so much resources, so I can’t really say yet if they did a great job or not …

Flash for iPhone!

Well, it’s not true at all, but it’s something like that ( they enabled this by using the Low Level Virtual Machine (LLVM) compiler infrastructure).

With the upcoming Flash CS5 we will able to create iPhone applications using Actionscript 3 and the Flash IDE (Flash CS5)!
It also seems that in the future it will be possible to compile iPhone apps using the free flash compiler.
We won’t have flash iphone apps, but native iphone applications:


iPhone applications built with Flash Platform tools are compiled into standard, native iPhone executable packages and there is no runtime interpreter that could be used to run Flash byte-code within the application.

Most of the Flash Player 10 and AIR 2.0 APIs will be available, so for instance: pixel Bender filters and also dynamically loading SWFs that contain ActionScript (but the Actionscript will be ignored since there’s no flash VM in the iphone).


The Cons.

We won’t be able to test our apps using the Mac iPhone simulator.  And we cannot use the iPhone controls with actionscript.

Read original entry here:
Read the developers’ FAQ:

Add system excepthook in actionscript!

Imagine you’ve made a very huge flash application and many users will play with it every day.

Imagine they don’t have the flashplayer debug installed and at certain points they fall into undiscovered application bugs ( it’s impossible to have a real bug free application, we know this ).
Then, what happens? With the flashplayer debug installed you can see the traceback and you can also continue or dismiss the code execution. But without the debug player? The code will try to continue but probably at that point your application is broken and users will feel it more and more uncomfortable with it.
What I would like to have in flash, and probably you too, is a global system exception handling for those unhandled exception.
In this way you can both present the problem to your users and then also create a report system which will help you to improve and fix your own application!
Something like I did with SEPY years ago using the sys.excepthook of python:
When an exception is raised and uncaught, the interpreter calls sys.excepthook with three arguments, the exception class, exception instance, and a traceback object. In an interactive session this happens just before control is returned to the prompt; in a Python program this happens just before the program exits. The handling of such top-level exceptions can be customized by assigning another three-argument function to sys.excepthook.

Flash camp on the beach (Rimini)

The new Flash camp will be in Italy, Rimini, and will take place on 5th of September. Participation is free!

Order your ticket via eventbrite.
The meeting will take place at Hotel Sporting Viale Vespucci, 20 47900 Rimini (Italy).
Speakers
As a camp everybody can join us as a speaker, today we have a great group of speakers already confirmed:
  • Jaco Pixeldump (www.pixeldump.org)
  • John Lindquist (http://pv3d.org, http://flex4.org)
  • Joost Nuijten
  • Eros Marcon (actionscript.it)
  • Simon Slooten (www.simonslooten.com)
  • Matteo Lanzi (aka Gallo_Teo flex-developers.org)
  • Adam Flater
  • Michael Labriola (http://blogs.digitalprimates.net/codeSlinger/)
  • Rich Tretola (http://blog.everythingflex.com)
  • Gabriele Farina (www.sephiroth.it)
  • Alessandro Crugnola (www.sephiroth.it)
  • Michael Plank (www.powerflasher.de)
  • Rich Tretola
  • Matt Chotin
  • Giorgio Natili (flex-developers.org)
Agenda
What’s New in Flex 4 (Matt Chotin) 9:00 – 9:45
Most of us have heard that the Flash Platform tools are getting a major upgrade with Flex 4.  We’ll give a high-level overview of what’s coming in the three major components: Flash Catalyst, Flash Builder, and the Flex Framework.
Concepting Rich Internet Applications (Joost Nuijten) 9:50 – 10:35
The pitfall of Flex applications is to thrown in a bunch of buttons of fields, the Flex skin looks nice, and the say: “There we have another Rich Internet Application”. To my opinion it is much more than that. It’s about creating the ultimate user experience by mixing interaction design, emotion and common sense.
“One key element of a good ergonomic web application, or at least a sign that it works ergonomically, is that you want to stay there — like a big old comfortable chair that wraps you up and you just don’t want to leave it, ever… (well, at least, maybe, for a little while more…)”
(SyMetric Sciences, Inc., 1999)
Flex 4 in 3D: The UI of the Future is Now! (John Lindquist) 10:40 – 11:25
Ok, the title might be a bit over-the-top, but the new 3D features of Flash Player 10 do allow us to pull off some pretty cool tricks. This session will cover step-by-step how to take advantage of the the 3D api. We’ll start by creating our own custom and reusable 3D layouts and work our way to creating 3D components. Once we’ve brought everything together into a full 3D application, we’ll end with a  discussion of the advantages and disadvantages of using 3D in user interfaces.
TESTING WITH FLEX AND FLASH BUILDER (Michael Labriola) 11:30 – 12:15
Unit testing in Flex is taking a giant leap forward. First learn about the latest technologies, their integration into the Flex developers workflow and the promises offered by these advancements. Then learn how to write tests using these new methods, how those tests can be used effectively and the theory behind their use. Finally, learn about the extension points and how numerous testing projects can now converge to offer solutions now and into the future of Flex.
FDT – Pure Coding Comfort (Michael Plank) 12:20 – 13:00
You want to improve your ActionScript/Flex development workflow and boost your programming
efficiency? Michael demonstrates how the coding flow completely changes with FDT by using
features like Quick Fixes and Auto Completion. FDT is an Eclipse based IDE for ActionScript
and MXML development that provides pure coding comfort.
Not only professionals prefer working with FDT, the tool is also appropriate for beginners
because of supporting features like e. g. live error highlighting. A short speed coding example
on stage illustrates how fast the coding workflow can be with FDT.
Mate – The beauty of a simple framework (Simon Slooten) 13:30 – 14:15
Mate is a Flex framework that is simple, elegant, scalable and simply beautiful. In this session you will get an introduction to Mate, as well as look at a Flex Application that uses Mate
ByteArray:  extend your swf apps with extra features (Marco Fusetti aka Jaco) 14:20 – 15:05
ByteArray is a great flash player feature that let you load/treat/save binary data.
Let’s look into some techniques and examples on adding features such swf black box, sound data, external swf inspection and more.
Using Merapi (Adam Flater) 15:10 – 15:55
An introduction to native hardware and software integration in Flash
Flex sdk (Matteo Lanzi aka Gallo Teo) 16:00 – 16:45
How to patch it to solve common architectural problems and improve performance
Flash Catalyst/Flash Builder 4 ˆ Designer/developer Workflow (Eros Marcon) 16:50 – 17:35
How to design and optimize an artwork for FC, importing design in FC, adding interaction, working with states and transitions, wiring FC interactive UI with real data in Flash Builder 4
Extending flash applications (Alessandro Crugnola aka Septhiroth and Gabriele Farina) 17:40 – 18:25
A quick walkthrough from static plugins to dynamic scripting
Java, Flex and Model View Presenter (Giorgio Natili) 18:30 – 19:05
Flex loves Java applications that expose API deployed under Blaze DS, follow us in a complete tour that shows the process to define good API for a Flex / Air application that follow Model View Presenter design pattern and get the key points of GUI Architectures for responsive applications.
Flex image uploading and manipulation via Pixel Bender (Rich Tretola) 19:10 – 19:40
Flash Player 10 introduced some new features including the ability to write a file to the users file system as well as the usage of Pixel Bender filters. In this session you will see how to upload an image within a Flex application,  filter the image with a Pixel Bender filter, and then use the JPEGEncoder class to encode the filter image to a ByteArray.