Showing posts with label settings. Show all posts
Showing posts with label settings. Show all posts

Wednesday, March 30, 2011

Adjusting SWF parameters for ActionScript Project

While creating ActionScript Project in Flex builder (Flash builder) You have no .fla file where it's possible to set background color or dimensions.

Eitherway it's possible to configure those settings. To define them add line like this:

[SWF(width="800", height="600", backgroundColor="#ffffff", frameRate="30")]

before main class definition.

Tuesday, February 22, 2011

Setters and Getters

Similar to other programming languages like C# there is possibility to create setters and getters in ActionScript. Here is an example:

//method accesed privately
private var _title:String = "Title";


//getter
public function get title():String
{
    return m_title;
}


//setter
public function set title(aTitle:String):void
{

    _title = aTitle;

    /*
     * here can be other code that you need to be executed 
     * when somebody sets your variable
     * example:
     * this.dispatchEvent(new Event('ModelTitleChangeEvent'));
     */
}

Use it or not? It depends on You and Your project. If project is advanced it is useful solution. And in my opinion code is easy to understand.

Monday, February 7, 2011

Problem with xampp - why apache server does not start

While using xampp you can be faced with problem when apache server cannot start. Even if console window show info, the status and button does not change.
The problem is not in xampp itself but in another program on your computer that uses port 80. In my case it was skype. To turn it off in skype open Tools -> Options -> Tab 'Advanced' -> 'Connection' and uncheck 'Use port 80 and 443...'
Now just save and restart skype. Let's check results.
It works.