Archive

Archive for the ‘Adobe Flex / ActionScript 3’ Category

SWF protection – SWF Protector 3.0 review

July 7, 2010 2 comments
No Gravatar

With rising problem of SWF reverse engineering, I was looking for a simple tool that does SWF protection. There are variety of tools out there, but one got the hold of my eye, so I decided to do a little testing. Not that I have something to hide, as I usually write GPL code, but when I do it for clients, then it is reasonable to mess up some sensitive code parts.
That tool is SWF Protector 3.0 which has nice interface and it is very simple to use.

According to author, it provides unbreakable protection for reverse engineering. I do not believe that, as everyting is breakable sooner or later, but for now it does the job good. It has two levels of protection, for Actionscript 2, for which I do not care about as I don’t use AS2, and two for AS3: Obfuscate and Protect.
Obfuscate does not protect SWF from decompressing and reverse engineering, but it really messes up code beyond readable. Protect protects from reverse engineering completely. Good thing is that default setting is to do both at once. However, since they increase size of the file, if size of SWF is really important, Read more…

Flex3 – Autocompletion failure fix after SDK upgrade

July 5, 2010 3 comments
No Gravatar

What irritates me the most in Flex Builder 3 (windows) or Flex3 for Eclipse (linux), is when you upgrade SDK, you loose autocomplete or some packages cannot be found by autocomplete.
For example, most common error is when you write import flash. and want to get events, all you can see is flash.errors but not flash.events or any other.

Problem: (this is just pure speculation)
Since FB3 comes with FlashPlayer 9.x, and most probably that you have 10.x by now, adding SDK looses itself between versions. No matter if you set in SDK’s ini file that target player is 10.

How to fix it:
Go to your project properties -> Flex Builder Path, choose Library tab, and expand your SDK.
DELETE playerglobal.swc then add playerglobal.swc manually from SDK.
(same-same but its somehow very different).

Now, clean your project and WOA! Now you have autocompletion and can see all packages.

Flex: Callback of a Callback

March 26, 2010 1 comment
No Gravatar

Depending on architecture of your Flex application (or application you work on), you might have to use callback functions, or it is mandatory to use them. Of course, you shouldn’t be mixing things inside so service functions should remain in service class, where you call your remote objects. Callback function populates your model and that is it. We shall not get into merit should you use MVC, callback functions etc. but presume that you have to do it this way.
So, this is a typical remote service call: Read more…

Flex 3 : Events – part 2

August 11, 2009 No comments
No Gravatar

I have seen that many of the junior Flex programmers have problems in understanding how events in Adobe Flex works and how should be used. So, I find a good thing to explain events a bit more. I have already wrote about custom events in this article. It’s time to go a bit deeper. Read more…

Flex 3 – ProgressBar suddenly stopped working? No problem!

May 20, 2009 No comments
No Gravatar

I had to take some parts of the old project to complete deadline for the new project I was working on. One of the components that I used had a ProgressBar, that worked like a charm.

Before…

I had to load some video clip from the net, and show it’s loading progress in accurate measure of bytes, as well as percents and to have it visually as a progress bar. Well, OK, that is not a problem, since I was picking progressEvent which has bytesLoaded and bytesTotal. Those values were filled correctly and on my surprise, progressBar haven’t been updated as the event was fired.

What the hack? This thing worked.

After extensive investigation, I realized that we have changed flash player from 9.x to 10.x. Now, many of the things work in a different way. ProgressBar component is one of it.  Before, you could omit filling the “mode” property, or you could set ti to manual:  mode=”manual”

Now this doesn’t work. you must fill it, and fill it with proper constant:

mode=”{ProgressBarMode.MANUAL}”

Now, it worked as it was before.

Flex 3 – Creation of custom events

April 24, 2009 2 comments
No Gravatar

In Flex 3 and ActionScript 3, events are the most important. As AS3 is completely event-driven asynchronimus language, commands are not waiting to finish, but executed in order, and waits for no one and nothing. However, there are a lot of code that dispaches and capture events in a way that is very error-prone. Read more…

Flex 3 – Smart positioning popup component

March 18, 2009 1 comment
No Gravatar

Popups are something that one cannot and should not avoid nowadays in web applications. I am heavy user of popups, and mostly, I do not want them to be centered on the screen/browser but opened at some coordinates at the component that invoked it.

That is nice but one problem rises. What if your component (let’s say button, link label or whatever else) is at the right edge of the screen, and usual popup opens to the right? What if it is in the right bottom of the screen? Read more…