Adobe AIR on Android devices
At last, a good news and a good response to the commercial strategy of Apple! Lets show to Steve what Flash exactly is
http://gotoandlearn.com/play.php?id=123
http://gotoandlearn.com/play.php?id=124
At last, a good news and a good response to the commercial strategy of Apple! Lets show to Steve what Flash exactly is
http://gotoandlearn.com/play.php?id=123
http://gotoandlearn.com/play.php?id=124
This little post to tell how I’m bored too find good tools but not really well coded or not well structured.
A good example is the AS3 TouchLib library to build multi-touch applications with TUIO :
This library is a very good idea to translate TCP data from the TUIO server (through FLOSC) to Flash… and it works well.
But when you look to the sources, you can immediately understand the bad MVC knowledge of the developers of that project.
The main controller (TUIO.as) and core classes are inside the flash events package (flash.events)… strange usage, no?
It should be good to organize a cleaner package, something like this :
com.nuigroup.touchlib.controllers.TUIO
com.nuigroup.touchlib.events.TouchEvent
com.nuigroup.touchlib.controls.TUIOCursor
com.nuigroup.touchlib.controls.TUIOObject
com.nuigroup.touchlib.controls.TUIOSimulator
The TouchLib library is not the only case.
A lot of developers release stuff and make them public too quickly.
The time spent to organize your project in a good MVC/OOP way will help others to understand it easier and will help you to maintain it correctly.
A framework is not required to do that. You just need to keep a good and coherent structure of your classes.
For my part, I always begin a project by creating empty packages :
com.myproject.models
com.myproject.views
com.myproject.controllers
com.myproject.controls
com.myproject.utils
During the development, I will create the classes I need to the corresponding package. In that way, I’m sure to keep and good and understandable code for everybody.
Last point : Why AS3 frameworks?
I know I will get some enemies but I need to explain why I don’t like PureMVC, Cairngorm and others:
There is a good idea of “re-usability” or “maintainability” behind these frameworks but if your project is just well “MVC-minded” they become useless…especially if the main goal of them is to use tools that are already in the Flash or Flex core.
I’m finally thinking that these frameworks are made for(and by) people who ignore how to give a professional structure to their project.
I’m often surprised by the inability or fadeless of some people to simply and correctly use the native AS3 library. And, in many cases, that’s why they use a framework. Sometimes they don’t know how to manage their events properly with native EventDispatcher. Sometimes they forget other native stuff like Event.ADDED_TO_STAGE and Event.REMOVE_FROM_STAGE events to manage things to be killed and cleared from memory. Sometimes they just don’t realize it’s much more quick and simple to create your own controller and its events, a model and the views without a framework layer behind that. Sometimes…
Sometimes I’m so disappointed by the bullshit coming from the mouth of pseudo Certified Flex Developers. They are crazy about frameworks.
One day, a colleague in consultancy to a big client told me : “He came to me to discuss 3hours about the name of a method. ‘GetProductByIdWhenReceivedFromForm1′ or ‘GetProductByIdForm1′. Finally, he chose the second one and he had to refactor lots of classes and re-organize his project.”
First thing, we forced to admit this guy was unable to take a decision, and his faculty to choose a method name is grammatically really bad and counterproductive. Secondly, wow… 3hours to find a way to recode 40% of your project because your framework madness is killing you from inside…
Hopefully, some of you, pure actionscript programmers, are not like that
If you do Flex applications, don’t forget Flex is already a framework.
If you do Flash applications, don’t use a framework, just think MVC.
This is a really nice ribbon effect made by a friend (Christophe Deaconescu).
He translated the Processing code from James Alliban you can find here.
The result is pretty smooth…even with a little glow filter.
Move your mouse over the black area below:
Here are the sources, ribbons.zip
For some weeks ago, I’m using MovieClips in Flash like I use ViewStack in Flex.
I made this tool because I was bored to work on FLA files with huge timeline animations where it’s almost impossible to find directly what you are looking for, especially when you work on a team and when it’s not your own source code.
In fact, I like the way to open a FLA file and see immediately all the states of an application.
The ViewStack Class and the ViewStackPanel Class manage your different states (frames of a MovieClip) using Event.ADDED_TO_STAGE and Event.REMOVED_FROM_STAGE events.
It becomes really easy to handle you IN and OUT transitions between states and kill all the listeners in a custom view linked to a Class.
In the following example, you’ll see a 2 states (2 frames) ViewStack.
On each frame, there is another MovieClip, linked to a Class that extends ViewStackPanel (here: ContactPanel and InfoPanel).
ContactPanel and InfoPanel inherits of the init(), kill() and disappear() methods… But let’s see in details, just for the ContactPanel:
ContactPanel Class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | package org.cornflex.examples.viewstack { import flash.display.MovieClip; import flash.events.MouseEvent; import org.cornflex.core.ViewStackPanel; import org.cornflex.transitions.TweenMax; public class ContactPanel extends ViewStackPanel { public var navigation:MovieClip; public var topBanner:MovieClip; public var pageContent:MovieClip; public var nextButton:MovieClip; public function ContactPanel() { navigation.alpha = 0; pageContent.alpha = 0; topBanner.alpha = 0; nextButton.alpha = 0; } override public function init():void { nextButton.addEventListener(MouseEvent.CLICK, changeFrame); TweenMax.to(navigation, .5, {alpha:1}); TweenMax.to(topBanner, .5, {alpha:1, delay:.2}); TweenMax.to(pageContent, .5, {alpha:1, delay:.4}); TweenMax.to(nextButton, .5, {alpha:1, delay:.6}); } override public function kill():void { //clear listeners and stuff... } override public function disappear():void { TweenMax.to(nextButton, .5, {alpha:0}); TweenMax.to(pageContent, .5, {alpha:0, delay:.2}); TweenMax.to(topBanner, .5, {alpha:0, delay:.4}); TweenMax.to(navigation, .5, {alpha:0, delay:.6, onComplete:finish}); } private function changeFrame(evt:MouseEvent):void { viewstack.goto(2); } } } |
The main Class of the FLA File, ViewStackExample:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | package org.cornflex.examples.viewstack { import flash.display.MovieClip; import flash.events.MouseEvent; import org.cornflex.core.ViewStack; public class ViewStackExample extends MovieClip { public var viewstack:ViewStack; public var jumpButton:MovieClip; public function ViewStackExample() { viewstack.debug = true; jumpButton.addEventListener(MouseEvent.CLICK, handleClick); } private function handleClick(event:MouseEvent):void { viewstack.goto(2); } } } |
As you can see in the Main Class, I put a jumpButton to show the possibility to call other states from outside the viewstack itself.
You can imagine to have a navigation working with indexes and telling the viewstack on which state it has to go…
And the SWF output :
To understand well the concept, I advice to take a look to my sources, here.
Months ago, I saw lots of video examples on blogs and YouTube and finally I got some time and found AS3 sources from some brilliant japanese guys (Libspark).
They built an AS3 library called FLARToolKit which is translated from a Java library (NyARToolkit).
This library can detect a “marker” on a video source and calculate its position in a three-dimensional space.
Theses coordinates can be easily used with Papervision3D and applied on a Collada Object or anything else.
Here is my AS3 Augmented Reality Example, done with a Spongle Bob 3DS file found for free on TurboSquid.
Here are some screenshots :
You wanna test it?
1. Download the marker in the PDF document and print it.
2. Allow Flash to access to your webcam when it asks.
3. Point the webcam at the printed marker.
Am I wrong or the Charting Components are parts of the Free Flex SDK?
If I’m not, the Adobe Flex Dev Team forgot to implement these Charting Components in their last SDK, once again.
One fixed or semi-fixed thing is you don’t need to add the “playerglobal.swc” when you create a project.
I said semi-fixed because, if you want to build a Flex project using Flash 10 player features, you need to remove the playerglobal.swc (FP9) and replace it by the playerglobal.swc (FP10). And If you don’t forget to change your HTML Wrapper “Required Flash Player Version” on 10.0.12, with a bit of chance, it will work correctly.
Hopefully, these tricks are common for experimented Flex/Eclipse users. But think one instant to the poor developpers wanting to learn some MXML and stuff… They have to be very very patient to set up their IDE before starting to enjoy the power of Flex.
I’ve found some other bad stuff in the last production release of the Flex SDK.
At least, we are able to compile Flash 10 applications and use the expected unloadAndStop(true) and System.gc() methods… but Jesus! When they are planning to release a complete and bug free SDK?!
How can they announce that :
“Flex SDK version 3.2.0.3958 is the latest production quality release.” at http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK
Mike Chambers Article here.
I was hoping for a long time Adobe AIR team release a new version of AIR. I was hoping especially for the memory leaks (garbage collector) in the Flash Player 9 normally fixed in Flash Player 10 and other bugs.
But I was a bit disappointed :
There is no runtime installer in the AIR 1.5 given in the last SDK Nightly build.
We still have to wait before testing and debugging ![]()
I installed the last SDK in Flex Builder but we just able to see AS3 code improvements and we cannot export an AIR application because there is no runtime to play it.
The only way to test improvements is to build a Flex Application with that new SDK because there is a Flash Player 10 beta2 for Internet Browsers.
And I was disappointed again :
I wanted to test the famous and expected “unloadAndStop()” method of the Loader Class.
The purpose of that method is to kill all listeners and free memory of a loaded SWF inside a Flash-Flex-AIR application. … It still seems to be buggy because I cannot see memory variations when this method is called.
I hope it’s due to the beta2 version of Flash Player 10 because this bug is a real mess! The unload() method of the MovieClip class in Flash Player 8 was working so perfectly !!
Definitely, Adobe put companies in bad situation. Think one instant to the companies have been planned big projects with Flex or AIR and they are blocked now due to bugs that was not there in previous Flash Player versions…
Can we continue to wait quietly ?? It’s difficult to do…when clients are nervous.
Click and move your mouse over the image.
Again, you need to build a sphere with 3DStudioMax and export it in ASE format.
And your texture has to be a spherical shot to be applied on the sphere.
Take a look to my sources here.
![]() |
Hi, I’m a Rich Internet Application developer, based in Belgium.
CornFlex.org is my R&D corner and I hope it will convince you to do more web applications with Adobe Flex and Flash! |