Archive for the ‘Flex’ Category

Did my passion for Flash ends here!

January 11, 2010

All this started when I was doing Lingo scripting with Macromedia Director in our multimedia class. I first heard about Flash there. At first I ignored it,for Lingo was giving me power that point of time (2001-2002). As an architect I used do AutoCAD and 3DSMAX and then import the 3D models into Director to add some interactivity. It was not that straight forward those days but with a lot of plugins and addons one could do Shockwave movies. While I was enjoying Lingo, I heard Flash can do animations and interactivity with very little effort. So thought will give it a try and started with Flash5. At first it seemed me a lot constrained compared to Director. Very little scripting or so to say actions one can choose from and adds to the objects you create. But then I came across some beautiful sites such as (lookandfeel.com,wearehere.com,not sure whether they exist now!) Then I thought I must try this out and there began my Flash carrer. Slowly caught Actionscript 1.0 and started doing experiements. Still love the first time I made mediaplayer in Flash to run the SWFs with stop,pause,play and seek bar.I still consider thats my best project till date.

Slowly Macromedia pushed in Flash and kind of neglected Director. I found value in that but surely missing all those 3D features of Lingo. While there were a few in Flash those days,the community arround Flash was superior compared to any other scripting. Learned a lot from Flash-DB and Flashmove. There I grew myself and looking at the vibrant community I never looked back as to do some other programming (JAVA,C#,PHP etc). I tried  those languages those days but then its the community which let me down. I could found a lot of folks arround me doing JAVA,dotNET but they were kind of showing their superiorness to me all the time. On the contrary Director forums were kind of very slow and there were almost no discussion about HTML and Javascript those days(At lest arround me).

I got myself going in Flash and slowly realised that there is not much I can do with the frontend unless I got some data from backend and the Flash community helped me right away with the support(Flash-DB,you guys rock). Within few months I started with PHP and MySQL,this were all happening from the same community. I never looked to go to a PHP forum till that time. When I visted a PHP forum,just for a test,I found those guys were also share the same kind of passion as Flash. I was been accepted and encouraged. The next thing was JAVA. Actually I started it intentionally as I heard a lot about it in everywhere. Learning was a little tough then as it was pure OOP and AS2 is just a compromise. When I have started my hands on JAVA, AS3 was shipped. And it was like a cake walk for me as I was just polishing Java. AS3 come in just the right time and I loveded it. So much of the pain of AS2 is gone. Till that point everything was going right. I was heavily doing Flash applications from casual games to applications.

This was the time when javascript developer were looked upon as inferior guys than the Flash guys. It was not the problem of the community, as the community was always aware of things. This was the problem created by big corporations and their management. They have to face the customers and customers werer asking about Flash applications. All done, we were delivering Flash applications for years but for what? For the native Javascript and HTML was not sufficient then to provide the kind of user interaction Flash was doing.

The time came when Flash is pushed into the enterprise arena. Macromedia released Flex as a serverside component and the buzz was everywhere. In between the transition of Macromedia to Adobe, Flex matured as a front end component framework. Wooohooooooo, a corner stone. And suddenly there were divisions in the Flash community happened,Flex developer and Flash developer. Some people,including me adopted Flex and started learning it as to see what it is doing. While some just dove into from other programming language as it was fetching money. I found value in Flex, as an application framework and started developing applications. Fun at first,but then I felt I am decreasing my value as a creative individual and doing the same kind of stuff what other programming language guys were doing. The objective of the company(Macromedia /Adobe) was achieved, with the similar syntaxes as other programming languages and ease of use of a declarative language, Flex brought in the developers from all arround the development sphere. But then developers who were really liked Flash for its richness in simplicity started to fade up,that includes me too. If all I have to do is learn your complex event models, lifecycles(which obviously will come in a matured language as AS3) why not I learn other languages like JAVA, dotNET, PHP. They are coming up nicely and if you talk about frontends,we have JavaFX,Silverlight and HTML.  Another big problem is the mindset of the community now, people coming straight to the Flex framework from other programming languages, think the Flash counterparts are just some guys but Flex developers are real ones. Common, put them into test by giving some animation logic or at least custom transition effects. Suddenly the answer would be why would that be required. Flash community was never like that, it always experimented with visual elements of any kind.

If we talk about pure cross-platform products,I mean data driven applications currently javascript and HTML are already doing nice stuffs, I would consider better than Flex/Flash. Coming with HTML5,CSS3 and javacript a great new era of web applications. The community arround it is looking as vibrant as the Actionscript 1 version of Flash. They are ready to take on the challenge and try things out differently.

Well, with that came along iPhone and Cocoa framework for ObjectiveC. I never thought the community could be so enrgetic there. I think its quite healthy and matured community there while at very early age of their life. Within 1-2 months of my diving into the code and starting my objectiveC venture I got direct help from people into core cocoa programming. Go catch @jonsterling at Twitter,this guy is incredibly talented and helps you out , just at the moment. I am steadly falling in love with ObjectiveC.

To conclude, my passion for creativeness and innovation is still there, so I will choose my wipons. Currently HTML5,Javascript,CSS3 are on the web side of things that passionate me. While for iphone and in general ObjecitveC is the thing. All in all on front end side, I should be doing Flash for my earnings I hope, not passion anymore, until Adobe or the Flash community does something to bring me back on the game. This kind of things happened,when I switched from Lingo to Flash. On job front I was doing Lingo but for passion I was into Flash. Now its the time for history to repeat itself. For I have stopped enjoying Flash on application front. While I still passionately do any gaming assignments on Flash. There is still a lot of things in there. But obvioulsy not Flex or any datadriven framework. The passion right now is on objectiveC,HTML5,CSS3 and javascript. Ohh well, how can I forget HAXE. And if we talk about games again,Unity and those kind of frameworks are already in the game. That is another area,which I am looking passionately too.

So there are a plenty of things for me to do as to keep up with my passion.

Lets go and do it.

Flex basics (and Flash)

December 12, 2009

Well, for a lot many people out there, this may be a very basic thing,but its very bad to see people still live in a dark area on the Flash platform. Fortunately(or unfortunately) I was been to a knowledge(regarding Flex and Flash platform) sharing program of a big organisation. To my surprise, the presenters were quite experienced (if we count number of years of their presence in Flash development and the things they have worked on before). But when the talk began I am surprised again that these guys are talking their own assumptions to a very fresh and dynamic crowd(who are following Flash from the early days and really know the inside of flash timeline,AS1,AS2 and AS3).

For people out there who really are following Flash because of its richness in graphics and animation and the easiness of adding interactivity to it, never get a chance to become a Flex developer for they are confused, what Flex is,and whom they think as their mentors are confused by themselves with their own assumptions. These guys(mentors) do not even read internet,never get down to write some code for their own doubts!! So the point is how companies can promote these guys to talk their minds out to such a vibrant resource(who can create wonders if allowed to learn the right thing) and make the work environment from vibrant flash community of developers to a confused-self assumed individuals ?!!

Well without further diving into my experience I am penning down the basics of Flex, what it is and what can I do with my Flash skills? But before that lets see the basics of SWF,FlashPlayer and Flash platform.

1. SWF stands for Shockwave Flash (not Small Web Format)
2. Flash is a Platform (Flex is not. Its a Framework.)
3. Flash does not mean Flash IDE (“Flash IDE” is just another tool to create SWF, so as “FlashBuilder”)
4. SWF struture is one (FlashPlayer never goes on reading the SWF to detect whether its made with FlashIDE or FlashBuilderIDE)
5. What Flex can do is a subset of what the Flash Player can do,not a superset.(ref : Mrinal Wadhwa)
6. Flashplayer internals are not closed,anyone and everyone on Flash world should know it

With all these, what can I do with my flash/actionscript skills? The question is still there for me. Ok,ask yourself what do you do with your skills now? Are you making games,interactive portfolios and engaging product demos? Do you work on each project from ground-up? Are you using some flash libraries out of many available today?I mean for loading assets,adding effects or making animations, do you do all these with Actionscript’s default classes or use some other libraries or you have already made some actionscript classes for all these repeatative kind of work. The last question, have you made atleast one class file which you generally copy-paste in some of your other projects so as to use the functionality you have already made long time back. If yes, this is the starting point of a code library or framework. While the definition of a framework may be much more technical but the beginning of it is code-re-use. So you have a class which can be used in a lot of other projects though not all. Thats good, now write another class which can be as portable as your first class. Now try and use it in another proejct. If you are successful,then think of some classes which can give you power to get rid of the regular tasks of doing the same thing over and again. Roughly put it can be called your own framework which you can use to write your own applications or if you share with someone else, those fellows can use your framework to get-rid-of the regular pain you were facing.

Now if you think,so whats the point? The point is FLEX is a framework! Am I kidding!! No,Flex is a framework and thats the bottom line. Its simply a collection of actionscript classes. So why its making so much of noise?! Because the framework you wrote a while ago might just help a very specific purpose,while FLEX framework helps all kind of data driven applications. Flex framework provides another way of writing your actionscript code too. Well,do not worry,if you think I need to learn another language?! NO,its the same actionscript but written in a declarative language as XML. Adobe(formerly Macromedia) named it MXML. Instead of actionscript in “.as” files you will be writing actionscripts in “.xml”. That simple!! Yeah,but then as in XML,you can define your own tags,in MXML you have to obey some specific tags(like in XHTML,you have to right <HEAD> and <BODY> etc). Wait a min,you just said Flex is a framework,why I will need that MXML to use this framework,can not my actiosncript knowledge do the thing. Ohh yes,of course, you can write only actionscript code to use Flex framework after all this is just another framework. So why are you confusing me with MXML? Because,writing in MXML lessens your line of code. OHH!! :) :) That makes you smile again. Good,lets see what else can we do with Flex framework. Except from the classes which makes your data transactions easy, Flex framework comes with a Layout Manager,Pop-up Mamanger and a lot of components. Now you are thinking,why I have to use components!! I have always neglected them in my FlashIDE. The answer would be, if you would have used components in FlashIDE,you would have come to FlexFramework much easily. I mean Flex framework give you components too. If you want to create a “Button” you can create with “new Button()”. Ohh! That I always used for new symbols from library but never used for components as I always try to neglect them or avoid them. No problem,start using them and you can see they are your friends not enemies. Even FlashCS4 component skinning is straight forward as to design a movieclip. And a last point as Flex comes with a compiler to compile your actionscript code. So you do not need a FlashIDE to produce SWFs. You mean to say from commandline if I write some instructions,that will create a SWF file out of my actionscript code(or MXMl file)? Yes. Then how to customise those Flex-framework components,I always hate those default colored compoenets even in FLashIDE? For these tasks also Flex-framework gives you a lot of classes,by using them you can color,style and animate your components. There is a way even to make your components in Flash and using them in Flex framework. But all those will be a different topic as a whole.

That means, Flash can do what Flex can do.Yes, because Flex is a framework. As your framework was intended for a certain reason,Flex framework too is intended for certain reason. It can effectively used for a data-driven application. But then you can do the same with Flash with a lot and lot of extra code. The same question comes why flash,Flex framework can do my application.Yes,but when you need pixel level perfection in your content Flash can give your artist all the tools to create beautiful and engaging graphics and animation.

If someone says I am a Flex developer and do not know what flash is? Ask him/her, are you talking about the framework? Well,I never come across that kind of projects to use that particular framework but I am quite comfortable at Flash and used a lot many other frameworks for my work,when the requirement will come I will read that framework too. There is nothing wrong in sticking to Flash-actionscript only, if your job requires this. There are a lot of frameworks on actionscript only which do their jobs best and can be helpful to you as a Flash-actionscript developer. But then its always better to know what the other framework is and how it works,so once you get time dive down the Flex-framework and see if it helps your job. There is nothing wrong in studying this,but this is obviously wrong to think someone superior because he/she knows one particular framework and does not know the basics.

Happy Flashing :)

Whats in 127?

December 6, 2009

While in AS3 the new alpha values are from “0.0″ to “1.0″, there is really something happening under the hood,if one increases it beyond 1. Tried to trace out alpha while increasing it by one on each frame. To my surprise it goes on increasing,well the real surprise came out when the value suddenly goes back to negative. So it goes like this,from 0 to 127 and then from -128 to 0 and goes on like that. Thought it would be helpful to someone who might be trying to play with alpha and think his/her code not working correct.

Testing code

this.addEventListener(Event.ENTER_FRAME,checkOnEachFrame);
private function checkOnEachFrame(e:Event):void
{
this.s.alpha += 1;
trace(this,’alpha is ‘+this.s.alpha);
}

(more…)

Flash Player 10.1 is announced

October 6, 2009

Adobe has announced Flash player 10.1 and with it comes a whole new era of Flash applications.It might seem that this is just a point release,but do not get fooled away by the point.For me it seems like a whole new Flash world. There are so many great things coming, the details can be found here (http://labs.adobe.com/technologies/flashplayer10/)
From developer’s perspective Global error handling is a one point solutions for all the try-catch blocks. Wow, I am so excited. Then comes multitouch,accelerometer,orientation detection for mobile devices just to name a few. FP10.1 will support HTTP streaming,another great addition to flash player.This is huge again.Now with Flash player 10.1 we will get direct access to microphone. Wow,simply awesome. Flashplayer will take advantage of Hardware acceleration whenever possible,even for Vector graphics and images(http://www.adobe.com/devnet/logged_in/jchurch_flashplayer10.1.html).
Well and the most tremendous part is Full flash player is now available for mobo devices.(http://www.adobe.com/aboutadobe/pressroom/pressreleases/200910/100509AFPforMobileDevicesandPCs.html)

Last,but not the list is Flash can now make applications for iphone,yeah from Flash CS5 one can directly produce native ObjecticeC code to deploy into iPhone(Obviously one need to go to Apple AppStore for the so called approval,huh!).
http://www.youtube.com/watch?v=M3CI5GyNXoA

Overall for me as a Flash developer this seems to be a new era coming to Flash platform.I can feel the freedom and fun. Long-live Adobe and long-live the Flash/SWF team at Adobe.

References :

http://www.adobe.com/devnet/logged_in/jchurch_flashplayer10.1.html

http://tv.adobe.com/watch/max-2009-develop/building-mobile-applications-with-adobe-air

http://www.adobe.com/aboutadobe/pressroom/pressreleases/200910/100509AFPforMobileDevicesandPCs.html

http://www.youtube.com/watch?v=M3CI5GyNXoA

Happy Flashing

Introduction to SQLite on AIR

August 30, 2009

SQLite is a relational database right inside Adobe AIR environment. While its a full fledged relational database system,the real power of  it comes from the ease of use. There is no server to configure,no server to start. Once Adobe Integrated Runtime (AIR) is installed in your system, you are ready to take  advantage of SQLite database. Actually SQLite comes with the AIR itself. So there is absolute zero configuration as it is clearly noted in the SQLite official site.

Now,all that one need to know is the Flash (Actionscript 3.0) APIs to start talking with the Database.

To begin with any database applications,one need to have a database in a database server,start the server,connect to it and then start putting in data or getting the data. Now in this case of SQLite, we already have the initial set up ready for us. I mean as a SQLite developer on Flash platform one need not worry about the server setup and starting the Database server. All one need to concentrate is, connecting to the Database and puting some data in or getting some data out from the database. For once AIR is installed SQLite is up and running,how cool :) ! Now the best part is,all the standard SQL query runs in the SQLite Database too. To get started, one need to create a database or connect to it,if already created. Now SQLite API gives us one syntax to do the both,I mean if the database is already present it just connects to it else it creates the Database for us and then connects to it. The syntax is as below

var conn = new SQLConnection();//Connect to the DB server
//adds event listeners to listen for the events
var conn.addEventListener(SQLEvent.OPEN, onOpenConnection);
var conn.addEventListener(SQLErrorEvent.ERROR, onConnectionError);
//connects or creates and connects to the database
var dbFile:File = File.applicationDirectory.resolvePath(“myDb.db”);
conn.openAsync(dbFile);//actually connecting to the Database

Thats all to create and connect to the database. By convention the database files are named with extention “db”,In this example we are creating a Database file named “myDb.db”. The Database is actually stored as a file,as we created now. To make any query to the Database the syntax will go as below

var sqlStatement:SQLStatement = new SQLStatement();
sqlStatement.sqlConnection = conn;//”conn” is the connectino we just made with the above code
var query:String = “SELECT * FROM friends”;//This is actual SQL query we are going to run in the Database
sqlStatement.text = query;
//adds event listeners to see if our query ran properly
sqlStatement.addEventListener(SQLEvent.RESULT, onQueryResult);
sqlStatement.addEventListener(SQLErrorEvent.ERROR, onQueryError);
sqlStatement.execute();
//finally calls to run the query in the Database

Thats all to it. :)

Now to make things easier for my project,I have created a helper class for regular tasks as querying the Database and getting the result. Please find the file at google code repository here. Hope that helps you on your day to day task of SQLite development under AIR and Flash platform.

happy flashing

Flash 3D authoring with CopperCube

April 26, 2009

Yet another 3d authoring tool for web 3d,CopperCube. Being on beta, its quite good on features and performance is kind of ok. The most notable feature is the ease of use and the swf size. Very easy to use and one can be productive right away. The swf filesize is also small,for 6 boxes with textures,lighting and a first person camera it came to 132 kb. The thing which hurt me is the performance on ie. My browser continuously crashed with one first person camera. Being on beta, I think these issues are to be there. Hopefully a stable compilation will come on the release version. Apart from that, actionscript is supported in it and the tutorial is cool to get started. For a longtime I was searching for a tool like this. The camera can be made to collide with the objects in scene,which is a very nice way to control without any code. Overall a must try for flash 3d game developers.

Get the out put files here.

Happy Flashing

Documentation Tool, NaturalDocs

April 21, 2009

Designing a software and developing it, is might be one part of the game.But I believe without a proper documentation of a software, the product itself decays in time. I am very dissapointed to see people calling themselves developers (ohh no, very good, experienced developers) do not even know and do not want to know the necessity of documentation. One generally finds the words “fix it man.forget that comment,fix the code.who cares why?” from the know all, Mr Fixit and efficient guy in a typical flash development environment. Obviously we are here to do stuff but then imagine if the same code you are passing on to some guy would come to you without documentation, what would be your reaction to the situation.The general reaction of the typical Mr Fixit is “This is not my code. I am trying to understand some body’s F*$#ing code. This is not the way one should right the code”.
Give me a break, documentation is the key to make a product come out alive over and again with lot ease and good maintaince. For flash projects I always thought AsDoc holds a good palce. It does actually if you are a Flex developer. But what happens if your whole project is Flash only!! AsDoc can not understand “fl” package.Ohh no!Ohh yes. It does not understand the package at all.Then there are work arrounds.Why?! If Flash is a platform and eveything is a tool to produce the SWF, the Flash only projects should get equal advantage as Flex.
Well,then there are some pretty tools who can do the thing sweetly and nicely. NaturalDocs is an opensource project, which does the thing.It supports a lot of languages and produces documentation clean and sweet. It has option even to create a frame based documentation or a no-frame only HTML based documentation. It supports the standard JavaDoc type comments as well as natural english language type comments too. Over all I am happy and satisfied with NaturalDocs as I became productive in it within 15 minutes after download. I must tool for any kind of development documentation. Cheers to NaturalDocs.

Adobe CS4 Event,Mumbai

April 21, 2009

Yesterday I had been to Adobe CS4 event at Mumbai.It was exciting and pleasure to be in the event. Met a few old pals and got to see new features coming in, in Adobe products. Good to see that Adobe is promoting OpenScreen project even in sales talks. Another interesting thing was Flash Catalyst. Though I am following up with Thermo for a long time,but seeing it in person is a different experience. Gumbo is another cool stuff shown in the presentation along with FlexBuilder 4 (though mentioned that the FlexBuilder 4 IDE is far from the actual release version,but I never expected to see “Fx” componenets). Then it was all Flash CS4 new features tour and Flash player 10 feature list. Over all it was an interesting place to be.

As far as the media server is concerned the most exciting feature came in with Flash Media Server 3.5 (FMS3.5) is dynamic streaming. Dynamic Streaming does the quality decission on the run time, it actually looks for the connection speed of users’ machine and stream the higher,medium or lower quality media ones respectively.

Monster Debugger : An Opensource debugger for SWFs :)

February 10, 2009

For a long time I was searching for a debugger for my Flash applications. It was a pain to customise my own debugger for every project. Xray is a cool one, but some how my expectations were more from a debugger as far as ease of use and features are concerned. The ease of use and the functionality both are awesome in case of the new Open Source Debugger from DesignStudio De Monsters.This is called “Monster Debugger” and the name says it all. Its an AIR application and the client code is embed inside it. Once downloaded and installed, one can track any SWFs from inside Flash IDE or standalone too. I fell in love with it at the first look itself.Cheers to DesignStudio De Monsters. Keep up the good work guys.

Happy Flashing.

Getting into RED5

January 1, 2009

Hi, Happy new year to all. Hope this brings with it success, friendship, faith and hope to everybody’s life.
To start with lets start with Red5. For past some weeks I was working on Red5, yeah its just some 2 -3 weeks only. All these time I was only trying to get my first application going and running Flash remoting in it. It took me some time but its worth.

First of all to go with Red5 it is mandatory to have Flash and JAVA handy. Belive me, its the same as AS3 development in an IDE such as Eclipse. There are syntax changes but over all its the same kind of stuff. So it is fun developing in JAVA as well as in AS3. RED5 supports JAVA SPRING framework for applications out of the box. Being said that, Spring makes its easy for a beginniner developer to get going in JAVA as all one need to write is a POJO(Plain Old Java Object) and configure one XML file.Cool, so lets get started. Below are the source files, I hope it helps somebody out there.

Source Files One

Source Files Two
(more…)