
|
If you were logged in you would be able to see more operations.
|
|
|
Parsley Core
Created: 19/Jan/10 12:08 AM
Updated: 03/Jan/11 04:27 AM
|
|
| Component/s: |
Messaging
|
| Affects Version/s: |
2.2.0
|
| Fix Version/s: |
2.2.0
|
|
|
I've played with some MessageHandlers and found that if you specify order as follow
[MessageHandler(order="999")]
public function handler1(msg:Message):void
{
...
}
[MessageHandler(order="1900")]
public function handler2(msg:Message):void
{
...
}
than call order is 1900,999. This corresponds to flash array sortOn behaviour because by default Array sort occurs using string representation of field. You use this code
function Processor (receivers:Array, handler:Function, async:Boolean = true, handleErrors:Boolean = true) {
this.receivers = receivers;
this.handler = handler;
this.async = async;
this.handleErrors = handleErrors;
receivers.sortOn("order");
}
in org.spicefactory.parsley.core.messaging.impl.Processor class.
But order field is the numeric one, so you probably should use
receivers.sortOn("order", Array.NUMERIC);
This affects all places of code there you use such sorting.
|
|
Description
|
I've played with some MessageHandlers and found that if you specify order as follow
[MessageHandler(order="999")]
public function handler1(msg:Message):void
{
...
}
[MessageHandler(order="1900")]
public function handler2(msg:Message):void
{
...
}
than call order is 1900,999. This corresponds to flash array sortOn behaviour because by default Array sort occurs using string representation of field. You use this code
function Processor (receivers:Array, handler:Function, async:Boolean = true, handleErrors:Boolean = true) {
this.receivers = receivers;
this.handler = handler;
this.async = async;
this.handleErrors = handleErrors;
receivers.sortOn("order");
}
in org.spicefactory.parsley.core.messaging.impl.Processor class.
But order field is the numeric one, so you probably should use
receivers.sortOn("order", Array.NUMERIC);
This affects all places of code there you use such sorting. |
Show » |
|