Re: [flexcoders] Re: modify item before binding to datagrid
Hi Tracy, Apologies but I am quite new with Flex. Here are my codes: ?xml version=1.0 encoding=utf-8? layout=vertical backgroundGradientColors=[#FFCC00, #993300] horizontalAlign=left mx:Script ![CDATA[ import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.rpc.soap.mxml.WebService; import mx.managers.CursorManager; /** * @bindable * @private * @property Will hold the data passed from the web service. */ [Bindable] private var _xmlData:XML; private function clickHandler(event:MouseEvent) :void { CursorManager.setBusyCursor(); event.target.enabled = false; var service:WebService = new WebService(); service.addEventListener(ResultEvent.RESULT, serviceResultHandler); service.addEventListener(FaultEvent.FAULT, serviceFaultHandler); service.loadWSDL(http://localhost:55841/Service1.asmx?WSDL;); service.RetrieveSuppliers2(); } private function serviceResultHandler(event:ResultEvent) :void { CursorManager.removeBusyCursor(); _xmlData = XML(event.result); this.dataGrid.visible = true; } private function serviceFaultHandler(event:FaultEvent) :void { CursorManager.removeBusyCursor(); Alert.show(String(event.fault), Error); this.btnLoad.enabled = true; } private function getDataItems() :void { var intSelected:int; var strID:String; var strContactName:String; var strCompanyName:String; intSelected = dataGrid.selectedIndex; strID = dataGrid.selectedItem.ID; strCompanyName = dataGrid.selectedItem.CompanyName; txtID.text = strID; txtCompanyName.text = strCompanyName; //Alert.show(strCompanyName, intSelected.toString()); } //private function sortNumericColumn(itemA:Object, itemB:Object): int //{ //return ObjectUtil.numericCompare(itemA[dataGrid.SupplierID], itemB[dataGrid.SupplierID]); //} ]] /mx:Script mx:VBox horizontalCenter=0 verticalCenter=0 horizontalScrollPolicy=off verticalScrollPolicy=off height=100% width=100% mx:Button id=btnLoad label=Load / Display Data width=500 click=clickHandler(event); / mx:HDividedBox width=100% height=100% mx:HBox width=70% height=100% borderStyle=solid mx:DataGrid id=dataGrid width=100% height=100% visible=false dataProvider={_xmlData.*} itemClick=getDataItems(); mx:columns mx:DataGridColumn headerText=ID dataField=SupplierID width=30/ mx:DataGridColumn headerText=Company Name dataField=CompanyName width=100/ mx:DataGridColumn headerText=Contact Name dataField=ContactName width=100/ mx:DataGridColumn headerText=Contact Title dataField=ContactTitle width=50/ mx:DataGridColumn headerText=Address dataField=Address width=150/ /mx:columns /mx:DataGrid /mx:HBox mx:HBox width=30% height=100% borderStyle=solid mx:Form id=frmDetails label=Details mx:FormItem direction=vertical label=Company Name required=true mx:TextInput id=txtID editable=false/ mx:TextInput id=txtCompanyName / mx:TextInput id=txtContactName / mx:TextInput id=txtContactTitle / /mx:FormItem /mx:Form /mx:HBox /mx:HDividedBox /mx:VBox /mx:Application In the code above, where do I place the resultFormat=e4x which you specified? Also, is there a way that instead of clicking a button, my datagrid would automatically retrieve during the start of the application (when I run the web page)? I am trying slowly to work on techniques, gaining more firm understanding through simple application which am trying to build. Thanks. From: Tracy Spratt tr...@nts3rd.com To: flexcoders@yahoogroups.com Sent: Thursday, 21 May, 2009 11:10:46 Subject: RE: [flexcoders] Re: modify item before binding to datagrid Here is
Re: [flexcoders] Re: modify item before binding to datagrid
Hi Mark, I cannot seem to get your code working for me.. I am getting this error: Access of Undefined Property ObjectUtil.. I am trying to simply copy the function which you have posted. Any further advise? From: markgoldin_2000 markgoldin_2...@yahoo.com To: flexcoders@yahoogroups.com Sent: Wednesday, 20 May, 2009 21:52:25 Subject: [flexcoders] Re: modify item before binding to datagrid Angelo, did you try the code I have replied to you with? --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: My apologies but I forgot to mention that I am getting the data from a .NET web service which is a dataset and then returned via string (XML) using the .NET function String strConn = ConfigurationManage r.ConnectionStri ngs[conString ].ConnectionStri ng; SqlConnection dbConnection = new SqlConnection( strConn); String strCommand = SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address FROM Suppliers ; SqlDataAdapter objCommand = new SqlDataAdapter( strCommand, dbConnection) ; DataSet DS = new DataSet(); objCommand.Fill( DS); dbConnection. Close(); dbConnection = null; DataTable DT = DS.Tables[0] ; return DS.GetXml(); So, basically, I think the SupplierID which is numeric originally becomes a string. How can I then prior to binding the same to the datagrid control, convert its data type back to numeric so that when I perform a sort, it would sort the supplierID interpreting it as a numeric value? Thanks. _ _ __ From: markgoldin_2000 markgoldin_ 2...@... To: flexcod...@yahoogro ups.com Sent: Monday, 18 May, 2009 23:44:33 Subject: [flexcoders] Re: modify item before binding to datagrid Here is what I am doing. column definition: mx:DataGridColumn headerText= Block dataField=tcbkcd sortCompareFunction =sortNumericCol umnTrackTotal / and: private function sortNumericColumnTr ackTotal( itemA:Object, itemB:Object) :int { return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); } where TrackTotal is a DG's id. HTH --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: Hi. I am quite new in Flex and would like to ask a simple question. I am retrieving datasets from a .NET webservice and binding the same to a datagrid. The datagrid comes with a feature that when you click on any of the headers, the column is sorted ASC or DESC. Now, one column which I am binding to is originally a numeric column. But when it binds to the datagrid, it's data type becomes string. Is it possible that prior to binding the said column to the datagrid, I would be able to convert it back to its numeric data taype? Since sorting the column in a string format would give a different result as compared to sorting the same column in a numeric format. Thanks. Regards.
RE: [flexcoders] Re: Embedding fonts dynamically...
You shouldn't need to unregister. We use weak references. I'm guessing that something else is preventing the module from unloading. Try using the profiler and see what is holding onto the module Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rid_b80 Sent: Thursday, May 21, 2009 8:13 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... Yes, I'm left the applicationDomain parameter to default. i'm jut wondering is there any information to do what's mentioned below. Using Flex to create the font swfs and is it possible to unregister font using the embeededFontregistry. Thanks, you help is much appreciated --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aha...@... wrote: Not if the fonts get registered with registerFont. If you use Flex to create the font swfs you shouldn't need to call registerFont, but they may not show up in enumerateFonts. However they should get registered with the embeddedFontRegistry and work properly. I assume you showed the exact call to loadStyleDeclarations and aren't messing with the applicationDomain parameter? Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rid_b80 Sent: Thursday, May 21, 2009 1:26 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... I guess what i'm trying to do is this when i call like StyleManager.loadStyleDeclarations(css/font1.swf); StyleManager.loadStyleDeclarations(css/font2.swf); and i call var fontList:array = Font.enumerateFonts(false); my fontList will be something like (font1,font2) Then when i go StyleManager.unloadStyleDeclarations(css/font1.swf); StyleManager.unloadStyleDeclarations(css/font2.swf); StyleManager.loadStyleDeclarations(css/font3.swf); StyleManager.loadStyleDeclarations(css/font4.swf); then var fontList:array = Font.enumerateFonts(false); my fontList is (font1,font2,font3,font4) not just (font3 and font4) I'm just wondering if there is anyway to do that Thanks --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: It should work, but depending on which class is going to display the text, you might also need to use ContextualClassFactory and/or package those classes into the same modules as the fonts. See other posts by me on embedded fonts. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rid_b80 Sent: Wednesday, May 20, 2009 7:04 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... I've tried this and it doesnt seems to unload the previous fonts Is anyone having that problem as well? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Wildbore, Brendon B.J.Wildbore@ wrote: Hi, One way of achieving this is two have a number of different stylesheets with the embedded fonts in them. Use the stylemanager class to change the stylesheet to display the font you would like. Eg. var oldStyleFile:String = /css/basicfont.swf; try{ StyleManager.unloadStyleDeclarations(oldStyleFile); }catch(err:Error){trace(error removing oldStyleFile style);} //add new theme var newStyleFile:String = /css/funkyfont.swf; try{ StyleManager.loadStyleDeclarations(newStyleFile); }catch(err:Error){trace(error loading newStyleFile style);} Hope this helps 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 tchredeemed Sent: Thursday, 4 December 2008 7:37 a.m. To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Embedding fonts dynamically... How would I do that? Also, do you
[flexcoders] Re: one to one chat
http://labs.adobe.com/technologies/stratus/ --- In flexcoders@yahoogroups.com, Pedro Sena sena.pe...@... wrote: On the other hand I would recommend you GraniteDS IMHO its easier than BlazeDS Make your try On Thu, May 21, 2009 at 4:20 PM, valdhor valdhorli...@...wrote: Depends on your back end. Here is one I got with a quick Google search... http://learn.adobe.com/wiki/display/Flex/Creating+a+BlazeDS+messaging+application+in+Flex+Builder Also, WebORB has a sample chat application. Check them out at http://www.themidnightcoders.com HTH Steve --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, dev.achiever dev.achiever@ wrote: Please help me one to one chat application develop by using flex -- /** * Pedro Sena * Systems Architect * Sun Certified Java Programmer * Sun Certified Web Component Developer */
[flexcoders] Re: Flash to JPG
Hi! thank you for your tip. I'll try this one. --- In flexcoders@yahoogroups.com, filipevirginio filipetor...@... wrote: Hi, you can use ImageSnapshot class: http://livedocs.adobe.com/flex/3/langref/mx/graphics/ImageSnapshot.html --- In flexcoders@yahoogroups.com, halfbaked11704 halfbaked11704@ wrote: hello everyone! I am new to this community. I have a problem regarding flash. How to save .swf file to a .jpg format?
[flexcoders] Getting data out of a DataGrid...
Ok, given the following: mx:DataGrid id=membersListDG dataProvider={membersList} itemClick=membersListDGItemClickHandler(event); mx:columns mx:DataGridColumn headerText=Last Name dataField=last_name width=80/ mx:DataGridColumn headerText=First Name dataField=first_name width=80/ mx:DataGridColumn headerText=Address dataField=address1 width=160/ mx:DataGridColumn headerText=City dataField=city width=80/ mx:DataGridColumn headerText=State dataField=state width=40/ mx:DataGridColumn dataField={_regCodeVO.validation_field}/ /mx:columns /mx:DataGrid How do I get the data out of the 6th column there? I don't know the name of the field, so the 'event.itemRenderer.data.fieldName' won't work. And something 'event.itemRenderer.data.(regCodeVO.validation_field)' won't work either... So how do you get the data out of a DataGrid when you have the field you need stored in a String, instead of hard-coded into the program? Thanks, Laurence MacNeill Mableton, Georgia, USA
[flexcoders] Formatting my messages on this list...
Why is it, every single time I post a message with some code in it, the formatting is always removed? All those tabs and spaces I have in there to make my code look halfway decent are all gone when the message is posted. Anyone know how to stop the formatting from being removed like that? Thanks, Laurence MacNeill Mableton, Georgia, USA
[flexcoders] Problem converting Flex app to AIR
Ok the original web based application uses a lot of RSL/modules launched from a central 'desktop'. We converted this to AIR and can launch the application and display the 'desktop'. Our problem is when we try to pop up a window. These are TitleWindow's that originally were loaded via PopupManager. We now instead create a NativeWindow and then use NativeWindow.stage.addChild() to add our TitleWindow. Problem is that although the NativeWindow appears (can see it and also see it in teh TaskBar) it is empty, just a white background. Actually checking the TitleWindow we found the constructor runs but initialize etc. never gets called. Assume it something simple weve missed but don't know what any ideas. tks
[flexcoders] Re: Formatting my messages on this list...
Hi, this is not a solution for your question,but if you replay from the forum with the Rich-Text Editor that still are in beta, works almost. --- In flexcoders@yahoogroups.com, laurence5905 lmacne...@... wrote: Why is it, every single time I post a message with some code in it, the formatting is always removed? All those tabs and spaces I have in there to make my code look halfway decent are all gone when the message is posted. Anyone know how to stop the formatting from being removed like that? Thanks, Laurence MacNeill Mableton, Georgia, USA
[flexcoders] localized parseFloat
Hi, Couldn't parseFloat() use the SharedResources properties to parse localized strings ? thomas --- http://www.web-attitude.fr/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056
[flexcoders] Re: Problem converting Flex app to AIR
Never mind, I figured it out. I was just being dumb and blind... --- In flexcoders@yahoogroups.com, reflexactions reflexacti...@... wrote: Ok the original web based application uses a lot of RSL/modules launched from a central 'desktop'. We converted this to AIR and can launch the application and display the 'desktop'. Our problem is when we try to pop up a window. These are TitleWindow's that originally were loaded via PopupManager. We now instead create a NativeWindow and then use NativeWindow.stage.addChild() to add our TitleWindow. Problem is that although the NativeWindow appears (can see it and also see it in teh TaskBar) it is empty, just a white background. Actually checking the TitleWindow we found the constructor runs but initialize etc. never gets called. Assume it something simple weve missed but don't know what any ideas. tks
Re: [flexcoders] Pb With Falsh Player 10
Christophe, maybe user-initiated action read that : http://www.adobe.com/devnet/flashplayer/articles/ fplayer10_uia_requirements.html HTH, Stephane Le 20 mai 09 à 10:54, christophe_jacquelin a écrit : Hello, I have an upload component that running well with Flash Player 9 and running wrong with Flash Player 10. What could be the problem. Thank you, Christophe; IBCM : International Bank of Chatenay-Malabry http://www.kiva.org/ lender/stephane4127 - Click on Map View
[flexcoders] Remote Service fails with IE8 - NetConnection.Call.Failed: HTTP: Status 200
Hi Flex experts, Once our clients upgrade to IE8 from IE7 the Flex remote service fails with the following exception, The weird thing is HTTP status 200 stands for successful request then why should it fail? Also tried adding add-no-cache-headers in services-config.xml still no use. I really appreciate your help on this. body = (Object)#1 clientId = (null) correlationId = B924DFCC-32C0-7DDF-CB34-67A9DF8567D4 destination = extendedData = (null) faultCode = Client.Error.MessageSend faultDetail = Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 200: url: 'http://localhost:8600/messagebroker/amf' faultString = Send failed headers = (Object)#2 messageId = 4E0B2F92-B1C2-3C6E-C634-67A9F10A4C79 rootCause = (mx.messaging.events::ChannelFaultEvent)#3 bubbles = false cancelable = false channel = (mx.messaging.channels::AMFChannel)#4
Re: [flexcoders] Flex Obfuscation -- WITH MODULES
Hey, http://nitrolm.com/nitro-lm-lite http://nitrolm.com/nitro-lm-liteIt is not exactly obfuscation, is encryption VELO On Thu, May 21, 2009 at 8:52 PM, Raheen M Shabbazz raheen_m_shabb...@yahoo.com wrote: Hello All, Has anyone found an obfuscation application that works well with a flex app using modules (Flex 3)? Does such a thing exist?! I feel like I have tried them all -- SecureSWF, SwfEncrypt, etc, etc -- but I have yet to find one that works well with modules. My main app loads and unloads modules -- modules that have been optimized against the main application. So, obfuscating the main app means that the modules need to have the EXACT SAME obfuscated names available to it. Surely, someone has solved this before, right? Thus far, I haven't found anything of use. Anyone else?
[flexcoders] Re: Ctrl click in combobox
Listen to MouseEvent, there you'l find property MouseEvent .controlKey to know ctrl is press or not!! --- In flexcoders@yahoogroups.com, lampei lam...@... wrote: Until recently, I did not know that you could reset the combobox back to the prompt value by ctrl-clicking the value in the combobox dropdown. However, as most people don't know that this is a possiblity with the combobox, I'm trying to mimic this functionality by setting the selectedIndex to -1 if a person clicks (without the ctrl key) the same value that is already selected. I have yet to find the selectedIndexChanged property change to anything other than false when the change event fires, so I'm unable to use that (same for selectedItemChanged). I tried setting the item under the mouse when itemRollOver fires to a property, then set it to null when itemRollOut fires. Then when the person clicks, I said if the selectedItem == the value underneath the mouse during itemRollOver, set the selectedIndex = -1, however, the itemRollOut seems to fire before the click event is fired. I've also yet to find where the code is for the ctrl-left click, or what causes that event to fire. If anyone has any hints for this, I would appreciate it. I'm running into a wall now...literally :)
[flexcoders] Re: Scrolling a text in text input when textalign is set to right
You are probably going to have to use the Text Layout Framework in Gumbo. This thread may help: http://forums.adobe.com/thread/232706 Or you could try this: http://www.arabicode.com/en/flaraby/as3/flex/ HTH Steve --- In flexcoders@yahoogroups.com, Rohit Sharma rohit.sharma1...@... wrote: Sorry for being vague about my requirements. The chat component is an Arabic chat component (RTL text). Hence the text is right text aligned. When we start typing in the text input, once the text input gets filled we are not able to see any further text provided by user. It does not get scrolled automatically to the new insertion position. If you want to see the text you have to select it using mouse and then drag it. Just try this by setting the text align property to right and start filling the text input. Once it gets filled you wont be able to see what you are inputting next. Hope this helps. Thanks, Rohit On Fri, May 22, 2009 at 12:12 AM, valdhor valdhorli...@...wrote: What is a right to left chat application ? Can you point me at an example of how it's meant to work? --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Rohit Sharma rohit.sharma1982@ wrote: Hi Steve, Its not working. While I am typing the text shifts as left aligned. This being a right to left chat application, I cant let it happen. Thanks, Rohit
[flexcoders] Re: Getting data out of a DataGrid...
Actually, you do know the name of the field. Try this... event.currentTarget.selectedItem[_regCodeVO.validation_field] HTH Steve --- In flexcoders@yahoogroups.com, laurence5905 lmacne...@... wrote: Ok, given the following: mx:DataGrid id=membersListDG dataProvider={membersList} itemClick=membersListDGItemClickHandler(event); mx:columns mx:DataGridColumn headerText=Last Name dataField=last_name width=80/ mx:DataGridColumn headerText=First Name dataField=first_name width=80/ mx:DataGridColumn headerText=Address dataField=address1 width=160/ mx:DataGridColumn headerText=City dataField=city width=80/ mx:DataGridColumn headerText=State dataField=state width=40/ mx:DataGridColumn dataField={_regCodeVO.validation_field}/ /mx:columns /mx:DataGrid How do I get the data out of the 6th column there? I don't know the name of the field, so the 'event.itemRenderer.data.fieldName' won't work. And something 'event.itemRenderer.data.(regCodeVO.validation_field)' won't work either... So how do you get the data out of a DataGrid when you have the field you need stored in a String, instead of hard-coded into the program? Thanks, Laurence MacNeill Mableton, Georgia, USA
[flexcoders] Re: modify item before binding to datagrid
How about import.utils.ObjectUtil; --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Hi Mark, I cannot seem to get your code working for me.. I am getting this error: Access of Undefined Property ObjectUtil.. I am trying to simply copy the function which you have posted. Any further advise? From: markgoldin_2000 markgoldin_2...@... To: flexcoders@yahoogroups.com Sent: Wednesday, 20 May, 2009 21:52:25 Subject: [flexcoders] Re: modify item before binding to datagrid Angelo, did you try the code I have replied to you with? --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: My apologies but I forgot to mention that I am getting the data from a .NET web service which is a dataset and then returned via string (XML) using the .NET function String strConn = ConfigurationManage r.ConnectionStri ngs[conString ].ConnectionStri ng; SqlConnection dbConnection = new SqlConnection( strConn); String strCommand = SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address FROM Suppliers ; SqlDataAdapter objCommand = new SqlDataAdapter( strCommand, dbConnection) ; DataSet DS = new DataSet(); objCommand.Fill( DS); dbConnection. Close(); dbConnection = null; DataTable DT = DS.Tables[0] ; return DS.GetXml(); So, basically, I think the SupplierID which is numeric originally becomes a string. How can I then prior to binding the same to the datagrid control, convert its data type back to numeric so that when I perform a sort, it would sort the supplierID interpreting it as a numeric value? Thanks. _ _ __ From: markgoldin_2000 markgoldin_ 2000@ To: flexcod...@yahoogro ups.com Sent: Monday, 18 May, 2009 23:44:33 Subject: [flexcoders] Re: modify item before binding to datagrid Here is what I am doing. column definition: mx:DataGridColumn headerText= Block dataField=tcbkcd sortCompareFunction =sortNumericCol umnTrackTotal / and: private function sortNumericColumnTr ackTotal( itemA:Object, itemB:Object) :int { return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); } where TrackTotal is a DG's id. HTH --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: Hi. I am quite new in Flex and would like to ask a simple question. I am retrieving datasets from a .NET webservice and binding the same to a datagrid. The datagrid comes with a feature that when you click on any of the headers, the column is sorted ASC or DESC. Now, one column which I am binding to is originally a numeric column. But when it binds to the datagrid, it's data type becomes string. Is it possible that prior to binding the said column to the datagrid, I would be able to convert it back to its numeric data taype? Since sorting the column in a string format would give a different result as compared to sorting the same column in a numeric format. Thanks. Regards.
[flexcoders] Re: modify item before binding to datagrid
Of cource I meant: import mx.utils.ObjectUtil; --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: How about import.utils.ObjectUtil; --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote: Hi Mark, I cannot seem to get your code working for me.. I am getting this error: Access of Undefined Property ObjectUtil.. I am trying to simply copy the function which you have posted. Any further advise? From: markgoldin_2000 markgoldin_2000@ To: flexcoders@yahoogroups.com Sent: Wednesday, 20 May, 2009 21:52:25 Subject: [flexcoders] Re: modify item before binding to datagrid Angelo, did you try the code I have replied to you with? --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: My apologies but I forgot to mention that I am getting the data from a .NET web service which is a dataset and then returned via string (XML) using the .NET function String strConn = ConfigurationManage r.ConnectionStri ngs[conString ].ConnectionStri ng; SqlConnection dbConnection = new SqlConnection( strConn); String strCommand = SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address FROM Suppliers ; SqlDataAdapter objCommand = new SqlDataAdapter( strCommand, dbConnection) ; DataSet DS = new DataSet(); objCommand.Fill( DS); dbConnection. Close(); dbConnection = null; DataTable DT = DS.Tables[0] ; return DS.GetXml(); So, basically, I think the SupplierID which is numeric originally becomes a string. How can I then prior to binding the same to the datagrid control, convert its data type back to numeric so that when I perform a sort, it would sort the supplierID interpreting it as a numeric value? Thanks. _ _ __ From: markgoldin_2000 markgoldin_ 2000@ To: flexcod...@yahoogro ups.com Sent: Monday, 18 May, 2009 23:44:33 Subject: [flexcoders] Re: modify item before binding to datagrid Here is what I am doing. column definition: mx:DataGridColumn headerText= Block dataField=tcbkcd sortCompareFunction =sortNumericCol umnTrackTotal / and: private function sortNumericColumnTr ackTotal( itemA:Object, itemB:Object) :int { return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); } where TrackTotal is a DG's id. HTH --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: Hi. I am quite new in Flex and would like to ask a simple question. I am retrieving datasets from a .NET webservice and binding the same to a datagrid. The datagrid comes with a feature that when you click on any of the headers, the column is sorted ASC or DESC. Now, one column which I am binding to is originally a numeric column. But when it binds to the datagrid, it's data type becomes string. Is it possible that prior to binding the said column to the datagrid, I would be able to convert it back to its numeric data taype? Since sorting the column in a string format would give a different result as compared to sorting the same column in a numeric format. Thanks. Regards.
[flexcoders] Re: Still more problems with DataGrid
--- In flexcoders@yahoogroups.com, Laurence MacNeill lmacne...@... wrote: As I add and delete items from my DataGrid's dataProvider (an ArrayCollection), my custom ItemRenderer starts messing things up. It remembers values from previous data that was there, but got deleted. But the weird thing is, it doesn't *always* do that, only some of the time. Basically, it'd be nice, whenever I delete a value from the DataProvider, to completely reset the DataGrid. Make it re-render itself completely from scratch, including the custom ItemRenderer in the 3rd column. How do I do this? http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf Q2
[flexcoders] SWFLoader showing images originally off the 'canvas'
In Flex I am trying to show examples of SWFs that run on portable devices in FlashLite. I am able to open them in a Flex control (HBox, TitleWindow etc.) and pass necessariy parameters but some images that are normally off the 'canvas' or 'stage' for the flash SWFs are showing up outside the container that I am loading the SWFs into. Setting heights and widths seem to constrain the main part of the swf but the other stuff still appears off ends but within the boundaries of the Flex app itself. Any ideas how to 'crop' the Flash lite SWFs? Thanks, - Todd
Re: [flexcoders] SWFLoader showing images originally off the 'canvas'
Use a canvas as a mask on the swf loader and that should work. On Fri, May 22, 2009 at 9:20 AM, twcrone70 twcron...@yahoo.com wrote: In Flex I am trying to show examples of SWFs that run on portable devices in FlashLite. I am able to open them in a Flex control (HBox, TitleWindow etc.) and pass necessariy parameters but some images that are normally off the 'canvas' or 'stage' for the flash SWFs are showing up outside the container that I am loading the SWFs into. Setting heights and widths seem to constrain the main part of the swf but the other stuff still appears off ends but within the boundaries of the Flex app itself. Any ideas how to 'crop' the Flash lite SWFs? Thanks, - Todd -- “When you choose hope, anything is possible.” -Christopher Reeve
Re: [flexcoders] Re: simple array?
Why even have the Array aspect in the second example? It stands as a pointless container for what we are seeing it used for. Unless there will be some additional items added to it that we have not seen yet. I just feel the need to point that out. :) Charles P. On Thu, May 21, 2009 at 3:49 PM, Eric Cooper e...@cooper.nu wrote: I just tried compiling what I wrote - and realized that it didn't... so here are two variants. The first is same as previous, but it compiles. The second may be more in the spirit of what you were attempting initially - and kind of highlights similarities between arrays and objects. First: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. } ); for each (var test:Object in records) { if (grid.selectedItem.PAYMENT_TYPE_CODE == test.code) Alert.show(test.text ); } Second: var PAYMENT_TYPE_CODE:String = CR; var records:Array = new Array( { AC: Remember to reset the station address. }, { RN: Remember to reset the station expiration date. }, { CP: Remember to contact contractor to remove the certificates from this station. }, { CR: Remember to cancel the refund payment. } ); for (var i:int = 0; i records.length; ++i) { if (records[i][grid.selectedItem.PAYMENT_TYPE_CODE]) Alert.show(records[i][PAYMENT_TYPE_CODE]); } --- In flexcoders@yahoogroups.com, Jason B nos...@... wrote: SWEET thanks --- In flexcoders@yahoogroups.com, Eric Cooper eric@ wrote: How about this: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. }, ); for each(test:Object in records){ if(grid.selectedItem.PAYMENT_TYPE_CODE == test[i].code) Alert.show(test[i].text ); } would that do it? -eric --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: var records:Array = new Array({ AC: Remember to reset the station address., RN: Remember to reset the station expiration date., CP: Remember to contact contractor to remove the certificates from this station., CR: Remember to cancel the refund payment. }); for each(test:Object in records){ //HERE we match up PAYMENT TYPE CODE with AC RN CP if one is a match we show the value if(grid.selectedItem.PAYMENT_TYPE_CODE == test[i]) Alert.show(SHOW ME ---Remember to reset the station address ); } datagrid hidden column AC, RN, CP are in datagrid user selects RT item from grid and hits button system match's that row with what message should be displayed user never see's RT since its a hidden field in grid user now see's a message displayed as a reminder --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: Jason, I'm not sure I follow exactly what the problem is now. Paul - Original Message - From: Jason B nospam@ To: flexcoders@yahoogroups.com Sent: Thursday, May 21, 2009 4:02 PM Subject: [flexcoders] Re: simple array? i want to loop the records and compare the value addresschange to the PAYMENT Type Code if its the right one display it --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: - Original Message - From: Jason B nospam@ To: flexcoders@yahoogroups.com Sent: Thursday, May 21, 2009 3:46 PM Subject: [flexcoders] Re:
Re: [flexcoders] Re: simple array?
Additionally, utilizing a loop to locate an item can eat up cycles if the list of codes gets to be large. Granted that in the case of this example looping 3 or even 10 items is likely not going to be an issue in anyway. Something to think about if the application of this example is used differently. Charles P. On Fri, May 22, 2009 at 10:50 AM, Charles Parcell pokemonkil...@gmail.comwrote: Why even have the Array aspect in the second example? It stands as a pointless container for what we are seeing it used for. Unless there will be some additional items added to it that we have not seen yet. I just feel the need to point that out. :) Charles P. On Thu, May 21, 2009 at 3:49 PM, Eric Cooper e...@cooper.nu wrote: I just tried compiling what I wrote - and realized that it didn't... so here are two variants. The first is same as previous, but it compiles. The second may be more in the spirit of what you were attempting initially - and kind of highlights similarities between arrays and objects. First: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. } ); for each (var test:Object in records) { if (grid.selectedItem.PAYMENT_TYPE_CODE == test.code) Alert.show(test.text ); } Second: var PAYMENT_TYPE_CODE:String = CR; var records:Array = new Array( { AC: Remember to reset the station address. }, { RN: Remember to reset the station expiration date. }, { CP: Remember to contact contractor to remove the certificates from this station. }, { CR: Remember to cancel the refund payment. } ); for (var i:int = 0; i records.length; ++i) { if (records[i][grid.selectedItem.PAYMENT_TYPE_CODE]) Alert.show(records[i][PAYMENT_TYPE_CODE]); } --- In flexcoders@yahoogroups.com, Jason B nos...@... wrote: SWEET thanks --- In flexcoders@yahoogroups.com, Eric Cooper eric@ wrote: How about this: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. }, ); for each(test:Object in records){ if(grid.selectedItem.PAYMENT_TYPE_CODE == test[i].code) Alert.show(test[i].text ); } would that do it? -eric --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: var records:Array = new Array({ AC: Remember to reset the station address., RN: Remember to reset the station expiration date., CP: Remember to contact contractor to remove the certificates from this station., CR: Remember to cancel the refund payment. }); for each(test:Object in records){ //HERE we match up PAYMENT TYPE CODE with AC RN CP if one is a match we show the value if(grid.selectedItem.PAYMENT_TYPE_CODE == test[i]) Alert.show(SHOW ME ---Remember to reset the station address ); } datagrid hidden column AC, RN, CP are in datagrid user selects RT item from grid and hits button system match's that row with what message should be displayed user never see's RT since its a hidden field in grid user now see's a message displayed as a reminder --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: Jason, I'm not sure I follow exactly what the problem is now. Paul - Original Message - From: Jason B nospam@ To: flexcoders@yahoogroups.com Sent: Thursday, May 21, 2009 4:02 PM Subject: [flexcoders] Re: simple array?
Re: [flexcoders] Re: modify item before binding to datagrid
Hi Mark, Thanks for your patience. I did write the import code for the ObjectUtil class. But I still cannot get things properly. In your code, you have this.. return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); my dataGrid's ID is MydataGrid what does the col pertains to? the column id defined for the datagrid? Here's my datagrid mxml mx:DataGrid id=MydataGrid creationComplete=getGridData(); width=100% height=100% visible=false dataProvider={_xmlData.*} itemClick=getDataItems(); mx:columns mx:DataGridColumn headerText=ID dataField=SupplierID width=30/ mx:DataGridColumn headerText=Company Name dataField=CompanyName width=100/ mx:DataGridColumn headerText=Contact Name dataField=ContactName width=100/ mx:DataGridColumn headerText=Contact Title dataField=ContactTitle width=50/ mx:DataGridColumn headerText=Address dataField=Address width=150/ /mx:columns /mx:DataGrid The SupplierID is the numeric column. But when I tried private function sortNumericColumn(itemA:Object, itemB:Object): int { return ObjectUtil.numericCompare(itemA[MydataGrid.SupplierID], itemB[MydataGrid.SupplierID]); } in the function you gave, I am getting the error: Access of possibly undefined property SupplierID through a reference with static type mx.controls:DataGrid Thanks a bunch for your patience. From: markgoldin_2000 markgoldin_2...@yahoo.com To: flexcoders@yahoogroups.com Sent: Friday, 22 May, 2009 21:51:55 Subject: [flexcoders] Re: modify item before binding to datagrid Of cource I meant: import mx.utils.ObjectUtil ; --- In flexcod...@yahoogro ups.com, markgoldin_ 2000 markgoldin_ 2...@... wrote: How about import.utils. ObjectUtil; --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ wrote: Hi Mark, I cannot seem to get your code working for me.. I am getting this error: Access of Undefined Property ObjectUtil.. I am trying to simply copy the function which you have posted. Any further advise? _ _ __ From: markgoldin_2000 markgoldin_ 2000@ To: flexcod...@yahoogro ups.com Sent: Wednesday, 20 May, 2009 21:52:25 Subject: [flexcoders] Re: modify item before binding to datagrid Here is what I am doing. column definition: mx:DataGridColumn headerText= Block dataField=tcbkcd sortCompareFunction =sortNumericCol umnTrackTotal / and: private function sortNumericColumnTr ackTotal( itemA:Object, itemB:Object) :int { return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); } where TrackTotal is a DG's id. HTH --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: Hi. I am quite new in Flex and would like to ask a simple question. I am retrieving datasets from a .NET webservice and binding the same to a datagrid. The datagrid comes with a feature that when you click on any of the headers, the column is sorted ASC or DESC. Now, one column which I am binding to is originally a numeric column. But when it binds to the datagrid, it's data type becomes string. Is it possible that prior to binding the said column to the datagrid, I would be able to convert it back to its numeric data taype? Since sorting the column in a string format would give a different result as compared to sorting the same column in a numeric format. Thanks. Regards.
[flexcoders] Re: How to optimise SWC to its minimal size?
Any ideas? Hey, Flex gurus I know you are here! :)
[flexcoders] Re: modify item before binding to datagrid
I use col as a reference to the clicked column's dataField retrieved via column collection. Just use same as mine code. --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Hi Mark, Thanks for your patience. I did write the import code for the ObjectUtil class. But I still cannot get things properly. In your code, you have this.. return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); my dataGrid's ID is MydataGrid what does the col pertains to? the column id defined for the datagrid? Here's my datagrid mxml mx:DataGrid id=MydataGrid creationComplete=getGridData(); width=100% height=100% visible=false dataProvider={_xmlData.*} itemClick=getDataItems(); mx:columns mx:DataGridColumn headerText=ID dataField=SupplierID width=30/ mx:DataGridColumn headerText=Company Name dataField=CompanyName width=100/ mx:DataGridColumn headerText=Contact Name dataField=ContactName width=100/ mx:DataGridColumn headerText=Contact Title dataField=ContactTitle width=50/ mx:DataGridColumn headerText=Address dataField=Address width=150/ /mx:columns /mx:DataGrid The SupplierID is the numeric column. But when I tried private function sortNumericColumn(itemA:Object, itemB:Object): int { return ObjectUtil.numericCompare(itemA[MydataGrid.SupplierID], itemB[MydataGrid.SupplierID]); } in the function you gave, I am getting the error: Access of possibly undefined property SupplierID through a reference with static type mx.controls:DataGrid Thanks a bunch for your patience. From: markgoldin_2000 markgoldin_2...@... To: flexcoders@yahoogroups.com Sent: Friday, 22 May, 2009 21:51:55 Subject: [flexcoders] Re: modify item before binding to datagrid Of cource I meant: import mx.utils.ObjectUtil ; --- In flexcod...@yahoogro ups.com, markgoldin_ 2000 markgoldin_ 2000@ wrote: How about import.utils. ObjectUtil; --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ wrote: Hi Mark, I cannot seem to get your code working for me.. I am getting this error: Access of Undefined Property ObjectUtil.. I am trying to simply copy the function which you have posted. Any further advise? _ _ __ From: markgoldin_2000 markgoldin_ 2000@ To: flexcod...@yahoogro ups.com Sent: Wednesday, 20 May, 2009 21:52:25 Subject: [flexcoders] Re: modify item before binding to datagrid Here is what I am doing. column definition: mx:DataGridColumn headerText= Block dataField=tcbkcd sortCompareFunction =sortNumericCol umnTrackTotal / and: private function sortNumericColumnTr ackTotal( itemA:Object, itemB:Object) :int { return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); } where TrackTotal is a DG's id. HTH --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: Hi. I am quite new in Flex and would like to ask a simple question. I am retrieving datasets from a .NET webservice and binding the same to a datagrid. The datagrid comes with a feature that when you click on any of the headers, the column is sorted ASC or DESC. Now, one column which I am binding to is originally a numeric column. But when it binds to the datagrid, it's data type becomes string. Is it possible that prior to binding the said column to the datagrid, I would be able to convert it back to its numeric data taype? Since sorting the column in a string format would give a different result as compared to sorting the same column in a numeric format. Thanks. Regards.
Re: [flexcoders] Re: How to optimise SWC to its minimal size?
Well, you mention that classes that are used directly or indirectly are garbage¹, but it¹s being used so they aren¹t garbage If they were pulled in, then it¹s more than likely that what ever you are trying to extract, depends on those garbage¹ classes. On 5/22/09 11:13 AM, lytvynyuk lytvyn...@yahoo.com wrote: Any ideas? Hey, Flex gurus I know you are here! :)
[flexcoders] Re: LineChart Magic
So I whipped out my wand and wrote a custom LineSegmentRenderer which extends ShadowLineRenderer. I used updateDisplayList to loop through the lineSeriesItems to draw my custom line. What I'm charting is surgical cases by day in a given month. What I wanted to show was a linechart that had weekends colored differently so we'd know why the case counts plateaued. I feel like I've just done my first bit of advanced coding in actionscript. I know this isn't very advanced, but hopefully it will help someone else trying to achieve a similar effect. I've left out some of the logic code, but you'll get the idea. var items:Array = (data as LineSeriesSegment).items; for (var i:int = 0; i items.length; i++) { // get the graphics object var g:Graphics = graphics; if (isWeekend) { // use weekend lineStyle g.lineStyle(3, 0x99, 1); } else { // use the weekday lineStyle g.lineStyle(2, 0xF2F2F2, 1); } // move to the starting point if we are at the first item if (i==0) g.moveTo(thisItem.x, thisItem.y); // draw if we are not the last item if (!lastItem) { g.lineTo(nextItem.x, nextItem.y); } }
Re: [flexcoders] Re: How to optimise SWC to its minimal size?
You can use the 'externs' command-line option to the Flex compiler to tell Flex to exclude specific classes - as long as you're sure that your code _will_ have access to them at runtime. Documentation here: http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html HTH, Ian On Fri, May 22, 2009 at 4:13 PM, lytvynyuk lytvyn...@yahoo.com wrote: Any ideas? Hey, Flex gurus I know you are here! :)
RE: [flexcoders] Re: LineChart Magic
Nice. I don't see a lot of charting examples but this is nice because I'm about to start a project plotting multiple items dealing with commodities and futures and I'm sure I'll need to customize it quite a bit. Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com http://www.cfwebtools.com 402-408-3733 x103 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jdizowat Sent: Friday, May 22, 2009 10:36 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: LineChart Magic So I whipped out my wand and wrote a custom LineSegmentRenderer which extends ShadowLineRenderer. I used updateDisplayList to loop through the lineSeriesItems to draw my custom line. What I'm charting is surgical cases by day in a given month. What I wanted to show was a linechart that had weekends colored differently so we'd know why the case counts plateaued. I feel like I've just done my first bit of advanced coding in actionscript. I know this isn't very advanced, but hopefully it will help someone else trying to achieve a similar effect. I've left out some of the logic code, but you'll get the idea. var items:Array = (data as LineSeriesSegment).items; for (var i:int = 0; i items.length; i++) { // get the graphics object var g:Graphics = graphics; if (isWeekend) { // use weekend lineStyle g.lineStyle(3, 0x99, 1); } else { // use the weekday lineStyle g.lineStyle(2, 0xF2F2F2, 1); } // move to the starting point if we are at the first item if (i==0) g.moveTo(thisItem.x, thisItem.y); // draw if we are not the last item if (!lastItem) { g.lineTo(nextItem.x, nextItem.y); } } No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.36/2126 - Release Date: 05/22/09 06:03:00
RE: [flexcoders] localized parseFloat
parseFloat is a player API. I think it will localize with the OS language. There might be third-party localizable parseFloat equivalents somewhere. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of thomas parquier Sent: Friday, May 22, 2009 1:45 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] localized parseFloat Hi, Couldn't parseFloat() use the SharedResources properties to parse localized strings ? thomas --- http://www.web-attitude.fr/ msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056
[flexcoders] Local compile issue on Flex Builder 3 on OSX Leopard
I am trying to help my boss set up a Flex project which works fine for me. He is on Mac, I am on PC. He can't compile in our properties files, even though he has them on his computer. I access these files via a compiler variable pointing to an absolute path on my machine, ie: C:\my\folder\etc\etc\locales\{locale} Below is the info from my boss's setup: (-source-path=/Users/doe/Documents/code/amp/trunk/locales/src/main/resources/locales/{locale} is the bad part, everything else works fine! Thanks! Compiler argument: -show-unused-type-selector-warnings=false -locale=en_US -source-path=/Users/doe/Documents/code/amp/trunk/locales/src/main/resources/locales/{locale}; -services=/Users/doe/Documents/code/amp/trunk/platform/platform-client/src/main/resources/services-config_LOCAL.xml -context-root=platform -default-background-color #FF Error message unable to open '/Users/doe/Documents/code/amp/trunk/locales/src/main/resources/locales/en_US;' Test on OS: $ cd /Users/doe/Documents/code/amp/trunk/locales/src/main/resources/locales/en_US $ ls platformResources.properties $ So the path is valid per the OS.
[flexcoders] Multi-column drop-in checkbox renderer
I am creating a CheckBox item renderer (redacted code at the end of this post). Using the static methods that return a ClassFactory lets me tell the renderer which column it applies to, as follows: itemRenderer={PermissionCheckBox.factory('columnName')} The renderer dispatches a bubbling event, for which I have to attach a listener using AS (or create a subclass of the grid that adds Event metadata): private function onCreationComplete(event:Event):void { myGrid.addEventListener(ChangePermissionEvent.CHANGE_PERMISSION, onPermissionChange, false,0,true); } So far, so good. What's the cleanest way to get the checkbox selected state to bind to the property indicated by dataField (or columnName). Do I have to resort to something like this: http://techmytongue.blogspot.com/2009/04/reuse-itemrenderers-for-multiple.html or go back to an inline renderer? The effect I want is: Imx:CheckBox xmlns:mx=http://www.adobe.com/2006/mxml; selected={data[this.columnName]} change=onChange(event) Thanks. Renderer-in-progress: ?xml version=1.0 encoding=utf-8? mx:CheckBox xmlns:mx=http://www.adobe.com/2006/mxml; label={columnName:String} change=onChange(event) mx:Script ![CDATA[ [Bindable] public var columnName:String; private var _row:MyRow; public static function factory(columnName:String):ClassFactory { var classFactory:ClassFactory = new ClassFactory(PermissionCheckBox); classFactory.properties = {columnName:columnName}; return classFactory; } override public function set data(value:Object):void { _row = value as MyRow; } private function onChange(event:Event):void { dispatchEvent(ChangePermissionEvent.create(_row, columnName:String, this.selected)); } ]] /mx:Script /mx:CheckBox
[flexcoders] Re: modify item before binding to datagrid
This is how I would do it.. mx:DataGrid id=MydataGrid creationComplete=getGridData(); width=100% height=100% visible=false dataProvider={_xmlData.*} itemClick=getDataItems(); mx:columns mx:DataGridColumn headerText=ID dataField=SupplierID width=30 sortCompareFunction=IDCompare/ mx:DataGridColumn headerText=Company Name dataField=CompanyName width=100/ mx:DataGridColumn headerText=Contact Name dataField=ContactName width=100/ mx:DataGridColumn headerText=Contact Title dataField=ContactTitle width=50/ mx:DataGridColumn headerText=Address dataField=Address width=150/ /mx:columns /mx:DataGrid private function IDCompare(itemA:Object, itemB:Object):int { return ObjectUtil.numericCompare(itemA.SupplierID, itemB.SupplierID); } --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Hi Mark, Thanks for your patience. I did write the import code for the ObjectUtil class. But I still cannot get things properly. In your code, you have this.. return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); my dataGrid's ID is MydataGrid what does the col pertains to? the column id defined for the datagrid? Here's my datagrid mxml mx:DataGrid id=MydataGrid creationComplete=getGridData(); width=100% height=100% visible=false dataProvider={_xmlData.*} itemClick=getDataItems(); mx:columns mx:DataGridColumn headerText=ID dataField=SupplierID width=30/ mx:DataGridColumn headerText=Company Name dataField=CompanyName width=100/ mx:DataGridColumn headerText=Contact Name dataField=ContactName width=100/ mx:DataGridColumn headerText=Contact Title dataField=ContactTitle width=50/ mx:DataGridColumn headerText=Address dataField=Address width=150/ /mx:columns /mx:DataGrid The SupplierID is the numeric column. But when I tried private function sortNumericColumn(itemA:Object, itemB:Object): int { return ObjectUtil.numericCompare(itemA[MydataGrid.SupplierID], itemB[MydataGrid.SupplierID]); } in the function you gave, I am getting the error: Access of possibly undefined property SupplierID through a reference with static type mx.controls:DataGrid Thanks a bunch for your patience. From: markgoldin_2000 markgoldin_2...@... To: flexcoders@yahoogroups.com Sent: Friday, 22 May, 2009 21:51:55 Subject: [flexcoders] Re: modify item before binding to datagrid Of cource I meant: import mx.utils.ObjectUtil ; --- In flexcod...@yahoogro ups.com, markgoldin_ 2000 markgoldin_ 2000@ wrote: How about import.utils. ObjectUtil; --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ wrote: Hi Mark, I cannot seem to get your code working for me.. I am getting this error: Access of Undefined Property ObjectUtil.. I am trying to simply copy the function which you have posted. Any further advise? _ _ __ From: markgoldin_2000 markgoldin_ 2000@ To: flexcod...@yahoogro ups.com Sent: Wednesday, 20 May, 2009 21:52:25 Subject: [flexcoders] Re: modify item before binding to datagrid Here is what I am doing. column definition: mx:DataGridColumn headerText= Block dataField=tcbkcd sortCompareFunction =sortNumericCol umnTrackTotal / and: private function sortNumericColumnTr ackTotal( itemA:Object, itemB:Object) :int { return ObjectUtil.numericC ompare(itemA[ TrackTotal. col], itemB[TrackTotal. col]); } where TrackTotal is a DG's id. HTH --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: Hi. I am quite new in Flex and would like to ask a simple question. I am retrieving datasets from a .NET webservice and binding the same to a datagrid. The datagrid comes with a feature that when you click on any of the headers, the column is sorted ASC or DESC. Now, one column which I am binding to is originally a numeric column. But when it binds to the datagrid, it's data type becomes string. Is it possible that prior to binding the said column to the datagrid, I would be able to convert it back to its numeric data taype? Since sorting the column in a string format would give a different result as compared to sorting the same column in a numeric format. Thanks. Regards.
RE: [flexcoders] Multi-column drop-in checkbox renderer
Sounds like a lot of work and I'm not sure I quite follow, but CheckBox already implements IDropInListItemRenderer and will set its check mark based on the Boolean value of the dataField in the data item Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Richard Rodseth Sent: Friday, May 22, 2009 10:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Multi-column drop-in checkbox renderer I am creating a CheckBox item renderer (redacted code at the end of this post). Using the static methods that return a ClassFactory lets me tell the renderer which column it applies to, as follows: itemRenderer={PermissionCheckBox.factory('columnName')} The renderer dispatches a bubbling event, for which I have to attach a listener using AS (or create a subclass of the grid that adds Event metadata): private function onCreationComplete(event:Event):void { myGrid.addEventListener(ChangePermissionEvent.CHANGE_PERMISSION, onPermissionChange, false,0,true); } So far, so good. What's the cleanest way to get the checkbox selected state to bind to the property indicated by dataField (or columnName). Do I have to resort to something like this: http://techmytongue.blogspot.com/2009/04/reuse-itemrenderers-for-multiple.html or go back to an inline renderer? The effect I want is: Imx:CheckBox xmlns:mx=http://www.adobe.com/2006/mxml; selected={data[this.columnName]} change=onChange(event) Thanks. Renderer-in-progress: ?xml version=1.0 encoding=utf-8? mx:CheckBox xmlns:mx=http://www.adobe.com/2006/mxml; label={columnName:String} change=onChange(event) mx:Script ![CDATA[ [Bindable] public var columnName:String; private var _row:MyRow; public static function factory(columnName:String):ClassFactory { var classFactory:ClassFactory = new ClassFactory(PermissionCheckBox); classFactory.properties = {columnName:columnName}; return classFactory; } override public function set data(value:Object):void { _row = value as MyRow; } private function onChange(event:Event):void { dispatchEvent(ChangePermissionEvent.create(_row, columnName:String, this.selected)); } ]] /mx:Script /mx:CheckBox
Re: [flexcoders] absolute paths for mx:script source
On Fri, May 22, 2009 at 5:32 AM, coder3 rrhu...@hotmail.com wrote: I wonder if there is a way to add absolute path to mx:script for example, my file is under src/app1/app1.mxml. and the as file is src/common/asfile.as [...] i tried to use mx:Script source=/common/asfile.as / but the error shows: no .../src/app1/common/asfile.as found. That would be the absolute path on your disk. For instance: mx:Script source=/Users/manish/Code/test/test_script.as / Manish
[flexcoders] NEED more than 15 menu item in Context Menu ????
Hi, I really need to have more than 15 menu item displayed on Context Menu. I desperately need some workaround or ideas to achieve this My client has invested thousands of dollar in Flex Project, he definitely need more than 15 menu item.If this project failed , client will NEVER think to invest in flex. Had I been aware of this limitation before I would have thought some solution by now.This comes as a surprise to me at the last moment ,just fews days before Prod Date. Pls gents help me get rid of this ...PLEASE provide some ideas. Thanks in advance. Thanks, Dharmendra
[flexcoders] session.getAttribute(somekey) returning NULL in SessionDestroyed
Hi all, session.getAttribute(somekey) is returning null in SessionDestroyed() method of flex listener. Below are the steps I am following 1) I am adding flexLister in contextInitialized method of ServletContextListener FlexSession.addSessionCreateListener(myListener) 2) In sessionCreate method sessionCreated(FlexSession session) { session.addSessionDestroyListener(this) } 3) some where in applicaion I am putting a key vlaue pair in session like this FlexContext.getSession().setAttribute(somekey , someVlue) ; The issue is when I try to retreive vale from session her is how I m retreiving value sessionDestroyed(FlexSession session) { session.getAttribute(somekey); this return null WHY ? } This is always returning me null Pls note that I am RTMP channel and version of LCDS is 2.6 I also tried RTMPFlexSession RTMPFlexSession.addSessionCreateListener(myListener) but no luck , still got null Am I doing anything wrong ? Thanks , Dharmendra
Re: [flexcoders] Ctrl click in combobox
On Fri, May 22, 2009 at 5:47 AM, lampei lam...@gmail.com wrote: Until recently, I did not know that you could reset the combobox back to the prompt value by ctrl-clicking the value in the combobox dropdown. However, as most people don't know that this is a possiblity with the combobox, I'm trying to mimic this functionality by setting the selectedIndex to -1 if a person clicks (without the ctrl key) the same value that is already selected. I have yet to find the selectedIndexChanged property change to anything other than false when the change event fires, so I'm unable to use that (same for selectedItemChanged). I tried setting the item under the mouse when itemRollOver fires to a property, then set it to null when itemRollOut fires. Then when the person clicks, I said if the selectedItem == the value underneath the mouse during itemRollOver, set the selectedIndex = -1, however, the itemRollOut seems to fire before the click event is fired. I've also yet to find where the code is for the ctrl-left click, or what causes that event to fire. The code is in ListBase.as: the selectItem function (called from mouseDownHandler). // allow unselecting via ctrl-click if (ctrlKey selectedData[uid]) { selectionChange = true; clearSelected(transition); } Here's the solution. 1. Make a custom class, MyList. public class MyList extends List { override protected function selectItem(item:IListItemRenderer, shiftKey:Boolean, ctrlKey:Boolean, transition:Boolean = true):Boolean { var index:int = itemRendererToIndex(item); if (index == selectedIndex) ctrlKey = true; return super.selectItem(item, shiftKey, ctrlKey, transition); } } 2. Use this class as the dropdown in the ComboBox. mx:ComboBox id=cb prompt=-- select -- dataProvider={['1', '2', '3']} dropdownFactory={new ClassFactory(MyList)} / Tada! Manish -- www.manishjethani.com
RE: [flexcoders] NEED more than 15 menu item in Context Menu ????
What about intercepting the right-click at the browser level and displaying your own contextual menu? However, you might have some browser incompatibility to look at. http://blog.another-d-mention.ro/programming/right-click-and-custom-cont ext-menu-in-flash-flex/ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dharmendra Chauhan Sent: Friday, May 22, 2009 3:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] NEED more than 15 menu item in Context Menu Hi, I really need to have more than 15 menu item displayed on Context Menu. I desperately need some workaround or ideas to achieve this My client has invested thousands of dollar in Flex Project, he definitely need more than 15 menu item.If this project failed , client will NEVER think to invest in flex. Had I been aware of this limitation before I would have thought some solution by now.This comes as a surprise to me at the last moment ,just fews days before Prod Date. Pls gents help me get rid of this ...PLEASE provide some ideas. Thanks in advance. Thanks, Dharmendra
[flexcoders] Access FormItem child
If I have a FormItem like this: ?xml version=1.0 encoding=utf-8? mx:FormItem xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% direction=horizontal mx:TextInput id=username/ mx:Button width=22 icon=@Embed(source='../assets/find.png') id=find /mx:Button /mx:FormItem then in another mxml fil where I am using that component: userLookUp /userLookUp is there a way of accessing username via markup tags? Or it's only via AS? Thanks
[flexcoders] Waiting for Flash Player to connect to the debugger
I can't run the debugger today I'm getting: Launching: Waiting for Flash Player to connect to the debugger yesterday all was working fine, never seen this error before, Run mode takes forever now, the following 5 line flex file takes 16 seconds to show up in the browser. Yesterday, less than 1. I've got a MAC: running: MAC OS x version 10.5.6 Model Name: iMac Model Identifier: iMac8,1 Processor Name: Intel Core 2 Duo Processor Speed: 2.4 GHz Number Of Processors: 1 Total Number Of Cores:2 L2 Cache: 6 MB Memory: 2 GB Bus Speed:1.07 GHz Boot ROM Version: IM81.00C1.B00 SMC Version: 1.29f1 I'm running Safari: Version 3.2.1 (5525.27.1) and Firefox V 3.0.10 I have Flash version 10,0,12,36 installed. I've tried using both Safari and Firefox, same problem on both. Here's my sourcecode in a NEW workspace and project: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Button x=73 y=48 label=Button click=ti.text = 'Help Adobe, please fix this problem!!!'/ mx:TextInput id=ti x=199 y=48/ /mx:Application Hit the debug button and get: Launching: Waiting for Flash Player to connect to the debugger Failed to connect; session timed out. Ensure that: 1. You compiled your Flash application with debugging on. 2. You are running the debugger version of Flash Player. I updated Flash player 10.0.22.87 still same problem. I then reinstalled Flex Builder 3 into the same directory, and updated it to: 3.0.2.213193 and am using Flash Player 9.0.124.0 Still cannot debug. here is my eclipse config.ini: #Eclipse Runtime Configuration File #Thu Mar 31 18:10:37 PST 2005 osgi.bundles=org.eclipse.equinox.com...@2:start,org.eclipse.update.configura...@3:start,org.eclipse.core.runt...@start osgi.bundles.defaultStartLevel=4 eclipse.product=com.adobe.flexbuilder.standalone.product osgi.splashPath=platform\:/base/plugins/com.adobe.flexbuilder.standalone osgi.instance.area.defau...@user.home/Documents/Flex Builder 3 #osgi.user.d...@user.home/Documents/Flex Builder 3 osgi.configuration.ar...@user.home/Documents/Flex Builder 3/configuration osgi.sharedConfiguration.area=platform\:/base/configuration osgi.sharedConfiguration.area.readOnly=true osgi.configuration.cascaded=true I've cleared the cache out of BOTH browsers and Flash Player. Still cannot debug.?? Any suggestions? thanks
Re: [flexcoders] localized parseFloat
On Fri, May 22, 2009 at 2:14 PM, thomas parquier mailingli...@web-attitude.fr wrote: Couldn't parseFloat() use the SharedResources properties to parse localized strings ? If you intend to parse a string like 1.234,56, I think you'll have to run it through a NumberFormatter first (1234.56) before you send it to the parse function. Manish
[flexcoders] Re: Waiting for Flash Player to connect to the debugger
Hmm, I often get problems like this when, for some reason, another instance of the debugger/player is running. Try making sure you are always closing each instance properly after running your program. Also check out your task manager to see if there are any running in the background. Hopefully that helps. If not, hopefully another wiser can :) --- In flexcoders@yahoogroups.com, luvfotography ygro...@... wrote: I can't run the debugger today I'm getting: Launching: Waiting for Flash Player to connect to the debugger yesterday all was working fine, never seen this error before, Run mode takes forever now, the following 5 line flex file takes 16 seconds to show up in the browser. Yesterday, less than 1. I've got a MAC: running: MAC OS x version 10.5.6 Model Name: iMac Model Identifier: iMac8,1 Processor Name: Intel Core 2 Duo Processor Speed:2.4 GHz Number Of Processors: 1 Total Number Of Cores: 2 L2 Cache: 6 MB Memory: 2 GB Bus Speed: 1.07 GHz Boot ROM Version: IM81.00C1.B00 SMC Version:1.29f1 I'm running Safari: Version 3.2.1 (5525.27.1) and Firefox V 3.0.10 I have Flash version 10,0,12,36 installed. I've tried using both Safari and Firefox, same problem on both. Here's my sourcecode in a NEW workspace and project: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Button x=73 y=48 label=Button click=ti.text = 'Help Adobe, please fix this problem!!!'/ mx:TextInput id=ti x=199 y=48/ /mx:Application Hit the debug button and get: Launching: Waiting for Flash Player to connect to the debugger Failed to connect; session timed out. Ensure that: 1. You compiled your Flash application with debugging on. 2. You are running the debugger version of Flash Player. I updated Flash player 10.0.22.87 still same problem. I then reinstalled Flex Builder 3 into the same directory, and updated it to: 3.0.2.213193 and am using Flash Player 9.0.124.0 Still cannot debug. here is my eclipse config.ini: #Eclipse Runtime Configuration File #Thu Mar 31 18:10:37 PST 2005 osgi.bundles=org.eclipse.equinox.com...@2:start,org.eclipse.update.configura...@3:start,org.eclipse.core.runt...@start osgi.bundles.defaultStartLevel=4 eclipse.product=com.adobe.flexbuilder.standalone.product osgi.splashPath=platform\:/base/plugins/com.adobe.flexbuilder.standalone osgi.instance.area.defau...@user.home/Documents/Flex Builder 3 #osgi.user.d...@user.home/Documents/Flex Builder 3 osgi.configuration.ar...@user.home/Documents/Flex Builder 3/configuration osgi.sharedConfiguration.area=platform\:/base/configuration osgi.sharedConfiguration.area.readOnly=true osgi.configuration.cascaded=true I've cleared the cache out of BOTH browsers and Flash Player. Still cannot debug.?? Any suggestions? thanks
Re: [flexcoders] Re: Waiting for Flash Player to connect to the debugger
Did you install the Debug version of Flash Player? http://www.adobe.com/support/flashplayer/downloads.html Under this section: Adobe Flash Player 10 — Debugger Versions (aka debug players or content debuggers) On Fri, May 22, 2009 at 1:46 PM, a.scavarelli a.scavare...@yahoo.comwrote: Hmm, I often get problems like this when, for some reason, another instance of the debugger/player is running. Try making sure you are always closing each instance properly after running your program. Also check out your task manager to see if there are any running in the background. Hopefully that helps. If not, hopefully another wiser can :) --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, luvfotography ygro...@... wrote: I can't run the debugger today I'm getting: Launching: Waiting for Flash Player to connect to the debugger yesterday all was working fine, never seen this error before, Run mode takes forever now, the following 5 line flex file takes 16 seconds to show up in the browser. Yesterday, less than 1. I've got a MAC: running: MAC OS x version 10.5.6 Model Name: iMac Model Identifier: iMac8,1 Processor Name: Intel Core 2 Duo Processor Speed: 2.4 GHz Number Of Processors: 1 Total Number Of Cores: 2 L2 Cache: 6 MB Memory: 2 GB Bus Speed: 1.07 GHz Boot ROM Version: IM81.00C1.B00 SMC Version: 1.29f1 I'm running Safari: Version 3.2.1 (5525.27.1) and Firefox V 3.0.10 I have Flash version 10,0,12,36 installed. I've tried using both Safari and Firefox, same problem on both. Here's my sourcecode in a NEW workspace and project: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Button x=73 y=48 label=Button click=ti.text = 'Help Adobe, please fix this problem!!!'/ mx:TextInput id=ti x=199 y=48/ /mx:Application Hit the debug button and get: Launching: Waiting for Flash Player to connect to the debugger Failed to connect; session timed out. Ensure that: 1. You compiled your Flash application with debugging on. 2. You are running the debugger version of Flash Player. I updated Flash player 10.0.22.87 still same problem. I then reinstalled Flex Builder 3 into the same directory, and updated it to: 3.0.2.213193 and am using Flash Player 9.0.124.0 Still cannot debug. here is my eclipse config.ini: #Eclipse Runtime Configuration File #Thu Mar 31 18:10:37 PST 2005 osgi.bundles=org.eclipse.equinox.com...@2 :start,org.eclipse.update.configura...@3 :start,org.eclipse.core.runt...@start osgi.bundles.defaultStartLevel=4 eclipse.product=com.adobe.flexbuilder.standalone.product osgi.splashPath=platform\:/base/plugins/com.adobe.flexbuilder.standalone osgi.instance.area.defau...@user.homeosgi.instance.area.default%3D%40user.home/Documents/Flex Builder 3 #osgi.user.d...@user.home %23osgi.user.dir%3D%40user.home/Documents/Flex Builder 3 osgi.configuration.ar...@user.homeosgi.configuration.area%3D%40user.home/Documents/Flex Builder 3/configuration osgi.sharedConfiguration.area=platform\:/base/configuration osgi.sharedConfiguration.area.readOnly=true osgi.configuration.cascaded=true I've cleared the cache out of BOTH browsers and Flash Player. Still cannot debug.?? Any suggestions? thanks -- Cheers, Nate http://blog.natebeck.net
[flexcoders] BindingUtils question.
I read a demo BindingUtils.bindProperty(dogNameText, text, myDog, name) dogNameText is textInput and myDog is a object how to I bind dogNameText's Texr property to one variable like myString BindingUtils.bindProperty(dogNameText, text, myString) give me error. Please give me a idea how to do this.Thanks Mark
Re: [flexcoders] Re: Waiting for Flash Player to connect to the debugger
On Sat, May 23, 2009 at 2:16 AM, a.scavarelli a.scavare...@yahoo.com wrote: Hmm, I often get problems like this when, for some reason, another instance of the debugger/player is running. Try making sure you are always closing each instance properly after running your program. Also check out your task manager to see if there are any running in the background. The command-line debugger (fdb) listens for the player to connect on port 7935. So on OS X you could run this command to see if another instance is already listening: lsof -i | grep 7935 Output: java 5408 manish6u IPv6 0x395ba24 0t0 TCP *:7935 (LISTEN) That most likely is fdb. You can kill it using its PID: kill -9 5408 I don't know if this'll work for Flex Builder though. Manish -- www.manishjethani.com
Re: [flexcoders] localized parseFloat
Manish, NumberFormatter input is a number, whereas parsing should occur on strings already localized (1 234,56=1234.56). thomas --- http://www.web-attitude.fr/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056 2009/5/22 Manish Jethani manish.jeth...@gmail.com On Fri, May 22, 2009 at 2:14 PM, thomas parquier mailingli...@web-attitude.fr mailinglists%40web-attitude.fr wrote: Couldn't parseFloat() use the SharedResources properties to parse localized strings ? If you intend to parse a string like 1.234,56, I think you'll have to run it through a NumberFormatter first (1234.56) before you send it to the parse function. Manish
Re: [flexcoders] Multi-column drop-in checkbox renderer
In that case, I would expect my subclass of CheckBox to do the same. I've added a super call as follows: override public function set data(value:Object):void { super.data = value; _row = value as MyRow; } and set the dataField on the column. Consider the following example from the documentation: http://livedocs.adobe.com/flex/3/html/cellrenderer_5.html I added the Change button to change the underlying data. It only works if I call refresh() on the collection. Is that expected? If so, then I might be on the right track if I get the right incantation of rendererIsEditor, dataField, editorDataField etc. mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var myDP:ArrayCollection = new ArrayCollection([ {label1:Order #2314, contact:John Doe, quant:3, solddate:new Date(2005, 0, 1), Sent:true}, {label1:Order #2315, contact:Jane Doe, quant:3, solddate:new Date(2005, 0, 5), Sent:false} ]); private function onChangeData(event:Event):void { var o:Object = myDP.getItemAt(0); o.Sent = !(o.Sent); myDP.refresh(); } ]] /mx:Script mx:Button label=Change click=onChangeData(event)/ mx:DataGrid id=myDG dataProvider={myDP} variableRowHeight=true width=500 height=250 editable=true mx:columns mx:DataGridColumn dataField=label1 headerText=Order # editable=false/ mx:DataGridColumn dataField=quant headerText=Quantity itemEditor=mx.controls.NumericStepper editorDataField=value/ mx:DataGridColumn dataField=solddate headerText=Date itemRenderer=mx.controls.DateField rendererIsEditor=true editorDataField=selectedDate/ mx:DataGridColumn dataField=Sent itemRenderer=mx.controls.CheckBox rendererIsEditor=true editorDataField=selected/ /mx:columns /mx:DataGrid /mx:Application On Fri, May 22, 2009 at 11:17 AM, Alex Harui aha...@adobe.com wrote: Sounds like a lot of work and I’m not sure I quite follow, but CheckBox already implements IDropInListItemRenderer and will set its check mark based on the Boolean value of the dataField in the data item Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Richard Rodseth *Sent:* Friday, May 22, 2009 10:48 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Multi-column drop-in checkbox renderer I am creating a CheckBox item renderer (redacted code at the end of this post). Using the static methods that return a ClassFactory lets me tell the renderer which column it applies to, as follows: itemRenderer={PermissionCheckBox.factory('columnName')} The renderer dispatches a bubbling event, for which I have to attach a listener using AS (or create a subclass of the grid that adds Event metadata): private function onCreationComplete(event:Event):void { myGrid.addEventListener(ChangePermissionEvent.CHANGE_PERMISSION, onPermissionChange, false,0,true); } So far, so good. What's the cleanest way to get the checkbox selected state to bind to the property indicated by dataField (or columnName). Do I have to resort to something like this: http://techmytongue.blogspot.com/2009/04/reuse-itemrenderers-for-multiple.html or go back to an inline renderer? The effect I want is: Imx:CheckBox xmlns:mx=http://www.adobe.com/2006/mxml; selected={data[this.columnName]} change=onChange(event) Thanks. Renderer-in-progress: ?xml version=1.0 encoding=utf-8? mx:CheckBox xmlns:mx=http://www.adobe.com/2006/mxml; label={columnName:String} change=onChange(event) mx:Script ![CDATA[ [Bindable] public var columnName:String; private var _row:MyRow; public static function factory(columnName:String):ClassFactory { var classFactory:ClassFactory = new ClassFactory(PermissionCheckBox); classFactory.properties = {columnName:columnName}; return classFactory; } override public function set data(value:Object):void { _row = value as MyRow; } private function onChange(event:Event):void { dispatchEvent(ChangePermissionEvent.create(_row, columnName:String, this.selected)); } ]]
Re: [flexcoders] BindingUtils question.
Try using BindingUtils.bindSetter and create function. From: markflex2007 markflex2...@yahoo.com To: flexcoders@yahoogroups.com Sent: Friday, May 22, 2009 5:07:21 PM Subject: [flexcoders] BindingUtils question. I read a demo BindingUtils. bindProperty( dogNameText, text, myDog, name) dogNameText is textInput and myDog is a object how to I bind dogNameText' s Texr property to one variable like myString BindingUtils. bindProperty( dogNameText, text, myString) give me error. Please give me a idea how to do this.Thanks Mark
Re: [flexcoders] localized parseFloat
On Sat, May 23, 2009 at 2:52 AM, thomas parquier mailingli...@web-attitude.fr wrote: NumberFormatter input is a number, whereas parsing should occur on strings already localized (1 234,56=1234.56). That's not true. You can pass a string to NumberFormatter. See this example: var nf:NumberFormatter = new NumberFormatter(); nf.decimalSeparatorFrom = ,; nf.thousandsSeparatorFrom = .; nf.decimalSeparatorTo = .; nf.thousandsSeparatorTo = ; var s:String = nf.format(1.234,56); trace(s); var f:Number = parseFloat(s); trace(f); Manish
[flexcoders] Re: BindingUtils question.
Have a look here -- http://blogu.lu/mrm/2009/01/data-binding-and-actionscript-3/ --- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: I read a demo BindingUtils.bindProperty(dogNameText, text, myDog, name) dogNameText is textInput and myDog is a object how to I bind dogNameText's Texr property to one variable like myString BindingUtils.bindProperty(dogNameText, text, myString) give me error. Please give me a idea how to do this.Thanks Mark
Re: [flexcoders] localized parseFloat
Thanks you Manish. thomas --- http://www.web-attitude.fr/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056 2009/5/22 Manish Jethani manish.jeth...@gmail.com On Sat, May 23, 2009 at 2:52 AM, thomas parquier mailingli...@web-attitude.fr mailinglists%40web-attitude.fr wrote: NumberFormatter input is a number, whereas parsing should occur on strings already localized (1 234,56=1234.56). That's not true. You can pass a string to NumberFormatter. See this example: var nf:NumberFormatter = new NumberFormatter(); nf.decimalSeparatorFrom = ,; nf.thousandsSeparatorFrom = .; nf.decimalSeparatorTo = .; nf.thousandsSeparatorTo = ; var s:String = nf.format(1.234,56); trace(s); var f:Number = parseFloat(s); trace(f); Manish
Re: [flexcoders] absolute paths for mx:script source
is there a way or a key to go to the project root directory relatively? thanks C Manish Jethani wrote: On Fri, May 22, 2009 at 5:32 AM, coder3 rrhu...@hotmail.com wrote: I wonder if there is a way to add absolute path to mx:script for example, my file is under src/app1/app1.mxml. and the as file is src/common/asfile.as [...] i tried to use mx:Script source=/common/asfile.as / but the error shows: no .../src/app1/common/asfile.as found. That would be the absolute path on your disk. For instance: mx:Script source=/Users/manish/Code/test/test_script.as / Manish -- View this message in context: http://www.nabble.com/absolute-paths-for-mx%3Ascript-source-tp23662408p23678693.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] absolute paths for mx:script source
On Sat, May 23, 2009 at 3:45 AM, coder3 rrhu...@hotmail.com wrote: is there a way or a key to go to the project root directory relatively? The Flex compiler (mxmlc) doesn't know about projects. If Flex Builder has any special variables like ${PROJECT_ROOT} or such settings, I'm not aware of that. Manish
[flexcoders] Re: simple array?
Two good points. I used an Array, as I wrote, to try to show how Jason might have done what he had initially intended using arrays. I didn't mean to suggest that that's how it would be best done. Sorry for confusion. I guess I just like the similarity of arrays and objects - something that is not seen in all languages. As for efficiency, I would probably go with static const int's (in lieu of enums) and use an array. This would require to iterating - just simple offset into array. Something like, static const PAYMENT_TYPE_AC:int = 0; static const PAYMENT_TYPE_RN:int = 1; static const PAYMENT_TYPE_CP:int = 2; static const PAYMENT_TYPE_CR:int = 3; static const PAYMENT_MESSAGES:Array = [ Remember to reset the station address., Remember to reset the station expiration date., Remember to contact contractor to remove the certificates from this station., Remember to cancel the refund payment. ]; If there are better ways, I am always happy to hear them. I am still pretty new to this Flex thing. -eric --- In flexcoders@yahoogroups.com, Charles Parcell pokemonkil...@... wrote: Additionally, utilizing a loop to locate an item can eat up cycles if the list of codes gets to be large. Granted that in the case of this example looping 3 or even 10 items is likely not going to be an issue in anyway. Something to think about if the application of this example is used differently. Charles P. On Fri, May 22, 2009 at 10:50 AM, Charles Parcell pokemonkil...@...wrote: Why even have the Array aspect in the second example? It stands as a pointless container for what we are seeing it used for. Unless there will be some additional items added to it that we have not seen yet. I just feel the need to point that out. :) Charles P. On Thu, May 21, 2009 at 3:49 PM, Eric Cooper e...@... wrote: I just tried compiling what I wrote - and realized that it didn't... so here are two variants. The first is same as previous, but it compiles. The second may be more in the spirit of what you were attempting initially - and kind of highlights similarities between arrays and objects. First: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. } ); for each (var test:Object in records) { if (grid.selectedItem.PAYMENT_TYPE_CODE == test.code) Alert.show(test.text ); } Second: var PAYMENT_TYPE_CODE:String = CR; var records:Array = new Array( { AC: Remember to reset the station address. }, { RN: Remember to reset the station expiration date. }, { CP: Remember to contact contractor to remove the certificates from this station. }, { CR: Remember to cancel the refund payment. } ); for (var i:int = 0; i records.length; ++i) { if (records[i][grid.selectedItem.PAYMENT_TYPE_CODE]) Alert.show(records[i][PAYMENT_TYPE_CODE]); } --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: SWEET thanks --- In flexcoders@yahoogroups.com, Eric Cooper eric@ wrote: How about this: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. }, ); for each(test:Object in records){ if(grid.selectedItem.PAYMENT_TYPE_CODE == test[i].code) Alert.show(test[i].text ); }
[flexcoders] Problem importing classes with D.eval
Hi, I write you again because I haven't manage to use D.importClass(Label); However, by using personnal classes, I was able to indirectly create labels, here is the code: I have try to create a personal class which inerit of Label class or which have a Label property. The two working examples show how I did : Example 1 what it works : ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=init() layout=vertical cornerRadius=0 alpha=1.0 backgroundGradientAlphas=[1.0, 1.0] backgroundGradientColors=[#EF0808, #F6E8E8] color=#22B21B borderColor=#202FC1 mx:Script ![CDATA[ import r1.deval.D; public function init():void { import maClasse; D.importClass(maClasse); D.eval(var M:maClasse = new maClasse(\XXX\) ; C_PM_P_2.addChild(M);, Dyna_context); } ]] /mx:Script /mx:Application maClasse.as : package { import mx.controls.Label; public class maClasse extends Label { public function maClasse(name:String) { super(); super.text = name; } } } Example 2 what it works (just maClasse changed) : maClasse.as : package { import mx.controls.Label; public class maClasse { public var lab:Label; public function maClasse(name:String) { super(); lab = new Label(); super.text = name; } } } _ These examples work pretty fine. No runtime error. However it's still impossible to directly import and use a Label with D.eval, following code fails at runtime: The error message is : Runtime Error: msg.rt.no.class [line:1] at r1.deval.rt::CallExpr/getAny() at r1.deval.rt::ExprStmt/exec() at r1.deval.rt::Block/exec() at r1.deval.rt::Block/run() at r1.deval.rt::Env$/run() at r1.deval::D$/eval() at test/init() at test/___test_Application1_creationComplete() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.core::UIComponent/set initialized() at mx.managers::LayoutManager/doPhasedInstantiation() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2() at mx.core::UIComponent/callLaterDispatcher() _ We suspect a problem with namespace or something like that (Label is defined under a specific namespace) But we don't know how to import a namespace in D.eval neither how to use the namespaceand neither if it's really the problem ;o) Does anyone have an idea about that problem? Wishes
[flexcoders] Re: simple array?
Two good points. I used an Array, as I wrote, to try to show how Jason might have done what he had initially intended using arrays. I didn't mean to suggest that that's how it would be best done. Sorry for confusion. I guess I just like the similarity of arrays and objects - something that is not seen in all languages. As for efficiency, I would probably go with static const int's (in lieu of enums) and use an array. This would require no iterating - just simple offset into array. Something like, static const PAYMENT_TYPE_AC:int = 0; static const PAYMENT_TYPE_RN:int = 1; static const PAYMENT_TYPE_CP:int = 2; static const PAYMENT_TYPE_CR:int = 3; static const PAYMENT_MESSAGES:Array = [ Remember to reset the station address., Remember to reset the station expiration date., Remember to contact contractor to remove the certificates from this station., Remember to cancel the refund payment. ]; If there are better ways, I am always happy to hear them. I am still pretty new to this Flex thing. -eric --- In flexcoders@yahoogroups.com, Charles Parcell pokemonkil...@... wrote: Additionally, utilizing a loop to locate an item can eat up cycles if the list of codes gets to be large. Granted that in the case of this example looping 3 or even 10 items is likely not going to be an issue in anyway. Something to think about if the application of this example is used differently. Charles P. On Fri, May 22, 2009 at 10:50 AM, Charles Parcell pokemonkil...@...wrote: Why even have the Array aspect in the second example? It stands as a pointless container for what we are seeing it used for. Unless there will be some additional items added to it that we have not seen yet. I just feel the need to point that out. :) Charles P. On Thu, May 21, 2009 at 3:49 PM, Eric Cooper e...@... wrote: I just tried compiling what I wrote - and realized that it didn't... so here are two variants. The first is same as previous, but it compiles. The second may be more in the spirit of what you were attempting initially - and kind of highlights similarities between arrays and objects. First: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. } ); for each (var test:Object in records) { if (grid.selectedItem.PAYMENT_TYPE_CODE == test.code) Alert.show(test.text ); } Second: var PAYMENT_TYPE_CODE:String = CR; var records:Array = new Array( { AC: Remember to reset the station address. }, { RN: Remember to reset the station expiration date. }, { CP: Remember to contact contractor to remove the certificates from this station. }, { CR: Remember to cancel the refund payment. } ); for (var i:int = 0; i records.length; ++i) { if (records[i][grid.selectedItem.PAYMENT_TYPE_CODE]) Alert.show(records[i][PAYMENT_TYPE_CODE]); } --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: SWEET thanks --- In flexcoders@yahoogroups.com, Eric Cooper eric@ wrote: How about this: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. }, ); for each(test:Object in records){ if(grid.selectedItem.PAYMENT_TYPE_CODE == test[i].code) Alert.show(test[i].text ); } would that do it? -eric --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: var records:Array = new Array({ AC: Remember to reset the station address., RN: Remember to
Re: [flexcoders] Access FormItem child
Actionscript. On Fri, May 22, 2009 at 1:01 PM, markgoldin_2000 markgoldin_2...@yahoo.com wrote: If I have a FormItem like this: ?xml version=1.0 encoding=utf-8? mx:FormItem xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% direction=horizontal mx:TextInput id=username/ mx:Button width=22 icon=@Embed(source='../assets/find.png') id=find /mx:Button /mx:FormItem then in another mxml fil where I am using that component: userLookUp /userLookUp is there a way of accessing username via markup tags? Or it's only via AS? Thanks
[flexcoders] AdvancedDataGrid Server Side Sorting
Hi. I have AdvancedDataGrid with server side pagination and sorting. The thing I cannot implement is showing sort triangles in datagrid headers. The only way i've found is manually listen SORT event and set collection.sort property of my dataProvider - but then when I change collection.source it causes collection.refresh() on my dataProvider's collection and it sorts again in Flex :( So some fields sorted in wrong way (differently as I sorted them on server (in DB)) Please help me :)
[flexcoders] Dynamic Org Chart - Needed
Hi. New to flexcoders. Not a developer. Talking to a guy from Adobe who said I should post here. I'm trying to figure out how to create an Org Chart/Tree Chart app similar to academia.edu/geni.com. Cristophe said that flex/actionscript would be the way to go, and said I might find resources/people here that I could talk to to figure this out. Rather than bog the list with too much stuff if this isn't the right place, I'd rather talk offline with anybody that can/wants to help. I'm more than willing to add more information on this thread if it's the right thing to do! The goal of this is to also potentially release this back to the open source community, as my need for this is kind of tangental to my targeted goal. Thanks -bruce caliventu...@yahoo.com
[flexcoders] Re: Multiple filters on datagrid
I'm also trying something similar, but with various components: http://s256908546.onlinehome.us/datagrid/am_post.html I can't get the filtering to work correctly. --- In flexcoders@yahoogroups.com, alinmircea_s alinmirce...@... wrote: From what I understand, is this what you're looking for? (a quick example for you get the basic idea. There are better and cleaner ways to do this.) ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.collections.ICollectionView; private function filterScChange(event:Event):void { ICollectionView(grid.dataProvider).filterFunction = filter; ICollectionView(grid.dataProvider).refresh(); } public function filter(item:Object):Boolean { if (item.test1.toUpperCase().match(f1.selectedLabel.toUpperCase()) || item.test2.toUpperCase().match(f2.selectedLabel.toUpperCase()) || item.test3.toUpperCase().match(f3.selectedLabel.toUpperCase()) || item.test4.toUpperCase().match(f4.selectedLabel.toUpperCase())) return true; return false; } ]] /mx:Script mx:ComboBox id=f1 labelField=test1 dataProvider={datap1} change=filterScChange(event)/ mx:ComboBox id=f2 labelField=test2 dataProvider={datap1} change=filterScChange(event)/ mx:ComboBox id=f3 labelField=test3 dataProvider={datap1} change=filterScChange(event)/ mx:ComboBox id=f4 labelField=test4 dataProvider={datap1} change=filterScChange(event)/ mx:ArrayCollection id=datap mx:Object test1=some test2=random test3=text test4=here/ mx:Object test1=also test2=here test3=and test4=here/ mx:Object test1=here test2=and test3=here test4=also/ mx:Object test1=here test2=some test3=random test4=text/ /mx:ArrayCollection mx:ArrayCollection id=datap1 mx:Object test1=some test2=random test3=text test4=here/ mx:Object test1=also test2=here test3=and test4=here/ mx:Object test1=here test2=and test3=here test4=also/ mx:Object test1=here test2=some test3=random test4=text/ /mx:ArrayCollection mx:DataGrid id=grid dataProvider={datap} mx:columns mx:DataGridColumn headerText=UserId dataField=test1/ mx:DataGridColumn headerText=UserName dataField=test2/ mx:DataGridColumn headerText=Active dataField=test3/ mx:DataGridColumn headerText=Last seen dataField=test4/ /mx:columns /mx:DataGrid /mx:Application
[flexcoders] Filtering multiple conditions in an arraycollection
I want to filter a datagrid by multiple criteria. I would like to have several types of components (checkbox, slider, textfield, etc) to filter, each one set to filter a particular datafield (asset_status, serial, tagsee data structure) in the arraycollection. The filterfunction does not work. When I click type in the textbox or check any checkboxes, it does not retreive the intended results. My entire code is below. The data source structure from the httpservice is listed before the code. Appreciate any help. /// Data Source Returned From HTTPService /// ?xml version=1.0 encoding=iso-8859-1 ? data row asset_statusActive/asset_status p_or_l / serial2CE9049CMC/serial is_missingReporting/is_missing tagCUSA221733/tag bar_conn3/13/2009 3:18:00 PM/bar_conn hell2361/hell23 zen_conn24/zen_conn actual_zen_date4/19/2009 8:24:00 PM/actual_zen_date dmi_conn / actual_dmi_date / alt_conn3/alt_conn hello05/10/2009/hello is_tripleTriple/is_triple is_redokay/is_red Disconnected_AssetAlways Connected/Disconnected_Asset /row data CODE ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=initApp() mx:Style source=t.css/ mx:Script ![CDATA[ import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; //var missing:ArrayCollection = myData.is_missing.contains('Missing'); [Bindable] var myData:ArrayCollection; // On startup private function initApp():void { srv.send(); } // Filter function private function processFilter(item:Object):Boolean { var nameRet:int = 0; var weekRet:int = 0; var dateRet:int = 0; var amntRet:int = 0; var iRet:int = 0; var chkRet:int = 0; var chkRet2:int = 0; var chkRet3:int = 0; var chkRet4:int = 0; var ret:Boolean = false; // If no filter text, or a match, then true if (!item.serial.length || (item.serial.toUpperCase().indexOf(nameFilter.text.toUpperCase()) = 0)) { nameRet = 1; } else { nameRet = 0; } if (!item.is_missing.length || (item.is_missing.toUpperCase().indexOf(weekFilter.text.toUpperCase()) = 0)) { weekRet = 1; } if(item.is_missing = checkBB) { chkRet = 1; } else { chkRet = 0; } if(item.alt_conn = slider.value) { amntRet = 1; } if(item.Disconnected_Asset = checkCC) { chkRet2 = 1; } if(item.Disconnected_Asset == checkDD) { chkRet3 = 1; } if(item.Disconnected_Asset = checkEE) { chkRet4 = 1; } iRet = chkRet nameRet weekRet chkRet3 chkRet4 amntRet; if(iRet == 1) { ret = true; } return ret; } private function resultHandler(e:ResultEvent):void { myData = e.result.data.row; //myData.source = ArrayCollection(e.result.data.row).toArray(); myData.refresh(); myData.filterFunction=processFilter; } private function faultHandler(e:FaultEvent):void { Alert.show(e.fault.message.toString()); // btnGetData.enabled = true; } public function getDetails(id:Number):void{ Alert.show('You clicked the row with an ID of: ' + id); } // Missing [Bindable] var checkBB:String; public function enableChk(event:Event):void{ if(chkAmount.selected) { checkBB = 'Missing'; myData.refresh(); } else { checkBB = 'asdf'; myData.refresh(); } } // Always Connected [Bindable] var checkCC:String; public function enableChk2(event:Event):void{ if(chkAmount2.selected)
[flexcoders] Vector issues when using child application domains
If I use a SWFLoader to load two sub-applications in child application domains (loadForCompatibility=false), and if each sub-application defines a type of the same name, Thing, then it doesn't seem possible to use the type Vector.Thing in both sub-applications. (The Thing type is *not* known to the parent application.) The first sub-application can declare a Vector.Thing and add Thing objects to it, but if the second sub-app tries to do the same, a type error is thrown. Is this a known limitation of Vector/sub-applications? Are there any known workarounds? There's some code that demonstrates the problem attached to https://bugs.adobe.com/jira/browse/FP-1986. Here's an example of the stack trace I get: TypeError: Error #1034: Type Coercion failed: cannot convert th...@3786461 to Thing. at Vector$object/http://adobe.com/AS3/2006/builtin::push() at VectorBugSubapp/onCreationComplete()[C:\workspace\x\VectorBugSubapp\src\VectorBugSubapp.mxml:9] at VectorBugSubapp/___VectorBugSubapp_Application1_creationComplete()[C:\workspace\x\VectorBugSubapp\src\VectorBugSubapp.mxml:2] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]
[flexcoders] Flash Skins Vs Css Vs Programatic Skin?? (All about performance)
Hi all!! each of the techniques has its differences, but which one of these is more efficient in performance when styling an application?? GUS
[flexcoders] Tile and 100% width
If I create a Tile element with a percent-based width (and leave the height unset), it uses some weird method to determine the height, and it's typically two to three times as tall as it needs to be. Any suggestions for how to work around this? I'd like the tile to be 100% the width of its parent container, but just tall enough to fit its children. -Maciek
Re: [flexcoders] Re: simple array?
Not that I think it is the best way, but the way I had originally suggested (which seemed to get over looked) was as follows. var records:Object = { AC: Remember to reset the station address., RN: Remember to reset the station expiration date., CP: Remember to contact contractor to remove the certificates from this station., CR: Remember to cancel the refund payment. }; var CODE:String = grid.selectedItem.PAYMENT_TYPE_CODE; if(records[CODE] != null ){ Alert.show(records[CODE]); } On Fri, May 22, 2009 at 6:55 PM, Eric Cooper e...@cooper.nu wrote: Two good points. I used an Array, as I wrote, to try to show how Jason might have done what he had initially intended using arrays. I didn't mean to suggest that that's how it would be best done. Sorry for confusion. I guess I just like the similarity of arrays and objects - something that is not seen in all languages. As for efficiency, I would probably go with static const int's (in lieu of enums) and use an array. This would require no iterating - just simple offset into array. Something like, static const PAYMENT_TYPE_AC:int = 0; static const PAYMENT_TYPE_RN:int = 1; static const PAYMENT_TYPE_CP:int = 2; static const PAYMENT_TYPE_CR:int = 3; static const PAYMENT_MESSAGES:Array = [ Remember to reset the station address., Remember to reset the station expiration date., Remember to contact contractor to remove the certificates from this station., Remember to cancel the refund payment. ]; If there are better ways, I am always happy to hear them. I am still pretty new to this Flex thing. -eric --- In flexcoders@yahoogroups.com, Charles Parcell pokemonkil...@... wrote: Additionally, utilizing a loop to locate an item can eat up cycles if the list of codes gets to be large. Granted that in the case of this example looping 3 or even 10 items is likely not going to be an issue in anyway. Something to think about if the application of this example is used differently. Charles P. On Fri, May 22, 2009 at 10:50 AM, Charles Parcell pokemonkil...@...wrote: Why even have the Array aspect in the second example? It stands as a pointless container for what we are seeing it used for. Unless there will be some additional items added to it that we have not seen yet. I just feel the need to point that out. :) Charles P. On Thu, May 21, 2009 at 3:49 PM, Eric Cooper e...@... wrote: I just tried compiling what I wrote - and realized that it didn't... so here are two variants. The first is same as previous, but it compiles. The second may be more in the spirit of what you were attempting initially - and kind of highlights similarities between arrays and objects. First: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. }, { code:CP, text:Remember to contact contractor to remove the certificates from this station. }, { code:CR, text:Remember to cancel the refund payment. } ); for each (var test:Object in records) { if (grid.selectedItem.PAYMENT_TYPE_CODE == test.code) Alert.show(test.text ); } Second: var PAYMENT_TYPE_CODE:String = CR; var records:Array = new Array( { AC: Remember to reset the station address. }, { RN: Remember to reset the station expiration date. }, { CP: Remember to contact contractor to remove the certificates from this station. }, { CR: Remember to cancel the refund payment. } ); for (var i:int = 0; i records.length; ++i) { if (records[i][grid.selectedItem.PAYMENT_TYPE_CODE]) Alert.show(records[i][PAYMENT_TYPE_CODE]); } --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: SWEET thanks --- In flexcoders@yahoogroups.com, Eric Cooper eric@ wrote: How about this: var records:Array = new Array( { code:AC, text:Remember to reset the station address. }, { code:RN, text:Remember to reset the station expiration date. },
[flexcoders] Re: Ctrl click in combobox
Argh! I was looking in the wrong component :) I should've been checking out the dropdown (I tried setting some listeners on this, but was unsuccessful), but I was looking in the ComboBox. Thanks for the pointer and the code. Looks like it will do the job. --- In flexcoders@yahoogroups.com, Manish Jethani manish.jeth...@... wrote: On Fri, May 22, 2009 at 5:47 AM, lampei lam...@... wrote: Until recently, I did not know that you could reset the combobox back to the prompt value by ctrl-clicking the value in the combobox dropdown. �However, as most people don't know that this is a possiblity with the combobox, I'm trying to mimic this functionality by setting the selectedIndex to -1 if a person clicks (without the ctrl key) the same value that is already selected. I have yet to find the selectedIndexChanged property change to anything other than false when the change event fires, so I'm unable to use that (same for selectedItemChanged). �I tried setting the item under the mouse when itemRollOver fires to a property, then set it to null when itemRollOut fires. �Then when the person clicks, I said if the selectedItem == the value underneath the mouse during itemRollOver, set the selectedIndex = -1, however, the itemRollOut seems to fire before the click event is fired. �I've also yet to find where the code is for the ctrl-left click, or what causes that event to fire. The code is in ListBase.as: the selectItem function (called from mouseDownHandler). // allow unselecting via ctrl-click if (ctrlKey selectedData[uid]) { selectionChange = true; clearSelected(transition); } Here's the solution. 1. Make a custom class, MyList. public class MyList extends List { override protected function selectItem(item:IListItemRenderer, shiftKey:Boolean, ctrlKey:Boolean, transition:Boolean = true):Boolean { var index:int = itemRendererToIndex(item); if (index == selectedIndex) ctrlKey = true; return super.selectItem(item, shiftKey, ctrlKey, transition); } } 2. Use this class as the dropdown in the ComboBox. mx:ComboBox id=cb prompt=-- select -- dataProvider={['1', '2', '3']} dropdownFactory={new ClassFactory(MyList)} / Tada! Manish -- www.manishjethani.com
[flexcoders] Gumbo - new namespaces - mx:Script error
Assuming that the latest namespace changes point to this standard: ?xml version=1.0 encoding=utf-8? s:Application name=GumboApp xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/halo mx:Script ![CDATA[ //ActionScript statements ]] /mx:Script Why does mx:Script give a Could not resolve mx:Script to a component implementation? What does work in the way of code completion does pop up mx:Script, and Gumbo Lang Refs still lists mx:Script. TIA, Mic.
[flexcoders] FlexBuilder design-mode wierdness...
Ok, all of the sudden one of my components can't be rendered in Design Mode anymore... I have no clue why... Is there some sort of size-restriction? Like, the length of the file can't be longer than a certain length or Design Mode won't work? That's the only thing I can think of. It's just this one file that won't render at all in Design Mode - no errors or anything, just a blank screen when I try to go into Design Mode to look at the file... Anyone have any clue at all as to why it's suddenly doing this? Laurence MacNeill Mableton, Georgia, USA
[flexcoders] Form validation in Flex?
Hi, I have many forms that need do form validation. Do you think if I can have a common Flex component to do all the form validation. Thanks for your help. Mark
[flexcoders] Re: NEED more than 15 menu item in Context Menu ????
Thanks Lot for the Reply. My FLex Application is not running inside browser , It is running inside DOt Net container as a Active X control. the idea you suggested required default context menu to be hidden ..is it possible to hide it ? If yes then I Can open some custom window on right click and design. I am not sure how concrete this idea is.. --- In flexcoders@yahoogroups.com, Yves Riel r...@... wrote: What about intercepting the right-click at the browser level and displaying your own contextual menu? However, you might have some browser incompatibility to look at. http://blog.another-d-mention.ro/programming/right-click-and-custom-cont ext-menu-in-flash-flex/ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dharmendra Chauhan Sent: Friday, May 22, 2009 3:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] NEED more than 15 menu item in Context Menu Hi, I really need to have more than 15 menu item displayed on Context Menu. I desperately need some workaround or ideas to achieve this My client has invested thousands of dollar in Flex Project, he definitely need more than 15 menu item.If this project failed , client will NEVER think to invest in flex. Had I been aware of this limitation before I would have thought some solution by now.This comes as a surprise to me at the last moment ,just fews days before Prod Date. Pls gents help me get rid of this ...PLEASE provide some ideas. Thanks in advance. Thanks, Dharmendra
[flexcoders] Re: session.getAttribute(somekey) returning NULL in SessionDestroyed
Hi Flexcoders, I request you to have a look in to it as I could not figure out why it is happening. --- In flexcoders@yahoogroups.com, Dharmendra Chauhan chauhan_i...@... wrote: Hi all, session.getAttribute(somekey) is returning null in SessionDestroyed() method of flex listener. Below are the steps I am following 1) I am adding flexLister in contextInitialized method of ServletContextListener FlexSession.addSessionCreateListener(myListener) 2) In sessionCreate method sessionCreated(FlexSession session) { session.addSessionDestroyListener(this) } 3) some where in applicaion I am putting a key vlaue pair in session like this FlexContext.getSession().setAttribute(somekey , someVlue) ; The issue is when I try to retreive vale from session her is how I m retreiving value sessionDestroyed(FlexSession session) { session.getAttribute(somekey); this return null WHY ? } This is always returning me null Pls note that I am RTMP channel and version of LCDS is 2.6 I also tried RTMPFlexSession RTMPFlexSession.addSessionCreateListener(myListener) but no luck , still got null Am I doing anything wrong ? Thanks , Dharmendra
RE: [flexcoders] Form validation in Flex?
It would probably be better to have all forms extend a base component and handle validation there. Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of markflex2007 Sent: Friday, May 22, 2009 10:34 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Form validation in Flex? Hi, I have many forms that need do form validation. Do you think if I can have a common Flex component to do all the form validation. Thanks for your help. Mark
[flexcoders] Working with files
I am trying to download a response from my server and then write that response out to a local file. But the local file is never complete. The amount of data I'm grabbing from the server can vary between a few K up to a couple megs. I am using a HTTPService call to request my data and then writing the file in my result function. I think that the data is not 100% transfered when the HTTPService is emitting the result event. The local file usualy varies from 26K lines of text to 56K lines and it is never 100%. In my result handler the code looks similar to this: private function resultFunction(e:ResultEvent):void { var data:String = e.result.toString(); var localFile:File = File.applicationStorageDirectory.resolvePath(response.xml); var fileStream:FileStream = new FileStream; fileStream.addEventListener(Event.COMPLETE, localFileWritten); fileStream.openAsync(localFile, FileMode.WRITE); fileStream.writeUTFBytes(data); fileStream.close(); } Should I be listening for a different event to know when e.result is done populating?