Dec 09

By 12th of Dec, my ixwebhosing account gets its 2nd birthday. Usually I will set it to “auto renewal”. However this year they are offering a super discount of unlimited pro plan, which is even cheaper than my current plan. Therefore I decided to switch to the linux plan. And here troubles begin….

Firstly, I was hoping to just “upgrade” or “change” my existing plan to the Unlimited Pro. And when I was signing up, it prompt me to select if “I am a new customer”, or “I am an existing customer”. Of course I chose the latter. Then surprisingly even I was choosing the same login name, same domain name, same billing profile, same user information, instead of upgrading my existing plan, they registered me for a new one?!!  What the &^^&$**^&(*%^&*(%&%$*$*^%)&(?!

Ok…..though it’s annoying, it’s not really the worst. Cause my existing plan is coming to an end anyway…. 12th, it’s only 3, 4 days away. The real trouble came at the “DNS propagation”. Initially I thought 24hrs~72hrs is just a rough estimation. However at night when I am able to access my domain with the domain name, I still cant access my email?! WTF?!

Messaging the 24hr-live chat of ixwebhosting, and I was informed that apart from DNS propagation, they still need to “change some options “ before activating the email server. Ahhhhhhhhhhhh!r*&*(&^&*(^&)&%$%$#$@#$#@*)(*()_

I 服了 U!

************************************************************

Iphone has no 3G signal since I changed my plan to iFlexi. Called singtel Cust.Service center twice.

First time, the guy said “sir, there is no problem with your line at all. It might be because in your area, the 3G signal is not strong enough.” BullSxxt!

2nd time, I waited for almost 30 mins before someone picked up my call. Luckily this guys explains “Sorry sir, I don’t know why but the GPRS signal for your phone is disabled. I will reactivate it tomorrow.And the 3G signal will come with it.” Well…does 3G signal rely on GPRS signal to transmit??? 问号,大大的问号…….

************************************************************

PS,

So called “peer” or “peer”ing in the FlashLib, is acting just as simple and same as the pDoc I was using all along! I JUST realized this…… :S

written by admin \\ tags: , , ,

May 06

Just now I was trying to restrict the backslash input in textbox in flash. Many I have tried, none successful. Good that I came across this post eventually, and it helps a LOT.

The original documentation in flash is stated as such :
"You can use a backslash to enter a ^ or – verbatim. The accepted backslash sequences are \-, \^ or \\. The
backslash must be an actual character in the string, so when specified in ActionScript, a double backslash must be used. "

That is so…..unclear……

Therefore when u try to restrict the "\", u end up have to use "^\\\\".
e.g. input_txt.restrict = "^\\\\"

********************************

Sometimes when you need to save the data from flash to XML, certain special characters should be taken care of. In XML, ‘<’, ‘>’, ‘/’ and ‘"’ all has its special/reserved meaning. The way I did is to convert those characters to a even more "special" character, that hopefully user wont type out from keyboard.

public static function encodeSpecialChars(str:String):String {
   var len:Number = str.length;

   for(var i:Number=0; i<len; i++) {
      switch (str.charAt(i)) {
         case "<":
            str = str.slice(0, i) + String.fromCharCode(170) + str.slice(i+1, len);
            break;
         case ">":
            str = str.slice(0, i) + String.fromCharCode(176) + str.slice(i+1, len);
            break;
         case "/":
            str = str.slice(0, i) + String.fromCharCode(178) + str.slice(i+1, len);
            break;
         case "\"":
            str = str.slice(0, i) + String.fromCharCode(179) + str.slice(i+1, len);
            break;
         case "\"":
            str = str.slice(0, i) + String.fromCharCode(164) + str.slice(i+1, len);
            break;

         default:
            break;
      }
   }

   return str;
}

public static function decodeSpecialChars(str:String):String {
   var len:Number = str.length;

   for(var i:Number=0; i<len; i++) {
      switch (str.charAt(i)) {
         case String.fromCharCode(170):
            str = str.slice(0, i) + "<" + str.slice(i+1, len);
            break;
         case String.fromCharCode(176):
            str = str.slice(0, i) + ">" + str.slice(i+1, len);
            break;
         case String.fromCharCode(178):
            str = str.slice(0, i) + "/" + str.slice(i+1, len);
            break;
         case String.fromCharCode(179):
            str = str.slice(0, i) + "\"" + str.slice(i+1, len);
            break;
         case String.fromCharCode(164):
            str = str.slice(0, i) + "\"" + str.slice(i+1, len);
            break;

         default:
            break;
      }
   }

   return str;
}

written by admin \\ tags: ,

Dec 03

Flash程序员的八层境界

    第一层,无代码境界.此为初级,学会了点儿Graphic,motion,mask,guide动画后就开始制作MV的人属此境界.不会用任何代码,把动作面板看作禁地.
    第二层,简单代码境界.此时已会用stop();之类的简单影片控制语句,会在普通模式下拖几条命令.并为此兴奋不已.
    第三层,简单事件境界.此时发现使用按钮和影片剪辑的事件处理器感觉好爽,于是大用特用,大堆的on,onClipEvent便诞生了.
    第四层,复杂帧境界.此时发现把代码写在按钮上十分不爽,十分不便于以后修改与维护,渐渐发现把所有代码尽量往帧上放是一件很爽的事.并且能用对象或函数来简化重复出现的语句,比如大量复制的影片剪辑事件的添加.尤其喜欢用路径,绝对路径.
     第五层,少有代码境界.此时发现代码写在帧上也十分不爽,转而把代码都放到外部文件,再用#include包含进帧.这还是次要的,主要的是对Class 文件有点儿爱不释手,恨不得把所有动作全变成方法写进Class里面.实际帧中的代码已经很少,而且路径运用较少,因为类中属性直接指向路径.忽地想起很 久没用_root,怪是想念.
    第六层,无代码境界.此时发现代码已经碍手碍脚,开始向往无代码的傻瓜操作,于是把相关功能封装成类,相关效果封装成组件,只需改改属性值就可以使用.把痛苦留给最初,组件写好后就前途一片光明了.
    第七层,后代码境界.此时对OOP思想已有深入了解,时间轴早已荒废许久,兴趣不再是做做Flash效果,开始扩展到相关领域.也学会用JSFL偷懒,Flash做前台,XXX做后台,通过若干API连接,已经把Flash应用远远超越其本身.
    第八层,神的境界.Flash之父莫敢说达此境界.学无止境,抑或尚未达此境界时,Flash已然淘汰.

******************************************************

    Copied from 江瑶Blog. I like this blog very much btw. Very informative, frequently updated.

    Anyway, I am at level 1 @ the year of 2002-2003. Just a little kid in this area. At year 2004~2006 I kinda upgraded to level 2, and did several flash clips for friends and hall events. In March 2007 I found my current job in Learning Edvantage, and did 1.5k lines of AS code on my first project (total naive coding). That is when I reached the 3rd level. Spending 3 month in this company, I jumped to level 5. And studied how to write components, though soon found out that it’s not really practical on my work-ground.

    Slacking for another 2 month and studying php-mySQL and mainly ASP.NET+MSSQL.

    Now most of the time doing crappy work, at the same time exploring level 7.

    学无止境。

   

written by admin \\ tags: , ,

Jul 10
_global.queryload = function(clip, intervalname) {
	clip.bytes_loaded = Math.round(clip.getBytesLoaded());
	clip.bytes_total = Math.round(clip.getBytesTotal());
	trace(clip.bytes_loaded + " / " + clip.bytes_total);
	if ( clip.bytes_loaded == clip.bytes_total ) {
		trace("done");
		trace(_root[intervalname]);
		clearInterval(_root[intervalname]);
	}
}
// To check internally, call it this way:
// preloader = setInterval(queryload, 500, this, "preloader"); 
// To check externally, call it this way:
// container.loadMovie("catnap.jpg");
// preloader = setInterval(queryload, 500, container, "preloader");

from

*************************************************************

A smart way to do the preloading in flash, quite useful.

written by admin \\ tags: , ,