3 Replies Latest reply on Oct 17, 2007 1:20 PM by ChristopherCesarz

    Need help with repeater

      I have need to display a column of image that the name is returned from a CFC as a array. I can populate the accoridain and appropriate panel just fine. What I am having a problem with is when I roll over the image I want to change the source of another image to use the same image name. I am including my code below. I appreciate any help.

      private function setLargeImage():void
      imgLargeVehicle.source = "/images/" + acShowroom.selectedChild.label + "/large_image/lg_" + lbImageName.text;

      <mx:Accordion x="111" y="176" width="190" height="370" id="acShowroom" creationComplete="initShowroom();" change="getShowroomModels();" fontFamily="Arial" fontSize="14" fontWeight="bold" color="#FFFFFF" backgroundAlpha="0.85" backgroundColor="#CCCCCC" borderThickness="2" themeColor="#515151" cornerRadius="0" fillAlphas="[0.5, 1.0]" fillColors="[#6C6C6C, #6C6C6C]" borderColor="#3B3B3B" borderStyle="outset">
      <mx:Canvas label="Ford" width="100%" height="100%" themeColor="#000000" id="acFord">
      <mx:Panel id="plFordVehicles" paddingBottom="1" paddingLeft="1" paddingRight="1" paddingTop="1">
      <mx:Repeater id="rptFordVehicles" dataProvider="{qryInventory.getDistinctShowroom.lastResult}">
      <mx:Label id="lbImageName" text="{rptFordVehicles.currentItem}" fontFamily="arial" color="black"/>
      <mx:Image id="imgThumb" source="/images/showroom/{acShowroom.selectedChild.label}/thumbs/{rptFordVehicles.current Item}" mouseOver="setLargeImage();"/>
        • 1. Re: Need help with repeater

          private function setLargeImage(e:Event):void
          imgLargeVehicle.source = "/images/" + e.target.id + "....

          I hope this helps.

          Ford is #1!
          • 2. Re: Need help with repeater
            mattf2007 Level 1
            Thanks Christopher but I found the answer a few minutes ago myself Here is what worked for me:

            private function setLargeImage(name:String):void
            imgLargeVehicle.source = "/images/showroom/" + acShowroom.selectedChild.label + "/large_image/lg_" + name;

            <mx:Repeater id="rptFordVehicles" dataProvider="{qryInventory.getDistinctShowroom.lastResult}">
            <mx:Image id="imgThumb" source="/images/showroom/{acShowroom.selectedChild.label}/thumbs/{rptFordVehicles.current Item}" name="{rptFordVehicles.currentItem}" mouseOver="setLargeImage(event.currentTarget.getRepeaterItem());"/>
            • 3. Re: Need help with repeater
              ChristopherCesarz Level 1
              So that works, too. Awesome.

              I love Ford vehicles! I used to do Ford tech support.

              Good luck!