RE: [flexcoders] Re: Question about a flex component

2009-08-04 Thread Gordon Smith
UIComponents have a visible:Boolean property which you can set to true or false.

You can tell whether a Container is scrollable by checking whether its 
maxHorizontalScrollPosition is greater than 0.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Tuesday, August 04, 2009 10:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



how do i make visible invisible the icons for previous/next?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, veena 
pandit v.kri...@... wrote:

 Hi,

 I am new to Flex. I am looking for help on designing a custom component
 that will
 hold a lot of items. When the items exceed the number that are visible in
 the ui
 of this horizontal component on the webpage an icon appears, which if you
 click
 will show a list of the other components you can click again and restore the
 ui with
 that item. Hope you understand what I am talking about. If not please post
 for clarification.

 Thanks in advance,

 Veena




RE: [flexcoders] Re: Question about a flex component

2009-07-28 Thread Gordon Smith
Use any program that can produce a GIF or PNG and draw a left-pointing and a 
right-pointing triangle.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Tuesday, July 28, 2009 5:43 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



Does anyone know of icons or images I can use in my buttons instead of labeling 
them Previous and Next. I tried to google it and I did not find anything.

Thanks.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 Why not just allow scrolling instead of paging? Scrolling components can 
 scroll through thousands of items quickly.

 Suppose there are 100 items and you can only see 10 at a time. So first you 
 see 0-9. When you click the icon you see 10-19. When you click it again you'd 
 see 20-29. So you'd need another icon (previous page instead of next 
 page) to go back to 10-19 and then 0-9.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena pandit
 Sent: Thursday, July 23, 2009 10:22 AM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Question about a flex component


 Hi,

 I am new to Flex. I am looking for help on designing a custom component that 
 will
 hold a lot of items. When the items exceed the number that are visible in the 
 ui
 of this horizontal component on the webpage an icon appears, which if you 
 click
 will show a list of the other components you can click again and restore the 
 ui with
 that item. Hope you understand what I am talking about. If not please post 
 for clarification.

 Thanks in advance,

 Veena




RE: [flexcoders] Re: Question about a flex component

2009-07-28 Thread Gordon Smith
The ASDoc for ArrayCollection lists removeItemAt() as an inherited method.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Tuesday, July 28, 2009 10:59 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



How do I remove a specific item from a HorizontalList whose dataprovider is an 
ArrayCollection?

Thanks,

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 You add child components which are UIComponents to a container like HBox.

 But you add data items to a list-based control like HorizontalList. These 
 data items then get displayed by item renderers, which are children which get 
 automatically created to display data items. The children are managed by the 
 list, not by you... you manage the data, not the renderers.

 By default, data items are expected to have a 'label' property to display, 
 unless you set the labelField or labelFunction of the list component. They 
 can be plain Objects, or instances of data classes, or anything else, but 
 typically they aren't visual components.

 Here's an example of adding two data items to a list using ActionScript.

 myList.dataProvider = new ArrayCollection();
 var item:Object;
 item = { label: One, data: 1 };
 myList.dataProvider.addItem(item);
 item = { label: Two, data: 2 };
 myList.dataProvider.addItem(item);

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena_kris2003
 Sent: Friday, July 24, 2009 3:19 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 Please help. The items are being added dynamically to the mx:HorizontalList 
 id=test bottom=0 width=100%
 backgroundColor=0x00 horizontalScrollPolicy=on
 verticalScrollPolicy=off/ I debugged the code and the
 items are being added, but I can't see them in the UI.
 If I change mx:HorizontalList to mx:HBox I can see the items
 in the UI. What am I doing wrong?

 --- In 
 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
  Gordon Smith gosmith@ wrote:
 
  No, I don't have an example and don't have time to create one for you since 
  I'm a development engineer, not a support engineer. But here is what you 
  should try, learning as you go:
 
  1. Create an app with an mx:HorizontalList.
  2. Make it show data items by assigning its dataProvider. Put in more data 
  items that will fit.
  3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
  4. Create mx:Buttons for Previous and Next, positioned to the left 
  and right of the HorizontalList.
  5. In their 'click' handlers, put code like 
  horizontalList.horizontalScrollPosition += 1. Use -= for the Previous 
  button.
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
   
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
   On Behalf Of veena_kris2003
  Sent: Thursday, July 23, 2009 4:42 PM
  To: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  Do you mind posting an example. It sounds like this is what I was looking 
  for. I need a horizontal list component with an icon at the right end of 
  the component that I can click and scroll to more items.
 
  Thanks,
 
  Veena
 
  --- In 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
   Gordon Smith gosmith@ wrote:
  
   Why not just allow scrolling instead of paging? Scrolling components can 
   scroll through thousands of items quickly.
  
   Suppose there are 100 items and you can only see 10 at a time. So first 
   you see 0-9. When you click the icon you see 10-19. When you click it 
   again you'd see 20-29. So you'd need another icon (previous page 
   instead of next page) to go back to 10-19 and then 0-9.
  
   Gordon Smith
   Adobe Flex SDK Team
  
   From: 
   flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com

   [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
On Behalf Of veena pandit
   Sent: Thursday, July 23, 2009 10:22 AM
   To: 
   flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
   Subject: [flexcoders] Question about a flex component
  
  
   Hi,
  
   I am new to Flex. I am looking for help

Re: [flexcoders] Re: Question about a flex component

2009-07-28 Thread veena pandit
What type do i get back?

On Tue, Jul 28, 2009 at 2:52 PM, valdhor valdhorli...@embarqmail.comwrote:



 item.data

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 veena_kris2003 v.kri...@... wrote:
 
   How do I extract the data portion of the item if the item looks like
  Object in the example below.
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Gordon
 Smith gosmith@ wrote:
  
   You add child components which are UIComponents to a container like
 HBox.
  
   But you add data items to a list-based control like HorizontalList.
 These data items then get displayed by item renderers, which are children
 which get automatically created to display data items. The children are
 managed by the list, not by you... you manage the data, not the renderers.
  
   By default, data items are expected to have a 'label' property to
 display, unless you set the labelField or labelFunction of the list
 component. They can be plain Objects, or instances of data classes, or
 anything else, but typically they aren't visual components.
  
   Here's an example of adding two data items to a list using
 ActionScript.
  
   myList.dataProvider = new ArrayCollection();
   var item:Object;
   item = { label: One, data: 1 };
   myList.dataProvider.addItem(item);
   item = { label: Two, data: 2 };
   myList.dataProvider.addItem(item);
  
   Gordon Smith
   Adobe Flex SDK Team
  
   From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com[mailto:
 flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of
 veena_kris2003
   Sent: Friday, July 24, 2009 3:19 PM
   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   Subject: [flexcoders] Re: Question about a flex component
  
  
  
   Please help. The items are being added dynamically to the
 mx:HorizontalList id=test bottom=0 width=100%
   backgroundColor=0x00 horizontalScrollPolicy=on
   verticalScrollPolicy=off/ I debugged the code and the
   items are being added, but I can't see them in the UI.
   If I change mx:HorizontalList to mx:HBox I can see the items
   in the UI. What am I doing wrong?
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com,
 Gordon Smith gosmith@ wrote:
   
No, I don't have an example and don't have time to create one for you
 since I'm a development engineer, not a support engineer. But here is what
 you should try, learning as you go:
   
1. Create an app with an mx:HorizontalList.
2. Make it show data items by assigning its dataProvider. Put in more
 data items that will fit.
3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
4. Create mx:Buttons for Previous and Next, positioned to the
 left and right of the HorizontalList.
5. In their 'click' handlers, put code like
 horizontalList.horizontalScrollPosition += 1. Use -= for the Previous
 button.
   
Gordon Smith
Adobe Flex SDK Team
   
From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 [mailto:flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com] On Behalf
 Of veena_kris2003
Sent: Thursday, July 23, 2009 4:42 PM
To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component
   
   
   
Do you mind posting an example. It sounds like this is what I was
 looking for. I need a horizontal list component with an icon at the right
 end of the component that I can click and scroll to more items.
   
Thanks,
   
Veena
   
--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com,
 Gordon Smith gosmith@ wrote:

 Why not just allow scrolling instead of paging? Scrolling
 components can scroll through thousands of items quickly.

 Suppose there are 100 items and you can only see 10 at a time. So
 first you see 0-9. When you click the icon you see 10-19. When you click it
 again you'd see 20-29. So you'd need another icon (previous page instead
 of next page) to go back to 10-19 and then 0-9.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 [mailto:flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com] On Behalf
 Of veena pandit
 Sent: Thursday, July 23, 2009 10:22 AM
 To: flexcoders@yahoogroups.com flexcoders

RE: [flexcoders] Re: Question about a flex component

2009-07-28 Thread Gordon Smith
The compiler wouldn't have a declaration of 'data', so would assume item.data 
has type *. At runtime it would have type int if its value is 1. But you could 
use class to define data items with strongly typed properties:

public class MyItem
{
public var label:String:
public var data:int;
}

and then the compiler would know that 'data' is int at compile-time.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of valdhor
Sent: Tuesday, July 28, 2009 11:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



Looks like an int to me.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, veena 
pandit v.kri...@... wrote:

 What type do i get back?

 On Tue, Jul 28, 2009 at 2:52 PM, valdhor valdhorli...@...wrote:

 
 
  item.data
 
  --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
  flexcoders%40yahoogroups.com,
  veena_kris2003 v.kris21@ wrote:
  
   How do I extract the data portion of the item if the item looks like
   Object in the example below.
  
  
   --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
   flexcoders%40yahoogroups.com, Gordon
  Smith gosmith@ wrote:
   
You add child components which are UIComponents to a container like
  HBox.
   
But you add data items to a list-based control like HorizontalList.
  These data items then get displayed by item renderers, which are children
  which get automatically created to display data items. The children are
  managed by the list, not by you... you manage the data, not the renderers.
   
By default, data items are expected to have a 'label' property to
  display, unless you set the labelField or labelFunction of the list
  component. They can be plain Objects, or instances of data classes, or
  anything else, but typically they aren't visual components.
   
Here's an example of adding two data items to a list using
  ActionScript.
   
myList.dataProvider = new ArrayCollection();
var item:Object;
item = { label: One, data: 1 };
myList.dataProvider.addItem(item);
item = { label: Two, data: 2 };
myList.dataProvider.addItem(item);
   
Gordon Smith
Adobe Flex SDK Team
   
From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
flexcoders%40yahoogroups.com[mailto:
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
  flexcoders%40yahoogroups.com] On Behalf Of
  veena_kris2003
Sent: Friday, July 24, 2009 3:19 PM
To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
flexcoders%40yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component
   
   
   
Please help. The items are being added dynamically to the
  mx:HorizontalList id=test bottom=0 width=100%
backgroundColor=0x00 horizontalScrollPolicy=on
verticalScrollPolicy=off/ I debugged the code and the
items are being added, but I can't see them in the UI.
If I change mx:HorizontalList to mx:HBox I can see the items
in the UI. What am I doing wrong?
   
--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
flexcoders%40yahoogroups.com
  mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com,
  Gordon Smith gosmith@ wrote:

 No, I don't have an example and don't have time to create one for you
  since I'm a development engineer, not a support engineer. But here is what
  you should try, learning as you go:

 1. Create an app with an mx:HorizontalList.
 2. Make it show data items by assigning its dataProvider. Put in more
  data items that will fit.
 3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
 4. Create mx:Buttons for Previous and Next, positioned to the
  left and right of the HorizontalList.
 5. In their 'click' handlers, put code like
  horizontalList.horizontalScrollPosition += 1. Use -= for the Previous
  button.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 flexcoders%40yahoogroups.com
  mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
  flexcoders%40yahoogroups.commailto:
  flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com] On Behalf
  Of veena_kris2003
 Sent: Thursday, July 23, 2009 4:42 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 flexcoders%40yahoogroups.com
  mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 Do you mind posting an example. It sounds like this is what I was
  looking for. I need a horizontal list component with an icon at the right
  end of the component that I can click and scroll to more items.

 Thanks,

 Veena

RE: [flexcoders] Re: Question about a flex component

2009-07-27 Thread Gordon Smith
That's not how list-based components work. You don't add event listeners to 
data items. You listen to events dispatched by the list itself.

What are you trying to accomplish with your event handlers?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Saturday, July 25, 2009 3:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



My message from earlier today never got posted. How do you add event listeners 
to objects in the horizontalList. I added the event listeners to the objects 
before I added the objects to the list. The event listener is not getting 
called.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 You add child components which are UIComponents to a container like HBox.

 But you add data items to a list-based control like HorizontalList. These 
 data items then get displayed by item renderers, which are children which get 
 automatically created to display data items. The children are managed by the 
 list, not by you... you manage the data, not the renderers.

 By default, data items are expected to have a 'label' property to display, 
 unless you set the labelField or labelFunction of the list component. They 
 can be plain Objects, or instances of data classes, or anything else, but 
 typically they aren't visual components.

 Here's an example of adding two data items to a list using ActionScript.

 myList.dataProvider = new ArrayCollection();
 var item:Object;
 item = { label: One, data: 1 };
 myList.dataProvider.addItem(item);
 item = { label: Two, data: 2 };
 myList.dataProvider.addItem(item);

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena_kris2003
 Sent: Friday, July 24, 2009 3:19 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 Please help. The items are being added dynamically to the mx:HorizontalList 
 id=test bottom=0 width=100%
 backgroundColor=0x00 horizontalScrollPolicy=on
 verticalScrollPolicy=off/ I debugged the code and the
 items are being added, but I can't see them in the UI.
 If I change mx:HorizontalList to mx:HBox I can see the items
 in the UI. What am I doing wrong?

 --- In 
 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
  Gordon Smith gosmith@ wrote:
 
  No, I don't have an example and don't have time to create one for you since 
  I'm a development engineer, not a support engineer. But here is what you 
  should try, learning as you go:
 
  1. Create an app with an mx:HorizontalList.
  2. Make it show data items by assigning its dataProvider. Put in more data 
  items that will fit.
  3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
  4. Create mx:Buttons for Previous and Next, positioned to the left 
  and right of the HorizontalList.
  5. In their 'click' handlers, put code like 
  horizontalList.horizontalScrollPosition += 1. Use -= for the Previous 
  button.
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
   
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
   On Behalf Of veena_kris2003
  Sent: Thursday, July 23, 2009 4:42 PM
  To: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  Do you mind posting an example. It sounds like this is what I was looking 
  for. I need a horizontal list component with an icon at the right end of 
  the component that I can click and scroll to more items.
 
  Thanks,
 
  Veena
 
  --- In 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
   Gordon Smith gosmith@ wrote:
  
   Why not just allow scrolling instead of paging? Scrolling components can 
   scroll through thousands of items quickly.
  
   Suppose there are 100 items and you can only see 10 at a time. So first 
   you see 0-9. When you click the icon you see 10-19. When you click it 
   again you'd see 20-29. So you'd need another icon (previous page 
   instead of next page) to go back to 10-19 and then 0-9.
  
   Gordon Smith
   Adobe Flex SDK Team
  
   From: 
   flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com

   [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
On Behalf Of veena pandit
   Sent: Thursday, July 23, 2009 10:22 AM

RE: [flexcoders] Re: Question about a flex component

2009-07-27 Thread Gordon Smith
Normally only the Player dispatches MouseEvents, in response to the user using 
the mouse. Why would you want to dispatch a MouseEvent in your code?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Monday, July 27, 2009 3:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



I fixed it so that I called the change=horizontalScrollListChange(event). 
Then I pass in a ListEvent to the horizontalScrollListChange method. Can I 
dispatch a MouseEvent
from the horizontalScrollListChange method?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 That's not how list-based components work. You don't add event listeners to 
 data items. You listen to events dispatched by the list itself.

 What are you trying to accomplish with your event handlers?

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena_kris2003
 Sent: Saturday, July 25, 2009 3:52 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 My message from earlier today never got posted. How do you add event 
 listeners to objects in the horizontalList. I added the event listeners to 
 the objects before I added the objects to the list. The event listener is not 
 getting called.

 --- In 
 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
  Gordon Smith gosmith@ wrote:
 
  You add child components which are UIComponents to a container like HBox.
 
  But you add data items to a list-based control like HorizontalList. These 
  data items then get displayed by item renderers, which are children which 
  get automatically created to display data items. The children are managed 
  by the list, not by you... you manage the data, not the renderers.
 
  By default, data items are expected to have a 'label' property to display, 
  unless you set the labelField or labelFunction of the list component. They 
  can be plain Objects, or instances of data classes, or anything else, but 
  typically they aren't visual components.
 
  Here's an example of adding two data items to a list using ActionScript.
 
  myList.dataProvider = new ArrayCollection();
  var item:Object;
  item = { label: One, data: 1 };
  myList.dataProvider.addItem(item);
  item = { label: Two, data: 2 };
  myList.dataProvider.addItem(item);
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
   
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
   On Behalf Of veena_kris2003
  Sent: Friday, July 24, 2009 3:19 PM
  To: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  Please help. The items are being added dynamically to the 
  mx:HorizontalList id=test bottom=0 width=100%
  backgroundColor=0x00 horizontalScrollPolicy=on
  verticalScrollPolicy=off/ I debugged the code and the
  items are being added, but I can't see them in the UI.
  If I change mx:HorizontalList to mx:HBox I can see the items
  in the UI. What am I doing wrong?
 
  --- In 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
   Gordon Smith gosmith@ wrote:
  
   No, I don't have an example and don't have time to create one for you 
   since I'm a development engineer, not a support engineer. But here is 
   what you should try, learning as you go:
  
   1. Create an app with an mx:HorizontalList.
   2. Make it show data items by assigning its dataProvider. Put in more 
   data items that will fit.
   3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
   4. Create mx:Buttons for Previous and Next, positioned to the left 
   and right of the HorizontalList.
   5. In their 'click' handlers, put code like 
   horizontalList.horizontalScrollPosition += 1. Use -= for the Previous 
   button.
  
   Gordon Smith
   Adobe Flex SDK Team
  
   From: 
   flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com

   [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
On Behalf Of veena_kris2003
   Sent: Thursday, July 23, 2009 4:42 PM
   To: 
   flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
   Subject: [flexcoders] Re: Question about a flex component
  
  
  
   Do you mind

Re: [flexcoders] Re: Question about a flex component

2009-07-27 Thread veena pandit
It is really complex code.  I don't understand it yet.

On Mon, Jul 27, 2009 at 7:02 PM, Gordon Smith gosm...@adobe.com wrote:



  Normally only the Player dispatches MouseEvents, in response to the user
 using the mouse. Why would you want to dispatch a MouseEvent in your code?



 Gordon Smith

 Adobe Flex SDK Team



 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *veena_kris2003
 *Sent:* Monday, July 27, 2009 3:44 PM

 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Question about a flex component





 I fixed it so that I called the change=horizontalScrollListChange(event).
 Then I pass in a ListEvent to the horizontalScrollListChange method. Can I
 dispatch a MouseEvent
 from the horizontalScrollListChange method?

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Gordon
 Smith gosm...@... wrote:
 
  That's not how list-based components work. You don't add event listeners
 to data items. You listen to events dispatched by the list itself.
 
  What are you trying to accomplish with your event handlers?
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto:
 flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of
 veena_kris2003
  Sent: Saturday, July 25, 2009 3:52 PM
  To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  My message from earlier today never got posted. How do you add event
 listeners to objects in the horizontalList. I added the event listeners to
 the objects before I added the objects to the list. The event listener is
 not getting called.
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com, Gordon
 Smith gosmith@ wrote:
  
   You add child components which are UIComponents to a container like
 HBox.
  
   But you add data items to a list-based control like HorizontalList.
 These data items then get displayed by item renderers, which are children
 which get automatically created to display data items. The children are
 managed by the list, not by you... you manage the data, not the renderers.
  
   By default, data items are expected to have a 'label' property to
 display, unless you set the labelField or labelFunction of the list
 component. They can be plain Objects, or instances of data classes, or
 anything else, but typically they aren't visual components.
  
   Here's an example of adding two data items to a list using
 ActionScript.
  
   myList.dataProvider = new ArrayCollection();
   var item:Object;
   item = { label: One, data: 1 };
   myList.dataProvider.addItem(item);
   item = { label: Two, data: 2 };
   myList.dataProvider.addItem(item);
  
   Gordon Smith
   Adobe Flex SDK Team
  
   From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 [mailto:flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com] On Behalf
 Of veena_kris2003
   Sent: Friday, July 24, 2009 3:19 PM
   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
   Subject: [flexcoders] Re: Question about a flex component
  
  
  
   Please help. The items are being added dynamically to the
 mx:HorizontalList id=test bottom=0 width=100%
   backgroundColor=0x00 horizontalScrollPolicy=on
   verticalScrollPolicy=off/ I debugged the code and the
   items are being added, but I can't see them in the UI.
   If I change mx:HorizontalList to mx:HBox I can see the items
   in the UI. What am I doing wrong?
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com,
 Gordon Smith gosmith@ wrote:
   
No, I don't have an example and don't have time to create one for you
 since I'm a development engineer, not a support engineer. But here is what
 you should try, learning as you go:
   
1. Create an app with an mx:HorizontalList.
2. Make it show data items by assigning its dataProvider. Put in more
 data items that will fit.
3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
4. Create mx:Buttons for Previous and Next, positioned to the
 left and right of the HorizontalList.
5. In their 'click' handlers, put code like
 horizontalList.horizontalScrollPosition += 1. Use -= for the Previous
 button.
   
Gordon Smith
Adobe Flex SDK Team
   
From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 [mailto:flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders

RE: [flexcoders] Re: Question about a flex component

2009-07-27 Thread Gordon Smith
You can try dispatching MouseEvents, but I'm not sure that they'll work exactly 
the same as a Player-generated one.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena pandit
Sent: Monday, July 27, 2009 4:17 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Question about a flex component



It is really complex code.  I don't understand it yet.
On Mon, Jul 27, 2009 at 7:02 PM, Gordon Smith 
gosm...@adobe.commailto:gosm...@adobe.com wrote:


Normally only the Player dispatches MouseEvents, in response to the user using 
the mouse. Why would you want to dispatch a MouseEvent in your code?



Gordon Smith

Adobe Flex SDK Team



From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of veena_kris2003
Sent: Monday, July 27, 2009 3:44 PM

To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component





I fixed it so that I called the change=horizontalScrollListChange(event). 
Then I pass in a ListEvent to the horizontalScrollListChange method. Can I 
dispatch a MouseEvent
from the horizontalScrollListChange method?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 That's not how list-based components work. You don't add event listeners to 
 data items. You listen to events dispatched by the list itself.

 What are you trying to accomplish with your event handlers?

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena_kris2003
 Sent: Saturday, July 25, 2009 3:52 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 My message from earlier today never got posted. How do you add event 
 listeners to objects in the horizontalList. I added the event listeners to 
 the objects before I added the objects to the list. The event listener is not 
 getting called.

 --- In 
 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com,
  Gordon Smith gosmith@ wrote:
 
  You add child components which are UIComponents to a container like HBox.
 
  But you add data items to a list-based control like HorizontalList. These 
  data items then get displayed by item renderers, which are children which 
  get automatically created to display data items. The children are managed 
  by the list, not by you... you manage the data, not the renderers.
 
  By default, data items are expected to have a 'label' property to display, 
  unless you set the labelField or labelFunction of the list component. They 
  can be plain Objects, or instances of data classes, or anything else, but 
  typically they aren't visual components.
 
  Here's an example of adding two data items to a list using ActionScript.
 
  myList.dataProvider = new ArrayCollection();
  var item:Object;
  item = { label: One, data: 1 };
  myList.dataProvider.addItem(item);
  item = { label: Two, data: 2 };
  myList.dataProvider.addItem(item);
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com
   
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com]
   On Behalf Of veena_kris2003
  Sent: Friday, July 24, 2009 3:19 PM
  To: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  Please help. The items are being added dynamically to the 
  mx:HorizontalList id=test bottom=0 width=100%
  backgroundColor=0x00 horizontalScrollPolicy=on
  verticalScrollPolicy=off/ I debugged the code and the
  items are being added, but I can't see them in the UI.
  If I change mx:HorizontalList to mx:HBox I can see the items
  in the UI. What am I doing wrong?
 
  --- In 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com,
   Gordon Smith gosmith@ wrote:
  
   No, I don't have an example and don't have time to create one for you 
   since I'm a development engineer, not a support engineer. But here is 
   what you should try, learning as you go:
  
   1. Create an app with an mx:HorizontalList.
   2. Make it show data items by assigning its dataProvider. Put in more 
   data items that will fit.
   3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
   4. Create

Re: [flexcoders] Re: Question about a flex component

2009-07-27 Thread veena pandit
I'll try it.  So how would I do it?

On Mon, Jul 27, 2009 at 7:25 PM, Gordon Smith gosm...@adobe.com wrote:



  You can try dispatching MouseEvents, but I'm not sure that they'll work
 exactly the same as a Player-generated one.



 Gordon Smith

 Adobe Flex SDK Team



 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *veena pandit
 *Sent:* Monday, July 27, 2009 4:17 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Re: Question about a flex component





 It is really complex code.  I don't understand it yet.

 On Mon, Jul 27, 2009 at 7:02 PM, Gordon Smith gosm...@adobe.com wrote:



 Normally only the Player dispatches MouseEvents, in response to the user
 using the mouse. Why would you want to dispatch a MouseEvent in your code?



 Gordon Smith

 Adobe Flex SDK Team



 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *veena_kris2003
 *Sent:* Monday, July 27, 2009 3:44 PM


 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Question about a flex component





 I fixed it so that I called the change=horizontalScrollListChange(event).
 Then I pass in a ListEvent to the horizontalScrollListChange method. Can I
 dispatch a MouseEvent
 from the horizontalScrollListChange method?

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Gordon
 Smith gosm...@... wrote:
 
  That's not how list-based components work. You don't add event listeners
 to data items. You listen to events dispatched by the list itself.
 
  What are you trying to accomplish with your event handlers?
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto:
 flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of
 veena_kris2003
  Sent: Saturday, July 25, 2009 3:52 PM
  To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  My message from earlier today never got posted. How do you add event
 listeners to objects in the horizontalList. I added the event listeners to
 the objects before I added the objects to the list. The event listener is
 not getting called.
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com, Gordon
 Smith gosmith@ wrote:
  
   You add child components which are UIComponents to a container like
 HBox.
  
   But you add data items to a list-based control like HorizontalList.
 These data items then get displayed by item renderers, which are children
 which get automatically created to display data items. The children are
 managed by the list, not by you... you manage the data, not the renderers.
  
   By default, data items are expected to have a 'label' property to
 display, unless you set the labelField or labelFunction of the list
 component. They can be plain Objects, or instances of data classes, or
 anything else, but typically they aren't visual components.
  
   Here's an example of adding two data items to a list using
 ActionScript.
  
   myList.dataProvider = new ArrayCollection();
   var item:Object;
   item = { label: One, data: 1 };
   myList.dataProvider.addItem(item);
   item = { label: Two, data: 2 };
   myList.dataProvider.addItem(item);
  
   Gordon Smith
   Adobe Flex SDK Team
  
   From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 [mailto:flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com] On Behalf
 Of veena_kris2003
   Sent: Friday, July 24, 2009 3:19 PM
   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.commailto:
 flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
   Subject: [flexcoders] Re: Question about a flex component
  
  
  
   Please help. The items are being added dynamically to the
 mx:HorizontalList id=test bottom=0 width=100%
   backgroundColor=0x00 horizontalScrollPolicy=on
   verticalScrollPolicy=off/ I debugged the code and the
   items are being added, but I can't see them in the UI.
   If I change mx:HorizontalList to mx:HBox I can see the items
   in the UI. What am I doing wrong?
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com
 mailto:flexcoders%40yahoogroups.com flexcoders%2540yahoogroups.com,
 Gordon Smith gosmith@ wrote:
   
No, I don't have an example and don't have time to create one for you
 since I'm a development engineer, not a support engineer. But here is what
 you should try, learning as you go:
   
1. Create an app with an mx:HorizontalList.
2. Make it show data items by assigning its dataProvider. Put in more
 data items that will fit.
3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
4. Create mx:Buttons for Previous and Next

RE: [flexcoders] Re: Question about a flex component

2009-07-27 Thread Gordon Smith
The same way you dispatch any other event: Construct the Event instance, set 
its properties, and then call dispatchEvent() on the object that the event 
should be dispatched from (which generally is 'this'):

var mouseEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN);
mouseEvent.localX = 10;
mouseEvent.localY = 10;
...
someComponent.dispatchEvent(mouseEvent);

Gordon Smith
Adeobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena pandit
Sent: Monday, July 27, 2009 4:46 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Question about a flex component



I'll try it.  So how would I do it?
On Mon, Jul 27, 2009 at 7:25 PM, Gordon Smith 
gosm...@adobe.commailto:gosm...@adobe.com wrote:


You can try dispatching MouseEvents, but I'm not sure that they'll work exactly 
the same as a Player-generated one.



Gordon Smith

Adobe Flex SDK Team



From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of veena pandit
Sent: Monday, July 27, 2009 4:17 PM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Question about a flex component





It is really complex code.  I don't understand it yet.

On Mon, Jul 27, 2009 at 7:02 PM, Gordon Smith 
gosm...@adobe.commailto:gosm...@adobe.com wrote:



Normally only the Player dispatches MouseEvents, in response to the user using 
the mouse. Why would you want to dispatch a MouseEvent in your code?



Gordon Smith

Adobe Flex SDK Team



From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of veena_kris2003
Sent: Monday, July 27, 2009 3:44 PM

To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component





I fixed it so that I called the change=horizontalScrollListChange(event). 
Then I pass in a ListEvent to the horizontalScrollListChange method. Can I 
dispatch a MouseEvent
from the horizontalScrollListChange method?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 That's not how list-based components work. You don't add event listeners to 
 data items. You listen to events dispatched by the list itself.

 What are you trying to accomplish with your event handlers?

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena_kris2003
 Sent: Saturday, July 25, 2009 3:52 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 My message from earlier today never got posted. How do you add event 
 listeners to objects in the horizontalList. I added the event listeners to 
 the objects before I added the objects to the list. The event listener is not 
 getting called.

 --- In 
 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com,
  Gordon Smith gosmith@ wrote:
 
  You add child components which are UIComponents to a container like HBox.
 
  But you add data items to a list-based control like HorizontalList. These 
  data items then get displayed by item renderers, which are children which 
  get automatically created to display data items. The children are managed 
  by the list, not by you... you manage the data, not the renderers.
 
  By default, data items are expected to have a 'label' property to display, 
  unless you set the labelField or labelFunction of the list component. They 
  can be plain Objects, or instances of data classes, or anything else, but 
  typically they aren't visual components.
 
  Here's an example of adding two data items to a list using ActionScript.
 
  myList.dataProvider = new ArrayCollection();
  var item:Object;
  item = { label: One, data: 1 };
  myList.dataProvider.addItem(item);
  item = { label: Two, data: 2 };
  myList.dataProvider.addItem(item);
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com
   
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com]
   On Behalf Of veena_kris2003
  Sent: Friday, July 24, 2009 3:19 PM
  To: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%2540yahoogroups.com
  Subject: [flexcoders] Re: Question about a flex component
 
 
 
  Please help. The items are being added dynamically to the 
  mx:HorizontalList id=test bottom=0 width=100%
  backgroundColor=0x00 horizontalScrollPolicy=on
  verticalScrollPolicy

RE: [flexcoders] Re: Question about a flex component

2009-07-24 Thread Gordon Smith
No, I don't have an example and don't have time to create one for you since I'm 
a development engineer, not a support engineer.  But here is what you should 
try, learning as you go:

1. Create an app with an mx:HorizontalList.
2. Make it show data items by assigning its dataProvider. Put in more data 
items that will fit.
3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
4. Create mx:Buttons for Previous and Next, positioned to the left and 
right of the HorizontalList.
5. In their 'click' handlers, put code like 
horizontalList.horizontalScrollPosition += 1. Use -= for the Previous button.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Thursday, July 23, 2009 4:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



Do you mind posting an example. It sounds like this is what I was looking for. 
I need a horizontal list component with an icon at the right end of the 
component that I can click and scroll to more items.

Thanks,

Veena

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 Why not just allow scrolling instead of paging? Scrolling components can 
 scroll through thousands of items quickly.

 Suppose there are 100 items and you can only see 10 at a time. So first you 
 see 0-9. When you click the icon you see 10-19. When you click it again you'd 
 see 20-29. So you'd need another icon (previous page instead of next 
 page) to go back to 10-19 and then 0-9.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena pandit
 Sent: Thursday, July 23, 2009 10:22 AM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Question about a flex component


 Hi,

 I am new to Flex. I am looking for help on designing a custom component that 
 will
 hold a lot of items. When the items exceed the number that are visible in the 
 ui
 of this horizontal component on the webpage an icon appears, which if you 
 click
 will show a list of the other components you can click again and restore the 
 ui with
 that item. Hope you understand what I am talking about. If not please post 
 for clarification.

 Thanks in advance,

 Veena




RE: [flexcoders] Re: Question about a flex component

2009-07-24 Thread Tracy Spratt
You must use the collection API to add the items in order for the necessary
events to be dispatched to update the UI.

 

What is the data type of you dataProvider?

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of veena_kris2003
Sent: Friday, July 24, 2009 6:19 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component

 

  

Please help. The items are being added dynamically to the mx:HorizontalList
id=test bottom=0 width=100% 
backgroundColor=0x00 horizontalScrollPolicy=on 
verticalScrollPolicy=off/ I debugged the code and the
items are being added, but I can't see them in the UI.
If I change mx:HorizontalList to mx:HBox I can see the items
in the UI. What am I doing wrong?

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Gordon Smith gosm...@... wrote:

 No, I don't have an example and don't have time to create one for you
since I'm a development engineer, not a support engineer. But here is what
you should try, learning as you go:
 
 1. Create an app with an mx:HorizontalList.
 2. Make it show data items by assigning its dataProvider. Put in more data
items that will fit.
 3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
 4. Create mx:Buttons for Previous and Next, positioned to the left
and right of the HorizontalList.
 5. In their 'click' handlers, put code like
horizontalList.horizontalScrollPosition += 1. Use -= for the Previous
button.
 
 Gordon Smith
 Adobe Flex SDK Team
 
 From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
On Behalf Of veena_kris2003
 Sent: Thursday, July 23, 2009 4:42 PM
 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 Subject: [flexcoders] Re: Question about a flex component
 
 
 
 Do you mind posting an example. It sounds like this is what I was looking
for. I need a horizontal list component with an icon at the right end of the
component that I can click and scroll to more items.
 
 Thanks,
 
 Veena
 
 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
ups.commailto:flexcoders%40yahoogroups.com, Gordon Smith gosmith@ wrote:
 
  Why not just allow scrolling instead of paging? Scrolling components can
scroll through thousands of items quickly.
 
  Suppose there are 100 items and you can only see 10 at a time. So first
you see 0-9. When you click the icon you see 10-19. When you click it again
you'd see 20-29. So you'd need another icon (previous page instead of
next page) to go back to 10-19 and then 0-9.
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
ups.commailto:flexcoders%40yahoogroups.com [mailto:flexcod...@yahoogro
mailto:flexcoders%40yahoogroups.com
ups.commailto:flexcoders%40yahoogroups.com] On Behalf Of veena pandit
  Sent: Thursday, July 23, 2009 10:22 AM
  To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
ups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] Question about a flex component
 
 
  Hi,
 
  I am new to Flex. I am looking for help on designing a custom component
that will
  hold a lot of items. When the items exceed the number that are visible
in the ui
  of this horizontal component on the webpage an icon appears, which if
you click
  will show a list of the other components you can click again and restore
the ui with
  that item. Hope you understand what I am talking about. If not please
post for clarification.
 
  Thanks in advance,
 
  Veena
 






RE: [flexcoders] Re: Question about a flex component

2009-07-24 Thread Gordon Smith
You add child components which are UIComponents to a container like HBox.

But you add data items to a list-based control like HorizontalList. These data 
items then get displayed by item renderers, which are children which get 
automatically created to display data items. The children are managed by the 
list, not by you... you manage the data, not the renderers.

By default, data items are expected to have a 'label' property to display, 
unless you set the labelField or labelFunction of the list component. They can 
be plain Objects, or  instances of data classes, or anything else, but  
typically they aren't visual components.

Here's an example of adding two data items to a list using ActionScript.

myList.dataProvider = new ArrayCollection();
var item:Object;
item = { label: One, data: 1 };
myList.dataProvider.addItem(item);
item = { label: Two, data: 2 };
myList.dataProvider.addItem(item);

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Friday, July 24, 2009 3:19 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



Please help. The items are being added dynamically to the mx:HorizontalList 
id=test bottom=0 width=100%
backgroundColor=0x00 horizontalScrollPolicy=on
verticalScrollPolicy=off/ I debugged the code and the
items are being added, but I can't see them in the UI.
If I change mx:HorizontalList to mx:HBox I can see the items
in the UI. What am I doing wrong?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 No, I don't have an example and don't have time to create one for you since 
 I'm a development engineer, not a support engineer. But here is what you 
 should try, learning as you go:

 1. Create an app with an mx:HorizontalList.
 2. Make it show data items by assigning its dataProvider. Put in more data 
 items that will fit.
 3. Turn off its scrollbar by setting horizontalScrollPolicy=off.
 4. Create mx:Buttons for Previous and Next, positioned to the left and 
 right of the HorizontalList.
 5. In their 'click' handlers, put code like 
 horizontalList.horizontalScrollPosition += 1. Use -= for the Previous button.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena_kris2003
 Sent: Thursday, July 23, 2009 4:42 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Re: Question about a flex component



 Do you mind posting an example. It sounds like this is what I was looking 
 for. I need a horizontal list component with an icon at the right end of the 
 component that I can click and scroll to more items.

 Thanks,

 Veena

 --- In 
 flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com,
  Gordon Smith gosmith@ wrote:
 
  Why not just allow scrolling instead of paging? Scrolling components can 
  scroll through thousands of items quickly.
 
  Suppose there are 100 items and you can only see 10 at a time. So first you 
  see 0-9. When you click the icon you see 10-19. When you click it again 
  you'd see 20-29. So you'd need another icon (previous page instead of 
  next page) to go back to 10-19 and then 0-9.
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
   
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com]
   On Behalf Of veena pandit
  Sent: Thursday, July 23, 2009 10:22 AM
  To: 
  flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] Question about a flex component
 
 
  Hi,
 
  I am new to Flex. I am looking for help on designing a custom component 
  that will
  hold a lot of items. When the items exceed the number that are visible in 
  the ui
  of this horizontal component on the webpage an icon appears, which if you 
  click
  will show a list of the other components you can click again and restore 
  the ui with
  that item. Hope you understand what I am talking about. If not please post 
  for clarification.
 
  Thanks in advance,
 
  Veena