[flexcoders] Re: Question about using [RemoteClass(alias=...)]
Forgive me, I be a dingbat... By setting the [RemoteClass(alias=...)] line, the thing I got back from the server was not an ArrayCollection of generic Objects, but of strongly typed Review (AS) objects, which didn't need any casting. All solved now. Nothing to see here... On Mon, Sep 6, 2010 at 1:52 PM, John Mesheimer john.meshei...@gmail.comwrote: I have an ActionScript class that creates a custom Review object, like so: / Review.as / Taken from one of Adobe's online samples package samples.restaurant { import mx.formatters.DateFormatter; // [RemoteClass(alias=samples.restaurant.Review)] [Bindable] public class Review { public function Review(source:Object=null) { // some date formatting stuff happens here } public var restaurantId:int; public var restaurantName:String; public var restaurant:Object; public var reviewDate:Date; public var reviewer:String; public var rating:Number; public var title:String; public var reviewText:String; public var email:String; } } This class lets me take an ArrayCollection of generic Objects from the server, loop through it with something like new Review(source[i]) and get a bunch of Review objects in an ArrayCollection. Works perfectly. I also need to be able to write a Review object (a Java object) to the server, so I add [RemoteClass(alias=samples.restaurant.Review)] above the ActionScript class declaration. This way I can declare a public var review:Review, call an addReview(review) on my RemoteObject service, and my server receives a Review Java object. This works perfectly too. The problem is that once I add this [RemoteClass(alias=...)] line, doing new Review(source[i]) no longer works as expected. Given the same ArrayCollection of generic Objects as before, new Review(source[i]) will still create a Review object, but now all its properties are null. If I comment out the [RemoteClass(alias=...)] line I can properly cast generic objects to Review objects again (but then I am no longer able to send a Review Java object to the server). Is this the way it's supposed to work? (I hope I've stated my problem clearly.) How can I accomplish both tasks using a single Review.as class? Thanks for any help, folks. John PS. I am using the Flex 3.5 SDK.
[flexcoders] Re: Question: How to Catch/Handle of Exiting of AIR Application
thank you alex for replying, i was able to handle the exiting event but i would like to prompt a confirmation exit when ctrl+f4 is pressed before the actual exit. like before closing the app it would likely have an alert of confirmation of exit. --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Should be flash.events.Event.EXITING On 6/14/10 8:07 PM, Arik de Guzman arik...@... wrote: Hi, i would like to ask how can i catch an ALT+F4 close on my application so i set some rules/methods before exiting. i have tried catching a keyboard.keydown event, it directly closes the application. Thanks in advance for the people who would reply to this post :) -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: Question about currentTarget and Event:Listener
It would appear as if you never call createHandlers. Try this version... ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=createHandlers(event) mx:Script ![CDATA[ import mx.controls.Alert; public function createHandlers(e:Event):void { b1.addEventListener(MouseEvent.CLICK, submitForm); b2.addEventListener(MouseEvent.CLICK, submitForm); } private function submitForm(e:Event):void { // Handle event here. Alert.show(Current Target: + e.currentTarget.id); Alert.show( You clicked me); } ]]/mx:Script mx:HBox width=100% mx:Button id=b1 label=Click Me/ mx:Button id=b2 label=Click Me, Too/ /mx:HBox /mx:Application --- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote: How can I have the button responding when it is clicked with the message : you clicked me I tried but it but it does not work. import mx.controls.Alert; public function createHandlers(e:Event):void { b1.addEventListener(MouseEvent.CLICK, submitForm); b2.addEventListener(MouseEvent.CLICK, submitForm); } private function submitForm(e:Event):void { // Handle event here. Alert.show(Current Target: + e.currentTarget.id); Alert.show( You clicked me); } ]]/mx:Script mx:Button id=b1 label=Click Me/ mx:Button id=b2 label=Click Me, Too/ /mx:Application
[flexcoders] Re: Question/Problems extending RichTextEditor, Learning
The problem is that the toolbar is not created until the RichTextEditor has been added to the screen. Use CallLater to wait for that: private var a:DRTE = new DRTE(); private function oncreationComplete():void { this.callLater(doSetItems); addChild(a); } private function doSetItems():void { a.SetItems(); } --- In flexcoders@yahoogroups.com, timgerr tgallag...@... wrote: Hello all, I want to extend the RichTextEitor and I have a problem(s) with doing so. So I wrote A action script class trying to extend the Rich Text Editor. I wanted to just add a text box to the toolbar but am getting errors, here is my code: ackage com.DaNaTiRTE { import mx.controls.RichTextEditor; import mx.controls.TextInput; public class DRTE extends RichTextEditor { public function DRTE() { //TODO: implement function super(); } private var _width:int; private var _height:int; public function SetItems():void { var t:TextInput = new TextInput(); t.width = 40; this.toolbar.addChild(t); } } } I wanted to do somthing like this when I call the code var a:DRTE = new DRTE(); a.SetItems(); addChild(a); When I do the (a.SetItems) I get an error Error #1009: Cannot access a property or method of a null object reference.. Can someone tell me what I am doing wrong, and if so what I need to be doing correctly? I want to not just build this code but understand how to extend components. Thanks for the help and read. timgerr
Re: [flexcoders] Re: Question/Problems extending RichTextEditor, Learning
Don’t extend RichTextEditor. It is an mxml file. Just copy it and edit the mxml. On 2/18/10 10:12 AM, valdhor valdhorli...@embarqmail.com wrote: The problem is that the toolbar is not created until the RichTextEditor has been added to the screen. Use CallLater to wait for that: private var a:DRTE = new DRTE(); private function oncreationComplete():void { this.callLater(doSetItems); addChild(a); } private function doSetItems():void { a.SetItems(); } --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , timgerr tgallag...@... wrote: Hello all, I want to extend the RichTextEitor and I have a problem(s) with doing so. So I wrote A action script class trying to extend the Rich Text Editor. I wanted to just add a text box to the toolbar but am getting errors, here is my code: ackage com.DaNaTiRTE { import mx.controls.RichTextEditor; import mx.controls.TextInput; public class DRTE extends RichTextEditor { public function DRTE() { //TODO: implement function super(); } private var _width:int; private var _height:int; public function SetItems():void { var t:TextInput = new TextInput(); t.width = 40; this.toolbar.addChild(t); } } } I wanted to do somthing like this when I call the code var a:DRTE = new DRTE(); a.SetItems(); addChild(a); When I do the (a.SetItems) I get an error Error #1009: Cannot access a property or method of a null object reference.. Can someone tell me what I am doing wrong, and if so what I need to be doing correctly? I want to not just build this code but understand how to extend components. Thanks for the help and read. timgerr -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: Question about flex source
I think you will find in this sort of case its for readability. The Event is probably highlighted there for the function its before. --- In flexcoders@yahoogroups.com, ztpi1 zt...@... wrote: I notice that the flex source files have commented out sections like this one: ** * Dispatched after the Application has been initialized, * processed by the LayoutManager, and attached to the display list. * * @eventType mx.events.FlexEvent.APPLICATION_COMPLETE */ Is the @ symbol significant here? Does the compiler see the line with the @ symbol or is it merely for reader information? It is my understanding that the @ symbol denotes an XML attribute, is that the correct interpretation?
[flexcoders] Re: Question about flex source
Yes, I learned about ASDoc shortly after I posted this question. Thank you. --- In flexcoders@yahoogroups.com, Aaron Hardy aaronius...@... wrote: See here under asdoc tags: http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html The @eventType tells the ASDoc generator that what it's seeing on that line is something special and needs to be dealt with in a special way. It shouldn't affect your application's code execution in any way. I'm not from Adobe though so my response is nothing official...it's just what I've gathered from experience. Aaron On Sun, Jan 3, 2010 at 7:55 PM, ztpi1 zt...@... wrote: I notice that the flex source files have commented out sections like this one: ** * Dispatched after the Application has been initialized, * processed by the LayoutManager, and attached to the display list. * * @eventType mx.events.FlexEvent.APPLICATION_COMPLETE */ Is the @ symbol significant here? Does the compiler see the line with the @ symbol or is it merely for reader information? It is my understanding that the @ symbol denotes an XML attribute, is that the correct interpretation?
[flexcoders] Re: Question about getting the type of item / component with drag and drop
See #1 in Gordon's response. -TH --- In flexcoders@yahoogroups.com, timgerr tgallag...@... wrote: What is the best way to check if it is a panel? timgerr --- In flexcoders@yahoogroups.com, Gordon Smith gosmith@ wrote: 1. if (dragEvent.currentTarget is Panel) 2. currentTarget is generically typed as Object, which doesn't have an addChild() method. But if you have already checked that the dropTarget is a Panel, it's safe to do a cast: Panel(dragEvent.currentTarget).addChild(...); Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of timgerr Sent: Wednesday, December 09, 2009 12:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Question about getting the type of item / component with drag and drop Hello all, I have been tasked with creating a menu that gets build with drag and drop components. I have followed this tutorial (http://www.flexafterdark.com/tutorials/Flex-Drag-and-Drop) and have learned a lot. I have a few questions to get to the next stage so I will ask a few questions. 1. When I drop (or drag over) an item like a panel, how can I tell what that UIComponent is, how can I tell that is a panel? 2. How can I get that panel as an object so I can do something like panelid.addChild(new dropped item)? Thanks for the read, timgerr Here is the code that I have from the tutorial. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute name=Drag and Drop tutorial creationComplete=Init() mx:Script ![CDATA[ import mx.core.DragSource; import mx.core.IUIComponent; import mx.managers.DragManager; import mx.events.DragEvent; import mx.controls.Alert; public function Init():void { // a mouseDown event will start the drag this.redBox.addEventListener(MouseEvent.MOUSE_DOWN, BeginDrag); // accepting a drag/drop operation... this.blueBox.addEventListener( DragEvent.DRAG_ENTER,AcceptDrop); // handling the drop... this.blueBox.addEventListener( DragEvent.DRAG_DROP, handleDrop ); } private function BeginDrag(mouseEvent:MouseEvent):void { // the drag initiator is the object being dragged (target of the mouse event) var dragInitiator:IUIComponent = mouseEvent.currentTarget as IUIComponent; // the drag source contains data about what's being dragged var dragSource:DragSource = new DragSource(); // ask the DragManger to begin the drag DragManager.doDrag( dragInitiator, dragSource, mouseEvent, null ); } public function AcceptDrop(dragEvent:DragEvent):void { var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent; // accept the drop DragManager.acceptDragDrop( dropTarget ); // show feedback DragManager.showFeedback( DragManager.COPY ); } public function handleDrop( dragEvent:DragEvent ):void { var dragInitiator:IUIComponent = dragEvent.dragInitiator; var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent; Alert.show( You dropped the Red Box on the Blue Box! ); var obj:Object = dragEvent.target; } ]] /mx:Script mx:HBox horizontalGap=100 mx:Canvas id=redBox width=100 height=100 backgroundColor=Red / mx:Canvas id=blueBox width=100 height=100 backgroundColor=Blue / /mx:HBox /mx:Application
[flexcoders] Re: Question about getting the type of item / component with drag and drop
What is the best way to check if it is a panel? timgerr --- In flexcoders@yahoogroups.com, Gordon Smith gosm...@... wrote: 1. if (dragEvent.currentTarget is Panel) 2. currentTarget is generically typed as Object, which doesn't have an addChild() method. But if you have already checked that the dropTarget is a Panel, it's safe to do a cast: Panel(dragEvent.currentTarget).addChild(...); Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of timgerr Sent: Wednesday, December 09, 2009 12:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Question about getting the type of item / component with drag and drop Hello all, I have been tasked with creating a menu that gets build with drag and drop components. I have followed this tutorial (http://www.flexafterdark.com/tutorials/Flex-Drag-and-Drop) and have learned a lot. I have a few questions to get to the next stage so I will ask a few questions. 1. When I drop (or drag over) an item like a panel, how can I tell what that UIComponent is, how can I tell that is a panel? 2. How can I get that panel as an object so I can do something like panelid.addChild(new dropped item)? Thanks for the read, timgerr Here is the code that I have from the tutorial. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute name=Drag and Drop tutorial creationComplete=Init() mx:Script ![CDATA[ import mx.core.DragSource; import mx.core.IUIComponent; import mx.managers.DragManager; import mx.events.DragEvent; import mx.controls.Alert; public function Init():void { // a mouseDown event will start the drag this.redBox.addEventListener(MouseEvent.MOUSE_DOWN, BeginDrag); // accepting a drag/drop operation... this.blueBox.addEventListener( DragEvent.DRAG_ENTER,AcceptDrop); // handling the drop... this.blueBox.addEventListener( DragEvent.DRAG_DROP, handleDrop ); } private function BeginDrag(mouseEvent:MouseEvent):void { // the drag initiator is the object being dragged (target of the mouse event) var dragInitiator:IUIComponent = mouseEvent.currentTarget as IUIComponent; // the drag source contains data about what's being dragged var dragSource:DragSource = new DragSource(); // ask the DragManger to begin the drag DragManager.doDrag( dragInitiator, dragSource, mouseEvent, null ); } public function AcceptDrop(dragEvent:DragEvent):void { var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent; // accept the drop DragManager.acceptDragDrop( dropTarget ); // show feedback DragManager.showFeedback( DragManager.COPY ); } public function handleDrop( dragEvent:DragEvent ):void { var dragInitiator:IUIComponent = dragEvent.dragInitiator; var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent; Alert.show( You dropped the Red Box on the Blue Box! ); var obj:Object = dragEvent.target; } ]] /mx:Script mx:HBox horizontalGap=100 mx:Canvas id=redBox width=100 height=100 backgroundColor=Red / mx:Canvas id=blueBox width=100 height=100 backgroundColor=Blue / /mx:HBox /mx:Application
[flexcoders] Re: Question?? Best method for plotting a Moving Average
I did it with the SQL code instead... it's a really cool routine that calculates Mov Avg and Standard Deviation then the Bollinger Bands and I send that to FLEX... if anyone wants the SQL code let me know... cra...@steury.com (I don't receive emails from this thread) --- In flexcoders@yahoogroups.com, jc_bad28 jc_ba...@... wrote: I'll vouche for ta-lib as well. I used it in an excel trading/chart app I made years ago. My approach for the ticker data array would be to use a for..loop instead of hard coding. That way you could adjust a few paramaters. When it comes to technical indicators, I prefer making the calcs on the server side and then having the data available to be plotted passed/requested/whatever. The reason being I can use that data in whatever client I want versus trying to learn different ways of doing the same thing in different clients. Another approach you might want to look at is using a charting library that has built in functions for the traditional indicators. I've used ChartDirector from ASE in multiple clients and multiple platforms. http://www.advsofteng.com/ You could write up your charting section in whatever and then bring it into flex as an image. ChartDirector is also open enough that you can program custom indicators into as well which is something I've done quite a few times and is what really sold me on the product. --- In flexcoders@yahoogroups.com, Jake Churchill reynacho@ wrote: We do the same thing. See this screen shot: http://www.reynacho.com/wp-content/uploads/2009/05/cse-charting.jpg There's a lot more than just a moving average and bollinger bands there but those are parts of it. In order to get this data, we first tapped into a feed which you have to pay good money for. I believe we are using NxCore which I think is a DTN product. You might look into that but I know there are others as well. For the data, we pass data into a java library called ta-lib: http://ta-lib.org/ It has methods for moving averages, deviations, etc. We found that the calculations for our app were simply too intense to be done on the client. But, we have 5-7 years worth of data that we are looking at for calculations so you might not run into the same bottleneck we had -Jake On Fri, Oct 23, 2009 at 11:49 AM, cjsteury2 craigj@ wrote: answer.net SQL database through Web services call to Flex.../answer... would like to create a new Array based on existing Array of Ticker data.. So I need to create a new Array Collection then loop through and add the date from the Tickers Array Collection along with the Moving 20 day average of the Close Price... THEN ( I have not mentioned this ) What I REALLY want is a Standard Deviation Calcuation against the Moving Average to plot Upper and Lower Bollinger Bands Here's my initial guesstimate at building the new 20 Day Moving Average Array Collection from the Existing Array_Tickers ArrayCollection [Bindable] public var Array_BBands:ArrayCollection; (new mov avg Ac) public function bld_Array_BBands():void { Array_BBands = new ArrayCollection; for (var i:int=0;iArray_Tickers.length;i++) \\ loop through existing Array_Tickers { Array_BBands.addItem(Array_Tickers.getItemat(i).date); if (i=20) \\ start at 20th row - as Moving Avg is 20 day { var mavg_tick:Int = 0; \\ create variable to hold Moving Average mvag_tick = Array_Tickers.getItemAt(i).close.valueof(); \\ need to pick up the date of the Array_Tickers mvag_tick += Array_Tickers.getItemAt(i-1).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-2).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-3).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-4).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-5).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-6).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-7).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-8).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-9).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-10).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-11).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-12).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-13).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-14).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-15).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-16).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-17).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-18).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-19).close.valueof(); var mavg:Int = (mavg_tick/20); Array_BBands.addItem(mavg); } } } If that works ( and I have no idea if it will ) then I need to get the Standard
[flexcoders] Re: Question?? Best method for plotting a Moving Average
I'll vouche for ta-lib as well. I used it in an excel trading/chart app I made years ago. My approach for the ticker data array would be to use a for..loop instead of hard coding. That way you could adjust a few paramaters. When it comes to technical indicators, I prefer making the calcs on the server side and then having the data available to be plotted passed/requested/whatever. The reason being I can use that data in whatever client I want versus trying to learn different ways of doing the same thing in different clients. Another approach you might want to look at is using a charting library that has built in functions for the traditional indicators. I've used ChartDirector from ASE in multiple clients and multiple platforms. http://www.advsofteng.com/ You could write up your charting section in whatever and then bring it into flex as an image. ChartDirector is also open enough that you can program custom indicators into as well which is something I've done quite a few times and is what really sold me on the product. --- In flexcoders@yahoogroups.com, Jake Churchill reyna...@... wrote: We do the same thing. See this screen shot: http://www.reynacho.com/wp-content/uploads/2009/05/cse-charting.jpg There's a lot more than just a moving average and bollinger bands there but those are parts of it. In order to get this data, we first tapped into a feed which you have to pay good money for. I believe we are using NxCore which I think is a DTN product. You might look into that but I know there are others as well. For the data, we pass data into a java library called ta-lib: http://ta-lib.org/ It has methods for moving averages, deviations, etc. We found that the calculations for our app were simply too intense to be done on the client. But, we have 5-7 years worth of data that we are looking at for calculations so you might not run into the same bottleneck we had -Jake On Fri, Oct 23, 2009 at 11:49 AM, cjsteury2 cra...@... wrote: answer.net SQL database through Web services call to Flex.../answer... would like to create a new Array based on existing Array of Ticker data.. So I need to create a new Array Collection then loop through and add the date from the Tickers Array Collection along with the Moving 20 day average of the Close Price... THEN ( I have not mentioned this ) What I REALLY want is a Standard Deviation Calcuation against the Moving Average to plot Upper and Lower Bollinger Bands Here's my initial guesstimate at building the new 20 Day Moving Average Array Collection from the Existing Array_Tickers ArrayCollection [Bindable] public var Array_BBands:ArrayCollection; (new mov avg Ac) public function bld_Array_BBands():void { Array_BBands = new ArrayCollection; for (var i:int=0;iArray_Tickers.length;i++) \\ loop through existing Array_Tickers { Array_BBands.addItem(Array_Tickers.getItemat(i).date); if (i=20) \\ start at 20th row - as Moving Avg is 20 day { var mavg_tick:Int = 0; \\ create variable to hold Moving Average mvag_tick = Array_Tickers.getItemAt(i).close.valueof(); \\ need to pick up the date of the Array_Tickers mvag_tick += Array_Tickers.getItemAt(i-1).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-2).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-3).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-4).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-5).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-6).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-7).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-8).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-9).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-10).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-11).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-12).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-13).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-14).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-15).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-16).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-17).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-18).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-19).close.valueof(); var mavg:Int = (mavg_tick/20); Array_BBands.addItem(mavg); } } } If that works ( and I have no idea if it will ) then I need to get the Standard Deviation calcualted somehow. Because the Formula for what I really want as previously stated is The Bollinger Bands formular or (MA+K*sigma) Moving Average (20 period) + or - depending if it's upper or lower (2 * sigma) Sigma is the Standard Deviation, and I am fairly certain that actionscript does not calculate the Standard Deviation, so I'll need to do that somehow and I have no idea how to do that... This is a lot for me, and I don't
[flexcoders] Re: Question?? Best method for plotting a Moving Average
answer.net SQL database through Web services call to Flex.../answer... would like to create a new Array based on existing Array of Ticker data.. So I need to create a new Array Collection then loop through and add the date from the Tickers Array Collection along with the Moving 20 day average of the Close Price... THEN ( I have not mentioned this ) What I REALLY want is a Standard Deviation Calcuation against the Moving Average to plot Upper and Lower Bollinger Bands Here's my initial guesstimate at building the new 20 Day Moving Average Array Collection from the Existing Array_Tickers ArrayCollection [Bindable] public var Array_BBands:ArrayCollection; (new mov avg Ac) public function bld_Array_BBands():void { Array_BBands = new ArrayCollection; for (var i:int=0;iArray_Tickers.length;i++) \\ loop through existing Array_Tickers { Array_BBands.addItem(Array_Tickers.getItemat(i).date); if (i=20) \\ start at 20th row - as Moving Avg is 20 day { var mavg_tick:Int = 0; \\ create variable to hold Moving Average mvag_tick = Array_Tickers.getItemAt(i).close.valueof(); \\ need to pick up the date of the Array_Tickers mvag_tick += Array_Tickers.getItemAt(i-1).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-2).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-3).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-4).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-5).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-6).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-7).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-8).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-9).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-10).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-11).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-12).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-13).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-14).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-15).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-16).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-17).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-18).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-19).close.valueof(); var mavg:Int = (mavg_tick/20); Array_BBands.addItem(mavg); } } } If that works ( and I have no idea if it will ) then I need to get the Standard Deviation calcualted somehow. Because the Formula for what I really want as previously stated is The Bollinger Bands formular or (MA+K*sigma) Moving Average (20 period) + or - depending if it's upper or lower (2 * sigma) Sigma is the Standard Deviation, and I am fairly certain that actionscript does not calculate the Standard Deviation, so I'll need to do that somehow and I have no idea how to do that... This is a lot for me, and I don't expect you or others have the answers but I need to get the Std Deviation caclulated from the Mean Value above and this is how to do that... http://en.wikipedia.org/wiki/Standard_Deviation I am not sure exactly the best way to proceed, but if anyone has a suggestions... I guess I would take the difference of each number in the series above form the mean, divide the sum of the numbers by the count (20) and take the square root. It's a brain teaser and I am working on it a piece at a time. If anyone has a shortcut I'd take it. --- In flexcoders@yahoogroups.com, jc_bad28 jc_ba...@... wrote: How are you receiving your price data to plot? Price feed? Static file? What you could do is create a function to loop through the array and perform the moving average calculation and add the result as an extra column in the array. Are you plotting the full historic price data set? If so, your MA will begin at the nth bar where n is your MA period setting. eg.. a 20 day MA won't start until the 20th day into the data set. If you're using a static dataset, you could do the calculation in Excel and then save the entire datset as XML and just bring that into flex and plot the MA from the existing values. --- In flexcoders@yahoogroups.com, cjsteury2 craigj@ wrote: Hi all,
Re: [flexcoders] Re: Question?? Best method for plotting a Moving Average
We do the same thing. See this screen shot: http://www.reynacho.com/wp-content/uploads/2009/05/cse-charting.jpg There's a lot more than just a moving average and bollinger bands there but those are parts of it. In order to get this data, we first tapped into a feed which you have to pay good money for. I believe we are using NxCore which I think is a DTN product. You might look into that but I know there are others as well. For the data, we pass data into a java library called ta-lib: http://ta-lib.org/ It has methods for moving averages, deviations, etc. We found that the calculations for our app were simply too intense to be done on the client. But, we have 5-7 years worth of data that we are looking at for calculations so you might not run into the same bottleneck we had -Jake On Fri, Oct 23, 2009 at 11:49 AM, cjsteury2 cra...@steury.com wrote: answer.net SQL database through Web services call to Flex.../answer... would like to create a new Array based on existing Array of Ticker data.. So I need to create a new Array Collection then loop through and add the date from the Tickers Array Collection along with the Moving 20 day average of the Close Price... THEN ( I have not mentioned this ) What I REALLY want is a Standard Deviation Calcuation against the Moving Average to plot Upper and Lower Bollinger Bands Here's my initial guesstimate at building the new 20 Day Moving Average Array Collection from the Existing Array_Tickers ArrayCollection [Bindable] public var Array_BBands:ArrayCollection; (new mov avg Ac) public function bld_Array_BBands():void { Array_BBands = new ArrayCollection; for (var i:int=0;iArray_Tickers.length;i++) \\ loop through existing Array_Tickers { Array_BBands.addItem(Array_Tickers.getItemat(i).date); if (i=20) \\ start at 20th row - as Moving Avg is 20 day { var mavg_tick:Int = 0; \\ create variable to hold Moving Average mvag_tick = Array_Tickers.getItemAt(i).close.valueof(); \\ need to pick up the date of the Array_Tickers mvag_tick += Array_Tickers.getItemAt(i-1).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-2).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-3).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-4).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-5).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-6).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-7).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-8).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-9).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-10).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-11).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-12).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-13).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-14).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-15).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-16).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-17).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-18).close.valueof(); mvag_tick += Array_Tickers.getItemAt(i-19).close.valueof(); var mavg:Int = (mavg_tick/20); Array_BBands.addItem(mavg); } } } If that works ( and I have no idea if it will ) then I need to get the Standard Deviation calcualted somehow. Because the Formula for what I really want as previously stated is The Bollinger Bands formular or (MA+K*sigma) Moving Average (20 period) + or - depending if it's upper or lower (2 * sigma) Sigma is the Standard Deviation, and I am fairly certain that actionscript does not calculate the Standard Deviation, so I'll need to do that somehow and I have no idea how to do that... This is a lot for me, and I don't expect you or others have the answers but I need to get the Std Deviation caclulated from the Mean Value above and this is how to do that... http://en.wikipedia.org/wiki/Standard_Deviation I am not sure exactly the best way to proceed, but if anyone has a suggestions... I guess I would take the difference of each number in the series above form the mean, divide the sum of the numbers by the count (20) and take the square root. It's a brain teaser and I am working on it a piece at a time. If anyone has a shortcut I'd take it. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, jc_bad28 jc_ba...@... wrote: How are you receiving your price data to plot? Price feed? Static file? What you could do is create a function to loop through the array and perform the moving average calculation and add the result as an extra column in the array. Are you plotting the full historic price data set? If so, your MA will begin at the nth bar where n is your MA period setting. eg.. a 20 day MA won't start until the 20th day into the data set. If you're using a static dataset, you could do the calculation in Excel and then save the entire datset as XML and just bring
[flexcoders] Re: Question?? Best method for plotting a Moving Average
How are you receiving your price data to plot? Price feed? Static file? What you could do is create a function to loop through the array and perform the moving average calculation and add the result as an extra column in the array. Are you plotting the full historic price data set? If so, your MA will begin at the nth bar where n is your MA period setting. eg.. a 20 day MA won't start until the 20th day into the data set. If you're using a static dataset, you could do the calculation in Excel and then save the entire datset as XML and just bring that into flex and plot the MA from the existing values. --- In flexcoders@yahoogroups.com, cjsteury2 cra...@... wrote: Hi all, I am stumped. If I want to add an additional data series to a HLOC Chart that is a line series of a simple 20 day moving average for the closing price (Close) value in an array collection (Array_Tickers)... how would I perform that calculation in Flex? mx:lineSeries id=mavg dataprovider=Array_Tickers ySeries=Close / How would I calculate Close as {The SUM for the Value of Close for the previous 20 days / divided by 20}...
[flexcoders] Re: Question for Math guys/girls
What if the user should make the line shorter then 100 pixels does the marker go away, I don't think it's math more like an array collection of markers. You save the x,y coordinates of the marker, as the line gets bigger or smaller you replace the markers that fit on the line from the array's x,y coordinates... Add an click event listener to your container with the line, then create a function to add the x,y coordinates to an array. Without a code example I can only guess what you are trying to accomplish. You can create a timer to refresh your container with the markers from the array, or generate another event when the line changes length, or you add another marker. Do you have any code to share? Randy --- In flexcoders@yahoogroups.com, flexaustin flexaus...@... wrote: I have a line which can be horizontal or diagnol, and the user can make it longer or short by dragging an end. If the user should click anywhere on the line I need to keep track of this and place a marker or callout over this clicked spot on the line at all times. So if the user clicks say 1/4, say 100 pixels from the bottom of the line) the way down from the top left of a diagonal line I need to put a marker there. Then if the user drags the line to make it twice as long I still need that marker to be in the same spot. How would I do this math wise? And no I don't want it to be a percentage of the length of the line. Meaning I always want the spot to be 100 pixels from bottom of the line. TIA, J
Re: [flexcoders] Re: Question for Math guys/girls
Does the angle of the line ever change? Or is it always 45 or 0? If the angle changes then the X coordinate will change for any points on the line. I hope that you are not scaling a MC to grow/shrink the line. Rather you should be drawing the line with every mouse move event (or whatever method you are using to allow user interaction). Charles P. On Mon, Oct 19, 2009 at 6:23 PM, Netaman rtigr...@gmail.com wrote: What if the user should make the line shorter then 100 pixels does the marker go away, I don't think it's math more like an array collection of markers. You save the x,y coordinates of the marker, as the line gets bigger or smaller you replace the markers that fit on the line from the array's x,y coordinates... Add an click event listener to your container with the line, then create a function to add the x,y coordinates to an array. Without a code example I can only guess what you are trying to accomplish. You can create a timer to refresh your container with the markers from the array, or generate another event when the line changes length, or you add another marker. Do you have any code to share? Randy --- In flexcoders@yahoogroups.com, flexaustin flexaus...@... wrote: I have a line which can be horizontal or diagnol, and the user can make it longer or short by dragging an end. If the user should click anywhere on the line I need to keep track of this and place a marker or callout over this clicked spot on the line at all times. So if the user clicks say 1/4, say 100 pixels from the bottom of the line) the way down from the top left of a diagonal line I need to put a marker there. Then if the user drags the line to make it twice as long I still need that marker to be in the same spot. How would I do this math wise? And no I don't want it to be a percentage of the length of the line. Meaning I always want the spot to be 100 pixels from bottom of the line. TIA, J -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: Question for Math guys/girls
Good points. I guess it would need to be percentage based as I didn't think about them shrinking the line past the point, duh. Yes the length and angle of the line can change at any time. Also I am not placing a marker in the same mc or sprite, but rather a popup on the mainstage needs to hover over that point on the line. J --- In flexcoders@yahoogroups.com, Charles Parcell pokemonkil...@... wrote: Does the angle of the line ever change? Or is it always 45 or 0? If the angle changes then the X coordinate will change for any points on the line. I hope that you are not scaling a MC to grow/shrink the line. Rather you should be drawing the line with every mouse move event (or whatever method you are using to allow user interaction). Charles P. On Mon, Oct 19, 2009 at 6:23 PM, Netaman rtigr...@... wrote: What if the user should make the line shorter then 100 pixels does the marker go away, I don't think it's math more like an array collection of markers. You save the x,y coordinates of the marker, as the line gets bigger or smaller you replace the markers that fit on the line from the array's x,y coordinates... Add an click event listener to your container with the line, then create a function to add the x,y coordinates to an array. Without a code example I can only guess what you are trying to accomplish. You can create a timer to refresh your container with the markers from the array, or generate another event when the line changes length, or you add another marker. Do you have any code to share? Randy --- In flexcoders@yahoogroups.com, flexaustin flexaustin@ wrote: I have a line which can be horizontal or diagnol, and the user can make it longer or short by dragging an end. If the user should click anywhere on the line I need to keep track of this and place a marker or callout over this clicked spot on the line at all times. So if the user clicks say 1/4, say 100 pixels from the bottom of the line) the way down from the top left of a diagonal line I need to put a marker there. Then if the user drags the line to make it twice as long I still need that marker to be in the same spot. How would I do this math wise? And no I don't want it to be a percentage of the length of the line. Meaning I always want the spot to be 100 pixels from bottom of the line. TIA, J -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: question with text color CSS for mx:Button on roll over.
add textRollOverColor: #FF; --- In flexcoders@yahoogroups.com, Matt Muller matthewmul...@... wrote: Sorry if this is a really simple question. I have a button and im loading in an external stylesheet and setting the buttons styleName to .removeUserButton. * mx:Button id=removeUser styleName=removeUserButton label=Remove/* .removeUserButton { upSkin: Embed(/assets/images/btn_secondary_up.png); overSkin: Embed(/assets/images/btn_secondary_over.png); downSkin: Embed(/assets/images/btn_secondary_over.png); font-family: Arial; font-size:11; color:#FF; font-anti-alias-type:advanced; } This all works fine except when I roll over the button the text color changes to *BLACK*. I need to keep it *WHITE* as I have it set in the CSS. Any ideas? thanks, MaTT
Re: [flexcoders] Re: Question about how to learn Flex 3
fred44455 wrote: However I am a little confused. when I go to Flex 3.3 Language Reference , I see a mix of Flash and Flex(mx:) packages. Is that mean that I can use the Flash packages listed in the Language Reference to develop with Flex 3? Thanks You will probably end up using a mixture of the two languages. The Flex bits will help you get the screen assets together, the look and feel of it. This higher level Flex code, written in mxml (like xml), enables you to quickly get screen layout organised. This mxml also gives you extra services to call on, compared to AS3. The AS3 bits will add extra code to support what you do with the screen assets -boxes, etc. The AS3 code you use in Flash works in the same way in Flex, which uses a mixture of the two languages. Personally, all my projects look like Flash applications, written as ActionScript projects in Flex. I prefer Flex for coding. Eventually, I may use some Flex code, supported by AS3 to write some different types of applications. You will get more done with Flex but I think you will need AS3 eventually. I would learn both. Think of it as two tracks that merge or separate as the needs change. John
[flexcoders] Re: Question about event.label
For Menu controls, if the data provider is an Array of Strings, Flex uses each String value as the label. When a menu item is clicked, the item's label is passed to the ItemClickEvent's label property. It would be necessary to use name-value pairs, in the dataProvider, if you used the Menu's labelField or labelFunction properties. -TH --- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote: The label is not defined in this example. How can the label be called without an error? (('right side with ' + event.label)/) Thanks for your time. ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script public function showMsg(msg:String):void { mx.controls.Alert.show('You just clicked on ' + msg); } /mx:Script mx:Panel width=100 height=100 mx:PopUpMenuButton id=menuBtn dataProvider={['One','Two','Three']} click=showMsg('left side') itemClick=showMsg('right side with ' + event.label)/ /mx:Panel /mx:Application
[flexcoders] Re: Question about how to learn Flex 3
But will AS3 that I am learning under Flash CS3 be exactly the same than in Flex 3? I mean I understand that the packages are sometimes different have compatibility issues but what I am trying to say is will be able to apply my AS3 coding habits into Flex 3? --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: It will not be a waste of time under any circumstances, but if you are going to start developing flex apps, you should probably concentrate on the Flex framework. AS3 is AS3, in fact languages are languages and becoming productive in one is less about syntax and more about using the available classes effectively. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of fred44455 Sent: Sunday, August 09, 2009 1:28 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Question about how to learn Flex 3 I am learning AS3 with Actionscript 3 Esssential Training(Lynda.com) but I was told that the Flash packages are different from Flex 3 packages. Should I continue learning AS3 with this video? It use Flex 3 as compiler but does not use any mx. packages. Will I get confused when I start learning AS3 for Flex? I don't want to waste my time. Thanks for your time.
[flexcoders] Re: Question about how to learn Flex 3
However I am a little confused. when I go to Flex 3.3 Language Reference , I see a mix of Flash and Flex(mx:) packages. Is that mean that I can use the Flash packages listed in the Language Reference to develop with Flex 3? Thanks - In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: It will not be a waste of time under any circumstances, but if you are going to start developing flex apps, you should probably concentrate on the Flex framework. AS3 is AS3, in fact languages are languages and becoming productive in one is less about syntax and more about using the available classes effectively. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of fred44455 Sent: Sunday, August 09, 2009 1:28 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Question about how to learn Flex 3 I am learning AS3 with Actionscript 3 Esssential Training(Lynda.com) but I was told that the Flash packages are different from Flex 3 packages. Should I continue learning AS3 with this video? It use Flex 3 as compiler but does not use any mx. packages. Will I get confused when I start learning AS3 for Flex? I don't want to waste my time. Thanks for your time.
RE: [flexcoders] Re: Question about how to learn Flex 3
Yes, you can use the flash namespace packages listed in the Flex language reference in Flex. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of fred44455 Sent: Sunday, August 09, 2009 12:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Question about how to learn Flex 3 However I am a little confused. when I go to Flex 3.3 Language Reference , I see a mix of Flash and Flex(mx:) packages. Is that mean that I can use the Flash packages listed in the Language Reference to develop with Flex 3? Thanks - In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tracy Spratt tr...@... wrote: It will not be a waste of time under any circumstances, but if you are going to start developing flex apps, you should probably concentrate on the Flex framework. AS3 is AS3, in fact languages are languages and becoming productive in one is less about syntax and more about using the available classes effectively. Tracy Spratt, Lariat Services, development services available _ From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of fred44455 Sent: Sunday, August 09, 2009 1:28 AM To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: [flexcoders] Question about how to learn Flex 3 I am learning AS3 with Actionscript 3 Esssential Training(Lynda.com) but I was told that the Flash packages are different from Flex 3 packages. Should I continue learning AS3 with this video? It use Flex 3 as compiler but does not use any mx. packages. Will I get confused when I start learning AS3 for Flex? I don't want to waste my time. Thanks for your time.
RE: [flexcoders] Re: Question about how to learn Flex 3
Yes, the AS3 is the same. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of fred44455 Sent: Sunday, August 09, 2009 3:28 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Question about how to learn Flex 3 But will AS3 that I am learning under Flash CS3 be exactly the same than in Flex 3? I mean I understand that the packages are sometimes different have compatibility issues but what I am trying to say is will be able to apply my AS3 coding habits into Flex 3? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tracy Spratt tr...@... wrote: It will not be a waste of time under any circumstances, but if you are going to start developing flex apps, you should probably concentrate on the Flex framework. AS3 is AS3, in fact languages are languages and becoming productive in one is less about syntax and more about using the available classes effectively. Tracy Spratt, Lariat Services, development services available _ From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of fred44455 Sent: Sunday, August 09, 2009 1:28 AM To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: [flexcoders] Question about how to learn Flex 3 I am learning AS3 with Actionscript 3 Esssential Training(Lynda.com) but I was told that the Flash packages are different from Flex 3 packages. Should I continue learning AS3 with this video? It use Flex 3 as compiler but does not use any mx. packages. Will I get confused when I start learning AS3 for Flex? I don't want to waste my time. Thanks for your time.
[flexcoders] Re: Question about a flex component
I want to make the icons visible only if the horizontal scroll is enabled (because enough items were put in the horizontal list). How do I do that? Thanks, Veena --- In flexcoders@yahoogroups.com, veena_kris2003 v.kri...@... wrote: Hi, Thanks for your answer. Do you mind posting an example? Thanks, Veena --- In flexcoders@yahoogroups.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 [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
[flexcoders] Re: Question about a flex component
how do i make visible invisible the icons for previous/next? --- In flexcoders@yahoogroups.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
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
[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.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.com [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
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
[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.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.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 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 [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
RE: [flexcoders] Re: Question about a flex component
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
[flexcoders] Re: Question about a flex component
How do I extract the data portion of the item if the item looks like Object in the example below. --- In flexcoders@yahoogroups.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.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 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 [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
[flexcoders] Re: Question about a flex component
item.data --- In flexcoders@yahoogroups.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, 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 [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 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 [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
Re: [flexcoders] Re: Question about a flex component
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
[flexcoders] Re: Question about a flex component
Looks like an int to me. --- In flexcoders@yahoogroups.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.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.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
RE: [flexcoders] Re: Question about a flex component
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
[flexcoders] Re: Question about a flex component
There is an example in the documentation of the HorizontalList: http://livedocs.adobe.com/flex/3/langref/mx/controls/HorizontalList.html#includeExamplesSummary --- In flexcoders@yahoogroups.com, veena_kris2003 v.kri...@... wrote: Do you mind posting a complete example? Hope it is not too much to ask. --- In flexcoders@yahoogroups.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 [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
[flexcoders] Re: Question about a flex component
Hi, Thanks for your answer. Do you mind posting an example? Thanks, Veena --- In flexcoders@yahoogroups.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.com [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
[flexcoders] Re: Question about a flex component
I need an example of code, that dynamically(at runtime) adds objects to a horizontalList and that has eventhandlers for the selected item in the horizontalList. --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: There is an example in the documentation of the HorizontalList: http://livedocs.adobe.com/flex/3/langref/mx/controls/HorizontalList.html#includeExamplesSummary --- In flexcoders@yahoogroups.com, veena_kris2003 v.kris21@ wrote: Do you mind posting a complete example? Hope it is not too much to ask. --- In flexcoders@yahoogroups.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 [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
[flexcoders] Re: Question about a flex component
None of my messages are getting posted on this forum. The dataProvider is a ArrayCollection of cusom objects. I added listeners to each object before I added the object to the horizontal list at runtime. I am not sure how to propogate the events when an item is selected from the horizontal list. --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: 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 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: 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
[flexcoders] Re: Question about a flex component
I have two problems at this point. I used the following example, to modify my code. But problem 1 is: even though I added an eventListener to the object that I added to the HorizontalList, the eventListener is not getting called when I click on the object in the UI. problem 2 is: the horizontal scroll bar looks wierd, it does not look like it should. How should I proceed? much appreciated, Veena --- In flexcoders@yahoogroups.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.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 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 [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
[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, 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.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 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 [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
RE: [flexcoders] Re: Question about a flex component
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
[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, 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 [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 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 [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
RE: [flexcoders] Re: Question about a flex component
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
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
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
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
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
[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, 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.com [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
[flexcoders] Re: Question about a flex component
Do you mind posting a complete example? Hope it is not too much to ask. --- In flexcoders@yahoogroups.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.com [mailto:flexcod...@yahoogroups.com] On Behalf Of veena pandit Sent: Thursday, July 23, 2009 10:22 AM To: flexcoders@yahoogroups.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
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
[flexcoders] Re: Question about a flex component
When I have an HBox component and I dynamically add items, items get added, but when I have a HorizontalList and I dynamically add items, nothing gets added. The item I am trying to add is a class that extends mx.core.UIComponent. Thanks, Veena --- In flexcoders@yahoogroups.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.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 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.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
[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, 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.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 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.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
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
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
[flexcoders] Re: Question about ArrayCollections
for each ( var item:Object in socketsToMonitor ) { trace(item.ip); } -TH --- In flexcoders@yahoogroups.com, Raymond Brown silenttr...@... wrote: Here is some code of what I am using today: private function startAliveDeadCheck():void { startMonitor(127.0.0.1, 80); } private function startMonitor(location:String, port:uint):void { monitor = new SocketMonitor(location, port); monitor.addEventListener(StatusEvent.STATUS, checkStatus); monitor.pollInterval = 1000; // every second monitor.start(); } private function checkStatus(e:StatusEvent):void { if (monitor.available) { connectFlag.text = ONLINE; } else { connectFlag.text = OFFLINE; } } The code works fine if you are monitoring one and only one socket. I wanted to modify the code to handle a bindable arraycollection but can never seem to pull the data out. I try changing the first function to use this: [Bindable] private var socketsToMonitor:ArrayCollection = new ArrayCollection([ {ip:127.0.0.1, port:80, aliveOrDead:false, monitor:}, {ip:127.0.0.1, port:8080, aliveOrDead:false, monitor:} ]); everything is fine. but I hit errors when trying to pull out each array and starting a monitor on it. I tried for each (item in socketsToMonitor) { trace(it...@ip); } I get an [Object object] and not the IP address. Any idea's of where I am going wrong. Once I even achieve this I am assuming my attempt to monitor function will need to be redone. I welcome any pointers and thanks for the help. -ray
[flexcoders] Re: Question on Mx:HTTP Service
also you can have those flashvars in your Flex application like var str : String = Application.application.parameters.flashvars(name); /***/ AC_FL_RunContent( src, playerProductInstall, FlashVars, PUT YOUR VAR HEREMMredirectURL=+MMredirectURL+'MMplayerType='+MMPlayerType+'MMdoctitle='+MMdoctitle+, width, 100%, height, 100%, align, middle, id, CFMTest, quality, high, bgcolor, #869ca7, name, CFMTest, allowScriptAccess,sameDomain, type, application/x-shockwave-flash, pluginspage, http://www.adobe.com/go/getflashplayer; ); } else if (hasRequestedVersion) { // if we've detected an acceptable version // embed the Flash Content SWF when all tests are passed AC_FL_RunContent( src, CFMTest, width, 100%, height, 100%, align, middle, id, CFMTest, quality, high, bgcolor, #869ca7, name, CFMTest, FlashVars, PUT YOUR VAR HERE, allowScriptAccess,sameDomain, type, application/x-shockwave-flash, pluginspage, http://www.adobe.com/go/getflashplayer; ); /*/ and in the html wrapper also you can assign PHP , Coldfusion var in those ( ) so do whatever you want you can do with var str Now!!
[flexcoders] Re: Question on Mx:HTTP Service
--- In flexcoders@yahoogroups.com, myworld100us myworld10...@... wrote: I am using an app Server{Jboss] to host Flex files . I want to call mx:HTTPService id=reportProfile resultFormat=e4x useProxy=false result=showReports(event) url=http://machineName:8080/ContextPath/flex/showReports.do/ how do i replace this part url= http://machineName:8080/ContextPath/flex/showReports.do; with /ContextPath/flex/showreports.do . Otherwise its link depending on the environment i have to keep changing the machineName and port
[flexcoders] Re: Question regarding FLV protection
--- In flexcoders@yahoogroups.com, Jon Oxtoby j...@... wrote: We're using FMS 3.0, unfortunately the downloading software we're attempting to block (Jaksta) can handle an rtmpe stream no problem. We have the SWF verification enabled and that prevents the software from opening a new stream, but it's still able to record the stream as it plays in the video player. Our thought was that if we can apply some sort of non-standard encryption to the FLV file and then decrypt it prior to being played in the video player, that the recorded version would still be the encrypted one and the downloaded file would not play. We'll continue to look into this and if we happen upon a reasonable solution I'll post it back. What if you use something like afterEffects to embed an image on top of the middle of the video with a blendmode that inverts on the image colors, then simply overlay that same image in your player with the reverse blendmode. They can record all they want, but if they don't have the image to invert the middle of the video, they'll have a crap copy with a middle that doesn't make any sense.
[flexcoders] Re: Question regarding FLV protection
We're using FMS 3.0, unfortunately the downloading software we're attempting to block (Jaksta) can handle an rtmpe stream no problem. We have the SWF verification enabled and that prevents the software from opening a new stream, but it's still able to record the stream as it plays in the video player. Our thought was that if we can apply some sort of non-standard encryption to the FLV file and then decrypt it prior to being played in the video player, that the recorded version would still be the encrypted one and the downloaded file would not play. We'll continue to look into this and if we happen upon a reasonable solution I'll post it back. Thanks for the help! Jon --- In flexcoders@yahoogroups.com, Alain Thibodeau thibodeau.al...@... wrote: Hi there, What version of FMS are you using? I would recommend looking into: -rtmpe -verify your swf files -restrict to your domain (VHOST.ALLOW) A From: thomas parquier mailingli...@... To: flexcoders@yahoogroups.com Sent: Tuesday, May 5, 2009 4:19:48 AM Subject: Re: [flexcoders] Question regarding FLV protection I don't use fms, but couldnt streaming flv through https or rtmps do the work ? Or maybe a session based authorization ? thomas --- http://www.web- attitude. fr/ msn : thomas.parquier@ web-attitude. fr softphone : sip:webattitude@ ekiga.net téléphone portable : +33601 822 056 2009/5/4 Jon Oxtoby j...@plstudios. com Hi, We're currently using FMS 3.0 as a streaming solution in an effort to prevent people stealing our FLV's, with limited success. The main issue we're running into is people using stream downloading software which is basically creating a new connection to FMS and downloading the stream. My question is - is it possible to intercept the FLV stream coming into a Flex application before it goes into the buffer and edit those bytes? Basically I'm looking at the possibility of encrypting the FLV on the server and then decrypting it on the fly as it streams into the Flex application. Does anyone know if this is feasible or not, or if not, what about the idea of decrypting the data in the buffer prior to it being accessed by the video player? I'm still semi-new to the whole concept of streaming video and FLV playback so if this is a stupid question please be gentle :). Cheers __ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now http://ca.toolbar.yahoo.com.
[flexcoders] Re: question for services-config?
Those tokens are replaced at runtime using the values in the http request url. You can also use custom run-time tokens that are replaced using options that are passed to the JVM. The following section of the blazeds documentation explains this. http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=lcarch_4.html -Alex --- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: I have question for the following code: channel-definition id=my-amf class=mx.messaging.channels.AMFChannel endpoint uri=http://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ properties polling-enabledfalse/polling-enabled /properties /channel-definition which file can provice {server.name}, {server.port} and {context.root}, Which file I can change if I want to change them? Please give me the file name I can make some changes. Thanks Mark
[flexcoders] Re: Question for [Bindable(event=event)] syntax?
private var _name:String; [Bindable(nameChanged)] [Bindable(myNameChanged)] public function get name():String { return _name; } public function set name(value:String):void { if (_name == value) return; _name = value; dispatchEvent(new Event(nameChanged)); dispatchEvent(new Event(myNameChanged)); } --- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: I confuse the syntax if two event more events triage the Binding? Is the following syntax right or not? [Bindable(event=event1,event=event2,event=event3)] Thanks Mark
Re: [flexcoders] Re: Question for Amfphp and Flex RemoteObject ?
When you import flex.war in the eclipse or Flex Builder, you will see all those configuration files. Thanks, with Regards, Jitendra Jain --- On Sun, 29/3/09, Amy amyblankens...@bellsouth.net wrote: From: Amy amyblankens...@bellsouth.net Subject: [flexcoders] Re: Question for Amfphp and Flex RemoteObject ? To: flexcoders@yahoogroups.com Date: Sunday, 29 March, 2009, 7:42 PM --- In flexcod...@yahoogro ups.com, markflex2007 markflex2007@ ... wrote: Hi, I take a look the Amfphp server code and structure. I do not see service-config. xml and remoting-config. xml file. I need set connection with the two files in server if I use Flex remoteobject. service-config. xml is used for endpoint setting and remoting-config. xml is used for destination/ source setting. I never could figure out where those files were supposed to come from, either. I think that they get created when you use the wizard to generate the code for you. I do my remote objects like this: http://flexdiary. blogspot. com/2009/ 01/lazy-loading- tree-example- file-posted. html HTH; Amy Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
[flexcoders] Re: Question for Amfphp and Flex RemoteObject ?
--- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: Hi, I take a look the Amfphp server code and structure. I do not see service-config.xml and remoting-config.xml file. I need set connection with the two files in server if I use Flex remoteobject. service-config.xml is used for endpoint setting and remoting-config.xml is used for destination/source setting. I never could figure out where those files were supposed to come from, either. I think that they get created when you use the wizard to generate the code for you. I do my remote objects like this: http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html HTH; Amy
[flexcoders] Re: Question an how to create dynamic content with Flex
Never mind, I am a goof. timgerr --- In flexcoders@yahoogroups.com, timgerr tgallag...@... wrote: Hello all, I am creating an application that is a windowed system, I mean that I have windows that will launch and you can move them around. I have ad to create all my content dynamically in Action Script because when my windows close I remove the object. Here is my question for y'all, can I create flex code dynamically, if so how can I do it? Meaning that if I remove the Flex code widget object can I create it again? Thanks for the information. timgerr
[flexcoders] Re: Question about binding and circular reference
Is there anything more sweet than write a long post and see it vanish in the air? Perhaps Chrome plus Flexcoders' Rich-Text Editor (Beta) is asking too much :) I'll try again, shorter version. Another approach, if you're set on binding: Rather than the outer component waiting for creationComplete on the inner component to set the model value, simply put code in the inner component that waits for creationcomplete and creates the component-model return bindings programmatically via BindingUtils. Hi Josh. I didn't give up on bidirectional binding, but I admit to be close to the metal :) The strategy that seems to work is this: - a value object with two methods: saveOriginal and restoreOriginal, also useful to manage the form's cancel button - binding through BindingUtils into createComplete - a mono-binding for date fields, because of a bug in DateField.as Here is some code. In case of interest, I'll post the implementation. bindForCreate does a single bind, while bindForUpdate does two. Enri // a form [Bindable] public var vo:SomeVO; [Bindable] private var voOut:SomeVO; private var cws:Array = []; // used later to unbind private function creationComplete():void { if (vo.isNew) { extend(cws, bindForCreate(vo, 'date', datefield, 'selectedDate')); extend(cws, bindForCreate(vo, 'name', nameField, 'text')); } else { voOut = new SomeVO(); vo.saveOriginal(); extend(cws, bindForUpdateException(vo, voOut, 'date', datefield, 'selectedDate')); extend(cws, bindForUpdate(vo, 'name', nameField, 'text')); vo.restoreOriginal(); } }
Re: [flexcoders] Re: Question about binding and circular reference
Also, try using commiting event only bindings for the trip back to the model. I don't use it so I'm not sure, but it might be exactly what you're looking for. My View Model system doesn't have these problems (and keeps track of dirty fields, etc), but it's wordy. I do some code-generation with a combination of BeanScript voodoo in JEdit and a custom Flex app, which cuts down on the work. I'm not 100% happy with my pattern yet, and need to write a helper util to better manage binding events, but it's getting close to good enough to release to the public :) 2009/3/18 enriirne enrii...@yahoo.it Is there anything more sweet than write a long post and see it vanish in the air? Perhaps Chrome plus Flexcoders' Rich-Text Editor (Beta) is asking too much :) I'll try again, shorter version. Another approach, if you're set on binding: Rather than the outer component waiting for creationComplete on the inner component to set the model value, simply put code in the inner component that waits for creationcomplete and creates the component-model return bindings programmatically via BindingUtils. Hi Josh. I didn't give up on bidirectional binding, but I admit to be close to the metal :) The strategy that seems to work is this: - a value object with two methods: saveOriginal and restoreOriginal, also useful to manage the form's cancel button - binding through BindingUtils into createComplete - a mono-binding for date fields, because of a bug in DateField.as Here is some code. In case of interest, I'll post the implementation. bindForCreate does a single bind, while bindForUpdate does two. Enri // a form [Bindable] public var vo:SomeVO; [Bindable] private var voOut:SomeVO; private var cws:Array = []; // used later to unbind private function creationComplete():void { if (vo.isNew) { extend(cws, bindForCreate(vo, 'date', datefield, 'selectedDate')); extend(cws, bindForCreate(vo, 'name', nameField, 'text')); } else { voOut = new SomeVO(); vo.saveOriginal(); extend(cws, bindForUpdateException(vo, voOut, 'date', datefield, 'selectedDate')); extend(cws, bindForUpdate(vo, 'name', nameField, 'text')); vo.restoreOriginal(); } } -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - j...@joshmcdonald.info - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/
[flexcoders] Re: Question, I am having problems with my encrypted local store
ok, it looks like some byte madness is going on, why would my ints stored as a byteArray come back multiplied by 256? If I use floats they come back in exponential notation? ha! Any suggestions? By the way, aren't rectangle's primitive objects or not,i am storing the virtualbounds into a userVO with a getter/setter, because saving a rectangle as an object with writeObject returns null? Any ideas?? Thanks, Patrick --- In flexcoders@yahoogroups.com, djhatrick djhatr...@... wrote: I am saving some info, and when i save the int goes in correctly, but when I readInt() it comes out a lot bigger, I can't find the relationship Here's what i am dealing with: ##VirtualBounds (x=0, y=0, w=3200, h=1200) READING this.virtualBounds 0 0 819200 307200 It's really confusing, what's funny, is that I have had no problems in the past. Any help, please. Thanks, Patrick
[flexcoders] Re: Question, I am having problems with my encrypted local store - Solved
I was using a setter in an encrypted local store from a rectangle object, I store a generic object... I guess it couldn't write fast enough or something? but generic objects work fine. -- --- In flexcoders@yahoogroups.com, djhatrick djhatr...@... wrote: ok, it looks like some byte madness is going on, why would my ints stored as a byteArray come back multiplied by 256? If I use floats they come back in exponential notation? ha! Any suggestions? By the way, aren't rectangle's primitive objects or not,i am storing the virtualbounds into a userVO with a getter/setter, because saving a rectangle as an object with writeObject returns null? Any ideas?? Thanks, Patrick --- In flexcoders@yahoogroups.com, djhatrick djhatrick@ wrote: I am saving some info, and when i save the int goes in correctly, but when I readInt() it comes out a lot bigger, I can't find the relationship Here's what i am dealing with: ##VirtualBounds (x=0, y=0, w=3200, h=1200) READING this.virtualBounds 0 0 819200 307200 It's really confusing, what's funny, is that I have had no problems in the past. Any help, please. Thanks, Patrick
[flexcoders] Re: Question from a C developper
long (c++) -- uint (ActionScript) There is no struct option in ActionScript, you can only create a class. Only objects are pass by reference in ActionScript. Converting an int to Number: var i : int = 47; var num : Number = i as Number; --- In flexcoders@yahoogroups.com, christophe_jacquelin christophe_jacque...@... wrote: Hello, I am a C developper and now I am developing in Action Script. I have questions about ActionScript - Is it possible to define a variable as a long ? - How to program the overloading of an operator like the equal between 2 objects of a same class. - What is the equivalent of a structure ? - When I call a function with a parameter, did this parameter is modified when I return from this function ? - How to convert an int to a Number ? Thank you, Christophe,
[flexcoders] Re: Question from a C developper
Object equality can be done with the ObjectUtil.compare method or by utilization of the UID interface, depending on your needs. I prefer uint over Number for representing a long. --- In flexcoders@yahoogroups.com, Alain Thibodeau thibodeau.al...@... wrote: - Is it possible to define a variable as a long ? int is 32 bits and if you need bigger than go with Number http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_11.html - How to program the overloading of an operator like the equal between 2 objects of a same class. Overloading is not possible in AS3, but google around some ppl have workarounds - What is the equivalent of a structure ? I think you would want to use Object class...? - When I call a function with a parameter, did this parameter is modified when I return from this function ? All ActionScript objects are always passed by reference except primitive data types: Boolean, Number, int, uint, and String http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Partsfile=03_Language_and_Syntax_160_19.html - How to convert an int to a Number ? just cast it http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7f87.html From: christophe_jacquelin christophe_jacque...@... To: flexcoders@yahoogroups.com Sent: Thursday, March 12, 2009 10:27:32 AM Subject: [flexcoders] Question from a C developper Hello, I am a C developper and now I am developing in Action Script. I have questions about ActionScript - Is it possible to define a variable as a long ? - How to program the overloading of an operator like the equal between 2 objects of a same class. - What is the equivalent of a structure ? - When I call a function with a parameter, did this parameter is modified when I return from this function ? - How to convert an int to a Number ? Thank you, Christophe, __ Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! Canada Messenger at http://ca.beta.messenger.yahoo.com/
Re: [flexcoders] Re: Question from a C developper
I prefer uint over Number for representing a long. To clarify, uint is just that: an unsigned 32-bit integer. A long is (typically) a signed 64-bit integral number. A uint will allow you to express numbers that are twice as large as the largest int, but that's only a small fraction of the range of long (and it ignores the negative range entirely). A Number, as mentioned before, is an IEEE-754 double (64-bit floating point number). The problem with representing longs as double is that at some point, you'll find a long x such that ((Number) x) == ((Number) x + 1) due to the properties of IEEE-754 floating point (i.e., there simply aren't enough bits in the representation to distinguish those two). I'm not sure what that long x is exactly. So basically, there is no long in ActionScript. You can approximate one with uint, you can approximate one with Number, or you can write your own BigInteger class and do the math internally. That's probably going to be quite ugly and complicated, especially since you can't use operator overloading for basic arithmetic. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com
[flexcoders] Re: Question from a C developper
That's correct. My use of uint is not a perfect replacement for long and is based on assumptions made for a specific project. I should have been more clear about that. ActionScript does not support long for portability purposes. --- In flexcoders@yahoogroups.com, Maciek Sakrejda msakre...@... wrote: I prefer uint over Number for representing a long. To clarify, uint is just that: an unsigned 32-bit integer. A long is (typically) a signed 64-bit integral number. A uint will allow you to express numbers that are twice as large as the largest int, but that's only a small fraction of the range of long (and it ignores the negative range entirely). A Number, as mentioned before, is an IEEE-754 double (64-bit floating point number). The problem with representing longs as double is that at some point, you'll find a long x such that ((Number) x) == ((Number) x + 1) due to the properties of IEEE-754 floating point (i.e., there simply aren't enough bits in the representation to distinguish those two). I'm not sure what that long x is exactly. So basically, there is no long in ActionScript. You can approximate one with uint, you can approximate one with Number, or you can write your own BigInteger class and do the math internally. That's probably going to be quite ugly and complicated, especially since you can't use operator overloading for basic arithmetic. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com
[flexcoders] Re: Question for LCDS Development?
Hi Mark, The LCDS server is a J2EE web application so either putting your .class files in WEB-INF\classes or putting packaged jar files that contain your classes in WEB-INF\lib will work. Hope that helps. -Alex --- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: Hi, I want to know how to deploy my java code to LCDS server. Do I have to copy *.class files to WEB-INF\classes fold or I have to copy jar files to WEB-INF\bin folder. Please give me a idea.Thanks Mark
[flexcoders] Re: question for services-config?
How to do this if I need se end point like http://192.168.0.10:1080/mytest/mytestbroker/amf Thanks Mark
[flexcoders] Re: Question on DateField as itemrenderer
Here's my silly version: http://home.comcast.net/~max.nachlinger/dateFieldRenderer/ (view-source enabled) DateField implements IDataRenderer, IDropInListItemRenderer, and IListItemRenderer so it was quite easy to use it as an item-renderer for the DataGrid.
[flexcoders] Re: Question for Cairngorm with Flex Module?
--- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: Hi, I build a Flex Module with cairngorm ,I load the module in main application and I need to load it many times. it works fine when I load the module at first time but I get error when I load it again. The error message is : Only one ServiceLocator instance can be instantiated Do you have a idea to fix this.Thanks for help. Mark The ServiceLocator is a singleton as you probably already know, and if by any chance you have an instance in the shell app and another one in the module you'll get that error. You can put your service instance in the shell ServiceLocator and inject it into module when when the Ready event fires. If what i said is not the case with your app, then post some code and I'll have a look... Cheers, Claudiu
[flexcoders] Re: Question about popup
--- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: Here is my code: var c:Classes = new Classes(); var popupWindow:TitleWindow = new TitleWindow; this line works fine: popupWindow = c.showPopupWindow(DisplayObject(this), saveAsPriceList); var saveAs:saveAsPriceList = new saveAsPriceList; but this wouldn't compile: popupWindow = c.showPopupWindow(DisplayObject(this), saveAs); try: //use the full path if this is not in the same //package as the calling code var saveAs:Class = saveAsPriceList; HTH; Amy
[flexcoders] Re: Question about HTTPService and callbacks
Anybody, please, any idea? --- In flexcoders@yahoogroups.com, markgoldin_2000 [EMAIL PROTECTED] wrote: I am building a common library to shre it between diffrent projects. First of all it will be used for data access. I am using HTTPService for all my data needs. Data retrival is a generic operaton, but data processing is not. I need to provide a custom callback function for each service.send(parameters) result. I am defining a callback for service itself: service.addEventListener(result, httpResult); private function httpResult(event:ResultEvent):void { var result:Object = event.result; var xmlResult:XML = XML(result); // here I need to call a function(xmlResult) that is specified by a data requestor which is in a diffrent project. } I was able to acoomplish (well, sort of) that by having HTTPService code and custom callbacks code in one package: private function httpResult(event:ResultEvent):void { var result:Object = event.result; var xmlResult:XML = XML(result); this[CallbackToRun](xmlResult); } where CallbackToRun is defined prior the call. Any idea how to do that? Thanks
RE: [flexcoders] Re: Question about HTTPService and callbacks
I see a few ways to do this. The key to all of them is using AsyncToken. You could add a callback parameter to your components send() function. If you use a function, then you can place a callback function directly in the AsyncToken(Responder?) and have the result handler execute the function You could use a string that is the name of the callback function, put that in the AsyncToken, and in the handler, like you have done, use bracket notation to get a reference to and execute the function. You could pass in a string use a string that identifies the call, then have your component dispatch an event on result. Either use a custom event that contains the result data and call identifier, or expose the lastResult and callId in public properties. Have the handler for the components result event use that data to execute whatever you need. You can mix and match these approaches as well. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markgoldin_2000 Sent: Friday, October 10, 2008 8:12 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Question about HTTPService and callbacks Anybody, please, any idea? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , markgoldin_2000 [EMAIL PROTECTED] wrote: I am building a common library to shre it between diffrent projects. First of all it will be used for data access. I am using HTTPService for all my data needs. Data retrival is a generic operaton, but data processing is not. I need to provide a custom callback function for each service.send(parameters) result. I am defining a callback for service itself: service.addEventListener(result, httpResult); private function httpResult(event:ResultEvent):void { var result:Object = event.result; var xmlResult:XML = XML(result); // here I need to call a function(xmlResult) that is specified by a data requestor which is in a diffrent project. } I was able to acoomplish (well, sort of) that by having HTTPService code and custom callbacks code in one package: private function httpResult(event:ResultEvent):void { var result:Object = event.result; var xmlResult:XML = XML(result); this[CallbackToRun](xmlResult); } where CallbackToRun is defined prior the call. Any idea how to do that? Thanks
[flexcoders] Re: Question about launching a form from a MXML component.
Thanks, I forgot, I'm a silly little boy :). Tim --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: addChild(FRM) From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of timgerr Sent: Tuesday, September 09, 2008 9:30 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Question about launching a form from a MXML component. Hello all, I have this MXML component called users.mxml, here is what it looks like: mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=366 height=208 mx:Form id=nuNewUserForm x=36 height=198 mx:FormItem label=User Name required=true mx:TextInput id=username toolTip=Less than 16 characters invalid=IsValid('username',false) valid=IsValid('username',true)/ /mx:FormItem mx:FormItem label=First Name required=true mx:TextInput id=firstname maxChars=25 toolTip=Less than 25 characters invalid=IsValid('fistname',false) valid=IsValid('fistname',true)/ /mx:FormItem mx:FormItem label=Last Name required=true mx:TextInput id=lastname maxChars=25 toolTip=Less than 25 characters invalid=IsValid('lastname',false) valid=IsValid('lastname',true)/ /mx:FormItem mx:FormItem label=Email required=true mx:TextInput id=email maxChars=100 toolTip=Less than 100 characters invalid=IsValid('email',false) valid=IsValid('email',true)/ /mx:FormItem mx:Label id=NewUserDateLabel text={newUserDate}/ mx:Button id=NewUserSubmit enabled=true label=Submit click=Submit()/ /mx:Form /mx:Canvas I then want to add it to Master.MXML so I do this : mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=MasterInit() mx:Script ![CDATA[ import comp.users.*; private function MasterInit():void { var FRM:Users= new Users(); ]] /mx:Script /mx:Application Once the MasterInit() is called, what do I have to do in order to get the form from Usersto show? Thanks, Timgerr
[flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
I agree that states are probably a much better option than viewstacks because they are more dynamic. I probably will consider doing this as I move along for this reason. I guess I was just wondering if there was a better way than using constants in the modellocator to bind what state, or selected index, that a component is in. If I used states, am I correct in saying I would still need to have a static variable in the modellocator that each views state variable would have to bind to? I am thinking there must be a better way to decouple the view from the model in this instance. Thanks, I appreciate this great feedback. --- In flexcoders@yahoogroups.com, Justin J. Moses [EMAIL PROTECTED] wrote: For your application, have you considered separating your views within states, and only populate them on the EnterState event? You could employ modules that load up on that event, rather than preloading them with components. The advantage of using states is that when your user comes back to opened states, they show themselves as they were left. Although the obvious caveat is the memory they take up (which you'd need to analyse in the Flex Profiler - assuming ur using Flex Builder 3 Pro). You can create the states dynamically, say when your user logs in, to load up the modules that type of user might need.
Re: [flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
- Original Message - From: j301c [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, September 01, 2008 6:56 PM Subject: [flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm I agree that states are probably a much better option than viewstacks because they are more dynamic. I probably will consider doing this as I move along for this reason. I guess I was just wondering if there was a better way than using constants in the modellocator to bind what state, or selected index, that a component is in. If I used states, am I correct in saying I would still need to have a static variable in the modellocator that each views state variable would have to bind to? I am thinking there must be a better way to decouple the view from the model in this instance. Thanks, I appreciate this great feedback. I can't quite follow how your application is put together. Usually the view is bound to the model via the modellocator and I don't really see the problem with that. I'm not sure what you are doing with the constants in the modellocator. The model shouldn't be tracking what is happening in the view. Basically the view issues events to notify the model of what changes are happening and to cue the model to make changes to itself as a result of what is going on in the view. The model changes and via binding the view is updated. Paul --- In flexcoders@yahoogroups.com, Justin J. Moses [EMAIL PROTECTED] wrote: For your application, have you considered separating your views within states, and only populate them on the EnterState event? You could employ modules that load up on that event, rather than preloading them with components. The advantage of using states is that when your user comes back to opened states, they show themselves as they were left. Although the obvious caveat is the memory they take up (which you'd need to analyse in the Flex Profiler - assuming ur using Flex Builder 3 Pro). You can create the states dynamically, say when your user logs in, to load up the modules that type of user might need. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
OK, I see what you're saying. I'm actually fairly new to Cairngorm, so I'd be interested in what others have to say about this... Personally, in my app, I assigned modules to user roles, and used the class name of each module as the name of the that contains it. This seems like it might still be coupling the view and model too tightly, though I'm not certain. Anyone?
[flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
Paul, If you're trying to understand Cairngorm by reading the docs and going through the Cairngorm Store demo, you'll notice that the views are toggled via constants in the model: eg. if( model.workflowState == ShopModelLocator.VIEWING_PRODUCTS_IN_THUMBNAILS ) ... so the various views or different features/sections that the user sees in the store are: ShopModelLocator.VIEWING_PRODUCTS_IN_THUMBNAILS ShopModelLocator.VIEWING_PRODUCTS_IN_GRID ShopModelLocator.VIEWING_CHECKOUT So that would explain why both the original poster and myself, would assume that for various features in your own app - such as a My Profile, Inbox, Contacts for an email application for example - would have to be handled by a viewstack and a list of constants. Do you think the Cairngorm Store app has been written with inherent flaws? If so, then how would you rewrite it to illustrate the behaviour you mentioned before? cheers, Justin
Re: [flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
First of all, I'm no Cairngorm expert and I'm not going to criticise a reference implementation. For a store application (any store) I would consider that the model would hold details of the stock items and the baskets of any shoppers. I wouldn't have the model keep track of what the shopper is currently doing, because that's not something that affects the shop stock or the users basket. The view on the other hand is concerned with what the user is doing and needs to keep track of the view state in order to manage the interface. In this respect I would be using constants to represent view states but they would be constants associated with view classes not model classes. My feeling is that model classes need to be as far as possible separate from the view, so that in theory you could replace the view implementation without changing the model at all. Inevitably there is a coupling between view and model but it's in terms of how the model is manipulated and accessed by the view. That's how I think about these things. I've been wrong before and will be again and I have no criticism for the Cairngorm Store. I'm not sure that's helpful. Paul - Original Message - From: Justin J. Moses [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, September 02, 2008 12:33 AM Subject: [flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm Paul, If you're trying to understand Cairngorm by reading the docs and going through the Cairngorm Store demo, you'll notice that the views are toggled via constants in the model: eg. if( model.workflowState == ShopModelLocator.VIEWING_PRODUCTS_IN_THUMBNAILS ) ... so the various views or different features/sections that the user sees in the store are: ShopModelLocator.VIEWING_PRODUCTS_IN_THUMBNAILS ShopModelLocator.VIEWING_PRODUCTS_IN_GRID ShopModelLocator.VIEWING_CHECKOUT So that would explain why both the original poster and myself, would assume that for various features in your own app - such as a My Profile, Inbox, Contacts for an email application for example - would have to be handled by a viewstack and a list of constants. Do you think the Cairngorm Store app has been written with inherent flaws? If so, then how would you rewrite it to illustrate the behaviour you mentioned before? cheers, Justin -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
I think that's a fair point you've made and I can't understand why the constants are in the model either in the Cairngorm Store. Seems to me like there should be a Singleton related to the view holding the list of available views to switch between. But I'm no Cairngorm expert either :P justin
Re: [flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
personally, I leave States to component level 'dynamic Flexi-magik' and use Viewstacks for major view changes. Viewstacks just seem more appropriate for major view changes. States I leave to component changes, eg a edit vs view in a form or something like that. IIRC, States actually are more complicated in implementation too, in case that matters. I just think the intent of States was not application state, rather component state. DK On Mon, Sep 1, 2008 at 1:56 PM, j301c [EMAIL PROTECTED] wrote: I agree that states are probably a much better option than viewstacks because they are more dynamic. I probably will consider doing this as I move along for this reason. I guess I was just wondering if there was a better way than using constants in the modellocator to bind what state, or selected index, that a component is in. If I used states, am I correct in saying I would still need to have a static variable in the modellocator that each views state variable would have to bind to? I am thinking there must be a better way to decouple the view from the model in this instance. Thanks, I appreciate this great feedback. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Justin J. Moses [EMAIL PROTECTED] wrote: For your application, have you considered separating your views within states, and only populate them on the EnterState event? You could employ modules that load up on that event, rather than preloading them with components. The advantage of using states is that when your user comes back to opened states, they show themselves as they were left. Although the obvious caveat is the memory they take up (which you'd need to analyse in the Flex Profiler - assuming ur using Flex Builder 3 Pro). You can create the states dynamically, say when your user logs in, to load up the modules that type of user might need. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Re: Question about Best Practices for Applications with many views using Cairngorm
For your application, have you considered separating your views within states, and only populate them on the EnterState event? You could employ modules that load up on that event, rather than preloading them with components. The advantage of using states is that when your user comes back to opened states, they show themselves as they were left. Although the obvious caveat is the memory they take up (which you'd need to analyse in the Flex Profiler - assuming ur using Flex Builder 3 Pro). You can create the states dynamically, say when your user logs in, to load up the modules that type of user might need.
[flexcoders] Re: question about AMF
I am following ya. One thing though, how come if I load Module 1 before Module 2, I find no problems. I guess Flex is just magical like that! :) --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: It is essentailly the same problem. Each module has a definition but only one can be translated via AMF and if it is the wrong one you have trouble. So you have to use the same techniques to only have one definition of any class used by AMF From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 12:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: question about AMF Alex, after looking through the ppt, I do not know if this is the same issue. It seems to me the issue you pointed me to is when the two modules want to share a portion of code. I.E. a singleton enforced class. My problem seems to be different, I am actually trying to instantiate code that has no relation between the separate modules. I am not sure if that would cause the problem or not... I don't understand why it would give me this error, when I am basically saying the same thing as if I were to say for each( var s:String in event.result ) after all DataVO is just an abstract data type.. right? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Maciek Sakrejda msakrejda@ wrote: http://www.google.com/search?q=alex+harui+blog http://www.google.com/search?q=alex+harui+blog -Original Message- From: tchredeemed apthorp@ Reply-To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: question about AMF Date: Fri, 22 Aug 2008 17:57:47 - Where is your blog at? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Shared code problem. See modules presentation on my blog for more details. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 9:47 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] question about AMF I have a VO called DataVO. I have two modules that call an AMF service, which returns an array of VO's. Every once in a while, I get the error: TypeError: Error #1034: Type Coercion failed: cannot convert com.gh.vo::[EMAIL PROTECTED] to com.gh.vo.DataVO. However, I can only get the compiler to throw this error in 1 situation: I start the app, load Module 2, than Module 1, than go back to Module 2. After I arrive back at Module 2, it throws the error on the resultHandler of the RemoveObject service, in code that looks like this: private function resultHandler( event:ResultEvent ):void { var hash:Array = new Array(); for each( var data:DataVO in event.result ){ hash.push(data); } dataAC = new ArrayCollection( hash ); } It breaks on the for each() line. Any ideas?
RE: [flexcoders] Re: question about AMF
Don't know why it doesn't fail in that case, but it could be timing of some sort. The exception you got may always be from Module1 or 2 so then it would work depending on the order of loading. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Monday, August 25, 2008 6:20 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: question about AMF I am following ya. One thing though, how come if I load Module 1 before Module 2, I find no problems. I guess Flex is just magical like that! :) --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: It is essentailly the same problem. Each module has a definition but only one can be translated via AMF and if it is the wrong one you have trouble. So you have to use the same techniques to only have one definition of any class used by AMF From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 12:26 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: question about AMF Alex, after looking through the ppt, I do not know if this is the same issue. It seems to me the issue you pointed me to is when the two modules want to share a portion of code. I.E. a singleton enforced class. My problem seems to be different, I am actually trying to instantiate code that has no relation between the separate modules. I am not sure if that would cause the problem or not... I don't understand why it would give me this error, when I am basically saying the same thing as if I were to say for each( var s:String in event.result ) after all DataVO is just an abstract data type.. right? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Maciek Sakrejda msakrejda@ wrote: http://www.google.com/search?q=alex+harui+blog http://www.google.com/search?q=alex+harui+blog http://www.google.com/search?q=alex+harui+blog http://www.google.com/search?q=alex+harui+blog -Original Message- From: tchredeemed apthorp@ Reply-To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: question about AMF Date: Fri, 22 Aug 2008 17:57:47 - Where is your blog at? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Shared code problem. See modules presentation on my blog for more details. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 9:47 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] question about AMF I have a VO called DataVO. I have two modules that call an AMF service, which returns an array of VO's. Every once in a while, I get the error: TypeError: Error #1034: Type Coercion failed: cannot convert com.gh.vo::[EMAIL PROTECTED] to com.gh.vo.DataVO. However, I can only get the compiler to throw this error in 1 situation: I start the app, load Module 2, than Module 1, than go back to Module 2. After I arrive back at Module 2, it throws the error on the resultHandler of the RemoveObject service, in code that looks like this: private function resultHandler( event:ResultEvent ):void { var hash:Array = new Array(); for each( var data:DataVO in event.result ){ hash.push(data); } dataAC = new ArrayCollection( hash ); } It breaks on the for each() line. Any ideas?
[flexcoders] Re: question about AMF
Where is your blog at? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Shared code problem. See modules presentation on my blog for more details. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 9:47 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] question about AMF I have a VO called DataVO. I have two modules that call an AMF service, which returns an array of VO's. Every once in a while, I get the error: TypeError: Error #1034: Type Coercion failed: cannot convert com.gh.vo::[EMAIL PROTECTED] to com.gh.vo.DataVO. However, I can only get the compiler to throw this error in 1 situation: I start the app, load Module 2, than Module 1, than go back to Module 2. After I arrive back at Module 2, it throws the error on the resultHandler of the RemoveObject service, in code that looks like this: private function resultHandler( event:ResultEvent ):void { var hash:Array = new Array(); for each( var data:DataVO in event.result ){ hash.push(data); } dataAC = new ArrayCollection( hash ); } It breaks on the for each() line. Any ideas?
Re: [flexcoders] Re: question about AMF
http://www.google.com/search?q=alex+harui+blog -Original Message- From: tchredeemed [EMAIL PROTECTED] Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: question about AMF Date: Fri, 22 Aug 2008 17:57:47 - Where is your blog at? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Shared code problem. See modules presentation on my blog for more details. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 9:47 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] question about AMF I have a VO called DataVO. I have two modules that call an AMF service, which returns an array of VO's. Every once in a while, I get the error: TypeError: Error #1034: Type Coercion failed: cannot convert com.gh.vo::[EMAIL PROTECTED] to com.gh.vo.DataVO. However, I can only get the compiler to throw this error in 1 situation: I start the app, load Module 2, than Module 1, than go back to Module 2. After I arrive back at Module 2, it throws the error on the resultHandler of the RemoveObject service, in code that looks like this: private function resultHandler( event:ResultEvent ):void { var hash:Array = new Array(); for each( var data:DataVO in event.result ){ hash.push(data); } dataAC = new ArrayCollection( hash ); } It breaks on the for each() line. Any ideas?
[flexcoders] Re: question about AMF
Alex, after looking through the ppt, I do not know if this is the same issue. It seems to me the issue you pointed me to is when the two modules want to share a portion of code. I.E. a singleton enforced class. My problem seems to be different, I am actually trying to instantiate code that has no relation between the separate modules. I am not sure if that would cause the problem or not... I don't understand why it would give me this error, when I am basically saying the same thing as if I were to say for each( var s:String in event.result ) after all DataVO is just an abstract data type.. right? --- In flexcoders@yahoogroups.com, Maciek Sakrejda [EMAIL PROTECTED] wrote: http://www.google.com/search?q=alex+harui+blog -Original Message- From: tchredeemed [EMAIL PROTECTED] Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: question about AMF Date: Fri, 22 Aug 2008 17:57:47 - Where is your blog at? --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: Shared code problem. See modules presentation on my blog for more details. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 9:47 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] question about AMF I have a VO called DataVO. I have two modules that call an AMF service, which returns an array of VO's. Every once in a while, I get the error: TypeError: Error #1034: Type Coercion failed: cannot convert com.gh.vo::[EMAIL PROTECTED] to com.gh.vo.DataVO. However, I can only get the compiler to throw this error in 1 situation: I start the app, load Module 2, than Module 1, than go back to Module 2. After I arrive back at Module 2, it throws the error on the resultHandler of the RemoveObject service, in code that looks like this: private function resultHandler( event:ResultEvent ):void { var hash:Array = new Array(); for each( var data:DataVO in event.result ){ hash.push(data); } dataAC = new ArrayCollection( hash ); } It breaks on the for each() line. Any ideas?
RE: [flexcoders] Re: question about AMF
It is essentailly the same problem. Each module has a definition but only one can be translated via AMF and if it is the wrong one you have trouble. So you have to use the same techniques to only have one definition of any class used by AMF From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 12:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: question about AMF Alex, after looking through the ppt, I do not know if this is the same issue. It seems to me the issue you pointed me to is when the two modules want to share a portion of code. I.E. a singleton enforced class. My problem seems to be different, I am actually trying to instantiate code that has no relation between the separate modules. I am not sure if that would cause the problem or not... I don't understand why it would give me this error, when I am basically saying the same thing as if I were to say for each( var s:String in event.result ) after all DataVO is just an abstract data type.. right? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Maciek Sakrejda [EMAIL PROTECTED] wrote: http://www.google.com/search?q=alex+harui+blog http://www.google.com/search?q=alex+harui+blog -Original Message- From: tchredeemed [EMAIL PROTECTED] Reply-To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: question about AMF Date: Fri, 22 Aug 2008 17:57:47 - Where is your blog at? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Shared code problem. See modules presentation on my blog for more details. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of tchredeemed Sent: Friday, August 22, 2008 9:47 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] question about AMF I have a VO called DataVO. I have two modules that call an AMF service, which returns an array of VO's. Every once in a while, I get the error: TypeError: Error #1034: Type Coercion failed: cannot convert com.gh.vo::[EMAIL PROTECTED] to com.gh.vo.DataVO. However, I can only get the compiler to throw this error in 1 situation: I start the app, load Module 2, than Module 1, than go back to Module 2. After I arrive back at Module 2, it throws the error on the resultHandler of the RemoveObject service, in code that looks like this: private function resultHandler( event:ResultEvent ):void { var hash:Array = new Array(); for each( var data:DataVO in event.result ){ hash.push(data); } dataAC = new ArrayCollection( hash ); } It breaks on the for each() line. Any ideas?
[flexcoders] Re: Question for TextArea display ?
This is a test. I need to extend TextArea to disply data from bottom to top. do you have any idea? Thanks Mark
RE: [flexcoders] Re: Question for TextArea display ?
What does This is a test mean? TextArea doesn't display data, it displays text. It uses TextField, a Flash Player class, to display that text, and TextField cannot display text from bottom to top. If your text consists of short non-wrapped lines ending with \n, then using String.split() to split your text into lines, Array.reverse() to reverse the lines, and String.join() to reassemble them in the opposite order. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: Monday, August 11, 2008 9:58 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Question for TextArea display ? This is a test. I need to extend TextArea to disply data from bottom to top. do you have any idea? Thanks Mark
RE: [flexcoders] Re: Question for TextArea display ?
Split the string into an Array,and reverse it. But I bet that is not really what you want. What do you want? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: Monday, August 11, 2008 12:58 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Question for TextArea display ? This is a test. I need to extend TextArea to disply data from bottom to top. do you have any idea? Thanks Mark
[flexcoders] Re: Question about Changewatch?
Did you declare the variable theChange as Bindable? This works for me: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=init() mx:Script ![CDATA[ import mx.controls.Alert; import mx.binding.utils.BindingUtils; [Bindable] public var theChange:Boolean; private function init():void { BindingUtils.bindProperty(this,onChange, this, theChange ); } public function set onChange(value:Boolean):void { Alert.show(change happen); } private function finishit():void { theChange = true; theChange = false; } ]] /mx:Script mx:Button x=105 y=359 label=save click=finishit()/ /mx:Application --- In flexcoders@yahoogroups.com, markflex2007 [EMAIL PROTECTED] wrote: Hi, I did a simple test for changewatch.I try to watch a variable change.but I am not sure why it doesn't work. (variable theChange change from true to false) The code is here: BindingUtils.bindProperty(this,onChange, this, theChange ); } public function set onChange (value:Boolean):void { Alert.show (change happen); } private function finishit():void{ theChange = true; theChange = false; } ]] /mx:Script mx:Button x=105 y=359 label=save click=finishit()/ /mx:Application Thanks for help Mark