I am using the MultiTopicConsumer with Blaze.
I have had problems with removeSubscription, it gives me an error when
I remove the last subtopic in the array of subscriptions. It works OK
if any other subtopic is removed.
I tracked down the problem to the actual Adobe Class
MultiTopicConsumer and method removeSubscription.
The code removes the subtopic, but then does a check afterwards to see
if it is ttrying to remove a subtopic that does not exist. But when it
is the last subtopic, it always fails.
Does anybody have a work around?
This is the method from Adobe Class MultiTopicConsumer:
public function removeSubscription(subtopic:String = null,
selector:String = null):void
{
for (var i:int = 0; i < subscriptions.length; i++)
{
var si:SubscriptionInfo =
SubscriptionInfo(subscriptions.getItemAt(i));
if (si.subtopic == subtopic && si.selector == selector)
{
subscriptions.removeItemAt(i);
break;
}
}
if (i == subscriptions.length)
throw new MessagingError("Attempt to remove a subscription
with subtopic: " +
subtopic + " and selector: " + selector + " that this
consumer does not have");
}
The problem is the if (i == subscriptions.length), which always is
true because it has just been removed.
Andrew