I didn't look at your code yet, but it looks like you're missing:
navItemFactory = new ClassFactory(MultilineButton);
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Kevin
Sent: Sunday, August 10, 2008 11:19 AM
To: [email protected]
Subject: [flexcoders] Multi-button ToggleButtonBar
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 comme! nt 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