It's because selectedChild takes a Container, not a String. Just change the type in your method declaration to:
public function switchStack(stack_id:Container,title:String):void { When you call it, you are passing in a Container, so it should be fine. -Ryan ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of George Georgiou Sent: Saturday, October 13, 2007 4:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] 1067: Implicit coercion of a value of type String to an unrelated type mx.core:Container. 1067: Implicit coercion of a value of type String to an unrelated type mx.core:Container. I really don't understand what's wrong and what this error mean. Error points to the highlighted line. Any help/tips? Thanks!! Here is my code: <mx:Script> <![CDATA[ [Bindable] private var panelTitle:String; public function switchStack(stack_id:String,title:String):void { mainStack.selectedChild = stack_id; panelTitle = title; } ]]> </mx:Script> <mx:ApplicationControlBar id="appMenu" dock="true"> <mx:Button id="addCustomerButton" label="Add Customer" click="switchStack(addCustomer,'Add Customer');"/> <mx:Button id="viewCustomersButton" label="View Customers" click="switchStack(viewCustomers,'View Customers');"/> <mx:Button id="addInvoiceButton" label="Add Invoice" click="switchStack(addInvoice,'Add Invoice');"/> <mx:Button id="viewInvoicesButton" label="View Invoices" click="switchStack(viewInvoices,'View Invoices');"/> <mx:Button id="receivePaymentButton" label="Receive Payment" click="switchStack(receivePayment,'Receive Payments');"/> <mx:Button id="addCreditNoteButton" label="Add Credit Note" click="switchStack(addCreditNote,'Add Credit Notes');"/> <mx:Spacer width="100%" /> <mx:Button label="About"/> </mx:ApplicationControlBar>