Expand my Community achievements bar.

Converting the WBPropertiesToolBar from raw AS to MXML

Avatar

Level 2
This isn't entirely necessary since the White Board provided
has a working properties toolbar. However in the application I am
developing I am frequently adding shapes with lots of different
object types added to the shape properties. This was starting to
add a lot of extra effort for me since every time I add a shape I
need to add code for the factory, the shape and a new properties
bar with extra property components. The current code for the
properties bar uses ActionScript for a lot of things like layout
that personally I find a lot easier in MXML. So I decided to
convert it to MXML.



The differences are functionally minor but it makes changing
the layout a whole lot easier. I changed the way a few things work
since binding is also a lot easier in MXML. Anyway you
should(!!?!?!?) be able to simply cut the code here and paste it
into a new MXML component called WBMXMLPropertiesToolBar.mxml in
the same directory structure as WBPropertiesToolBar.as
(com.adobe.coreUI.controls.whiteboardClasses.shapes). To have a
shape use the new properties toolbar you need to modify the factory
for that shape.



For instance if you wanted WBSimpleShapeFactory to use
WBMXMLPropertiesToolBar instead of its default toolbar you will
need to modify around line 46


quote:



_toolBar = new WBPropertiesToolBar();



replacing it with


quote:



_toolBar = new WBMXMLPropertiesToolBar();





Feel free to offer any pointers on my MXML :).



I hope someone finds this useful. Let me know if I broke some
functionality (It worked well for me). I'll try and post more
things like this but I am working from a now heavily branched
version of the whiteboard (which probably will hurt me when they
drop the next release).



Ves

2 Replies

Avatar

Former Community Member
Ooh, this is awesome! Can hardly wait to see what you're
doing with the whiteboard... I'm reasonably happy with it, but it
was my first attempt at this problem-set, and can think of a bunch
of design choices I would have made differently if I was to do it
again. I'm glad someone else gets to start with my experience and
build on it to make it better!



nigel

(btw, the whiteboard has a couple of little fixes, but I
think your changes should be reasonably safe).