This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2818fa8  tour-de-jewel: fix ToggleButtonBar examples for the new 
behavior
2818fa8 is described below

commit 2818fa808ccfe8512d4282680f9bb80c1fde7a4f
Author: Carlos Rovira <[email protected]>
AuthorDate: Sun Feb 14 11:31:50 2021 +0100

    tour-de-jewel: fix ToggleButtonBar examples for the new behavior
---
 examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml 
b/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 82e6d45..686be8c 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -175,8 +175,10 @@ limitations under the License.
 
                        public function tbbChangeHandler(event:Event):void
                        {
-                               var selected:Boolean = 
(event.target.getElementAt(event.target.selectedIndex) as ISelectable).selected;
-                               tbb_label.text = 
event.target.selectedItem.label + ' (icon: ' + event.target.selectedItem.icon + 
'). isSelected? ' + selected;
+                               if(event.target.selectedIndex != -1) {
+                                       var selected:Boolean = 
(event.target.getElementAt(event.target.selectedIndex) as ISelectable).selected;
+                                       tbb_label.text = 
event.target.selectedItem.label + ' (icon: ' + event.target.selectedItem.icon + 
'). isSelected? ' + selected;
+                               }
                        }
                ]]>
        </fx:Script>

Reply via email to