In Flex 3, using Flex Builder, I have been trying to extend the
ToggleButtonBar to allow multi-line buttons. I have used the multi-line
button code from Alex Harui's blog to create individual multi-line
buttons, but I have had no luck in applying this to the ToggleButtonBar.
My thought was to override the ToggleButtonBar, replacing the regular
button with Alex's version. When I do this, I get the following
error:
TypeError: Error #1034: Type Coercion failed: cannot convert
mx.controls.buttonBarClasses::[EMAIL PROTECTED] to
com.company.gst.view.multiLineButton.MultilineButton
at com.company.gst.view.multiLineButton::ToggleButtonBarML/
createNavItem()[C:\inetpub\wwwroot\multilinebutton\src\com\company\gst
\view\multiLineButton\ToggleButtonBarML.as:31]
This error points to the line I've added the comment to below.
override protected function createNavItem(label:String,
icon:Class = null):IFlexDisplayObject
{
//Next is the line causing the error
var b:MultilineButton
=MultilineButton(super.createNavItem(label, icon));
b.toggle = true;
return b;
}
I'll appreciate any suggestions regarding how to fix this, or a
better way to approach the original problem.
I have a zipped version of the project here:
www.frontlinewebdev.com/flex/multilinetbb.zip
<http://www.frontlinewebdev.com/flex/multilinetbb.zip>
Thanks,
Kevin