1/12, 91«1234»

另一种对象深度比较方法---as3实现

2011-12-7 11:00:24 开发者 抢沙发(1)

 我们要比较2个对象的内容是否相同,即深度比较的方法可以用MD5等算法实现。

以下是代码片段:

  var a:Object = new Object();

a.b = [1, 2, 3];
a.c = { };
a.c.a = ''
var b:Object = { };
b.b = [1, 2, 3];
b.c = { };
b.c.a = '';
var abytes:ByteArray = new ByteArray();
var bbytes:ByteArray = new ByteArray();
abytes.writeObject(a);
abytes.position = 0;
bbytes.writeObject(b);
bbytes.position = 0;
trace(a == b); //false
trace(abytes.toString() == bbytes.toString()) // true
trace(MD5.hashBytes(abytes) == MD5.hashBytes(bbytes)); //true

 

 

规范说明书几个词

2010-12-29 9:46:46 开发者 抢沙发(5)

 强调依次降降级

  • MUST /  MUST NOT  / REQUIRED / SHALL / SHALL NOT
  • SHOULD / SHOULD NOT / RECOMMENDED
  • MAY / OPTIONAL

 1. MUST   This word, or the terms "REQUIRED" or "SHALL", mean that the

   definition is an absolute requirement of the specification.
 
2. MUST NOT   This phrase, or the phrase "SHALL NOT", mean that the
   definition is an absolute prohibition of the specification.
 
3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.
 
4. SHOULD NOT   This phrase, or the phrase "NOT RECOMMENDED" mean that
   there may exist valid reasons in particular circumstances when the
   particular behavior is acceptable or even useful, but the full
   implications should be understood and the case carefully weighed
   before implementing any behavior described with this label.
 
5. MAY   This word, or the adjective "OPTIONAL", mean that an item is
   truly optional.  One vendor may choose to include the item because a
   particular marketplace requires it or because the vendor feels that
   it enhances the product while another vendor may omit the same item.
   An implementation which does not include a particular option MUST be
   prepared to interoperate with another implementation which does
   include the option, though perhaps with reduced functionality. In the
   same vein an implementation which does include a particular option
   MUST be prepared to interoperate with another implementation which
   does not include the option (except, of course, for the feature the
   option provides.)
 

Flash前端开发者必备工具

2010-12-13 11:59:51 开发者 抢沙发(0)

辛苦的升级

2010-7-24 12:44:27 开发者 抢沙发(0)

从3.2.15 逐步升级到 5.0.0 真受痛苦,之后的版本由于本人愚钝。。。还是无法升级至最新的isroc。。。。

 

话说最新的编辑器让我非常郁闷。。。缺少了代码的所见即所得的部分。。。。

周期

2010-6-23 22:24:53 开发者 抢沙发(0)

本周最值得关注的blog:

http://blog.kaourantin.net/  之 http://www.kaourantin.net/2010/03/timing-it-right.html 及 http://blog.kaourantin.net/?p=83

受影响的 API和类:

EI   LC  Timer  EnterFrame   throw 等

新的Trine计划有待测试

1/12, 91«1234»