ActionScript 3.0 :: Capture Item You Rollover In A List?
Feb 11, 2008How you get the target of what item is being rolled over in a list component.
I have tried e.target.item.data but with no luck? I used the ListEvent.item_clicked.
How you get the target of what item is being rolled over in a list component.
I have tried e.target.item.data but with no luck? I used the ListEvent.item_clicked.
The following code almost works, but the list item doesn't change until I scroll the list:
ActionScript Code:
import fl.events.ListEvent;
scrollList.addEventListener(ListEvent.ITEM_ROLL_OVER, hoverHandler);
[code]....
I am trying to get the index of an item in a List object on a mouse roll over event (please keep in mind this is not the selectedIndex I need). Heres the code I am currently using:
list.addEventListener(ListEvent.ITEM_ROLL_OVER, onItemRollOver);
function onItemRollOver(e:Event):void {
var itemInfo:Number = 0;
/*This is where I need the Index Number of Item being Rolled over instead of Selected Item*/
itemInfo = list.selectedIndex;
txt_Display.text = 'Item Index #: ' + itemInfo;
play();
}
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]...
I want to be able to select an item from my list component and fire a function directly related to selecting that item. list is called "tidlist" function is "selecttid(n)" the "n" needs to be replaced with the index number... so if run my swf and the list component displays my items... when i select one (the third one for example)... i want to fire "selectTid(3)".... cant seem to grasp.
View 1 RepliesI want to be able to select an item from my list component and fire a function directly related to selecting that item.
list is called "tidlist"
function is "selecttid(n)"
the "n" needs to be replaced with the index number... so if run my swf and the list component displays my items... when i select an item (the third one for example)... i want to fire "selectTid(3)".... cant seem to grasp.
Creating a dynamic list and associating a picture with each list item. i need the list to be scrollable, and i want the list and it's associated picture to be displayed randomly when the application is re-launched. i.e it doesnt show the same list everytime.
I also what to be able to sort the displayed list items. e.g if the list items is about restaurants, i want users to be able to sort the displayed items by either; district, cusine type and gastro type.
I want to add a SimpleButton to a list item in a list component. I am getting the CellRenderer for the list item I want and using the addChild method to add the simple button. The button appears in the right spot on the list item but it doesn't function like a button. It's like the contents of the buttons first frame is added to the CellRenderer and nothing else.
View 1 RepliesI am using flash standard combobox in my application, and want to add rollover color to my dropdown items. how can I change the rollover color.
View 2 RepliesI have a big problem with my flash menu and the hittest function.I want to show a 'popup' window on menu item rollover (and i did it!).But I have a rollover problem passing through other items because of hittest areas are colliding.I attach a .fla file for example...Try to pass from 'voice1' to 'voice 2'...voice 1 windows remain shown.
View 5 RepliesI try to list add the icon used the additem function but it just can display the lable name that icon function didn't work. I convert the icon type movie clip , shape and icon that still can't dispaly in the list. Actually, I want dynamic list let user choose the icon.
View 2 RepliesNot sure if you guys remember flash paper or not, but basically I am trying to clone it in AS3. The layout anyway, not the actual conversion. I have my PDF pages and SWF format and I have them loading into a tile list. I want to get the Y value of each item in the tile list so I can make a page browser.
View 2 Replieslist component in flash cs3.
assume that i have 5 items in my list and i want to disable 3,4,5 items from mylist box. how to do this?
item 1 -- enabled state
item 2 -- enabled state
item 3 -- disabled state
item 4 -- disabled state
item 5 -- disabled state
using flash cs3, i want to achieve this
This is my first time working with a class attached to a movieclip that is nested inside a class attached to a movie clip.I've tested all the properties and methods of PTListItem.as and they work properly but when I try to call them on the list item through PTListTop.as it returns undefined.The end goal is to dynamically load a checklist via a txt file.
View 1 Repliesassume that i have 5 items in my list and i want to disable 3,4,5 items from mylist box. how to do this ??
item 1 -- enabled state
item 2 -- enabled state
item 3 -- disabled state
[code].....
I'm looking for a way to disable a specific item within a List component. I had thought there would be something along the lines of myList.listItems[3].enabled = false like you find in many other GUI type languages, but I can find no documentation of this in Flash AS3. What confuses me is that there is Disabled_skin and Selected_disabled in the Cell Renderer skins, so obviously it's something that has been catered for - unless I've misunderstood the use.
View 4 Repliesassume that i have 5 items in my list and i want to disable 3,4,5 items from mylist box. how to do this ??
item 1 -- enabled state
item 2 -- enabled state
item 3 -- disabled state
item 4 -- disabled state
item 5 -- disabled state
using flash cs3, i want to achieve this , how to do this?
I have an AS file which contains all of the code for a main menu. This code loads another AS file which initializes code for the general items that will be on the stage throughout the whole flash. But when I initialize the code for one of the menu items after it's clicked I don't know how to get 2 of the items from the stage elements code to be on top of the display list. Because, as the code for the menu item loads the two stage elements are going to cover the items from that code and after its loaded its going to open up and show them the items that are loaded from the menu item code.
View 4 RepliesI have a screen which is essentially an address screen. Amongst other fields. there are two fields on the screen which are used to enter the region of the user. One is a combo box, the other is a plain text field.
After the user selects their country from a drop down list, if that country has a list of regions associated with it, a Combobox is populated and displayed, with the text field being hidden. If there are no regions associated with the country then the combobox is hidden and the text field is displayed:
[Code]...
I have two spark lists and want to drag items from one list to the other. When im dragging an item and over the other list item, i want the target item to change the background coloer.Basically instead of showing the black line indicating that I will drop between elements, I want to see the target item highlight.
View 1 RepliesI have a list of objects containing an icon, a label, and a tooltip. I want to show only the icon and the label. The tooltips should be visible on mouse over an item.
Is there a way i can achieve this without writing my own mouse-over/out functions?
(notice that dataTips are a different thing as they are displayed only when the label is cut)
I have a List with an item renderer and would like to enable drag-and-drop onto the items in the list, rather than adding the data to the list. Is it possible to find the item that is being hovered over when dragging?
View 1 RepliesHow do I wordwrap in a spark list w/ an itemrenderer? This posting at[URL] works 100% but when I try to set a separate item renderer, I can't get the word wrapping...instead, I get an ugly horizontal scroll bar. HEre is my mxml:
[Code].....
When would you want to use removeAll() vs just new ArrayCollection when you want to clear an array collection. Remove all iterates though each item in the list. I can't see a case when I would want to use it.
View 1 RepliesI have a List with textInput as itemrenderer. Initially the list is loaded with data from a data provider. However since the items are rendered in textInputs, I have the ability to change the value of a particular item.
But when trying to access the value of the changed item using the function below, I still get the old value in my trace:
private function addItem(event:Event):void {
trace(myDataProvider.getItemAt(myList.selectedIndex).label);
}
what I need to do for the new value to be available. My itemrenderer is shown below:
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
i m trying to insert new item on sharepoint list from flex using sharepoint-as3-connector
[Code]...
I'm having a problem with getting the value of an item that the user selects in my mobile Flex application. When I select an item from the list I place that item into an ArrayCollection. But when I check the value (trace()), the value is [object Object] and I can't seem to access the actual value of the object. Here is what I am doing:
private var selectedPlayers:ArrayCollection = new ArrayCollection();
private var numOfPlayers:int;
...
//check if item is not already in selected players list
[code]....
I am using the combobox to make a drop down list. I want to make the text of one of the items in the list bold. I have searched and found how to set the whole list bold but cant find a way to set it on a item by item basis.
View 0 RepliesIs there any way to tell which item a user selects from a List? I already have a "change" event listener, but that doesn't tell me WHICH item was clicked (at least, I don't think it does.)
[edit: forgot the XML part...the list is generated from an xml file:]
Code:
<?xml version="1.0" ?>
<songs>
<song display="Hallelujah Chorus: A Soulful Celebration" url="001.mp3">
[Code]....
The reason I need to know which song I'm on is so I can reference the <composer> child tag for the correct song.
Is it possible to have 4 list boxes but only let the user select one item from all four list boxes? If so how?
[Code]...