Getting fresh data from database

Problem
Problem is that some browsers won't refresh data got from database. They cache query results. Example:
var url:String = "http://www.example.com/get_data.php";
var req:URLRequest = new URLRequest( url );
var loader:URLLoader = new URLLoader();
loader.load( req );
So with this you can load results from php document. But when you ask for results again, some browsers (I noticed IE) will cache results and you will get same results. Refreshing the page and loading your application again will help. But you don't want user to refresh page, don't you?
Solution
Solution is pretty simple. In order to get new result you must confuse browser. You can confuse it by giving it new url to load. So, on our original url we will give it some meaningless sufix which won't do anything other than generate new url.
url += "?randomVar=" + Math.random();
Your new url will look like this now:
http://www.example.com/get_data.php?randomVar=0.8319580480456352
This way on every refresh you get different number as sufix, making your url unique.
Finally your code should be:
var url:String = "http://www.example.com/get_data.php";
url += "?randomVar=" + Math.random();
var req:URLRequest = new URLRequest( url );
var loader:URLLoader = new URLLoader();
loader.load( req );
FlashDevelop – essential developing environment
Overview

FlashDevelop is awesome tool which is used as developing environment. I've been using it for a great deal of time now. It has nice organised and intuitive interface, it's easy to set up, and the best of all, it gives you ton of features that you don't have implemented in Flash. I'm talking here about Flash CS3 since I possess it. Some of my best features I'll be covering in this article.
With nice looking environment and tons of features you would expect some price. But fortunately for us developers, FlashDevelop is free. If you want, you can support the project and donate through PayPal (they deserve it).
Features
Like I said, there are a lot of features which are really useful when writing your code. I'll cover only some of them. Complete list of features you can find in FD (FlashDevelop) tour section: list of features
1. Code completion
This one is really time saver! I've been working with C# for a while, and I loved it's IntelliSense. That is really one thing that Flash misses and I, as developer, miss even more.
In Flash you have a little bit of code completion functionality. As I noticed, code completion only shows when you do import classes or when you name your variable with sufix txt, mc and btn (i.e. myTextField_txt). If you miss one letter when writing your code code completion in Flash will close, which is not the case in FD (it will stay open and offer possibilities).
Great thing is that when you import classes, you can write only final class name, and not whole package to get to final class which you want to import like in Flash.
Beside having offered object name in code completion, it also includes graphical presentation of function, getter/setter, private and public variable, etc. (simple icon which is very useful when choosing some variables or functions with identical name).
2. Code navigation
Great thing is that you can follow your variables, functions and everything else in Outline window. I don't use it very often, but it is handy when I need to find something fast. You can click on element and program brings you to it's declaration.
You can bookmark line in your code, and then you can view all bookmarks in Bookmarks window.
Files window is sort of files explorer, and I don't use it, but it can be useful.
On the other hand, Project window is always when I'm working on my projects. Project window contains all files in your project structure. In fact it is folder of your project. From here you can inspect all files in your project, open them, rename, delete, etc.
3. Documentation generation

Lots of people aren't fans of documenting your code. I find it as general mistake since I know how hard is to get back on the project that you haven't work on for a long time.
For those smart enough to comment code, FD supports one neat feature. It is not default integrated but it is pretty simple to install. You can comment your code in Javadoc comments and click GENERATE ASDOC button in FlashDevelop. You have your ASDoc documentation for your classes. Really good way to make the best documentation for your code.
Final thought
These are just 3 general features that I use the most.
One thing I miss is debugger. I still use Flash debugger since it is really good. But even without debugger, this piece of work is best developing environment I've worked on. And it is free!
For more information on FlashDevelop visit FlashDevelop wiki pages or FlashDevelop forum.
Send custom class through LocalConnection

Recently, I got my head around a problem of LocalConnection not working with sending data that is not simple data. I couldn't send my own classes through it.
I found a solution with registerClassAlias. You can read more about it:
registerClassAlias()
The example above is a demonstration of using registerClassAlias with LocalConnection, and sending custom class named TextData from Main.swf to LoadingSWF.swf.
Project life cycle
Project life cycle steps

1.Define requirements
Talk to your client, and get to know what is your project about. You'll get most of requirements, but I suppose not all. Don't worry, you'll be filled in when project kicks in.
2. Define project cost
First of all, break all requirements in small tasks. Then, estimate how long do you need on getting that task done. Sum all hours and add some more time (which I call "safety time"), which will secure you in case your tasks get longer than you anticipated. After you did thatmultiply it with your hourly rate. You should get your project cost.
3. Write specification
If you are developer, and are working with other developers it's crucial to have some sort of standard between you. Specification gives you project goals and requirements. You can also include some programming language standards which your team will follow. Big projects have special person which takes care of this and it is absolutely must have, but if you are working alone, it could use you to have written standards. If project needs maintenance, you can return and read specification and know exactly what you need to do.
4. Plan your project
When you were estimating your project cost, you have broken requirements in smaller pieces. Now you can use that smaller pieces and put it in calender. Estimate how much a day will you work, and put tasks according to they priority. Include holidays and weekends in planning. You are done with project preparations.
5. Start working
Take that tasks and start working. If you are developer don't forget about importance of planning out your classes.
6. Test it yourself
Write number of test and functionality your project needs to have, and do the testing. If you want, write down some bug list for future references. Maybe someday you'll be in the same position, having the same bug.
7. Have your client test it
It is important to have your client take a look of your project before it is finalized. That way you can get feedback from client and a new bug list.
8. Document your project
When you have finalized your project take some time to document about it. Update your specification and write help on how to use your project.
Final thought
I hope I summarized basic steps of having a project on your hands from beginning to the end. If you have any comments, or you do it some other way I would appreciate your thoughts and opinions.
Regards,
Vjeko

Recently I went to Twitter. I was really skeptical, and still am. But one thing that is cool, you can found out news really quickly. Since Twitter allows only 140 characters, message is short and educative. On the other hand, users post a lot of messages. So you need time to read it all if you follow a lot of other users.
I just began with it didn't use much effort to add contacts, but surely will over time. If you want to add me, search me: Vjekoslav Ratkajec, or vratkajec.
Cheers,
Vjeko
Blog started…
As you see, there are few categories and I'll be filling them in soon enough.
Cheers,
Vjeko

One other thing is that you have to have proper folder structure for generating you documentation. My folder structure is on the picture. This is needed because when you choose to generate ASDoc it will create separate folder in which it will store all documents needed for your documentation. In src I put my source code, in deploy goes final product, and in root is my FD file. Then when I click on ASDOC button to generate documentation, it will create doc folder in the same directory as your FD file. If you follow their tutorial and input their code in Toolbar.xml, it states path to your source code folder. I find this structure as the best way of keeping your files neatly organised. If you still choose to have your own structure, just replace -doc-sources path in Toolbar.xml.