Expand my Community achievements bar.

error on getRepeaterItem

Avatar

Level 1
Hi.

I'm still very new in this whole flex/actionscript
environment.

I'm using the repeater to show records read from XML, and on
click of an image in the repeater loop,

I want to go to another state to update the particular item.

I've been using chunks of code from examples, but obviously
doing somthing wrong when trying to piece them together, as theres
not always the exact examples you're looking for.

This is the error I'm getting:

ReferenceError: Error #1069: Property getRepeaterItem not
found on mx.core.FlexLoader and there is no default value.

Any assistance would be greatly appreciated.

2 Replies

Avatar

Former Community Member
Need to see some simplified sample code displaying the error.
Maybe need to cast in event listener, just a shot in the dark. Need
that sample code.

Avatar

Level 1
Hi,

here are the relevant chunka of code....

hope it is enough and makes sense



private function getNameData(getName:MouseEvent):void

{

currentState='BrokerUpd';



var getd:Object = getName.target.getRepeaterItem();

brkName0.text=getd.name;



}

.

.

.

.

.

<mx:HTTPService id="brkrData" url="brokers.xml" />

.

.

.

.

.







<mx:State name="Brokers">



<mx:AddChild position="lastChild">



<mx:Panel x="228" y="102" width="636" height="227"
layout="absolute" title="Brokers" id="panel2">

<mx:VBox>



<mx:Repeater id="brkRepeater"
dataProvider="{brkrData.lastResult.brokers.broker}">

<mx:HBox>

<mx:Label
text="{brkRepeater.currentIndex}.{brkRepeater.currentItem.name}"
width="168" id="brkrname1"/>

<mx:Image source="../img/edit.png" id="edtBrkr"
mouseDown="getNameData(event)"/>

<mx:Image source="../img/del.PNG"/>



<mx:Button x="54" y="155" label="clients" fontSize="9"
borderColor="#1636AC"/>

<mx:Button x="54" y="155" label="policies" fontSize="9"
borderColor="#1636AC"/>

<mx:Button x="362" y="0" label="claims" fontSize="9"
borderColor="#1636AC"/>

</mx:HBox>

</mx:Repeater>



</mx:VBox>



</mx:Panel>

</mx:AddChild>



<mx:SetProperty target="{panel1}" name="height"
value="227"/>

<mx:SetProperty target="{image1}" name="x"
value="321"/>

<mx:SetProperty target="{image1}" name="width"
value="192"/>

<mx:SetProperty target="{clients1}" name="width"
value="117"/>

<mx:SetProperty target="{brkrs1}" name="width"
value="117"/>

<mx:SetProperty target="{panel1}" name="width"
value="210"/>

</mx:State>