Month: April 2012

  • Сannot create the APKBuilder object Debug Certificate expired

    Сannot create the APKBuilder object Debug Certificate expired

    When I run my Android application I catch next error:

    “Сannot create the APKBuilder object Debug Certificate expired on 4/19/12 4:58 PM”

    It means that your debug.keystore sertificate is expired. To fix this just delete it. Exlipse will regenerate a new one.

    You need to delete next file: (in Linux)

    ~/.android/debug.keystore
  • How to fix “Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration” for apache2 in Ubuntu

    How to fix “Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration” for apache2 in Ubuntu

    If you got:

    Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
    

    message in error log of your apache2 web server under Ubuntu you need to do next:

    Run this command in terminal with sudo

    cp -arp /etc/apache2/mods-available/headers.load  /etc/apache2/mods-enabled/headers.load  

    Restart Apache2:

    Also run with sudo

    /etc/init.d/apache2 restart
  • How to use embed font in your ActionScript Flash application

    How to use embed font in your ActionScript Flash application

    To use embed font in your Flash application you need to do next:

    1. Declare font and show TTF font location

    [Embed(source="../../../../../../assets/fonts/MyFont.ttf", fontFamily="MyFont",fontWeight="normal", mimeType="application/x-font-truetype", embedAsCFF="false")]
    private var MyFont:Class;

    take care about embedAsCFF=”false”. This is important part of code.

    2. Create TextFormat object and use embed font it in.

    var textFormat:TextFormat = new TextFormat();
    textFormat.font = "MyFont"; // Here is font attached
    textFormat.italic = false;
    textFormat.color = 0x000000;
    textFormat.size = 12;
    textFormat.bold = false;

    3. Create TextField object and start using TextFormat object BEFORE setting any text for TextField

    var textField:TextField = new TextField();
    textField.embedFonts = true;
    textField.antiAliasType=AntiAliasType.ADVANCED;
    textField.defaultTextFormat = textFormat;
    textField.selectable = false;
    textField.autoSize = TextFieldAutoSize.LEFT;
    textField.text = "Here is text with embed font"

    That’s all!

    Please tell me if you know better solution, thanks.

  • How to make fadein / fadeout effect for TextField using only ActionScript 3.0 in Flash

    How to make fadein / fadeout effect for TextField using only ActionScript 3.0 in Flash

    Hi, here I want to share you my first experience in Flash development.

    Recently I want to made fadein/fadeout effect for some TextField in my application.

    Below you can see code of Utils.as class. The code is pretty simple.

    package {
        import flash.events.TimerEvent;
        import flash.text.TextField;
        import flash.utils.Timer;
    
        public class Utils {
            public function Utils() {
            }
    
            static public function fadeInOut(obj: TextField, isFadeIn: Boolean): void {
                var timer: Timer;
                timer = new Timer(1, 20);
                timer.addEventListener(TimerEvent.TIMER, TimerTask);
                timer.addEventListener(TimerEvent.TIMER_COMPLETE, TimerCompleteTask);
                timer.start();
    
                function TimerTask(e: TimerEvent): void {
                    if (obj.alpha & lt; 0.9 & amp;& amp; isFadeIn) { obj.alpha += 0.15; } if (obj.alpha & gt; 0 & amp;& amp; !isFadeIn) {
                        obj.alpha -= 0.05;
                    }
                }
    
                function TimerCompleteTask(e: TimerEvent): void {
                    timer.stop();
                }
            }
        }
    }

    That’s all.
    NOTE: Please, tell me if you got the better solution. Thanks!