Badcreature / mad-components

Automatically exported from code.google.com/p/mad-components
0 stars 0 forks source link

Index out of range error in segmented control #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Use the following code:

var TEST_DATA:XML = <data><units label="1"/><units label="2"/><units 
label="3"/></data>;
var attributes:Attributes = new Attributes(0,0,250,40);
attributes.parse(<style background="#FFFFFF,#0055FF"/>);            
var UnitSelector:UISegmentedControl = new UISegmentedControl(this, TEST_DATA, 
attributes);

What is the expected output? What do you see instead?

RangeError: Error #1125: The index 1 is out of range 0.
    at com.danielfreeman.extendedMadness::UISegmentedControl/showPressed()[/Users/danielfreeman/Documents/Adobe Flash Builder 4/ExtendedMadnessLib/src/com/danielfreeman/extendedMadness/UISegmentedControl.as:163]
    at com.danielfreeman.extendedMadness::UISegmentedControl/set index()[/Users/danielfreeman/Documents/Adobe Flash Builder 4/ExtendedMadnessLib/src/com/danielfreeman/extendedMadness/UISegmentedControl.as:87]
    at com.danielfreeman.extendedMadness::UISegmentedControl()[/Users/danielfreeman/Documents/Adobe Flash Builder 4/ExtendedMadnessLib/src/com/danielfreeman/extendedMadness/UISegmentedControl.as:76]

What version of the product are you using? On what operating system?
ExtendedMadnessLib_0_1_2.swc
ExtendedMadnessLib_0_1_1.swc
ExtendedMadnessLib_0_1_0.swc

Please provide any additional information below.
Does not occur in ExtendedMadnessLib_0_0_9.swc

Original issue reported on code.google.com by gmcdon...@rdr.id.au on 20 Feb 2012 at 9:30

GoogleCodeExporter commented 8 years ago
Is there any known workarounds to this?

Original comment by gmcdon...@rdr.id.au on 28 Feb 2012 at 7:59

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You just need to wrap the data inside another html tag:

<segC><data><units label="1"/><units label="2"/><units label="3"/></data></segC>

Original comment by doc.andr...@gmail.com on 2 Mar 2012 at 4:34

GoogleCodeExporter commented 8 years ago
That got rid of the error in 0_1_3, but now I find that setting the .index 
property of the UISegmentedControl does not highlight the selected item 
anymore, or fire the Event.CHANGE event for the control. This also used to work 
in 0_0_9.

Has something else changed?

Original comment by gmcdon...@rdr.id.au on 2 Mar 2012 at 11:46