Expand my Community achievements bar.

Factory does not exist - WBCanvas

Avatar

Level 2

Okay, I have tried to replicate WBArrowShape, WBArrowShapeDescriptor and WBArrowShapeFactory as a duplicate... i.e.

WBArrowShape_red, WBArrowShapeDescriptor_red and WBArrowShapeFactory_red, only to find it does not recognise this new factory?

*** Factory does not exist in WBCanvas - and returns function ***

3 Replies

Avatar

Level 2

Opening up WBCanvas, you can see there is a var factory:IWShapeFactory = _registeredFactories[p_desc.factoryID] as IWBShapeFactory;

All seems to hinder on _registeredFactories object, but if p_desc.factoryID exist and is placed inside the object of _registeredFactories and is returned as null, what does this mean??

Avatar

Employee

Hi James,

Can you eloborate on what you meant by placed inside _registeredFactories and returned null.

Just to clarify, a shape can have a facoryId, but it must be registered with the WhiteBoard before you draw the shape.

thanks

arun

Avatar

Level 2

Okay, on the drawShape function inside WBCanvas, this is where my code seems

to stop working. In fact, it breaks at this line...

var factory:IWBShapeFactory = registeredFactories[pdesc.factoryID] as

IWBShapeFactory;

if (!factory)

{

trace("2.1 Factory does not exist");

return; <<<< breaks here and returns that factory does not exist :/

}

Perhaps this is where the syncing comes in handy?

James