ActionScript Code Analyzer

I was making a simple experiment about analyzing code and creating view that show linked classes and used functions, it was just experiment, nothing too big. At the end I have made a small application that analyze ActionScript code which give some information about the code has been written.

Application analysis the selected folder and create a simple code metrics, which shows the number of code line in files, blank lines, comments, number of functions, and so on. You can analyze your whole Flex Project or simply some of the classes that you wrote. The idea of detecting number of the lines is to predict the amount of effort that will be required to similar projects or libraries. Of course, this cannot be used to estimate the productivity of the developer. Every programmer thinks different and experienced developer may give same functionality with less code than new programmer. So that is the main reason that it cannot be used for productivity.

Read rest of this article »

Sending ActionScript Object To Java

There is a lot of source about how to communicate between ActionScript and Java via BlazeDs, but almost all of them unfortunately are classic scenarios.  Of course in development we always don’t work with the ideal classic ways, we need different solutions for different problems. One problem I was face to couple months ago sending ActionScript class from ActionScript to Java using RemoteObject, which is actually quite simple but I couldn’t find any example, so I thought it will be good to write about it now.


Read rest of this article »

Concerns About Delivering AIR Applications use Native Processes in AIR 2.0

One of the most wanted requests in AIR Runtime was the capability of communication with the other programs in the operating system that AIR applications will run. Well with AIR 2.0(Athena) finally Adobe decides to add this functionality. But now I do have another concern, but first I want to explain what the new ways of communicating with other programs in AIR 2.0 are.

If you want to open another program in AIR 2.0 all you have to do is calling the openWithDefaultApplication() method of the File Class. Of course you have to specify which file you want to be open. For instance if you want text file to be open with text editor, all you have to do is calling the method and text file will open with assigned default application. This is pretty simple.Of course by this way you cannot communicate with the application that will open, all you do is give a command to open.

If you want to communicate with the other applications in operating systems, than you have to use what call Native Processes. This is of course really good news, because including me lots of people face to problem of how to do that. But there is a small concern, much is I understand if a developer decide to use the Native Processes than developer have to release AIR project as EXE,DMG  or Debian and RPM’s. That means soon as we decide to use the Native Processes, we will no longer be able to use AIR file as published installer. The reason why many people want to use AIR is because it is cross platform. And of course Adobe is not stepping back from this idea, but there is also no reason to use Native Processes and still release the project as AIR file.

It is simple, as a developer when I want to use Native Processes I am aware there are different operating systems and all operating system doesn’t support same features/applications. But why simply detecting that in AIR application and executing code by that decision instead of releasing programs for different operating systems as different installers.

I am sure they have a good explanation for this feature, but as developer I want things to be easy, we are all ready spending so much time for unimportant things than developing, decreasing our productivity is not a good idea.

PS: I based this article on presentation of Christian Cantrell in Adobe Max, as you all know all features are not concrete I might be wrong of my thoughts. In case if you want to watch presentation online here is the link;
http://tv.adobe.com/watch/max-2009-develop/whats-coming-in-adobe-air-2-

Take Care,
Engin Yöyen!

Disabling Certain Rows in Data Grid

Using data grid is great, but sometimes you may need to disable certain rows of data grid. By default Flex SDK doesn’t support disabled rows. But with a few line of cods this functionality can be add easily. First of all we have to create a new Actionscript class and extend to do DataGrid.

For disabling a row we have to override two method first one is mouseEventToItemRenderer() and second one is drawRowBackground() . First method will trigger every time mouse over to data grid row. When method is triggered method will check the incoming data and if data property enabled is false than it will return null, otherwise it will return the item renderer as it comes. Second method is drawing the background of row, this is only visual presentation. In this method when an enabled property is false it will draw background as gray, which can indicate the row is disable. Here are the methods;

Read rest of this article »

and AIR 2.0!

As everybody knows Adobe has present a lot of new features for existing programs of Adobe in Adobe Max. Some of them of course for developers some of them for designers. But I only want to mention new features of AIR 2.0.

There has been a lot of request from developers since AIR 1.0 release. Fortunately some of those features will be added to AIR 2.0. Here is the short list of new features of AIR 2.0;

  • Local microphone access API
  • Multi-touch & gesture support
  • Support for detecting mass storage devices
  • Native Process API
  • Open Document API
  • P2p socket protocol support
  • HTML5 & CSS3 support

Of course as a developer I love new features. Hopefully there will be more detail soon when the publish the beta version of AIR 2.0
Take Care
Engin Yöyen!

Introduction to Object-Oriented Programming–1 (Classes)

Although “Object-Oriented Programming” combination of these words is scary for beginning programmers, but after beginning the OOP it turns out that all process is not so hard actually. I think the difficult part for beginner is always adaptation process. For making this process little easier I will make a short introduction to object-oriented programming. In this and the next few sections I will explain the basic terms and they part of work in object oriented programming.

Classes and Objects

Classes are code snippets which do simple tasks for us. To do a specific job, sometimes one, sometimes several different classes at the same time can be used. For using these classes we have to create an Object of a class.

For example, let say there is an image animation that you use in every project you’re working on, which is working with 40 lines of codes. Normally (when writing code in timeline), you have to copy and paste these 40 lines of code every time you want to use the animation. Rather than that you can write bit of more code and turn that animation code as a single ActionScript file. In this case has been developed a Class. You can use the animation of this class file in Timeline or in another Class structure. But whenever you use the Class file you have created you are actually creating and using Object. Which means an Object is instance of a class file.


Read rest of this article »

Transition from Procedural Programming to Object Oriented Programming

There are few small topics that you have to learn before you start programming OOP. Before I start I want to mention a feature which same with Flash CS3. With Flash CS3 we were not able to write codes on Buttons or MovieClips. This was not a good feature for lots of developers. But I find this feature very useful, because as a developer I am not favor of seeing 100 pieces of code all around of one simple project. Of course there is no such a rule which say; you have to write all code in 1 frame”, but writing code on each button and movie clip which is added to project is also not a good work style. Anyway in this article I will cover how to use Document Class, Library Objects and Classpath.

Document Class

With Flash CS3 new feature introduced called “Document Class”. With this feature now we can integrate class files without adding any code in timeline. Of course if you want you can still use timeline but as a developer you have to decide it is necessary or not.
Usage of Document Class is very simple. First you have to make a class file that you want to use as a Document Class. Than you have to add name of this class in the Document Class property of the flash document which you can reach from Properties panel.

Here is a simple class for purpose of testing;


Read rest of this article »

What is Object Oriented Programming?

Before starting to the topic I want to mention this is a first part of series article about Object Oriented Programming (OOP). As is not easy to cover OOP with detail in couple articles I thought would be better to divide to the pieces. First I will be covering basics of OOP and than I am planning to write about Design Patterns.

Object Oriented Programming

In basic understanding OOP is; making objects from pieces of solution out of existing problem. The goal is to having those objects ready to use for similar problems in future. The advantage of OOP is that you could manipulate each piece of solution fast and easy. Because solution of problem divided many useful pieces, manipulating single piece of solution it’s also fast and easy. Manufacturing systems will be good example for this.


Read rest of this article »

Programming and Education about Programming

The main target of this article is to answer different questions that I get about programming and process of learning programming. The questions are usually comes from people who working in different programming language and want to learn to new one, information about programming academies, about programming, and how hard is language. That’s why I think article may help to people who want to start to learn new programming language and who all ready did start. (The article mostly about how I think and about experience that I had. Generally I don’t think there might be the so much different between different countries, but this is also open topic)

Programming and Being Professional in Programming Language

Programming basically is not an easy but therefore an enjoyable work/job.  Of course this is relative to the language you use, work you do, application you do and so on. Anyway as a description I could say Programming is not learning a programming language, programming is learning to be able to program. I think programmer should be able to see programming language it is not as a target that have to reach, instead have to see as a tool that he/she have to use. A programmer should be able to work in more than one programming language. If you are able to use ActionScript 3.0 there is no reason why you can not program in Java or JavaScript. Of course syntax of those languages may be close to each other but my point is if you are able to program in certain programming language you should also be able to program with some other language too. The key point is the learning basics of the language, with other term learning the syntax. Rest of the knowledge you need you will get it piece by piece when you need it.

I don’t want you to get wrong. Being able to programming and being professional in certain language is totally different things. Being good in programming will help you to work with different platforms much more easily. But being professional in programming language means developing your self in certain field. Being professional in certain language is always give you chance to work in the better place and certain kind of works with it.


Read rest of this article »

Using Actionscript 3 Language Reference in Flash CS4

Being able to program with an language is not mean you have knowledge of all the methods, parameters, structure etc. I would say; good is as language documentation is easy to find and use the functionality of the language from developer perspective. I love ActionScript 3.0 language reference, first was bit on not understandable but currently is everything I need. In Flash CS3 you can simply press F1 and see the language reference. Of course you can reach that also online;

http://help.adobe.com/en_US/Flash/10.0_UsingFlash/

The main problem I had was the when I press F1 in Flash CS4 instead of help panel my default browser was trying to connect the online documentation. Of course now days you can find internet everywhere but I still do prefer to reach language reference on my computer. For just getting information about an event or an method I have to connect internet wait for page to be open, than click over and over again. For me this is such a waste of time and simply I don’t like it. But there is a solution for this problem. The copy of language reference is being installed when you install copy of Flash CS4. There is two ways to reach this documentation, first is finding on operating file system.

On windows operating system path is;
C:\Program Files\Common Files\Adobe\Help\en_US\AS3LCR\Flash_10.0\index.html

On Mac operating system path is;
/Library/Application Support/Adobe/Help/en_US/AS3LCR/Flash_10.0/index.html

On Linux operating system path is;
/Library/Application Support/Adobe/Help/en_US/Flash/10.0_UsingFlash/index.html


Read rest of this article »

PHVsPjwvdWw+