I am using the whiteboard custom shapes example. I want to add to the WB toolbar to clear the whiteboard (possiby adding a permission level). Here is the code a I am adding:
var clearShape:WBShapeToolBarDescriptor = new WBShapeToolBarDescriptor(WBShapeToolBarDescriptor.COMMAND);
clearShape.toolTip =
"Clear Whiteboard";
clearShape.command =
"removeAllShapes";
clearShape.icon = CLEAR_IMAGE;
toolBar.addCustomShapeToToolBar(clearShape);
Is there a command to clear the WB? How can I implement this?
Thank you.
Views
Replies
Total Likes
hi,
Listen for event WBToolBarEvent.TOOL_BAR_CLICK,
so it should be like
toolBar.addEventListener(WBToolBarEvent.TOOL_BAR_CLICK, clearAllShapes)
protected function clearAllShapes(p_evt:WBToolBarEvent):void
{
if (p_evt.data.command == "removeAllShapes") {
sharedWBModel.removeAllShapes();
}
}
Thanks
Arun
Views
Replies
Total Likes
I keep getting the error:
*1046: Type was not found or was not a compile-time constant:
WBToolBarEvent.*
at:
*protected function clearAllShapes(p_evt:WBToolBarEvent):void
*
Views
Replies
Total Likes
Hi,
Can you check the import statement of WBToolBarEvent. I found that the Flex builder for some reason was putting the wrong import statement [import com.adobe.rtc.events WBToolBarEvent;]
The right one is
import com.adobe.coreUI.events.WBToolBarEvent;
Thanks
Arun
Views
Replies
Total Likes
Hi,
Thank you for the fast response. I changed the import and the error is
now in:
protected function clearAllShapes(p_evt:WBToolBarEvent):*void
*
{
if (p_evt.data.command == "removeAllShapes")
{
sharedWB.model.removeAllShapes()
}
}
p_evt.data.command - Undefined property - data.
Thanks,
S
Views
Replies
Total Likes
Sorry, it should have been p_evt.item.command, please do let me know if it works.
Thanks
Arun
Views
Replies
Total Likes
Yes, it works fine.
Thank you, Arun.
Views
Replies
Total Likes
Views
Likes
Replies