[flexcoders] Relayout component
Is there any way to force re-layout an component? Some child elements within a tabNavigator change this size and I would like that it re-layout all children instead of put a scroll bar. Cheers -- Marco Catunda
Re: [flexcoders] Flexunit and button click simulation
Do you want to do it because you want to test handler method? If so, why not call straight handler method? On 09/06/2010, at 07:36, NagendraP wrote: hi I have a button in my view which is listening to the mouse click. Im my flex unit test function, i am creating mouseevent object and then dispatching the event on the button object. this is not working when i run the flex unit cases. Any one to throw more light in simulating the button clicks in flex units. Regards Prasad -- Marco Catunda
[flexcoders] dispatchEvent import
Hi, I'm learning swiz framework and stumble upon this code http://www.pastebin.org/307313 at http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html My question is how could flex compiler understand the 'dispatchEvent' method in line 41 and 65? I haven't seen any explicit import of it. Cheers -- Marco Catunda
Re: [flexcoders] Re: dispatchEvent import
Yes, this component is neither UIComponent nor extend EventDispatcher and I don't have to change it to extend EventDispatcher because every things works well. For me it's so strange!! I don't know why. On 04/06/2010, at 18:24, turbo_vb wrote: Hey Steve, The component that Marco is referring to is not a UIComponent, so it doesn't have a dispatchEvent() method. He'll have to change thel class to extend EventDispatcher. -TH --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: The component itself has a dispatchEvent method. The this keyword is implicit in the call. It could have been written as this.dispatchEvent. --- In flexcoders@yahoogroups.com, Marco Catunda marco.catunda@ wrote: Hi, I'm learning swiz framework and stumble upon this code http://www.pastebin.org/307313 at http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html My question is how could flex compiler understand the 'dispatchEvent' method in line 41 and 65? I haven't seen any explicit import of it. Cheers -- Marco Catunda -- Marco Catunda
[flexcoders] Simple sum operation issue
I've just stumble upon this problem... Take a look at below code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=onCreationComplete(event) mx:Script ![CDATA[ import mx.events.FlexEvent; public function onCreationComplete(event:FlexEvent):void{ var v:Number; v = 540.54; v += 1192.32; v += 1192.33; textInput.text = v.toString(); } ]] /mx:Script mx:TextInput id=textInput verticalCenter=0 horizontalCenter=0/ /mx:Application The result should be 2925.19, but I've got 2925.18996. Any tips? Cheers -- Marco Catunda
[flexcoders] Re: Simple sum operation issue
I resolved the problem of Floating Point. I hadn't find any round function at Flex library. But this is on NumberFormatter class. Sorry!! Here is a workaround of this issue. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=onCreationComplete(event) mx:Script ![CDATA[ import mx.formatters.NumberFormatter; import mx.events.FlexEvent; public function onCreationComplete(event:FlexEvent):void{ var v:Number; v = 540.54; v += 1192.32; v += 1192.33; var f:NumberFormatter = new NumberFormatter(); f.rounding = nearest; f.precision = 2; textInput.text = f.format(v.toString()); } ]] /mx:Script mx:TextInput id=textInput verticalCenter=0 horizontalCenter=0/ /mx:Application -- Marco Catunda On Mon, May 4, 2009 at 8:55 PM, Marco Catunda marco.catu...@gmail.com wrote: I've just stumble upon this problem... Take a look at below code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=onCreationComplete(event) mx:Script ![CDATA[ import mx.events.FlexEvent; public function onCreationComplete(event:FlexEvent):void{ var v:Number; v = 540.54; v += 1192.32; v += 1192.33; textInput.text = v.toString(); } ]] /mx:Script mx:TextInput id=textInput verticalCenter=0 horizontalCenter=0/ /mx:Application The result should be 2925.19, but I've got 2925.18996. Any tips? Cheers -- Marco Catunda
Re: [flexcoders] maxWidth property not working on Advanced DataGrid
I didn't understand very well, but If you remove height=80 property in below line, the vertical scroll bar go away. mx:AdvancedDataGrid width=318 height=80 id=dg horizontalCenter=0 dataProvider={arr} horizontalScrollPolicy=auto -- Marco Catunda On Wed, Apr 22, 2009 at 8:52 AM, labosox lgad...@gmail.com wrote: Hello, I am trying to create a grid that will update its size on a column resize event. I want the grid to keep getting large until they hit a max width then turn on a horizontal scroll bar. Everything seems to work fine unless I have a vertical scroll bar present in the grid. When I try to re-size a column the datagrid adds a horizontal scroll bar automatically. Heres my code: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=initApp() viewSourceURL=srcview/index.html mx:Script ![CDATA[ import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn; import mx.controls.advancedDataGridClasses.AdvancedDataGridRendererProvider; import mx.events.IndexChangedEvent; import mx.events.ResizeEvent; import mx.collections.IViewCursor; import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.events.DataGridEvent; import mx.events.AdvancedDataGridEvent; import mx.controls.dataGridClasses.DataGridColumn; import mx.managers.CursorManager; public var bDummy:Boolean = false; [Bindable] private var itemAC:ArrayCollection; private function initApp():void{ dg.maxWidth = stuff.width; dg.addEventListener(AdvancedDataGridEvent.COLUMN_STRETCH, resizeCol); } private function resizeCol(event:AdvancedDataGridEvent):void { var _colIndex:Number = event.columnIndex; var width:Number; for(var i:int = 0; i = dg.columns.length - 1; i++) { width += dg.columns[i].width; } dg.width = width; //ive tried to add 18 here to handle the scroll bar but then the maxWidth //is ignored and the grid keeps resizing outside of its maxWidth } ]] /mx:Script mx:Array id=arr mx:Object name=Redsox quanity=10 cost=1000/ mx:Object name=Rays quanity=11 cost=500/ mx:Object name=Yankees quanity=20 cost=2000/ /mx:Array mx:Canvas width=500 height=45% backgroundColor=red horizontalCenter=0 verticalCenter=-65 id=stuff verticalScrollPolicy=off horizontalScrollPolicy=off mx:AdvancedDataGrid width=318 height=80 id=dg horizontalCenter=0 dataProvider={arr} horizontalScrollPolicy=auto mx:columns mx:AdvancedDataGridColumn width=100 headerText=name dataField=name/ mx:AdvancedDataGridColumn width=100 headerText=quanity dataField=quanity/ mx:AdvancedDataGridColumn width=100 headerText=cost dataField=cost/ /mx:columns /mx:AdvancedDataGrid /mx:Canvas /mx:Application
Re: [flexcoders] ADG to .csv - Not finding any solutions out there
At Flash Player 10 you could do it. http://blog.everythingflex.com/2008/10/01/filereferencesave-in-flash-player-10/ But I've never used. -- Marco Catunda On Tue, Mar 24, 2009 at 11:24 AM, Scott h...@netprof.us wrote: I tried to do this a while back from the client but ran into an issue where flex doesn't have direct access to the file system. This talks about it here: http://livedocs.adobe.com/flex/3/html/help.html?content=security_6.html However, you can do this with Air. I started working on a similar thing for something I was playing with. All I did was loop through the datagrid objects and parse out the information I wanted then manually wrote the variables in the order I wanted with a , (comma) between each one. If you can find a way around the standard flex app being able to write to the drive then let me know! Scott From: flexcoders@yahoogroups.com on behalf of Tom Chiverton Sent: Tue 3/24/2009 9:45 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] ADG to .csv - Not finding any solutions out there On Tuesday 24 Mar 2009, Adrian Williams wrote: several solutions for doing this with a standard DataGrid, but nothing for the Advanced, including searching thru the flexcoders archive. I'd expect the same approach to work - at a guess it grabs dg.dataProvider and loops over it ? -- Tom Chiverton Helping to authoritatively mesh synergistic sticky seamless clusters as part of the IT team of the year, '09 and '08 This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com http://www.halliwells.com/ . -- This message has been scanned for viruses and dangerous content by MailScanner http://www.mailscanner.info/ , and is believed to be clean.
Re: [flexcoders] Validation question
If you set errorString property of the validated field, the red border will plot automatically. -- Marco Catunda On Mon, Feb 2, 2009 at 2:05 PM, markgoldin_2000 markgoldin_2...@yahoo.com wrote: I am working on a generic program that would validate user entries. If validation fails how do I inforce Flex's generic red border for the validated field? Thanks
Re: [flexcoders] Buttonbar not centering at startup
Ben, horizontalCenter=0?? It should be horizontalAlign=center, shouldn't it? -- Marco Catunda On Sun, Feb 1, 2009 at 10:29 PM, Ben Cessa bce...@gmail.com wrote: Hi again, right now I'm just playing a little with AIR and PV3D writing a little useless app as an exercise. I'm having an odd problem with ButtonBar, the thing don't get the horizontal center when the apps starts, is aligned to the left, however, as soon as I start resizing the main window it works very nice. Any ideas about what could this be? The actual portion of code I'm using is this: mx:ButtonBar id=figSelector width=100% height=100% horizontalGap=20 horizontalCenter=0 verticalAlign=middle buttonWidth=50 buttonHeight=50 And here's a little screencap of what the component shows at startup By the way, I'm also having problems removing that ugly background from the buttons, can't figure out the skin needed, I was thinking in use a 100% transparent PNG as background image but I'm not sure, just in case someone know how to remove that too :P Well, thanx a lot for your attention and I hope someone can give me hand with this
Re: [flexcoders] Shared Objects And Modules
Lorenzo, When the doc says the same domain it means that flash player should get module from the same URL domain for security reason. About shared objects, it is cool but has size limitation like cookies. You can save whatever you want... -- Marco Catunda On Mon, Feb 2, 2009 at 7:27 AM, thelordsince1984 lore...@katamail.com wrote: Hi, i'm reading about shared objects...they are like html cookies but with improved performances...very cool!!but if i use modules can i always save the state of each modules? Infact i read that modules are used for the same domain..what domain means? that I can save the state for a single application (so a single swf files), is it true? thanks in advance Regards Lorenzo
Re: [flexcoders] Re: Common base class for components
I've just read this article. Very nice... Does anyone could explain me or point me some URL about the correct flow of Flex building components methods calls. I've never seen any documentation about it. As far as I understand, after invalidateProperties method, the further calls will happen commitProperties measure updateDisplayList Is it in that order? Is there any other important calls to know on? Cheers -- Marco Catunda On Thu, Jan 29, 2009 at 2:00 PM, Amy amyblankens...@bellsouth.net wrote: http://www.munkiihouse.com/?p=37
Re: [flexcoders] Is there a best-practice for knowing when a component is being shown to the user
Hi João Just looking it over, try to bindable visible property from parent's container. It could be a feasible work around. Cheers -- Marco Catunda On Fri, Jan 30, 2009 at 3:03 PM, João joao.sale...@webfuel.pt wrote: Hello, imagine an application composed of a nested hierarchy of Components, ViewStacks, View States, Navigators, etc. How can a component on the bottom of the hierarchy run a function every time he is shown to the user? The show event is only dispatched when the component visibility changes to true. If we are changing the component's parent visibility, the component might not be visible on screen, but the event is never dispatched. So, this means that a component never knows if it is being shown to the user or not (really visible!). This is a huge problem, since until now I wasn't able to find a clean an unobtrusive solution. Is there a best-practice for solving this problem? Thanks, João Saleiro
Re: [flexcoders] Datagrid
Nilson, Essa lista de flex é internacional, Se você escrever em Inglês, as pessoas nessa lista irão entende-lo melhor. Mas se vc quiser escrever em portugues, existem as seguintes listas que eu conheço: flexdev - Google Groups flex-brasil - Yahoo Groups It's an international flex list. If you write your question in English, the guys of this list could be understand you better. But, if you want to discuss in portuguese language there are the following list that I know: flexdev - Google Groups flex-brasil - Yahoo Groups Answering your question: What do you realy intend to do? I asked it because, until I know, there is no easy solution to get line when you click on it. I guess there is other nice solution in flex to deal with your problem. I've never needed it. -- Marco Catunda On Mon, Jan 26, 2009 at 12:44 PM, nilsonmalmeida nilsonmalme...@gmail.com wrote: Como faço para pagar os valores de uma linha em um datagrid, quando clicar nela ? Obrigado.
[flexcoders] Comparing Array and Object, not expected results
Hi, Why the Alert method shows Crazy string at this code below? I really didn't fingure it out. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=onCreationComplete(event) mx:Script ![CDATA[ import mx.controls.Alert; public function onCreationComplete(event: Event): void { var a: Array = new Array(); a.push( 2 ); var i: Object = 2; if( a == i ) { Alert.show( Crazy...!!! ); } else { Alert.show( Ok ); } } ]] /mx:Script /mx:Application
Re: [flexcoders] Re: Properly remove children
I have some doubt about weak references at eventListener. When I add a eventListener with weak reference true, the object don't get a point/reference to it but what happens with eventListener array after removing this object. This array don't has the reference for garbage collect, so the garbage collect could collect it, but this object was never removed from this eventListner array, wasn't it? That's my question. Is this object removed from eventlistener array when weak reference is true? Is it feasible to implement it in pure action script or It is a voodoo feature for compiler? On Wed, Jan 7, 2009 at 8:27 AM, Manish Jethani manish.jeth...@gmail.com wrote: On Wed, Jan 7, 2009 at 4:48 AM, markgoldin_2000 markgoldin_2...@yahoo.com wrote: Ok, here what I am getting. I have a container that I am adding different forms to at the run time. These forms are all based on the same class though. So, before I add a new form I am removing current form using: container.removeAllChildren(); each form when created is adding a custom event listener to a parent - the container. When a custom event is triggered every form that was created (regardless that it was removed after) gets this custom event to handle. When you listen for an event on one of your ancestors, you usually want to use a weak reference (the last parameter to addEventListener). That's because your parent doesn't know you're listening on it, so when you've been removed and discarded, you'll still be around because of the event listener. Manish
Re: [flexcoders] Cairngorm v/s others
I would love to know how pronounce it correctly too. This name is a tongue twister for me. :) :) On Sat, Jan 3, 2009 at 10:15 PM, Hyder hyder_...@hotmail.com wrote: Btw, I've always wondered, how does one pronounce Cairngorm... Kane Gaum ?
Re: [flexcoders] Canceling remoteobject operation?
Amy, I don't know if I understand you problem. When one operation fault, I guess this operation is finished, therefore there is no way receive many faults with the same operation. I think you have other problem... If even so you want do cancel this operation I will do this: At then end of execute function, put this line: taken.operation = _ro.getOperation('getServices'); In line with ??? replace for it: var operation:Operation=token.operation; I don't know if it will run, I don't test it... -- Marco Catunda On Mon, Dec 29, 2008 at 4:33 PM, Amy amyblankens...@bellsouth.net wrote: I have a situation where a single remoteobject call is triggering multiple faults. In my fault handler, I want to cancel the operation on the first one. However, I'm not sure how to get from the token to the operation that was called. Here's my code: package com.rw.adBlankenship.remoting { import com.rw.adBlankenship.vo.GraphicProfile; import flash.events.Event; import mx.collections.ArrayCollection; import mx.events.CollectionEvent; import mx.messaging.Channel; import mx.messaging.ChannelSet; import mx.messaging.channels.AMFChannel; import mx.rpc.AsyncToken; import mx.rpc.Responder; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.rpc.remoting.RemoteObject; public class GetProfiles { //--- shared variables: //remote object to use: private static var _ro:RemoteObject=new RemoteObject (); private static var _channels:ChannelSet=defaultChannelSet(); /** * Set the profiles collection to the ArrayCollection that * is being used to page through the graphic profiles. * More profiles will be added to it as they are loaded */ public static var profiles:ArrayCollection = new ArrayCollection(); //ensures GraphicProfile gets compiled into this class private static var dummy:GraphicProfile; //sets up default channel set private static function defaultChannelSet():ChannelSet { /* Once we know the settings logic works, this will return a channelset with a default channel that can be used if none is specified. */ return new ChannelSet; } //allows the endpoint to be set from anywhere in the application public static function set endpoint (gateway:String):void { var channel:AMFChannel; //look to see if the channel is already there for (var i:int=0; i_channels.channels.length; i++){ channel=_channels.channels[i]; if (channel.endpoint==gateway) return; } //add channel channel = new AMFChannel('gpChannel'+i, gateway); _channels.addChannel(channel); } public static function get endpoint():String{ return Channel(_channels.channels [_channels.channels.length-1]).endpoint; } /** * Executes the getServices service. * Takes a parameters object with the following properties. * @param categoryID:int-Category to display profiles for (use -1 for string search) * @param searchString:String-Search string to retrieve profiles for (use null for category search) * @param page:int-page number of results to retrieve (defaults to 0) * @param pageSize:int-size of a page of results (how many to ask for) (defaults to 0) */ public static function execute(categoryID:int=- 1,searchString:String=null, page:int=0, pageSize:int=24):void{ if (_channels.channels.length==0) { throw new Error('No endpoint specified for GetCategories command Remote Object'); } _ro.channelSet=_channels; _ro.destination = 'AMF_Category'; _ro.source = 'AMF_Category'; var token:AsyncToken=_ro.getServices (categoryID=-1?null:categoryID, searchString, page, pageSize); token.addResponder(new Responder (profilesLoaded, profileLoadFailed)); } /* Populate current ArrayCollection with the result. This will generate a CollectionChange wherever the other end of the reference is so it will know the categories have arrived. */ private static function profilesLoaded (e:ResultEvent):void{ //keep from sending tons of collection events profiles.disableAutoUpdate(); for (var i:int=0; ie.result.length; i++) { profiles.addItem(e.result[i] as GraphicProfile); } //send the collection event profiles.enableAutoUpdate(); } private static function profileLoadFailed (e:FaultEvent):void{ trace(e.fault); //dispatch a collection change event so that the SearchProfiles can react profiles.dispatchEvent(new CollectionEvent (CollectionEvent.COLLECTION_CHANGE)); //keep from tying up resources responding to more faults on this call var operation:Operation=???; operation.cancel(); } } } I'd really appreciate it if someone could help me out with what goes in place of ??? above. Thanks; Amy
Re: [flexcoders] Get data from a cell in a data grid
Daniel, Generally, components in Flex works with dataprovider. The question is how can you get data from dataprovider? Depends on the type of dataprovider is. How do you set up dataprovider for this grid? Look at http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_1.html Cheers -- Marco Catunda On Tue, Dec 16, 2008 at 7:18 PM, danielrkrueger danielrkrue...@yahoo.com wrote: If I know the RowIndex and the Column number how can I get the data from the data grid? It seems simple, but I can't seem to find it.
Re: [flexcoders] Getting NULL Object Reference while deleting last element of the list
Anuj, I think there is something wrong with this structure. Why make it into for loop? The _addToAssociatedDevicesArr is received the same value for(var i:*=0;i_addDevicesLen-1;i++) { _addToAssociatedDevicesArr=nvrsInPoolList.selectedItems; } The last loop has the same problem. The index variable t is never used. Why it is in for loop? for(var t:*=0;t_addToAssociatedDevicesArr.length;t++) { if(nvrsInPoolList!=null) { IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex); } } About the problem you complain I think one of this variable is null value: camerasInPoolList arrAddToPool arrRemoveFromPool -- Marco Catunda On Thu, Dec 11, 2008 at 7:33 PM, anuj181 anuj...@gmail.com wrote: Hi Guys I am trying to implement the delete entries of the list box. The code works fine till the last entry, when i am trying to delete the last item after selection it is throwing error TypeError: Error #1009: Cannot access a property or method of a null object reference. I have seen this error so many times but I am not sure how will i fix this in the following code. Please help me in fixing this error Thanks Anuj /*CODE*/ mx:Button x=322 y=237 label=Add id=_addButton click=addToAssociatedDevices(event)/ private function addToAssociatedDevices(evt:MouseEvent):void { var _addDevicesLen:int=devicesInList.length; var _addToAssociatedDevicesArr:Array; for(var i:*=0;i_addDevicesLen-1;i++) { _addToAssociatedDevicesArr=nvrsInPoolList.selectedItems; } if((_addToAssociatedDevicesArr is Array)(_addToAssociatedDevicesArr!=null)) { var removeIndex:int = 0; for each (var addItemVal:* in _addToAssociatedDevicesArr) { if(addItemVal!=null) { IList(camerasInPoolList.dataProvider).addItem(addItemVal as Object); //Adds a device to the Add To Camera Pool list arrAddToPool.push(addItemVal); //Removes a device from the Remove From Pool list removeIndex = arrRemoveFromPool.indexOf(addItemVal); if(removeIndex -1) { arrRemoveFromPool.splice(removeIndex,1); } } } } for(var t:*=0;t_addToAssociatedDevicesArr.length;t++) { if(nvrsInPoolList!=null) { IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex); } } }
Re: [flexcoders] Best practice for calling asynchronous functions?
Mark, I've used to the same approach you describe but I didn't implemet failureFunc. This facade, in my case, detect a failure and display a message error. This approach take an advantage that you don't take care any more for failures and it will always be treat in the same way. This is a example method in my facade public function formDeleteAccount( listener: Function ): Operation To call this method you can use formDeleteAccount( handler ).send( params ) The send method return a AsyncToken and you can add more listener or put other params token for handler function. There is other methods like it: public function filterByText( listener: Function, text: String ): AsyncToken In this case, we use the compiler to force the correct params. I like this second approach and we will convert all the code to use it. If you have an interesting, I can send you all the code. But believe, I don't know if it is the best practice, but, for my problem, it run very well. -- Marco Catunda On Wed, Dec 10, 2008 at 6:34 AM, Mark Carter [EMAIL PROTECTED] wrote: In my app, I make a wide variety of XML-RPC calls. Now, to avoid having to add/remove listeners all over the place, I've created a class (facade?) with functions like: function save(xml:XML, successFunc:Function, failureFunc:Function):void; function load(id:String, successFunc:Function, failureFunc:Function):void; Note, the class' state does not change when any of these functions are called. The class makes the necessary XML-RPC call and listens to the appropriate events before calling the relevant success or failure function. The class guarantees that either the successFunc or the failureFunc will be called at some point (but never both). This makes my calling code very neat: save(myXML, function(id:String):void { Alert.show(Successfully saved XML using id: + id); // now do the next step }, function(msg:String):void { Alert.show(Failed to save because: + msg); // now rollback }); One obvious drawback of this is that its not so easy to add multiple listeners to, say, the save operation. But, in my situation, I never need to. What say you all - good or bad practice? -- View this message in context: http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20930596.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Set up style for TextField
It works!!! Thanks a lot! On Sat, Dec 6, 2008 at 7:00 PM, Alex Harui [EMAIL PROTECTED] wrote: Try private function addAccountText(): void { this.pAccountTextField = new UITextField(); this.pAccountTextField.styleName = this; this.pAccountTextField.width = this.width * 65 / 100; this.pAccountTextField.height = this.height; this.pAccountTextField.x = this.width-this.pAccountTextField.width; this.pAccountTextField.y = 0; this.addChild( this.pAccountTextField ); this.setStyle( 'paddingRight', this.pAccountTextField.width + 5 ); } From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Marco Catunda Sent: Saturday, December 06, 2008 7:03 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Set up style for TextField Hi, I extended a textinput component to show other relationed text based on input user. It is a kind of personal component for application interface rules. I could show this text in other component behind it, but the design and usability was not so good. The snipet code above show how I added other text (TextField) behind TextInput: private function addAccountText(): void { this.pAccountTextField = new TextField(); this.pAccountTextField.width = this.width * 65 / 100; this.pAccountTextField.height = this.height; this.pAccountTextField.x = this.width-this.pAccountTextField.width; this.pAccountTextField.y = 0; this.addChild( this.pAccountTextField ); this.setStyle( 'paddingRight', this.pAccountTextField.width + 5 ); } The only problem about this code is text format. Is is not the same format as textinput componente inheritance. How could I apply the same format into TextField? I've tried the following lines with no success: this.pAccountTextField.styleSheet = this.textField.styleSheet; this.pAccountTextField.setTextFormat( this.textField.getTextFormat() ); Any tips? Regards -- Marco Catunda -- -- Marco Catunda
[flexcoders] Set up style for TextField
Hi, I extended a textinput component to show other relationed text based on input user. It is a kind of personal component for application interface rules. I could show this text in other component behind it, but the design and usability was not so good. The snipet code above show how I added other text (TextField) behind TextInput: private function addAccountText(): void { this.pAccountTextField = new TextField(); this.pAccountTextField.width = this.width * 65 / 100; this.pAccountTextField.height = this.height; this.pAccountTextField.x = this.width-this.pAccountTextField.width; this.pAccountTextField.y = 0; this.addChild( this.pAccountTextField ); this.setStyle( 'paddingRight', this.pAccountTextField.width + 5 ); } The only problem about this code is text format. Is is not the same format as textinput componente inheritance. How could I apply the same format into TextField? I've tried the following lines with no success: this.pAccountTextField.styleSheet = this.textField.styleSheet; this.pAccountTextField.setTextFormat( this.textField.getTextFormat() ); Any tips? Regards -- Marco Catunda
[flexcoders] How to get availability memory
Hi, Is there any way to get availability amount of memory? I only be able to get amount of memory in using by totalMemory property of System class. -- Marco Catunda
Re: [flexcoders] Detect a databinding
Hi Jules, Yes I could separate IList for each view, but in this approach I don't share common data, so the memory will increase without needness. I don't know about performance... I thought ICollectionView (ArrayCollection) for pageaable solution too complex. All of this complex is for local sort and filter features but when We work with remote data pageable, all this nice feature should be implement in server side not in local client side, so there is no worth for remote pageable data. As soon as I have time I will build a short example using this solution and send to you for appreciate. Perhaps, you can have a good idea to improve in this solution. :) Thanks On Wed, Dec 3, 2008 at 8:09 AM, Jules Suggate [EMAIL PROTECTED] wrote: Hey Marco, Could you use a separate IList for each view? I don't know how your implementation works -- but if it's using IViewCursor internally onto an ArrayCollection or some such, you shouldn't have much performance hit as they would all be pointing at the same underlying data... Jules On Wed, Dec 3, 2008 at 10:13, Marco Catunda [EMAIL PROTECTED] wrote: Hi Jules, Let me say about my problem. I've developed a class that implements IList interface for implicit pageable approach. This class works fine for one data provider of component. If I use it in two or more components the list become flicker. The problem of this flicker is when one component needs to get itens which is different for other component. The limit page in memory fill itens for one component, all components will receive events collection change, all components will refresh itens so the other component will get other itens and this loop will work forever. My solution was implement 'n' pages for 'n' components, but why could I detect how many components is using this object, the first idea was inspect a bindings? I saw a generated action script for binding, but I couldn't find out any solution. I didn't figure out how it works. There is some undocument API that I didn't understand. The idea of overrinding addEventListener don't work because the system never calls removeEventListener, so the pages which was created will never remove from memory. It is a memory leak problem. I don't have any idea how Flex remove theses listeners. Maybe it is a voodoo approach. :) Regards, On Tue, Dec 2, 2008 at 11:00 AM, Jules Suggate [EMAIL PROTECTED] wrote: Hi Marco, first up you have to ask yourself why you want this feature? There may be another way to solve the problem. However, here's what I know of your specific question... Last time I checked (Flex 3 beta 2) there was no *official* way to inspect the bindings on a component at runtime. However, if you create a component with bindings and load it up at runtime, you will find there are undocumented properties that enable you to do this. Look for a _watchers array -- you will also find it helpful to keep the generated actionscript that the Flex compiler normally throws away so you can read how databinding is implemented. The properties above are not part of the public API, so could change at any time. In fact, IIRC some of the very binding properties I just mentioned may even have been deprecated in the final Flex 3 release... proceed with caution. Which is why I ask what the actual problem is you are trying to solve -- perhaps the list can help you come up with other ideas :-) For example, your idea of overriding addEventListener is cunning -- perhaps that solution can be explored further. Cheers, Jules On Tue, Dec 2, 2008 at 23:05, Marco Catunda [EMAIL PROTECTED] wrote: Hi, I have a singleton class with model data provider (like cairngorm model). Some user interface components binding this model in data provider property. I didn't find out any way to detect if there is binding in this model or not, and how many bindings. The binding model works with events, so my idea was override addEventListener in singleton model to detect binding. But it don't work because the removeEventListener isn't call when component go away. Does anyone has any tips? Regards -- Marco Catunda -- Marco Catunda -- Marco Catunda
[flexcoders] Detect a databinding
Hi, I have a singleton class with model data provider (like cairngorm model). Some user interface components binding this model in data provider property. I didn't find out any way to detect if there is binding in this model or not, and how many bindings. The binding model works with events, so my idea was override addEventListener in singleton model to detect binding. But it don't work because the removeEventListener isn't call when component go away. Does anyone has any tips? Regards -- Marco Catunda
Re: [flexcoders] Detect a databinding
Hi Jules, Let me say about my problem. I've developed a class that implements IList interface for implicit pageable approach. This class works fine for one data provider of component. If I use it in two or more components the list become flicker. The problem of this flicker is when one component needs to get itens which is different for other component. The limit page in memory fill itens for one component, all components will receive events collection change, all components will refresh itens so the other component will get other itens and this loop will work forever. My solution was implement 'n' pages for 'n' components, but why could I detect how many components is using this object, the first idea was inspect a bindings? I saw a generated action script for binding, but I couldn't find out any solution. I didn't figure out how it works. There is some undocument API that I didn't understand. The idea of overrinding addEventListener don't work because the system never calls removeEventListener, so the pages which was created will never remove from memory. It is a memory leak problem. I don't have any idea how Flex remove theses listeners. Maybe it is a voodoo approach. :) Regards, On Tue, Dec 2, 2008 at 11:00 AM, Jules Suggate [EMAIL PROTECTED] wrote: Hi Marco, first up you have to ask yourself why you want this feature? There may be another way to solve the problem. However, here's what I know of your specific question... Last time I checked (Flex 3 beta 2) there was no *official* way to inspect the bindings on a component at runtime. However, if you create a component with bindings and load it up at runtime, you will find there are undocumented properties that enable you to do this. Look for a _watchers array -- you will also find it helpful to keep the generated actionscript that the Flex compiler normally throws away so you can read how databinding is implemented. The properties above are not part of the public API, so could change at any time. In fact, IIRC some of the very binding properties I just mentioned may even have been deprecated in the final Flex 3 release... proceed with caution. Which is why I ask what the actual problem is you are trying to solve -- perhaps the list can help you come up with other ideas :-) For example, your idea of overriding addEventListener is cunning -- perhaps that solution can be explored further. Cheers, Jules On Tue, Dec 2, 2008 at 23:05, Marco Catunda [EMAIL PROTECTED] wrote: Hi, I have a singleton class with model data provider (like cairngorm model). Some user interface components binding this model in data provider property. I didn't find out any way to detect if there is binding in this model or not, and how many bindings. The binding model works with events, so my idea was override addEventListener in singleton model to detect binding. But it don't work because the removeEventListener isn't call when component go away. Does anyone has any tips? Regards -- Marco Catunda -- Marco Catunda
Re: [flexcoders] Re: Flex nested tree get data from mysql and php
timgerr, You have to convert a table list, lft and rgt nested set approach, to an hierarchical model in server side. Unfortunately, the Flex DataDescriptionDefault only work in a model of array of array with 'chidren' field. As soon as I have time, I intend to develop a class that implements ITreeDataDescriptor. This class will work on nested set approach (MPTT) and pageable skill. On Sun, Nov 30, 2008 at 2:08 PM, timgerr [EMAIL PROTECTED] wrote: Amy, as always, you rock, that url was a good read. My problem is I am not sure how many children I will have or what the structure will look like. I am doing a tree so I can have n number of nodes or children, and I am not sure how to build the return object/array. Thanks for the read. timgerr --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, timgerr tgallagher@ wrote: Hello all, I am working with nested arrayobjects and I cannot construct the needed data from my php/mysql backend. I am using nested sets (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html), with left and right keys. I need to construct the data (in php) and pass it to flex (using a remote call). I need/want to get the data to flex and put it into an arraycollection. Has any one done this? If so, can you post some code? I have been banging my head on this for a long time and cannot get the data into the right format for an array collection. My client felt it wasn't appropriate to send all the data at once, so the way I work it is to have a manager class that tells each child node to load all of its children one at a time, using an event model that allows for interruptions when the user selects something so that then it concentrates on the children of the selected node. But you might find this article a good start to the way you want to do it: http://www.insideria.com/2008/04/amf3-php-server-objects-to-fle.html -- Marco Catunda
[flexcoders] Store local data
Hi, Is there any way to store local data using Flash Player? I've just seen using AIR. I would like to use it for cache solution. -- Marco Catunda
Re: [flexcoders] Store local data
The kind of data is a dataprovider with a lot of records (500 - 2000). The shared objects don't store many datas. :( Let me explain my problem. I have a screen which user have to input data very fast. It is a kind of POS (Point of Sale). The input text, with autosuggest approach, in this screen, is searching data into dataprovider using memory search. If I implement server search for this autosuggest the latency of this approach won't be accept for input data very fast. Until 2.000 records I guess no problem, but If It will be more, I will have a problem. The AIR has a SQL local data store. I'm looking foward to have the same thing in Flash Player. :) On Sat, Nov 22, 2008 at 1:38 PM, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: Marco Catunda [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, November 22, 2008 3:00 PM Subject: [flexcoders] Store local data Hi, Is there any way to store local data using Flash Player? Yes - shared objects (like cookies, really) http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html These are fine for persisting data between sessions and/or sharing data between concurrently running flash instances. I've just seen using AIR. I would like to use it for cache solution. I doubt it will be suitable, but maybe your use of the word cache isn't quite right. What kind of cache? Paul -- Marco Catunda -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Marco Catunda
Re: [flexcoders] Store local data
Peter, I've implemented exactly as you said, put the content when the application starts. But the problem is amount of data. If It is larger the memory will be out of. The solution of cache XML in the user's browser has the same memory problem for larger data. I'm praing for that data not become larger... It's my hope right now. Thanks I appreciate your help. On Sat, Nov 22, 2008 at 4:14 PM, Peter Witham [EMAIL PROTECTED] wrote: I don't think we'll see SQL Lite in the Flash player for web anytime soon due to the security problems it could create. Have you considered pulling the auto suggest content in when the application starts and / or in the background? The only other option that comes to mind is have the server page generate an XML document and have that downloaded in to the users browser cache maybe and pull the data from there? Depending on how often that data changes you could have the server generate the XML document at intervals or when the application is loaded perhaps, I think a server should be able to handle the load depending on the amount of users at any given time. Regards, Peter. On Sat, Nov 22, 2008 at 12:01 PM, Marco Catunda [EMAIL PROTECTED] wrote: The kind of data is a dataprovider with a lot of records (500 - 2000). The shared objects don't store many datas. :( Let me explain my problem. I have a screen which user have to input data very fast. It is a kind of POS (Point of Sale). The input text, with autosuggest approach, in this screen, is searching data into dataprovider using memory search. If I implement server search for this autosuggest the latency of this approach won't be accept for input data very fast. Until 2.000 records I guess no problem, but If It will be more, I will have a problem. The AIR has a SQL local data store. I'm looking foward to have the same thing in Flash Player. :) On Sat, Nov 22, 2008 at 1:38 PM, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: Marco Catunda [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, November 22, 2008 3:00 PM Subject: [flexcoders] Store local data Hi, Is there any way to store local data using Flash Player? Yes - shared objects (like cookies, really) http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html These are fine for persisting data between sessions and/or sharing data between concurrently running flash instances. I've just seen using AIR. I would like to use it for cache solution. I doubt it will be suitable, but maybe your use of the word cache isn't quite right. What kind of cache? Paul -- Marco Catunda -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Marco Catunda -- Peter Witham http://www.evolutiondata.com Internet and Multimedia developer Certified Flash Designer. -- Marco Catunda
[flexcoders] Pageable data provider
Hi, Does anyone could point me how could I build a pageable data provider? I've just seen examples using RecordSet class which doesn't have anymore in flex. I'm bit amazed because pageable solution is very common problem/solution, Is there any easy way to implement it that I haven't figured it out yet? I'm young in Flex world... My idea is to write a class which implements IList interface. This class will support remote call in either getItemAt and getItemIndex methods throwing the ItemPendingError Exception when the item isn't in local client memory. Any other tips? -- Marco Catunda
Re: [flexcoders] Re: Pageable data provider
Nathan, Thanks. I appreciate any help. It's like a HTML solution page approach. I would like a desktop way, as Matt Chottin called Implicit Pagging [1]. In [1], Matt Chotin explain very well some problems about large data sets, but this article [1] is too old (2004) and he didn't use any newer class like ArrayCollection, ICollectionView, IList, ... [1] http://weblogs.macromedia.com/mchotin/archives/2004/03/large_data_sets.html On Fri, Nov 21, 2008 at 5:57 PM, nathanpdaniel [EMAIL PROTECTED] wrote: http://www.adobe.com/cfusion/communityengine/index.cfm? event=showDetailspostId=9263productId=2loc=en_US Maybe? I'm not 100% sure of what you're referring to - but that sounds like it... --- In flexcoders@yahoogroups.com, Marco Catunda [EMAIL PROTECTED] wrote: Hi, Does anyone could point me how could I build a pageable data provider? I've just seen examples using RecordSet class which doesn't have anymore in flex. I'm bit amazed because pageable solution is very common problem/solution, Is there any easy way to implement it that I haven't figured it out yet? I'm young in Flex world... My idea is to write a class which implements IList interface. This class will support remote call in either getItemAt and getItemIndex methods throwing the ItemPendingError Exception when the item isn't in local client memory. Any other tips? -- Marco Catunda -- Marco Catunda
Re: [flexcoders] Problem with Flex form
Bruce, I don't know exactly why the resultHandler function is not called. I will try to call addEventListener before call send method of myContactService in sendMyData. You can get the result of PHP in event.result of resultHandler method. On Tue, Nov 11, 2008 at 2:22 AM, brucewhealton [EMAIL PROTECTED] wrote: Hello all, I have been unable to figure out why something simple is not happening in a form of mine. I have a form that does successfully take the user input and email it to us. However, for some reason, the Alert button that should give the user feedback is not working. It just hangs there when the user clicks on the submit button. I will need to share the code to get help with this. It is very basic and it does send the email message. I'll trim off extraneous appearance code that is not related to the actual logic of the form. So, we have the main application that has a Panel that calls the ContactFormComp (for ContactFormComponent)(leaving off the Application tag, of course: mx:Panel title=Contact Future Wave Designs forms:ContactFormComp id=MyContactForm/ /mx:Panel So, now we have the form component - this will be a bit longer, though still rather simple, but I don't know why it doesn't call the Alert function: ?xml version=1.0 encoding=utf-8? mx:Form xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; private function sendMyData():void { var obj:Object = new Object(); obj.Name = Name.text; obj.email = email.text; obj.phone = phone.text; obj.message = message.text; myContactService.send(obj); myContactService.resultFormat = text; myContactService.addEventListener(ResultEvent.RESULT, resultHandler); myContactService.addEventListener(FaultEvent.FAULT, fault_handler); } private function resetForm(event:MouseEvent):void { Name.text = ; email.text = ; phone.text = ; message.text = ; } private function resultHandler(event:ResultEvent):void { Alert.show(Thank you! Your message has been emailed, Thank you!); } private function fault_handler():void { Alert.show(There was a problem., Problem Encountered); } ]] /mx:Script mx:HTTPService id=myContactService url=mail_sender.php method=POST result=resultHandler(event) resultFormat=text/ mx:Label text=Your Contact Information/ mx:FormItem label=Name: mx:TextInput id=Name width=200 / /mx:FormItem mx:FormItem label=Email: mx:TextInput id=email width=200/ /mx:FormItem mx:FormItem label=Phone Number: mx:TextInput id=phone width=200/ /mx:FormItem mx:FormItem label=Message: mx:TextArea id=message width=200/ /mx:FormItem mx:FormItem mx:Button label=Submit fontSize=16 click=sendMyData()/ /mx:FormItem mx:FormItem mx:Button label=Reset Form fontSize=16 click=resetForm(event)/ /mx:FormItem /mx:Form I don't know if there is a problem with my php code but it does email the form. In order to share that, I have the php code in a text file here: http://futurewavedesigns.com/ContactUs/mail_sender.php.txt You'll see it is basic. Please let me know if you see any error explaining why it doesn't get to the Alert message. thanks, and Here's an additional issue... If anyone knows php how would I send a message from the php form saying Ok or Fault. That is in the code but I am not sure how to send it back to Flex. Thanks Bruce -- Marco Catunda
Re: [flexcoders] AMFPHP and Value Objects
Alan, Just to complement... I'm used VO (AMFPHP approach) with a lot of method with no problem. These VOs have the same face as above. On Mon, Nov 10, 2008 at 9:39 PM, Alan [EMAIL PROTECTED] wrote: On my last AMFPHP project my PHP and Flex VOs were: package com.mydomain { [Bindable] [RemoteClass(alias=UserVO)] public class UserVO { public var id :int; public var username :String; public var password :String; public var last_login :String; public var user_id :int; public var usertype_id :int; public var project_id :int; public function UserVO() { } } } PHP /// ?php class UserVO { var $id; var $username; var $password; var $last_login; var $user_id; var $usertype_id; var $project_id; // explicit actionscript package var $_explicitType = UserVO; } ? On Nov 10, 2008, at 6:07 PM, Fotis Chatzinikos wrote: Might be completly irrelevant (have not used AMFPHP) but are you using Remote class Metas? -- Marco Catunda
[flexcoders] Online help for flex applications
Hi, I just discuss how is the best way to make a on-line help for flex application. I'm thinking to write the help text in wiki system with some marks to inform flex app where is the help text for. Getting static html from wget approach and process this marks in a batch script. This marks will inform which area of app this help should appear. Display the help text in flex using mx:htmlText. How do you do to build help text for flex application? Regards -- Marco Catunda
[flexcoders] ItemsChangeEffect in Tree component don't play
Hello Guys, What's the problem with the following snipet code above? It doesn't play the DefaultListEffect when component is a Tree. Is it a Bug or I forgot something? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:DefaultListEffect fadeInDuration=2000 fadeOutDuration=2000 id=glow/ mx:Tree id=tree1 labelField=@label showRoot=true width=160 itemsChangeEffect={glow} mx:XMLListCollection id=MailBox mx:XMLList folder label=Mail folder label=INBOX/ folder label=Personal Folder Pfolder label=Business / Pfolder label=Demo / Pfolder label=Personal isBranch=true / Pfolder label=Saved Mail / /folder folder label=Sent / folder label=Trash / /folder /mx:XMLList /mx:XMLListCollection /mx:Tree mx:Button label=add item click={MailBox.addItemAt(tree1.selectedItem.copy(),0)}/ /mx:Application Regards -- Marco Catunda