theflashbum / fcss

Flash Cascading StyleSheet Library
fcss.flashartofwar.com
83 stars 13 forks source link

AbstractOrderedObject.as bug and optimisation #7

Open jeromedecoster opened 14 years ago

jeromedecoster commented 14 years ago

Hello,

I think the $deleteProperty doesn't work: http://github.com/theflashbum/fcss/blob/master/src/com/flashartofwar/fcss/objects/AbstractOrderedObject.as#L117

I suggest you : flash_proxy override function $deleteProperty(name:*):Boolean { var s:String = name; var has:Boolean = properties.hasOwnProperty(s); if (has) { delete properties[s]; propertiesIndex.splice(propertiesIndex.indexOf(s), 1); } return has; }

//

The setProperty method can be optimize: http://github.com/theflashbum/fcss/blob/master/src/com/flashartofwar/fcss/objects/AbstractOrderedObject.as#L133

I suggest you : flashproxy override function setProperty(name:, value:_):void { var s:String = name; if (!properties.hasOwnProperty(s)) propertiesIndex[propertiesIndex.length] = s;

properties[s] = value;

}

//

The nextName and nextValue method can be optimize too: http://github.com/theflashbum/fcss/blob/master/src/com/flashartofwar/fcss/objects/AbstractOrderedObject.as#L202

I suggest to use "int" : flash_proxy override function nextValue(index:int):* { return properties[propertiesIndex[int(index - 1)]]; }

Bye !