Re: [flexcoders] AMFPHP problem
As you probably know, NetConnection.Call.BadVersion means that an error was thrown in the php script, usually a syntax error, but your script runs fine on other servers. I would suspect something in the php config on the server is causing you trouble. I have the same problem every time I move to a new server because I try and transfer too much info and not enough memory is allocated ro running php scripts on the server. Check your php.ini HTH Pete gotgoose09 wrote: I have been running my Flex applications just fine on my local computer and a remote server. I have been tasked with transferring them to a new server. Now whenever I execute a RemoteObject call I get [RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend faultDetail=Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'https://server/path/to/gateway.php https://server/path/to/gateway.php'] I know my PHP code works locally. I know it works on the old server. Even the AMFPHP service browser does not work and gives me the same issue. I know that the gateway.php works since I can view it in a web browser with no errors. I am wondering if the HTTPS is causing the problem, but I'm not sure. What can I do to solve this or figure out how to solve this? Any help would be greatly appreciated! - Ben
[flexcoders] Re: Nested PopUp and Mouse_Down_Outside event
Thank you for the suggestion. I looked at the event class and it would be quite tedious just to trap the mouse down event because of the need to traverse the owner chain. what I need to do is just to stop the mouse down event from bubbling up the chain. In the end I solved this problem by replacing the combobox with a popupbutton and list combination. Thanks! regards, CH --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: The event.relatedObject should be the object hit. If you hit the dropdown and check its owner property, you should end up back at the ComboBox 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 johncch85 Sent: Tuesday, November 10, 2009 12:38 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Nested PopUp and Mouse_Down_Outside event Hi, I'm trying to solve this problem here and I'd like to ask if anyone has any suggestions? I have a panel instance that is contextual and will be shown by the popupmanager when the user clicks on a button. To facilitate auto hiding when the user clicks outside the panel, I'm using the FlexMouseEvent.MOUSE_DOWN_OUTSIDE to trap the event and close the popup. I have a custom component inside this panel that uses a pop up similar to the date field. The custom component utilizes a class that extends UIComponent which acts as a popup to select an input value that will fill in to a textbox. The principle of operation is totally similar to that of the datefield. Unfortunately, this custom component has a few combo boxes inside. The main problem happens because of the listening of the MOUSE_DOWN_OUTSIDE event in the parent panel. I am able to stop the event from happening by preventing the mousedown events from the inner popup from bubbling up the display chain. The only thing I am unable to deal with is the bubbling up of the event when the user clicks the combobox dropdown which is the list item. From my understanding, it is handled by a separate popupmanager hence the event is not bubbled up the panel display chain. Is there any solution or any way around this? If not I'll have to switch the combo boxes with some other components, which I would like to avoid as I feel that the combobox presents the least clicks to the users. Thank you!
Re: [Spam] RE: [flexcoders] tabbing between headerRenderers?
Hey Alex, Thanks for your reply... I'm finding that event.preventDefault isn't working for me... This is it in a new flex web app... http://pastebin.com/m40b6a13c And when I run it in debug mode, click into the text input and press any key, I can see the keyCode but cancelable = false and therefore event.preventDefault isn't working. Do you have any clues to how I can make cancelable = true? It's a R/O property so perhaps I need to do something to the text object? Thanks for any help.. Nick 2009/11/10 Alex Harui aha...@adobe.com Yes. You will need to override keyFocusChange event, call preventDefault and change focus to another TextInput Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui
Re: [Spam] RE: [flexcoders] tabbing between headerRenderers?
Alex, I've sorted it... My mistake.. I wasn't using the correct event and I needed to assign it using AS, not MXML... http://pastebin.com/d5a59014b Thanks for your help :) Nick 2009/11/11 Nick Middleweek n...@middleweek.co.uk Hey Alex, Thanks for your reply... I'm finding that event.preventDefault isn't working for me... This is it in a new flex web app... http://pastebin.com/m40b6a13c And when I run it in debug mode, click into the text input and press any key, I can see the keyCode but cancelable = false and therefore event.preventDefault isn't working. Do you have any clues to how I can make cancelable = true? It's a R/O property so perhaps I need to do something to the text object? Thanks for any help.. Nick 2009/11/10 Alex Harui aha...@adobe.com Yes. You will need to override keyFocusChange event, call preventDefault and change focus to another TextInput Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui
[flexcoders] Re: Progress for synchronous operation
Could you use an indeterminate progress bar? (http://livedocs.adobe.com/flex/3/langref/mx/controls/ProgressBar.html) --- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote: What's a good way to display progress or a busy cursor for a potentially long-running, but synchronous operation (in my case generating a PDF using AlivePDF) ? As noted here, CursorManager.setBusyCursor doesn't display the cursor until there is no code running, and PopupManager seems to act similarly. Defer initiation of the operation using a timer?
Re: [flexcoders] Passing values from popup window to MXML component
Hi, I have written a function and after checking the username and password, to toggle the buttons, but I get the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. Here is the function I wrote public function checkCredentials():void { if(loginWin1.userInput.text == 'funandlearning' loginWin1.passwordInput.text == 'funandlearning') { Alert.show(Login Successful); PopUpManager.removePopUp(loginWin1); //var main:Main = new Main(); main.logout.visible = false; } else { Alert.show('Try again'); PopUpManager.removePopUp(loginWin1); } } LoginPopUp contains the code for displaying on the popupwindow, and Main is another component which contains code for calling popup window and it contain other UI code for header. Is this the right way to do? Thanks From: Omotola Anjorin shot2f...@yahoo.com To: flexcoders@yahoogroups.com Sent: Mon, November 9, 2009 6:33:48 AM Subject: Re: [flexcoders] Passing values from popup window to MXML component Yeah you can do what rohit said by adding a logout button at the same place and toggling the visiblity. This way, From you main application you can do something like this. if(loginWin. userInput. text=='funandlearni ng' loginWin.passwordIn put.text= ='funandlearning' ) { Alert.show( Login Successful) ; loginWin.loginButto n.visible = false loginWin.logoutButt on.visible = true } You can also use the same button but play around the text property. Cheers From: Rohit Sharma rohit.sharma1982@ gmail.com To: flexcod...@yahoogro ups.com Sent: Mon, November 9, 2009 12:21:02 PM Subject: Re: [flexcoders] Passing values from popup window to MXML component You can add a logout button at the same place as login button and toggle the visibilities of these buttons depending upon the state of your component. On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning funandlearning3@ yahoo.com wrote: Hello All, I was trying to create a login Page. The page has one main MXML application file with couple of MXML components. The First component contains the following: Component1.mxml: ?xml version=1.0 encoding=utf- 8? width=60% height=261 mx:Script ![CDATA[ import mx.managers. PopUpManager; import mx.controls. Alert; import components.LoginPop Up; import mx.events.CloseEven t; public var loginWin:LoginPopUp ; private function loginHandler( ):void { loginWin = new LoginPopUp() ; loginWin.addEventLi stener(CloseEven t.CLOSE,closeHan dler); PopUpManager. addPopUp( loginWin, this,true) ; PopUpManager. centerPopUp( loginWin) ; } public function closeHandler( event:CloseEvent ):void { PopUpManager. removePopUp( loginWin) ; } public function checkCredentials( ):void{ if(loginWin. userInput. text=='funandlearni ng' loginWin.passwordIn put.text= ='funandlearning' ) { Alert.show( Login Successful) ; } else { Alert.show( Login Failed); } } ]] /mx:Script mx:HBox width=90% height=55 borderColor= #F85023 id=headerButtons borderStyle= outset horizontalAlign= left verticalAlign= middle backgroundColor= #938480 mx:Spacer width=10%/ mx:Button id=loginMain label=Login click=loginHandler ( )/ mx:Button id=logout label=LogOut / /mx:HBox mx:HBox width=100% height=82% mx:HBox width=25% height=82% borderStyle= outset borderColor= #F85023 /mx:HBox mx:HBox width=65% height=82% borderColor= #F85023 borderStyle= outset /mx:HBox /mx:HBox /mx:VBox component2.mxml has the following code for the popup ?xml version=1.0 encoding=utf- 8? xmlns:main= components. * layout=vertical title=Please login showCloseButton= true !-- defined state to toggle between register and login -- mx:states mx:State name=Register basedOn= mx:AddChild relativeTo= {loginForm} position=lastChild creationPolicy= all mx:FormItem label=Email mx:TextInput id=email/
[flexcoders] Re: Progress for synchronous operation
I am not fully sure how AlivePDF works because I have never used it but I thought that it could be done asynchronously because I saw a complete event in the documentation that reads: Dispatched when PDF has been generated and available. The save() method generate this event That to me says that it can be generated asynchronously but like I said I really dont know. As far as showing progress during a synchronous call it is not possible. This is because the synchronous call does not return until it is done and thus the UI will never get a chance to update during the process. If you want to show something before that is possible. You could use a timer or you may want to look at the callLater method of displayObject as this will wait one frame before calling the method you want. This would allow you to show say a pop up or something so they user could at least see something. --- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote: What's a good way to display progress or a busy cursor for a potentially long-running, but synchronous operation (in my case generating a PDF using AlivePDF) ? As noted here, CursorManager.setBusyCursor doesn't display the cursor until there is no code running, and PopupManager seems to act similarly. Defer initiation of the operation using a timer?
[flexcoders] Embedded and non-embedded fonts in a single text field at the same time
Hi All, Is it possible to show some part of the text using non-embedded font and remaining text using embedded font in a single UITextField? I am trying a workaround for subscript and superscript. For this to work, I need to have the custom created subscript and superscript font to be embedded in the swf. But I don't have any other fonts embedded as the fonts are being referred from a external CSS file. I have to show a sub/supscript in a UITextField component along with the other text. Its like displaying some part of the text using non-embedded font and remaining text using embedded font. Does anyone have any idea how to do this? Or have any better idea to show sub/superscript text where I don't have to embed other fonts (apart from custom sub/sup fonts)? TIA -- Mahesh Kokadwar
[flexcoders] Re: Odd DragOver Problem
--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Double check your logic about when you call acceptDragDrop Also, are you overriding createChildren? If so, please post your code.
[flexcoders] Re: How can I use Grouping collection to group data on the parent ?
--- In flexcoders@yahoogroups.com, Thomas Silvester thomas_...@... wrote: Please Can anyone help me out? There's a GroupingCollection example at flexdiary.blogspot.com. It's not an exact match for what you're asking, but you might find that it helps point you in the right direction. HTH; Amy
Re: [flexcoders] Re: How can I use Grouping collection to group data on the parent ?
Thanks much. Tom. --- On Wed, 11/11/09, droponrcll amyblankens...@bellsouth.net wrote: From: droponrcll amyblankens...@bellsouth.net Subject: [flexcoders] Re: How can I use Grouping collection to group data on the parent ? To: flexcoders@yahoogroups.com Date: Wednesday, November 11, 2009, 8:36 PM --- In flexcod...@yahoogro ups.com, Thomas Silvester thomas_13s@ ... wrote: Please Can anyone help me out? There's a GroupingCollection example at flexdiary.blogspot. com. It's not an exact match for what you're asking, but you might find that it helps point you in the right direction. HTH; Amy
[flexcoders] Re: Odd DragOver Problem
Thank you for the help. I have a dragEnterHandler function which is called upon the main container's DragEvent.DRAG_ENTER event. The dragEnterHandler is the only place where acceptDragDrop is called, but that handler is only called when I'm on the left side of the container. I'm looking through the Flex source now to see when exactly the DRAG_ENTER event is dispatched. It's worth noting that the dead zone changes as the size of the control changes. It's not half of the container size, but around 60% of the length. Thank you again for your assistance. --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Double check your logic about when you call acceptDragDrop 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 bgamblin Sent: Tuesday, November 10, 2009 8:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Odd DragOver Problem Well, I hate to sound ditzy here, but I didn't actually fix all the problems by changing the background color. That fix stabilized the problem, making it so that the dead zones no longer seem random. However, it is now a situation where there is a definite cutoff about midway through the main HBox. Anything to the left of center will create a DragOver event. Anything to the right, won't. Has anybody seen this issue? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, bgamblin BrandG@ wrote: Never mind. I figured it out. I totally forgot that for something to be droppable, it has to be a visible component. In this case, setting the background color to anything at all makes it a droppable target. Sorry for the interruption. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, bgamblin BrandG@ wrote: Say you have an HBox, and inside that HBox you have lots of little child HBoxes. Now, you want to rearrange the child HBoxes using drag and drop. Using Flex, it's pretty easy to enable drag/drop support. However, the dragover event seems to fire at odd points. As I drag a child HBox around the main HBox, I sometimes see the invalid drag icon, even though it should be valid. If it disallowed dragging one child over another, I could understand that. But even that seems random, with some portions of the children showing as valid drag targets, and others not. With a small number of children, it was odd but not debilitating. With a large number of children, it became entirely untenable. If I have ten children, I can't drop the items anywhere except the first half of it's width. Is there another element to this that affects where an object becomes a drop target or not? Variable width perhaps? Padding? I'm at a loss.
[flexcoders] Re: AMFPHP problem
So you would suggest increasing the memory allocation for scripts in php.ini? Are there any other settings I should check? --- In flexcoders@yahoogroups.com, Pete pe...@... wrote: As you probably know, NetConnection.Call.BadVersion means that an error was thrown in the php script, usually a syntax error, but your script runs fine on other servers. I would suspect something in the php config on the server is causing you trouble. I have the same problem every time I move to a new server because I try and transfer too much info and not enough memory is allocated ro running php scripts on the server. Check your php.ini HTH Pete gotgoose09 wrote: I have been running my Flex applications just fine on my local computer and a remote server. I have been tasked with transferring them to a new server. Now whenever I execute a RemoteObject call I get [RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend faultDetail=Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'https://server/path/to/gateway.php https://server/path/to/gateway.php'] I know my PHP code works locally. I know it works on the old server. Even the AMFPHP service browser does not work and gives me the same issue. I know that the gateway.php works since I can view it in a web browser with no errors. I am wondering if the HTTPS is causing the problem, but I'm not sure. What can I do to solve this or figure out how to solve this? Any help would be greatly appreciated! - Ben
Re: [flexcoders] Re: AMFPHP problem
On Wednesday 11 Nov 2009, gotgoose09 wrote: So you would suggest increasing the memory allocation for scripts in php.ini? Only if that's the problem :-) What does the error log of you PHP application say ? -- Helping to simultaneously negotiate out-of-the-box turn-key customers 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.
[flexcoders] Re: Odd DragOver Problem
I'm not overriding CreateChildren, but I'd be glad to post the code I'm using. Here's the function for when the main container is created: public function ColumnArranger() { super(); this.setStyle(borderStyle,solid); this.setStyle(borderThickness,1); this.setStyle(backgroundColor,#1B4B6A); this.percentWidth = 100; addEventListener( DragEvent.DRAG_ENTER, dragEnterHandler ); addEventListener( DragEvent.DRAG_DROP, dragDropHandler ); addEventListener( DragEvent.DRAG_OVER, dragOverHandler ); addEventListener( DragEvent.DRAG_EXIT, dragExitHandler ); } This is the function for the addition of children: public function populateData(columnArray:Array):void { var currBox:HBox = null; var currLabel:Label = null; var currCheckBox:CheckBox = null; for each (var currValues:Object in columnArray) { currBox = new HBox(); currBox.setStyle(horizontalAlign,center); currBox.setStyle(borderStyle,solid); currBox.setStyle(borderThickness,1); currBox.percentWidth=100; currLabel = new Label(); currLabel.text = currValues.name; currBox.addChild(currLabel); currBox.addEventListener( MouseEvent.MOUSE_MOVE, beginDrag ); this.addChild(currBox); } } Then this is the function for the child's MouseMove: public function beginDrag( mouseEvent:MouseEvent ):void { if (mouseEvent.buttonDown) { var dragInitiator:IUIComponent = mouseEvent.currentTarget as IUIComponent; var dragSource:DragSource = new DragSource(); DragManager.doDrag( dragInitiator, dragSource, mouseEvent, null ); } } --- In flexcoders@yahoogroups.com, droponrcll amyblankens...@... wrote: --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: Double check your logic about when you call acceptDragDrop Also, are you overriding createChildren? If so, please post your code.
[flexcoders] Re: AMFPHP problem
I was trying to enable that, but was unsuccessful. Do you know how I can enable it and get something useful out of it? Thanks, Ben --- In flexcoders@yahoogroups.com, Tom Chiverton tom.chiver...@... wrote: On Wednesday 11 Nov 2009, gotgoose09 wrote: So you would suggest increasing the memory allocation for scripts in php.ini? Only if that's the problem :-) What does the error log of you PHP application say ? -- Helping to simultaneously negotiate out-of-the-box turn-key customers 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.
Re: [flexcoders] Re: AMFPHP problem
A quick check of my php.ini file and a default one, I spotted the following differences: - max_execution_time = 1200 ; Maximum execution time of each script, in seconds max_input_time = 1200; Maximum amount of time each script may spend parsing request data memory_limit = 256M ; Maximum amount of memory a script may consume (16MB) implicit_flush = On output_buffering = Off post_max_size = 64M upload_max_filesize = 64M ; I think this was done to enable an upload routine to work, not to allow amfphp to run Also noticed [eAccelerator] block which was commented out, but I think that was so I could develop on this box, I think it's OK on deployment (though watch the memory again). Please note that none of this is fine tuned, I tried it, it worked, I left it alone! There was enough RAM on the servers in question to run with these settings... Looking again, those execution times look way to big... Regards, Pete gotgoose09 wrote: So you would suggest increasing the memory allocation for scripts in php.ini? Are there any other settings I should check? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Pete pe...@... wrote: As you probably know, NetConnection.Call.BadVersion means that an error was thrown in the php script, usually a syntax error, but your script runs fine on other servers. I would suspect something in the php config on the server is causing you trouble. I have the same problem every time I move to a new server because I try and transfer too much info and not enough memory is allocated ro running php scripts on the server. Check your php.ini HTH Pete gotgoose09 wrote: I have been running my Flex applications just fine on my local computer and a remote server. I have been tasked with transferring them to a new server. Now whenever I execute a RemoteObject call I get [RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend faultDetail=Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'https://server/path/to/gateway.php https://server/path/to/gateway.php https://server/path/to/gateway.php https://server/path/to/gateway.php'] I know my PHP code works locally. I know it works on the old server. Even the AMFPHP service browser does not work and gives me the same issue. I know that the gateway.php works since I can view it in a web browser with no errors. I am wondering if the HTTPS is causing the problem, but I'm not sure. What can I do to solve this or figure out how to solve this? Any help would be greatly appreciated! - Ben
[flexcoders] Re: AMFPHP problem
--- In flexcoders@yahoogroups.com, Pete pe...@... wrote: As you probably know, NetConnection.Call.BadVersion means that an error was thrown in the php script, usually a syntax error, but your script runs fine on other servers. I would suspect something in the php config on the server is causing you trouble. I have the same problem every time I move to a new server because I try and transfer too much info and not enough memory is allocated ro running php scripts on the server. Also, check to make sure your PHP version is not too old or too new. http://flexdiary.blogspot.com/search/label/Remoting http://gfxcomplex.com/amf/amfphp-is-dead/ (read the comments for a possible fix) HTH; Amy
Re: [flexcoders] Runtime fonts embedding in AIR
But it seems that in this case loaded SWF resides in the different applcation domain and thus its Font.registerFont() call does nothing for the parent application. On Wed, Nov 11, 2009 at 1:25 AM, Alex Harui aha...@adobe.com wrote: I think most folks load the SWF as a byteArray using URLLoader then use Loader.loadBytes() to load the SWF. 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 *Sergey Kovalyov *Sent:* Tuesday, November 10, 2009 5:54 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Runtime fonts embedding in AIR Hi All! Probably the most popular approach to load fonts runtime is to generate SWF files either in Flash or in Flex where font is registered via Font.registerFont(fontClass). In Flash you normally add it to the library. In Flex you embed it via [Embed] metatag. And we have used this approach for a while as a guideline for content developers. In our Flex application this works perfect. But now we need to show the same content in the AIR application. And since all SWF fonts are in the local-with-file sandbox, their Font.registerFont() calls are just ignored. In other words, when I create text fields upon the SWF font loading and use that loaded font, it just does not work. *private* *function* onEmbeddedFontComplete() : *void* { *trace*(Font.enumerateFonts().length); *// Output 0;* *var* textField : UITextField = *new* UITextField(); textField.htmlText = *font face='SegoeScript'Segoe Script/font*; textField.rotation = 30; box.addChild(textField); } ... mx:SWFLoader id=embeddedFont complete=onEmbeddedFontComplete() / I suppose this should be quite common problem when you are creating some text editing software that works with runtime loaded fonts which are not deployed along with the application, but created by users, and eventually you need to migrate to AIR. Any ideas how to avoid the problem without modification to the content (we already have a lot of font files in use and we can not enforce users to redevelop all)? Sergey.
[flexcoders] Re: AMFPHP problem
Hmm, good point. The server is running 5.1.6 and I am running 5.2. Thanks for the links I will check them out. --- In flexcoders@yahoogroups.com, droponrcll amyblankens...@... wrote: --- In flexcoders@yahoogroups.com, Pete pete1@ wrote: As you probably know, NetConnection.Call.BadVersion means that an error was thrown in the php script, usually a syntax error, but your script runs fine on other servers. I would suspect something in the php config on the server is causing you trouble. I have the same problem every time I move to a new server because I try and transfer too much info and not enough memory is allocated ro running php scripts on the server. Also, check to make sure your PHP version is not too old or too new. http://flexdiary.blogspot.com/search/label/Remoting http://gfxcomplex.com/amf/amfphp-is-dead/ (read the comments for a possible fix) HTH; Amy
[flexcoders] Re: AMFPHP problem
I found this So, I posted to flexcoders and it seems that the latest AMFPHP requires PHP 5.2.3, and my host had stalled out somewhere in 4. Bottom line, I can't post a working example unless my host upgrades, I switch hosting plans/hosts, or I can find a remoting option which will work on PHP 4. Could the issue be PHP 5.1.6? (I'm pretty sure it's .6, I'd have to check) --- In flexcoders@yahoogroups.com, gotgoose09 thegoosm...@... wrote: Hmm, good point. The server is running 5.1.6 and I am running 5.2. Thanks for the links I will check them out. --- In flexcoders@yahoogroups.com, droponrcll amyblankenship@ wrote: --- In flexcoders@yahoogroups.com, Pete pete1@ wrote: As you probably know, NetConnection.Call.BadVersion means that an error was thrown in the php script, usually a syntax error, but your script runs fine on other servers. I would suspect something in the php config on the server is causing you trouble. I have the same problem every time I move to a new server because I try and transfer too much info and not enough memory is allocated ro running php scripts on the server. Also, check to make sure your PHP version is not too old or too new. http://flexdiary.blogspot.com/search/label/Remoting http://gfxcomplex.com/amf/amfphp-is-dead/ (read the comments for a possible fix) HTH; Amy
Re: [flexcoders] Re: Progress for synchronous operation
Thanks. Yes, I wasn't expecting to show dynamically-updating progress during the synchronous operation. Just wanted to pop up something (or change the cursor) before, and remove it after. I'll take a closer look at the AlivePDF docs. On Wed, Nov 11, 2009 at 6:24 AM, ag_rcuren robert.vancuren...@gmail.comwrote: I am not fully sure how AlivePDF works because I have never used it but I thought that it could be done asynchronously because I saw a complete event in the documentation that reads: Dispatched when PDF has been generated and available. The save() method generate this event That to me says that it can be generated asynchronously but like I said I really dont know. As far as showing progress during a synchronous call it is not possible. This is because the synchronous call does not return until it is done and thus the UI will never get a chance to update during the process. If you want to show something before that is possible. You could use a timer or you may want to look at the callLater method of displayObject as this will wait one frame before calling the method you want. This would allow you to show say a pop up or something so they user could at least see something. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard Rodseth rrods...@... wrote: What's a good way to display progress or a busy cursor for a potentially long-running, but synchronous operation (in my case generating a PDF using AlivePDF) ? As noted here, CursorManager.setBusyCursor doesn't display the cursor until there is no code running, and PopupManager seems to act similarly. Defer initiation of the operation using a timer?
Re: [flexcoders] Flex Data Grid Question
Apologies for resurrecting a somewhat old thread, but since my searches turned me up here and I spent several hours today working on this issue I thought it would be appropriate. Here's is the code I came up with that mostly solves this. My source data is just a basic XMLListCollection. The renderer colSpanningHeader is a basic label component. I did nothing but make it align center *** mx:AdvancedDataGrid id=gridTemplates left=10 right=10 top=10 bottom=50 mx:dataProvider mx:GroupingCollection id=gc source={xmllTemplates} mx:Grouping mx:GroupingField name=templateType /mx:GroupingField /mx:Grouping /mx:GroupingCollection /mx:dataProvider mx:columns mx:AdvancedDataGridColumn id=hidCol headerText= width=0 visible=True/ mx:AdvancedDataGridColumn dataField=name headerText=Formal Name width=280/ mx:AdvancedDataGridColumn dataField=abbreviation headerText=Short Name width=150/ mx:AdvancedDataGridColumn dataField=insertDate headerText=Date Created width=150/ /mx:columns mx:rendererProviders mx:AdvancedDataGridRendererProvider column={hidCol} depth=1 columnSpan=4 renderer=colSpanningHeader/ /mx:rendererProviders /mx:AdvancedDataGrid *** I find one problem with this, I can't completely get rid of the first column. It makes my grid look a little tacky. Anyone out there know how I can get this same method of grouping without showing the first column? I don't want a folder tree, I just want a header row for each group. Thanks ~mike guess what wrote: I need to draw a data grid where I need to do paint subtotals and and page total and group by some category . Can anyone provide me witha same xml for this kind of table Item IDName Qty Price Milk --- This is how it should be milk should be first row [Just a blank row with Milk in it ] 1. Soy Milk l5USD 2. Choclate 215USD SubTotal 20 USD [ Again Blank row ] Water [ Again Blank Row ] 1. Aqua 1 10USD 2. Calistoga 1 10USD SubTotal 20 USD [ Again Blank row ] PurchaseTotal 40 USD [ Again Blank row ] Can someone provide with an xml for this type of table in flex . Is it possible . -- View this message in context: http://old.nabble.com/Flex-Data-Grid-Question-tp23766210p26293126.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Flex Data Grid Question
I'm not sure how to group in the way you're wishing it, but I am sure that it can be done. I think the trick is with the item renderers. Which is something I just learned about. Here's my entire code, Sorry I can't release the entire http service since it's to a protected site, but it pulls back a basic XML file formatted like so: rows row nameBob/name otherother value/other /row /rows Main App MXML: ** ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=init(); mx:Script ![CDATA[ import mx.events.ItemClickEvent; import mx.collections.ArrayCollection; import mx.collections.XMLListCollection; import mx.utils.ArrayUtil; import mx.rpc.events.*; import mx.controls.Alert; import mx.collections.HierarchicalData; [Bindable] private var arcLibraries:ArrayCollection = new ArrayCollection(); [Bindable] private var xmllTemplates:XMLList = new XMLList(); [Bindable] private var curLibLevel:String = new String(enterprise); [Bindable] private var usrLevel:String = new String(enterprise); private function init():void{ changeUserID(); getTemplates.send(); vwSelectBtnSettings(); } private function changeUserID():void{ if(Boolean(Number(userID.text))){ arcLibraries = new ArrayCollection([ {label:User Library, level:user}, {label:Enterprise Library, level:enterprise}, {label:System Library, level:system} ]); usrLevel = 'user'; } else{ arcLibraries = new ArrayCollection([ {label:Enterprise Library, level:enterprise}, {label:System Library, level:system} ]); usrLevel = 'enterprise'; } vwSelectBtnSettings(); } //on click will change user id to a valid value private function defaultUserID():void{ if (userID.text == '0'){userID.text= '11001'}else{userID.text= '0'}; changeUserID(); } private function httpService_fault(evt:FaultEvent):void { var title:String = evt.type + ( + evt.fault.faultCode + ); var text:String = evt.fault.faultString; Alert.show(text,title); xmllTemplates = new XMLList(); } private function httpService_result(evt:ResultEvent):void { xmllTemplates = evt.result.row; gc.refresh(); gridTemplates.validateNow(); for (var i:int=gridTemplates.numChildren;i-1;i--){ gridTemplates.selectedIndex=i; gridTemplates.expandItem(gridTemplates.selectedItem,true); } gridTemplates.selectedIndex=-1; } private function tabLibClick(evt:ItemClickEvent):void{ var targetComp:TabBar = TabBar(evt.currentTarget); curLibLevel = targetComp.dataProvider[evt.index].level; getTemplates.send(); vwSelectBtnSettings(); } private function vwSelectBtnSettings():void{ if(curLibLevel == usrLevel) {btnNew.enabled=btnEdit.enabled=btnHide.visible=true;btnAdopt.visible=false;btnEdit.label='Edit';} else{btnNew.enabled=btnEdit.enabled=btnHide.visible=false;btnAdopt.visible=true;btnEdit.label='View';} } private function gridClick():void{ var msg:String = new String(); msg = XML(gridTemplates.selectedItem).child(templateID);
[flexcoders] Common Access Card (CAC) integration for login to flex app running in browser
I need to allow login to my Flex app (running in a browser on Windows, Linux, or Mac) from a goverment CAC card. Has anyone on this list ever done that or know where I can go for more info on how to make this happen?
[flexcoders] Chart Similar to Google finance ?
Hi There, I need charts similar to google finance . Does any charting library support it ? . I explored all leading third party charting library but none of them seems to satisfy my requirement. please advice me on this .. Regard, Dharmendra
[flexcoders] Re: Chart Similar to Google finance ?
Check anychart.com. They have some pretty good charts that might fit your needs. HTH, Matt --- In flexcoders@yahoogroups.com, Dharmendra chauhan_i...@... wrote: Hi There, I need charts similar to google finance . Does any charting library support it ? . I explored all leading third party charting library but none of them seems to satisfy my requirement. please advice me on this .. Regard, Dharmendra
[flexcoders] Determine the location of shared object files
I am hoping that someone can at least point me in the right direction here. I have an application that runs on the users desktop that I would like to be able to read / write flash shared object files. This is NOT an Air application so I need to manually write this file. My goal is to have my app be able to write some information into the shared object so that any swf running on my domain could read that shared object and get that information. The reason I want to use shared objects is because it is pretty generic and the SWF would not have to know about app or even who wrote the shared object just that there is some information there. My Questions are: 1. How can I determine the location of a shared object file if I know the domain and path of it. To be more specific, I have found this path several places and with some testing it seems to be correct. For Web sites: %APPDATA%\Macromedia\Flash Player\#SharedObjects\random code\domain\path\object name.sol But I still have no idea how to generate the random code part of this path. If I have a swf write to the shared object I can easily enough search and find the .sol file 100% of the time but I would really like to be able to write this file before any swf is run. I hope that makes sense. 2. From what I have gathered .sol files are pretty much AMF data with a special header is this correct? 3. Had anybody tried anything like this before? Will it work and is there a better way?
Re: [flexcoders] Re: Progress for synchronous operation
So I tried this pattern: private function onClickSave(event:Event):void { CursorManager.setBusyCursor(); var generatePDF:Function = function(e:Event):void { savePDF(bytes); }; // Delay start so cursor can display var timer:Timer = new Timer(1, 1); timer.addEventListener(TimerEvent.TIMER, generatePDF); timer.start(); } private function savePDF(pdfBinary:ByteArray):void { var fileRef:FileReference = new FileReference(); fileRef.save(pdfBinary,MyReport.pdf); } But then of course I get the security error below from savePDF: Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press. at flash.net::FileReference/_save() Any good ideas for displaying a busy cursor or indeterminate progress bar while doing a long-running synchronous operation? On Wed, Nov 11, 2009 at 9:59 AM, Richard Rodseth rrods...@gmail.com wrote: Thanks. Yes, I wasn't expecting to show dynamically-updating progress during the synchronous operation. Just wanted to pop up something (or change the cursor) before, and remove it after. I'll take a closer look at the AlivePDF docs. On Wed, Nov 11, 2009 at 6:24 AM, ag_rcuren robert.vancuren...@gmail.comwrote: I am not fully sure how AlivePDF works because I have never used it but I thought that it could be done asynchronously because I saw a complete event in the documentation that reads: Dispatched when PDF has been generated and available. The save() method generate this event That to me says that it can be generated asynchronously but like I said I really dont know. As far as showing progress during a synchronous call it is not possible. This is because the synchronous call does not return until it is done and thus the UI will never get a chance to update during the process. If you want to show something before that is possible. You could use a timer or you may want to look at the callLater method of displayObject as this will wait one frame before calling the method you want. This would allow you to show say a pop up or something so they user could at least see something. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard Rodseth rrods...@... wrote: What's a good way to display progress or a busy cursor for a potentially long-running, but synchronous operation (in my case generating a PDF using AlivePDF) ? As noted here, CursorManager.setBusyCursor doesn't display the cursor until there is no code running, and PopupManager seems to act similarly. Defer initiation of the operation using a timer?
[flexcoders] When Do I Render a Legend in a Chart?
My Flex chart has code that creates a legend from each data series. Currently, I have the drawLegend function execute when a button is clicked. I am trying to get the legend to draw automatically but I am having trouble determining when to call the drawLegend function. Users click on an 'Update' button which retrieves data. I want the legend to get created after this, without the users having to click on another button. I have put my drawLegend function in several places (ResultHandler, afterEffectEnd(for chart animation, etc.) and nothing works. Sometime after the series has been added to the chart and after the series animation ends, the legend can be added. How can I trap this point in time and call my function? Any ideas? Below is the code I used to create the legend. Note that even though the code processes each series, I noticed that the Fill color is null if it is called too early. private function drawLegend(event:Event):void { clearLegend(); // Use a counter for the series. var z:int = 0; var numRows:int; if (chart.series.length % rowSize == 0) { // The number of series is exactly divisible by the rowSize. numRows = Math.floor(chart.series.length / rowSize); } else { // One extra row is needed if there is a remainder. numRows = Math.floor(chart.series.length / rowSize) + 1; } for (var j:int = 0; j numRows; j++) { var gr:GridRow = new GridRow(); myGrid.addChild(gr); for (var k:int = 0; k rowSize; k++) { // As long as the series counter is less than the number of series... //skip columnset group if (chart.series[z] is LineSeries || chart.series[z] is ColumnSeries){ if (z chart.series.length) { var gi:GridItem = new GridItem(); gr.addChild(gi); var li:LegendItem = new LegendItem(); // Apply the current series' displayName to the LegendItem's label. li.label = chart.series[z].displayName; // Get the current series' fill. var sc:SolidColor = new SolidColor(); sc.color = chart.series[z].items[0].fill.color; // Apply the current series' fill to the corresponding LegendItem. li.setStyle(fill, sc.color);//was just sc // Apply other styles to make the LegendItems look uniform. li.setStyle(textIndent, 5); li.setStyle(labelPlacement, left); li.setStyle(fontSize, 9); gi.setStyle(backgroundAlpha, 1); gi.setStyle(backgroundColor, sc.color); //gi.width = 80; // Add the LegendItem to the GridItem. gi.addChild(li); } } // Increment any time a LegendItem is added. z++; } }
[flexcoders] Cant get Java compiler classes to work - Error: -1
Hi, (sorry if this appears as a duplicate post - I dont think the first one posted properly into the mailing list) I wonder if anyone can help. I'm trying to write a very simple Java class using the Flex SDK 3.4 to compile a simple mxml file. The code I've written is: import java.io.File; import flex2.tools.oem.Application; public class TestCompile { public static void main(String[] args) throws Exception { Application app = new Application(new File(C:\\temp\\app.mxml)); app.setOutput(new File(C:\\temp\\app.swf)); long result = app.build(true); if (result 0) { System.out.println(COMPILE OK); } else { System.out.println(COMPILE FAILED, result = + result); } } } When I run this, I consistently get the following: Loading configuration file C:\Projects\flexPresentation\WEB-INF\frameworks\flex-config.xml Error: -1 COMPILE FAILED, result = 0 Does anyone know what Error -1 means? And how to solve it? The annoying thing is that I had this code working at one point, and I dont know what I've done to make this happen! Any ideas? Cheers Nathan -- View this message in context: http://old.nabble.com/Cant-get-Java-compiler-classes-to-work---%22Error%3A--1%22-tp26308183p26308183.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] Runtime fonts embedding in AIR
The applicationDomain shouldn't matter because all of the related classes should be wrapping a DefineFont object. LoadBytes() lets you choose an applicationDomain topology so you can always load directly into the main one if you want. 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 Sergey Kovalyov Sent: Wednesday, November 11, 2009 8:49 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Runtime fonts embedding in AIR But it seems that in this case loaded SWF resides in the different applcation domain and thus its Font.registerFont() call does nothing for the parent application. On Wed, Nov 11, 2009 at 1:25 AM, Alex Harui aha...@adobe.commailto:aha...@adobe.com wrote: I think most folks load the SWF as a byteArray using URLLoader then use Loader.loadBytes() to load the SWF. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Sergey Kovalyov Sent: Tuesday, November 10, 2009 5:54 AM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: [flexcoders] Runtime fonts embedding in AIR Hi All! Probably the most popular approach to load fonts runtime is to generate SWF files either in Flash or in Flex where font is registered via Font.registerFont(fontClass). In Flash you normally add it to the library. In Flex you embed it via [Embed] metatag. And we have used this approach for a while as a guideline for content developers. In our Flex application this works perfect. But now we need to show the same content in the AIR application. And since all SWF fonts are in the local-with-file sandbox, their Font.registerFont() calls are just ignored. In other words, when I create text fields upon the SWF font loading and use that loaded font, it just does not work. private function onEmbeddedFontComplete() : void { trace(Font.enumerateFonts().length); // Output 0; var textField : UITextField = new UITextField(); textField.htmlText = font face='SegoeScript'Segoe Script/font; textField.rotation = 30; box.addChild(textField); } ... mx:SWFLoader id=embeddedFont complete=onEmbeddedFontComplete() / I suppose this should be quite common problem when you are creating some text editing software that works with runtime loaded fonts which are not deployed along with the application, but created by users, and eventually you need to migrate to AIR. Any ideas how to avoid the problem without modification to the content (we already have a lot of font files in use and we can not enforce users to redevelop all)? Sergey.
RE: [SPAM] Re: [flexcoders] Passing values from popup window to MXML component
What reference is null? Yes, that architecture is common. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Funand Learning Sent: Wednesday, November 11, 2009 12:07 AM To: flexcoders@yahoogroups.com Subject: [SPAM] Re: [flexcoders] Passing values from popup window to MXML component Hi, I have written a function and after checking the username and password, to toggle the buttons, but I get the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. Here is the function I wrote public function checkCredentials():void { if(loginWin1.userInput.text == 'funandlearning' loginWin1.passwordInput.text == 'funandlearning') { Alert.show(Login Successful); PopUpManager.removePopUp(loginWin1); //var main:Main = new Main(); main.logout.visible = false; } else { Alert.show('Try again'); PopUpManager.removePopUp(loginWin1); } } LoginPopUp contains the code for displaying on the popupwindow, and Main is another component which contains code for calling popup window and it contain other UI code for header. Is this the right way to do? Thanks _ From: Omotola Anjorin shot2f...@yahoo.com To: flexcoders@yahoogroups.com Sent: Mon, November 9, 2009 6:33:48 AM Subject: Re: [flexcoders] Passing values from popup window to MXML component Yeah you can do what rohit said by adding a logout button at the same place and toggling the visiblity. This way, From you main application you can do something like this. if(loginWin. userInput. text=='funandlearni ng' loginWin.passwordIn put.text= ='funandlearning' ) { Alert.show( Login Successful) ; loginWin.loginButto n.visible = false loginWin.logoutButt on.visible = true } You can also use the same button but play around the text property. Cheers _ From: Rohit Sharma rohit.sharma1982@ gmail.com To: flexcod...@yahoogro ups.com Sent: Mon, November 9, 2009 12:21:02 PM Subject: Re: [flexcoders] Passing values from popup window to MXML component You can add a logout button at the same place as login button and toggle the visibilities of these buttons depending upon the state of your component. On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning funandlearning3@ yahoo.com mailto:funandlearni...@yahoo.com wrote: Hello All, I was trying to create a login Page. The page has one main MXML application file with couple of MXML components. The First component contains the following: Component1.mxml: ?xml version=1.0 encoding=utf- 8? width=60% height=261 mx:Script ![CDATA[ import mx.managers. PopUpManager; import mx.controls. Alert; import components.LoginPop Up; import mx.events.CloseEven t; public var loginWin:LoginPopUp ; private function loginHandler( ):void { loginWin = new LoginPopUp() ; loginWin.addEventLi stener(CloseEven t.CLOSE,closeHan dler); PopUpManager. addPopUp( loginWin, this,true) ; PopUpManager. centerPopUp( loginWin) ; } public function closeHandler( event:CloseEvent ):void { PopUpManager. removePopUp( loginWin) ; } public function checkCredentials( ):void{ if(loginWin. userInput. text=='funandlearni ng' loginWin.passwordIn put.text= ='funandlearning' ) { Alert.show( Login Successful) ; } else { Alert.show( Login Failed); } } ]] /mx:Script mx:HBox width=90% height=55 borderColor= #F85023 id=headerButtons borderStyle= outset horizontalAlign= left verticalAlign= middle backgroundColor= #938480 mx:Spacer width=10%/ mx:Button id=loginMain label=Login click=loginHandler ( )/ mx:Button id=logout label=LogOut / /mx:HBox mx:HBox width=100% height=82% mx:HBox width=25% height=82% borderStyle= outset borderColor= #F85023 /mx:HBox mx:HBox width=65% height=82% borderColor= #F85023 borderStyle= outset /mx:HBox /mx:HBox /mx:VBox component2.mxml has the following code for the popup ?xml version=1.0 encoding=utf- 8? xmlns:main= components. * layout=vertical title=Please login
[flexcoders] Re: using itemsChangeEffect when filtering a tilelist
any help guys