adobe昨天公布的rc4,咱就迫不及待地用了,结果发现一个bug,这个在rc2中没有。

flash.net.NetStream,在使用seek(offset:Number)进行跳转后立刻togglePause()来暂停流(假设当前状态是播放),读取流的time属性并没有更新到offset。在rc2中确实更新正确了。

预加载有很多种,dom预加载、iframe预加载、ajax预加载等等。但是有另外一种简洁安全的做法:

  • 对ie使用Image来预加载内容
  • 其它浏览器使用动态的object标签

例如:

window.onload = function () {

    var i = 0,
        max = 0,
        o = null,

        // list of stuff to preload
        preload = [
            'http://tools.w3clubs.com/pagr2/.sleep.expires.png',
            'http://tools.w3clubs.com/pagr2/.sleep.expires.js',
            'http://tools.w3clubs.com/pagr2/.sleep.expires.css'
        ],
        isIE = navigator.appName.indexOf('Microsoft') === 0;

    for (i = 0, max = preload.length; i < max; i += 1) {

        if (isIE) {
            new Image().src = preload[i];
            continue;
        }
        o = document.createElement('object');
        o.data = preload[i];

        // IE stuff, otherwise 0x0 is OK
        //o.width = 1;
        //o.height = 1;
        //o.style.visibility = "hidden";
        //o.type = "text/plain"; // IE
        o.width  = 0;
        o.height = 0;

        // only FF appends to the head
        // all others require body
        document.body.appendChild(o);
    }

};

四月 29th, 2010

最近在练口琴

No Comments, 其它, by army.

年前玩了空之轨迹后突然想起来学口琴,大概自己的几大爱好中就差了门艺术吧,于是乎就练起来了。起初尝试布鲁斯,后来因为压音实在太过苦恼(不是不会,其实我学会了压音了已经),后来转战半音阶,而且半音阶口琴也比较适合动漫、流行等音乐主奏。

目前所有学习后的曲目都放在http://www.tudou.com/home/army8735#tui-tab_0这里,可以感觉得到每支新曲子都是有进步的。要吹的还很多,大家有任何喜欢的歌或者建议都可以留下来,我一个个去试~

四月 19th, 2010

土豆映像节颁奖典礼

4 Comments, 前端开发, by army.

http://www.tudou.com/programs/view/fL3GI1M-huc

从2月开始接手第2期到现在,终于在高潮后走到尾声了。

四月 6th, 2010

土豆rss主页

No Comments, 前端开发, by army.

冒充了一回设计,我那水平也只能这样了:

http://rss.tudou.com/