Arrays :: Flex DropDown Selection Not Working When Search For Item?

Nov 26, 2011

so here is the problem that I have so far. I tried to simplify my code so I can attempt to figure this out, but I have had absolutely no luck. I have a viewstack that contains 1 dropdown per stack. They share the same data provider. What I want to do is to select the item contents from the first one. Once I do that, when I click a button to the next stack I have a function that searches from index 0 to the dataprovider length and if the item from the first stack matches the second one, I want to have the second dropdown pick that item up and display it. I have it matching, and I try to select it, but when I run the application it shows up like nothing is selected. Here is what I have:

edit: I got it to work for a simple example, but when I attempt to use it in my more complicated example, on that button click it for some reason resets the value of selectedIndex to -1. How do I prevent this from happening? This is working code for the simple example

[Code]...

View 1 Replies


Similar Posts:


Flex :: Get List Item Selection Working When Using A Png Mask In An Item Renderer In A 4.5 Mobile App?

Jun 10, 2011

I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.

When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.

Code:

public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;

[code]...

View 1 Replies

Flex :: Select Item In Details Form Dropdown When Datagrid Item Is Selected

Feb 15, 2011

I have this datagrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>

[Code]....

What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).

View 1 Replies

Flex :: DropDown Event For Selection Changed?

Jul 19, 2011

Trying to add handling for when the selected item changes in a drop-down. However, the Change/Changing events are fired before the drop down panel closes. This is too soon. I need to do some handling after the drop down is closed with the new selected value.

View 1 Replies

Flex :: Keep Prompt/dummy Item In Dropdown List?

May 5, 2011

I have a dropdownlist of "Select an employee" which is optional. I need it to have "No one" at the top so that user can change back to NoOne if he' ve already chosen "John Someone".

My question is how to keep the prompt item, or add a dummy item at -1 without changing the dataprovider (I really hate adding "No one" to the original employeeList dataprovider)

[URL]

Flex 4 Drop Down List - bound with data service, how to always keep prompt or add item at index -1 programmatically

View 3 Replies

Flex :: TileList Item Selection?

Sep 1, 2009

In my TileList, I want to select the TileList items on rollover, as opposed to the click event. I already have the TileList setup to allowMultipleSelection = "true".

View 3 Replies

Flex :: Spark List Not Displaying Selection When An Item Is Removed

Aug 3, 2011

I have an issue with Spark Lists whereby I am trying to ensure that an item is always selected and ensure that the GUI displays this to the user.

The application (full code below) creates a List, a Label and a Button. The Label states what is selected in the List. The button removes the selected item. Changing the selection, updates the text in the Label. Important: The List has "requireSelection" set to true to ensure that an item is always selected.

If I select the first item in the List, the selection is correctly reflected in the label. Clicking "Remove" removes the item and the next item is selected. This is all working correctly.[code]...

View 1 Replies

Flex :: Find Out Deselected Item In Spark List With Multiple Selection

Aug 3, 2010

In a spark list I could use the change event to find out which item has been selected or deselected. The dispatched IndexChangeEvent object has the properties newIndex and oldIndex holding this information.

But with multiple selection allowed this doesn't work anymore because newIndex and oldIndex could refer to indices of still selected elements.

A solution would be to copy the selectedIndices vector to another variable and compare this variable with selectedIndices after a change in selection, but this seems to be somewhat complex.

Does anyone know if there is an easy way two get the index/item a user is deselecting while other elements are still selected?

View 2 Replies

Flex :: Unable To Select Item In Spark.components.List After De-selection

Dec 21, 2010

I have a spark List defined as:

<s:List id="symbolList" dataProvider="{symbolListCollection}" change="symbolNameChangeHandler(event)"></s:List>

With the change handler defined like this:

protected function symbolNameChangeHandler(event:IndexChangeEvent):void {
symbolList.validateProperties();
changeSymbolView(symbolList.selectedItem);
}

and symbolListCollection as an ArrayList filled with Strings.

At first, the change event works fine, and I get what I expect.

However, if I Ctrl-click on the selected item, to de-select it, i am unable to ever select an item again.

When I click on something to try to select it, the change event DOES fire, however, the ItemChangeEvent has both oldIndex and newIndex set to -1

View 1 Replies

Flex :: Spark DataGrid On Mobile Application Handle Scroll And Selection Item?

Dec 15, 2011

I have a spark datagrid on a mobile application, I set the

interactionMode="touch"

and the dataGrid scrolling is good, I got some problems adding a selectionChange eventListener to it, because scrolling the dataGrid will automatically change the selection and instead simply scrolling it, the function binded will start...

How can I add the touch dalay before select the index, so if I scroll the grid the selection won't change, and it change only if I press the item without scrolling?

View 1 Replies

AS3 :: Flex - Trigger A Search Function When Item Is Selected In Combobox?

Mar 3, 2011

I have a combobox that act as autosuggestion for a search application. Search function is getting triggered by a search button. I also want to trigger the search function either when the item in combobox is double or single clicked. Code:

[Code]..

View 2 Replies

Arrays :: Search Multidimensional Array (Flash As3) Using Another Array For Search Criteria

Sep 26, 2011

Long story short: I want to search a multidimensional array in AS3 for (in this example) the location of 6 strings - all of which are stored in another unrelared array. Long story long: Once I get the locations (in the multidimensional array) of each string, i then know where it's located, and can access other atributes of that object - so if i found the string "box3" is located in element [5] of my multidimensional array, i can now target: multiArray[5][3] to return the 4th item stored (keeping in mind we're starting from 0, so 3 is the 4th position).

I can get this to work once, but I'm trying to set up a for loop based on the length of my basic string storage array - this array holds (in this example) 6 instance name strings - each time my for loop loops, i need to run a search in my multdimensional array for the next consecutive instance name. Then, once I've located all of them (and store the results in a new temporary array) I can dig around in each location for the info I need.

[Code]...

View 3 Replies

ActionScript 2.0 :: Selected Item In A Dropdown Box?

Oct 25, 2010

I have a FlashVars in the html page "State"How do I get the code below to reflect the State that is in the html page.So if State = WA the drop down list will have WA as the item shown.This is the code for the combobox

Quote:
var listenerObject:Object = new Object();
listenerObject.change = function(evtObj:Object) {

[code].....

View 2 Replies

ActionScript 1/2 :: Current Selection Cannot Have Actions Applied To It But The Search Box Says It Have

Mar 9, 2011

And I need to edit the very script I found doing text search, just the one that cannot exist by what the editor says.Script was made in the times of Macromedia Flash 8, I use current Flash (cs5) trial.

View 2 Replies

ActionScript 3.0 :: Event Listener On Dropdown List Item

Mar 24, 2010

I'd like to display tool tips, once the user holds his mouse on an item of an opened combobox.Ifyou open the drop down list of a combo box, you'll see a list ofelements/items. Each of them can be accessed e.g. viamyCombo.getItemAt(0) .To me it seems I only get an object with adata and label property. But I think there must be more to it, becausewhen you hold your mouse over a sub-element, it'll be highlighted. Thismeans that there is some event listener on that very single item. Sohow can I do this?[code]

View 3 Replies

ActionScript 3.0 :: Dropdown Menu - Making Every Item Clicked Only Once

Apr 7, 2009

I made a drop down menu based on xml file and some simple summation after each click of the item. This drop down menu code is based on the xml driven menu. What I need is how to make every item can only be clicked once, so once clicked, it should not be able to be clicked any more.

View 2 Replies

Arrays :: Array Random Selection?

Dec 22, 2010

How can I make an array in flash as2 and from there select 12 values assigning them to twelve different variables?So far I got this:

quotes = new Array();
quotes[0] = "one";
quotes[1] = "two";

[code]....

View 2 Replies

ActionScript 3.0 :: Item Selection Via The Keyboard?

Feb 10, 2012

I have 4 items on the stage item1_mc, item2_mc, etc...they're stacked vertically with a small space between them. I wish to cycle through these items with two keys, up and down respectively...My current idea is to create an array of these items and have each press of the key add or subtract "1" from the current selection..

View 1 Replies

ActionScript 2.0 :: Combobox Won't Allow Selection Of 1st Item?

Oct 18, 2009

Like the title says I can't seem to get my combobox to allow the first item to be selected after loading.If I select any other item in the list it works fine and I can immediately come back and select the first.Seems like strange behavior but as this is my first project using the combobox I'm hoping it's something I've overlooked or just didn't realize I needed.Here is the code I'm using

Code:
comboBox.getFocus();
// Create Listener Object.

[code]......

View 1 Replies

ActionScript 3.0 :: Menu Item Selection Error?

Jun 23, 2010

I tried with some codes but I couldn't do the following in the popup1. I need to select items when I click I need change the filter effects or colors2. After selecting item in each category that filter effect won't go.

View 1 Replies

ActionScript 2.0 :: Flash8 : Search Multiple Arrays For A Value?

Feb 26, 2009

I am attempting to search multiple arrays (over 300) for a specific value which will then determine if that question is to be loaded. I have used these over the years as the quizzes simply loaded questions randomly. Now I am appempting to move this into a computer adaptive test format. I have most everything worked out except for this part which is the key to the project.

What I have is 300+ arrays like the ones below. Once a student answers a question either correctly or incorrectly a difcal value is assigned. It is that value I need to search for to determine which question to load.

For example if the student answered a question incorrectly and the difcal was calculated as -4.03 (difcal values are always in array element[0]) I would need to search the all arrays to find that value and then load that array into the question function.

Code:

var q1:Array = new Array();
q1[0] = -4.03;
q1[1] = 0.57;

[code]....

View 2 Replies

ActionScript 2.0 :: Flash8 Dropdown Menu Not Working?

Oct 6, 2009

I'm having an issue with my dropdown menu, and I know how It's not working, but not why. See, I have an mc in my menu that I have a rollOver and rollOut function on. This makes it swap between frame 1 and 2 (2 beeing the frame with dropdown). Here's the issue: When I have the rollOver/Out function on the main item, the submenu items don't do anything when clicked. But when I remove the rollOver/Out function and just go directly to frame to from start, they work.

View 1 Replies

Button Dropdown Stops Working In Timeline

Feb 23, 2010

When creating a dropdown for a button, I noticed the dropdown will stop working if the button does not run the entire length of the timeline. i.e.: if you navigate to a page that is out of that button's "range" it will stop working unless reset by returning to the root page. Nesting the problematic button in a movie, however, solves this problem...

View 3 Replies

ActionScript 2.0 :: Embedded Dropdown Menu Not Working?

Nov 8, 2004

so heres the deal i have a drop down menu that for some reason is not picking up button presses, im starting to think its because the drop down menu is within another movie clip, but its driving me nuts, any reasons why an embeded movie clip wouldnt be picking up a hitTest or a this.onRelease ??? ahh driving me nuts heres my code im using the undocumented tween class

onClipEvent(load){
//portfolio dropdown
this.onRelease = function() {

[Code].....

View 2 Replies

Flash :: Arrays - As3 Check To See If Item In Array Has Been Clicked

Jun 29, 2011

Sorry if this is a little n00b-ish. I'm working in AS3. I've got an array of 8 buttons. I'm currently hiding the button that is clicked using e.currentTarget. How can I tell flash to make all the buttons that aren't the currentTarget to become visible (i.e. if a button has been hidden by previously being clicked, how do I tell it to become visible again when another button is clicked?)

[Code]....

View 1 Replies

ActionScript 2.0 :: Comparing Arrays - See If An Item Exists In Another Array?

Jan 29, 2009

I have some script which grabs stuff from an xml file. The stuff grabbed from the xml is in a loop to create an automatic menu. This is all fine and dandy. Say there are 9 items in the xml file, I get 9 menu items with their unique id's.What I want to do is define an array for comparison against the info taken from the xml file. Say in the xml file I have nodes set up for Apple, Pear, Banana and Orange. With my current script I would get a menu with these items on it. What I need to do is be able to specify the items I want to appear on the menu. For this example I would want Apple and Banana only.

I have experimented with if statements, and it takes too much code to accomplish what I want I am sure there is a more compact way. My idea is to set an array with the items I want in it,then when the information is taken from the xml file,I need the script to do the function of creating menu items only with the items I have specified in the array. Below I have added the code, which has been modified from Kirupa's own squirrel finder tutorial.I need the code to be as reusable as possible, ie only the array would need to change.In my code the variable featureType would contain the information I need to compare against.

Code:
//set limits on the features that need to display
// define array
var featureLimits:Array = ["Apple", "Banana"];[code].....

View 1 Replies

ActionScript 2.0 :: Embedded Movieclip Actions Not Working (dropdown Type Menu)

Sep 16, 2006

I have a dropdown style menu that has some movieclip buttons inside it and when I click on the movieclips the actions aren't working.

Here is the file I'm working on. Rollover the head on the border and you'll see what I mean. [URL]

I tried searching but couldn't find any threads that answered my question about why the MC doesn't work when its embedded inside another MC.

Here is the code (first frame of root timeline) that is used for the movieclip button:

Code:
_root.odinHead_mc.videoGalleryButton_mc.onPress = function() {
_root.videoGallery_mc._visible = true;
};

View 2 Replies

ActionScript 2.0 :: Selection.setSelection() Not Working?

Jan 29, 2009

I've looked this up online under all kinds of criteria, and I can't seem to get any examples to work.I'm trying to get Flash (AS2) to select all of the text in a dynamic text field once the user focuses on that text field. Below is an example of the code:

ActionScript Code:
import mx.utils.Delegate;
class Embed extends MovieClip

[code]....

View 1 Replies

Flex :: Access TileList Item Index In A Custom Item Renderer?

Mar 4, 2011

<mx:itemRenderer>
<mx:Component>
<mx:Canvas>

[code]......

View 2 Replies

Flex :: Toggling States - When Other Item Is Selected The First Item Does Not Change Its State?

Apr 26, 2011

I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,

if(itemIndex == 0)
this.currentState="selected";

this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,

<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">

My states are like this,

<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved