List component mousewheel scrolling
hi there....I have a dynamically generated list component
however it seems scrolling with the 'mouse wheel' is not set by
default. How can I do this in AS3?
If my List component is
var newList:List = new List();
how do I set the mouse wheel scrollin?
Thanks!
Arrghh, not the right one. I am also moving the scroller bar by using a linkbar to tab the scrollbar to different positions. I need to fire an event when the scroller has reached those new positions. The FlexEvent.CHANGE_END only works when you use the scroller manually.
Similar Messages
-
Help with a vertical scroll bar issue with a List component
hi. i have a basic <s:list> that uses an XMLListCollection as it's data provider and a very basic itemrenderer. when a row in the list is clicked a function gets the list.selectedIndex then populates some text fields with more xml data. that all works fine.. the problem i have is that the vertical scroll bar on the list seems to be "clickable" - just like a row in the list. the scroll bar scrolls normally but when it's clicked the selectedIndex becomes -1 which is not helpful b/c the value -1 is passed to the XMLListCollection.
any ideas? cheers.thanks but still problematic...surely the <s:List> component shouldn't return a value when the scrollbar thumb is clicked? i created a very basic list (see below) and made the list dimensions short enough so that there is a vertical scrollbar and found that when the scrollbar thumb is clicked the trace(event.currentTarget.selectedIndex) returns a number. that's annoying b/c i just want a selectedIndex value for a row that is clicked not the scrollbar.
any ideas to get around? cheers
<fx:Script>
<![CDATA[
protected function list1_clickHandler(event:MouseEvent):void
trace(event.currentTarget.selectedIndex);
]]>
</fx:Script>
<s:List x="162" click="list1_clickHandler(event)" y="276" labelField="@label" width="144" height="153">
<s:dataProvider>
<s:XMLListCollection>
<fx:XMLList xmlns="">
<node label="one"/>
<node label="two"/>
<node label="three"/>
<node label="four"/>
<node label="five"/>
<node label="six"/>
<node label="seven"/>
<node label="eight"/>
<node label="nine"/>
<node label="ten"/>
<node label="eleven"/>
</fx:XMLList>
</s:XMLListCollection>
</s:dataProvider>
</s:List> -
Horizontal Scroll in list component
Hi,
I'm using a list component which is populated from a textbox. I've set the horizontal scroll policy to auto and also to on however the scroll either doesn't appear (in the case of auto) or doesn't move (in the case of on). Is there a setting which I need to modify to have the horizontal scroll working normally?
ThanksI tried the invalidate method as follows but nothing happened:
mylist.invalidate();
Not sure if I explained myself well, I just want the horizontal scrollbar to appear and be able to move it when one or more items in the list are long and thus not all visible...thanks -
List component scroller eventlistener for finished scrolling ?
I have a list component which contains an item renderer. I would like to know if it is possible to detect when the scoller that is built into the List has finished scrolling can fire an event. Is there a built in eventlistener ?
Arrghh, not the right one. I am also moving the scroller bar by using a linkbar to tab the scrollbar to different positions. I need to fire an event when the scroller has reached those new positions. The FlexEvent.CHANGE_END only works when you use the scroller manually.
-
Scroll one item in List component
Hello!
I use List component for song list in my flash music player. Everything works ok except for one problem - when the name of the song is too long, user can't read the full name of the song. One solution would be to use the horizontal scroll bar, but I have a better solution on mind: would like the current song automatically scroll (go around like in mp3 players). I guess I have to get current song's DisplayObject, to change it's x coordinate, but how? Maybe there are other solutions?
Thanks in advance,
elvmanOh, I forgot to mention that I am using ActionScript 3.
-
List component skin or style problem
I am building a scrolling list that pulls data from a xml
file, and binds the data to a list component
I am trying to figure out how to change the look of the list
component.
I need to create a rounded backgound for each list item and I
would like to use a symbol for this.
I can't find a setStyle property to change this and if I try
to adjust the HaloTheme.fla there is no List symbol to change.
How do I access the graphic being used by the list component?
Thanks for any helpYou could write your own CellRenderer and apply it to the
list.
http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples -
Cannot get more than 8 item in list component
Hi,
I can't get more than 8 items in list component using getItemAt(), it returns null. I will search more for this but no result.
Please Help me here to move to next step.
Thanks
Sureshkumar GIf you're asking if you can overall, yes you can:
http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f41.html
If you're asking if you can do this in the same context, off-screen, no you still get the same error as the .enabled property.
I hate to throw a hunch but I feel as though Adobe is employing something I'm used to in native iOS programming (Apple Devices). In lists they have something called "dequeue". It's the reason an extremely long list scrolls smoothly. What it does is render ONLY the rows that are in view. When a row is about to scroll off view it deallocates it from memory and then recreates the next row. They do this so you only ever have the current amount of viewable rows in memory and it speeds up scrolling. Although, I can make property changes to items in an iOS list that's off-screen so they don't have this issue ;(. Just food for thought.
I'd submit it to the bugbase and see what Adobe states. They may say they intend you to get the item in view, alter it and then go back to your previous position. That would be silly but at most I can tell you I definitely get errors trying to access an element outside my view. They're probably not used to items needing visual toggles when you can't even see them.
edit:
On a further note I tried the scrollToIndex() method, tried to disable, that much worked fine. The second I then scrolled back to the previously selected index the list screwed up.
I even daisy chained functions a second apart (30 frames worth of wait). I scrolled down and that worked so I waited 1 second. I disabled the visible item I wanted to and that worked so I waited another second. I scrollToIndex(0) to get back to the top of the list, the list blew up. Random items (several items) were disabled and the one that I explicitly disabled was enabled. -
CS4 List component strange behavior
On a List component I am using the bottom 'scroll down' button's hotspot is only the very top of the button. This is when the y scale of the component is set to 293. When I set the y scale to 280 the hotspot is the entire button. The top 'scroll up' button works fine and so does the scroll bar. Any ideas?
For some reason, for all nodes beyond the first, when the anonymous new instance of BankingStatementTransaction is added to the list, the data in the new instance is identical to the first node, even though the transNode passed to the BankingStatementTransaction
Constructor has a new set of data.
The iterator variable in a For/Each is the Current property of the IEnumerator object that implements the iteration. It is a local copy of the collection item. Therefore your BankingTransactionStatement object is being created from the one
local copy, so they will be all the same. Which item in the collection is undefined, but you seem to have proved it is the first. See:
http://msdn.microsoft.com/en-us/library/5ebk1751.aspx
You should either clone the transnode (if you want to use a new object) or use a For/Next instead of For/Each and access the collection item directly, using the index. -
hello everyone,
I've been working with Flex 3 for over a year and really want
to get into customizing components the best way possible, so i've
been digging into the classes. my first task is to create a smooth
tween when scrolling a List component instead of the default
"jumping" motion. So i decided to extend the list and do some
function overriding:
override protected function moveRowVertically(i:int,
numCols:int, moveBlockDistance:Number):void
var r:IListItemRenderer;
trace(String(listItems
[j]));
for (var j:int = 0; j < numCols; j++)
r = listItems[j];
prev_y
= r.y + moveBlockDistance;
//trace(r.y +" "+(r.y+ moveBlockDistance)+" "+prev_y);
TweenMax.to(r,0.5,{y:(r.y +
moveBlockDistance),ease:Sine.easeOut});
//r.move(r.x, r.y + moveBlockDistance);
rowInfo
.y += moveBlockDistance;
I've found moveRowVertically to be the method that actually
does the vertical row movement (called from the scrollVertically
method in the ListBase class). As you can see, i've added the
TweenMax where the object's move method was. This works
normally when the tween time is set to 0 sec, the List scroll
effect is the same as the stock component. But when TweenMax.to is
changed to 0.5 sec, the animation behaves strangely. I believe this
is partly because when a new object appears in the list it is
immediately added to the list, so the method that controls the
addChild needs to have the TweenMax animation also applied to. But
also, there is another problem, when you click the scroll arrow
before the TweenMax animation is complete, this function uses the
current y poisition (in the middle of the animation) as opposed to
the end y position- when the animation is complete. This is why the
TweenMax positions the items correctly when the TweenMax duration
is set to 0.
I
have an example here.
When you click the scroll arrow and wait for the animation to
complete, it works as the code expects. But when you click too fast
or scroll the scrollbar thumb, you can see the unexpected behavior.
SO what I believe needs to be added to the code is an array
that stores the end y coordinate and have the class use that
instead of the current y coordinate. I believe the best way to do
this is to store the end y coordinate in the listItems
[j] array so that i could call: TweenMax.to(r.end_y +
moveBlockDistance),ease:Sine.easeOut}); and all would be fine (for
the objects in the display, hopefully). But i cannot find the
original as file where the listItems property is (aka:
listContent.listItems as defined in the listItems get and set
methods in ListBase.as). Here i could extend this and define a
custom property. But a more important question is this: is it
possible to define a custom property on the fly, so i wouldn't have
to extend the listContent object (therefore, extending ListBase,
then List... on down the line)?
thank you all for your help!Ok I found out that it works fine in IE but not in FirefoX
HOWEVER it does work fine in Firefox from another computer! I tried
clearing out the cache but NOTHING...chan ANYONE PLEASE HELP
ME??? -
Why is mousewheel scrolling disabled in Safari 5.1? Fix in sight?
Why is mousewheel scrolling disabled/broken in Safari 5.1? is there a fix in sight? I see posts going back to July about this.
This is too much of a fundamental, functional problem to have continued for so long. I upgraded to 5.1 in hopes of the frequent crashes ceasing, but now I'm immediately struck with this problem. Not a good start.Agreed, going to Firefox is the step in the right privacy direction.
http://yro.slashdot.org/story/11/09/25/2131205/facebook-cookies-track-users-even -after-logging-out
AdBlock Plus, BetterPrivacy, Ghostery, Click&Clean and yes even NoScript (drag a Temp allow all button to the toolbar)
To deny your computer from accessing Facebook
In Admin user
sudo pico /etc/hosts
Arrow down below the material you see there and don't change it
add
0.0.0.0 www.facebook.com
0.0.0.0 www.facebook.net
control x to exit and save.
another easier way (can use in Standard User this way) is to use the free TextWrangler and open file by name:
/etc/hosts
and perform the same thing. -
How can I select an item from a list component with a seperate button
This is a repost, I decided it'd probably be better here than
in the general discussion board. I will try to delete the other
one.
Hello Everyone,
This is my first post here. I am trying to figure out how to
select an item within a list component with a button. This button
is calling a function. I have searched for the past 3 hours online
and I can't find anything about it. I thought perhaps I could set
the selectedItem parameter, but that is read only, and I believe it
returns an object reference rather than something like a number so
even if i could set it, it would be pointless. I also found a get
focus button, thought that may lead me somewhere, but I think that
is for setting which component has focus currently as far as typing
in and things like that. I am lost.
Basically I am looking for a way to type this
myList.setSelected(5); where 5 is the 5th item in the list.
Any help would be much appreciated.Never mind found it. It is the property called selectedIndex
and it is writable -
How to populate list component via xml file?
There is a TextArea component that should show the name and
the description of the item selected in the list component. But I
dont know how to populate list with external XML and what should be
the coding in flash as well as what should be written in the XML.
Please help.Here's an xml file listing a couple of brother comedy teams:
<?xml version="1.0" encoding="UTF-8"?>
<team>
<brothers>
<Marx>
<name>Groucho</name>
<name>Chico</name>
<name>Harpo</name>
<name>Zeppo</name>
<name>Gummo</name>
</Marx>
<Howard>
<name>Moe</name>
<name>Curly</name>
<name>Shemp</name>
</Howard>
</brothers>
</team>
Open a new .fla and save it in the same folder as the .xml
file. Place a List Component on the Stage and name it (in this
case, "comicTeams_list"). In the first frame write the following
ActionScript:
//create XML object and load external xml file
var broList:XML = new XML();
broList.ignoreWhite = true;
broList.onLoad = processList; // this is a function that will
be written below
broList.load("populateList.xml");
function processList(success:Boolean):Void{
if(success){
loadList();
}else{
trace("Load failure");
function loadList():Void{
var broName:String;
var listEntries =
broList.firstChild.childNodes[0].childNodes[0].childNodes.length;
for(var i:Number = 0;i<listEntries;i++){
broName =
broList.firstChild.childNodes[0].childNodes[0].childNodes
.childNodes[0].nodeValue;
trace(broName);
comicTeams_list.addItem(broName);
//to make something happen when you click on a name in the
List, create a Listener and function
var broListListener:Object = new Object();
broListListener.change = someAction; //"someAction" is a
function to be written shortly
//add the Listener to the List
comicTeams_list.addEventListener("change", broListListener);
function someAction(evtObj:Object):Void{
var pickedBrother:String = evtObj.target.selectedItem.label;
//write actions here, referencing pickedBrother variable
The names of the Marx Brothers will appear in the box.
This is written in AS2. When you post a question, it's a good
idea include which version of ActionScript you're using. -
Count the rows in a list-component
Hi,
How can I count the rows with a value in a list component?
I thought it would be RowCount but as I figured out that shows the number of shown rows, not the number of rows with a value.Hi,
Try list.dataProvider.length -
List component row manipulation
I have two questions regarding as3 list component:
- I'd like to highlight and keep selected the item a user last selected from my list component. I've combed the live reference as well as google and must be typing the wrong search words. I can tell what label and index an item was that was selected but am not finding a way to highlight and keep highlighted the user's choice in the list component.
- Also, I'm exploring the notion of inline buttons within a list's rows. If a user hovers their mouse over a row, a set of small buttons come up the user can click on for further functionality. This may be more of a make your own component answer but I'm exploring it nonetheless. Any thoughts or comments on this?
Thanks!no something else is going on. Or perhaps you didn't explain your problem clearly.
After servlet b calls getList() you have two servlets each having a reference to the same list
A------\
List
B------/ -
Adding Images to the List component
Adding Images to the List component while using the FLV
PLayback
All, ( i can send you my source files if it would help)
I'm using the FLV Playback component and loading videos into
it from an external xml file. I also have a list component tied to
the FLV playback that when you click on one of the elements in the
list, it plays that movie.
QUESTION:
My question is how do I add an image to the list component?
Below is the xml file and the actionscript. I've added the image
attribute to the XML file as img="time_square.jpg" and added the
element of the array when calling/creating the list. Did I do this
right?
Any direction would be very much appreciated.Adding Images to the List component while using the FLV
PLayback
All, ( i can send you my source files if it would help)
I'm using the FLV Playback component and loading videos into
it from an external xml file. I also have a list component tied to
the FLV playback that when you click on one of the elements in the
list, it plays that movie.
QUESTION:
My question is how do I add an image to the list component?
Below is the xml file and the actionscript. I've added the image
attribute to the XML file as img="time_square.jpg" and added the
element of the array when calling/creating the list. Did I do this
right?
Any direction would be very much appreciated.
Maybe you are looking for
-
TCode - FF67 - Manual Bank Reco - No open items were found
Hi all, We are getting the above error message on executing TCode - FF67 with the following steps made for the customisation of " Manual Bank Reco " : 1. Create Account Symbol 2. Assign Accounts to Account Symbol 3. Create Keys to Posting
-
Help :( Skype 7.1 won't stop crashing no matter what I try.
Last night I got a msg to update my skype to version 7.1, so I did that and turned off my laptop. Today I logged on my laptop and logged in Skype, and right after I logged in, not even 30 seconds later, on the home page it comes up with a msg that sa
-
Hi Is it possible to find out the workflow for creation of purchase request, approval and creation of purchase order followed in our organization through sap system without users/functional peoples intervention. Please provide inputs Regards Lavanya
-
Consolidation of items in accounting document
Hi All I have this scenario in MySAP ERP 2005 version SD Billing doc has two line items Item 1{Material=A,Plant=2000,P-centre=21000,Amount=$3,Qty=1,Tax=$0.42} Item 2{Material=A,Plant=2000,P-centre=21000,Amount=$4,Qty=1,Tax=$0.56} Revenue was posted t
-
Message no. AG021 when doing component availabilty check,
Hi PP Gurus, When I'm trying to do Availability check for Planned order (order type PE) getting an error 'No control data maintained for checking group 02 and checking rule' (Message no. AG021) though Availability checking control for order type PP01