Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   Flex (http://www.flasher.ru/forum/forumdisplay.php?f=84)
-   -   Обработка событий в компонентах Repeater (http://www.flasher.ru/forum/showthread.php?t=91976)

SVE 13.02.2007 10:48

Обработка событий в компонентах Repeater
 
Добрый день! Господа, подскажите пожалуйста, в чем моя ошибка:
есть такой код
Код:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

  <mx:Script>
    <![CDATA[
      [Bindable]
      public var myArray:Array=[1,2,3,4,5];
    ]]>
  </mx:Script>
 
  <mx:ArrayCollection id="myAC" source="{myArray}"/>
  <mx:Repeater id="list" dataProvider="{myAC}">
    <mx:HBox>
      <mx:Button id="b1" label="Click Me"
        mouseOver="l1[event.target.instanceIndices].setStyle('color', '#ffffff');"
        mouseOut="l1[event.target.instanceIndices].setStyle('color', '#000000');"/>
      <mx:Label id="l1" text="{list.currentItem}"
                      mouseOver="l1[event.target.instanceIndices].setStyle('color', '#ffffff');"
                    mouseOut="l1[event.target.instanceIndices].setStyle('color', '#000000');"/>
    </mx:HBox>
  </mx:Repeater>
</mx:Application>

Т.е. хочу чтоб при наведении курсора на объект "Label" он менял цвет.
Такой трюк проходит с кнопкой ("Button"), но не с самим "Label".. :(
Выскакивает ошибка - Error #1069: Property instanceIndices not found on mx.core.UITextField and there is no default value.
Почему?
Спасибо!

Denis.Oleynik 16.02.2007 16:39

Просто замени на
Код:

<mx:Label id="l1" text="{list.currentItem}"
    mouseOver="event.currentTarget.setStyle('color', '#ffffff');"
                    mouseOut="event.currentTarget.setStyle('color', '#000000');"
/>



Часовой пояс GMT +4, время: 04:54.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.