I receive the following error message for the lines that contain a linkbutton:

1119: Access of possibly undefined property CurrentState through a reference 
with static 
type EComm.

The following is the source code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
        <mx:states>
                <mx:State name="cartView">
                        <mx:SetProperty target="{products}" name="width" 
value="0"/>
                        <mx:SetProperty target="{products}" name="height" 
value="0"/>
                        <mx:SetProperty target="{cartBox}" name="width" 
value="100%"/>
                        <mx:AddChild relativeTo="{cartBox}" 
position="lastChild">
                                <mx:DataGrid id="dgDataGrid" width="100%">
                                        <mx:columns>
                                                <mx:DataGridColumn 
headerText="Column 1" 
dataField="col1"/>
                                                <mx:DataGridColumn 
headerText="Column 2" 
dataField="col2"/>
                                                <mx:DataGridColumn 
headerText="Column 3" 
dataField="col3"/>
                                        </mx:columns>
                                </mx:DataGrid>
                        </mx:AddChild>
                        <mx:RemoveChild target="{lbtnViewCart}"/>
                        <mx:AddChild relativeTo="{cartBox}" 
position="lastChild">
                                <mx:LinkButton label="Continue Shopping" 
click="this.CurrentState=''" id="lbtnContShop"/>
                        </mx:AddChild>
                </mx:State>
        </mx:states>
        <mx:ApplicationControlBar dock="true" width="100%" height="90">
                <mx:Canvas width="100%" height="90">
                        <mx:Label x="0" y="10" text="Flex"/>
                        <mx:Label x="0" y="41" text="GROCER"/>
                        <mx:Button label="View Cart" id="btnViewCart" 
right="90"/>
                        <mx:Button label="Checkout" id="btnCheckout" 
right="10"/>
                </mx:Canvas>
        </mx:ApplicationControlBar>
        <mx:Label text="(c) 2007, FlexGrocer" right="10" bottom="10"/>
        <mx:HBox x="0" y="0" width="100%" height="100%" id="bodyBox">
                <mx:VBox width="100%" height="100%" id="products">
                        <mx:Label text="Milk" id="prodName"/>
                        <mx:Label text="$1.99" id="price"/>
                        <mx:Button label="Add To Cart" id="add"/>
                </mx:VBox>
                <mx:VBox height="100%" id="cartBox">
                        <mx:Label text="Your Cart Total: $"/>
                        <mx:LinkButton label="View Cart" 
click="this.CurrentState='cartView'" 
id="lbtnViewCart"/>
                </mx:VBox>
        </mx:HBox>
</mx:Application>


-- In flexcoders@yahoogroups.com, "Weldon MacDonald" <[EMAIL PROTECTED]> wrote:
>
> What exactly is the problem, I did those examples and they worked perfectly.
> 
> On 1/25/07, primemate10 <[EMAIL PROTECTED]> wrote:
> >
> >   Could anyone assist me with a section of the "Training from the Source
> > book on Adobe Flex"?
> >
> > Specifically, the section "Working with View States" (pages 52-56)
> > just doesn't work as expected. I did the example over third times
> > without any success.
> >
> > Any assistance that anyone can provide will be greatly appreciated.
> >
> >  
> >
>

Reply via email to