selectedChild is a container, not a string

 

if you have a container id="addCustoner" you want to type the param as
container

 

________________________________

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> 

 

Reply via email to