I am building a Flex application that utilizes SWFAddress. Whenever I update the hijacked URL via SWFAddress' SWFAddress.setValue() method, I notice it causes the SWFAddressEvent.CHANGE event to dispatch, causing my page to go through its update cycle again.

Is there a method within SWFAddress to "silently" update the hijacked URL, such that the SWFAddressEvent.CHANGE event is not dispatched?

The only way around this that I can think of right now is to remove the event listener, change the URL, then add it back. But that seems... really... inefficient. Any ideas?

Thank you for your time.

有帮助吗?

解决方案

Hey just checked out the source code, there's nothing in there that lets you block the event, if it's a new value then the event is dispatched (it looks like it skips doing this during init but in all other cases if the change occurs it's dispatched). You can modify the source since it's available and add your own boolean to SWFAddress to stop it from dispatching the event, otherwise like you already said removing/adding the listener is an option, if it's only one object having the listener added/removed I don't think performance would be impacted.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top