[flexcoders] Re: Resize Component
A few follow-up notes I forgot to mention in my first reply. First, you and I both had a typo in the DataGrid's id (dgProdcts vs dgProducts). Second, The canvas width (and correspondingly, height) should be bound to this: (dgProducts.selectedItem.image as Image).width. Third, you should not explicitly call expand.play() on the DataGrid's click event. That action is done automatically by specifying the resizeEffect in the Canvas. Nick Matelli | Consultant, Amentra Inc. Email: [EMAIL PROTECTED] 1775 Wiehle Ave Suite 103, Reston VA 20190 --- In flexcoders@yahoogroups.com, raphamaster20004 [EMAIL PROTECTED] wrote: Hi, I have one dataGrid and necessary that when the user to click in one determined item of the same it executes the Resize in an image, but it executes only one time the effect, in the image, being that when click in the effect does not happen again. This is my code: mx:Resize id=expand target={img} widthTo=300 heightTo=250/ mx:DataGrid id=dgProdcts dataProvider={produtos} x=284 y=28 height=151 width=406 click=expand.play(); mx:columns mx:DataGridColumn headerText=Nome dataField=modelo/ mx:DataGridColumn headerText=Linha dataField=linha/ /mx:columns /mx:DataGrid mx:Image source={dgProducts.selectedItem.image} x=10 y=10 width=30 height=60 id=img/ tanks for attention Raphael
[flexcoders] Re: Resize Component
Raphael, There are a few things you need for the code to work. Below is how I recommend changing it. Your dataGrid's dataProvider is 'produtos', and each object within it has an 'image' property. I recommend having each of these point directly to an Image object (as opposed to a String of the image's source). Something like this: mx:Image id=myImage width=150 height=55 mx:sourcehttp://www.google.com/images/logo_sm.gif/mx:source /mx:Image /* (Then, within some initialization ActionScript method) */ // produto is some object with 'modelo' and 'linha' properties produto.image = myImage; produtos.addItem(produto); Now, your resize effect doesn't need to specify the 'target', 'widthTo', or 'heightTo' properties. The latter two specifications are what I suspect was your main problem. The effect doesn't happen more than once because it's trying to be resized FROM width 300 TO width 300. Example: mx:Resize id=expand/ Lastly, images do have resize issues, as written about in the Flex API. So put your image inside a canvas, bounded to the sides, and resize the canvas. Example: mx:Canvas resizeEffect=expand width={(dgProducts.selectedItem as Image).width} height={(dgProducts.selectedItem as Image).height} mx:Image id=img source={(dgProducts.selectedItem.image as Image).source} x=10 y=10 left=0 right=0 top=0 bottom=0 / /mx:Canvas That should be all you need. Hope this helps. If you have more questions, don't hesistate to ask! Nick Matelli | Consultant, Amentra Inc. Email: [EMAIL PROTECTED] 1775 Wiehle Ave Suite 103, Reston VA 20190 --- In flexcoders@yahoogroups.com, raphamaster20004 [EMAIL PROTECTED] wrote: Hi, I have one dataGrid and necessary that when the user to click in one determined item of the same it executes the Resize in an image, but it executes only one time the effect, in the image, being that when click in the effect does not happen again. This is my code: mx:Resize id=expand target={img} widthTo=300 heightTo=250/ mx:DataGrid id=dgProdcts dataProvider={produtos} x=284 y=28 height=151 width=406 click=expand.play(); mx:columns mx:DataGridColumn headerText=Nome dataField=modelo/ mx:DataGridColumn headerText=Linha dataField=linha/ /mx:columns /mx:DataGrid mx:Image source={dgProducts.selectedItem.image} x=10 y=10 width=30 height=60 id=img/ tanks for attention Raphael
[flexcoders] Re: Cairngorm - what's you best practice on handling inital data from the server
Almong, I don't see any problem with #5. The getTabsLabels() should contain a simple null check, so it will only perform an action when your serviceList object is populated. Client-side manipulation of the serviceList object should take place within the result method of the command retrieving the list. I'm not sure what you mean when you state but it shouldn't be there as it won't be readable. Can you clarify your concerns with this approach? -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, mydarkspoon [EMAIL PROTECTED] wrote: Hello all, I'm new with Cairngorm, trying to develop a wizard RIA with flex, and I encountered an issue with data binding that went ugly: In my model I have an XML doc taht describes several available search services from the server. This XML is retrieved when the app start by using an appropriate command that uses business delegate. However, in the view I have a TabBar, that needs to manipulate the XML config file from the model, meaning that it has to know when this xml is retrieved. I found few approaches to this: 1. use a fake getter-setter binded to the model. My drawback from this approach is quite obvious, I don't really need a getter here, but a notification... 2. custom [Bindable(event=)]. This also not the best way as it introduces new complexity to the model and enforces the developer to dispatch an event... 3. Using a command to create the data for the TabBar in the view. I think this creates a tightly coupled connection between the controller and the view... 4. Using Paul Williams ac:ObserveValue / util. Although one might think this creates a slick binding to function by hiding the fake getter-setter, it actually dispatches redundant events because it handler can't be compared to the source property, and thus the handler is being called even when the source is null. 5. using curly braces: mx:TabBar dataProvider={getTabsLabels(_model.servicesList)} / This approach also introduces redundant events as its destination is not read-write enabled and it will get dispatched even when the servicesList is null. Moreover, I want to executes one more manipulation on the xml from the model, it can be created while calling the getTabsLabels() but it shouldn't be there as it won't be readable... I'll be more than happy to hear your ideas. Thanks a lot ! Almog Kurtser.
[flexcoders] Re: Cairngorm - what's you best practice on handling inital data from the server
Hi Almog, I see your concern now. You're right in that the logic for creation of the view stack should remain in the view code, not the command or in some other binding. Here's how we handle that situation. On the component's creationComplete, we call init(): private function init():void { Changewatcher.watch(_model, servicesList, createViewStack) } private function createViewStack(event:PropertyChangeEvent):void { //do view stack creation logic here } This way, your view logic is in one place and built off the model. In terms of the redundant dispatching of events, it will fire once or twice on startup will a null value, but after that it should only fire the one time your property is set. That's how all binding works and it's nothing to worry about. Are your concerns performance-related, or more about style/elegance? -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, mydarkspoon [EMAIL PROTECTED] wrote: Hi Nick, Thanks for the help, the reasons why I'm not satisfied with #5 are like that: The tabs naming is one operation that takes place, another one is creating a ViewStack object to correspond those tabs. Obviously, the view stack Can be built upon setting the TabBar dataProvider, however, I think it's not readable beacuse when I open an mxml component in search for a specific view control, the viewstack in this example, I would look first at the mx:ViewStack / tag instead, not at the TabBar, which should have nothing to do with the ViewStack leaving it to be loosely coupled as much as possible. Actually, this brings me the idea which I'll have to implement anyway, to bind the ViewStack object's selectedIndex to the model using a local helper function to get the selectedIndex, null checking the model for the config file, and eventually returning an index. This is not perfect but more elegant I think, yet I'd like to adapt best practices dealing with such issues so feel about it :) I almost forgot, my second drawback from the curly braces metjod is the dispatching of redundant event, which is the reason that causes the null checking to be essential. Thanks and best regards, Almog Kurtser.
[flexcoders] Re: Flex 3 + LiveCycle: Is debugging Java possible?
You should be able to debug the Java code just fine. If you're using JBoss, make sure the debugging is enabled. The run script has a line in it like this: #JPDA options. Uncomment and modify as appropriate to enable remote debugging . #JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS Make sure its uncommented. Once JBoss is running, you can choose remote debugging in Eclipse. The standalone FlexBuilder doesn't include this, so you can add it as a plugin, or just download a second version of Eclipse and run both at the same time. In Eclipse, go to Open Debug Dialog - new Remote Java Application - (select project) - Host: localhost - Port: 8787 - Debug --- In flexcoders@yahoogroups.com, Johannes Nel [EMAIL PROTECTED] wrote: ditto On Nov 22, 2007 5:25 PM, Carlos Rovira [EMAIL PROTECTED] wrote: We are using eclipse wtp with tomcat and we can debug Flex, java or both at once 2007/11/21, jamiebadman [EMAIL PROTECTED]: Hi, Our project is a Flex 3 + LiveCycle 2.5 application and is all built under a single project - ie the Flex and Java are contained within a single project and can be built entirely from there. Nice... except for when we want to debug the Java code (which so far has not been necessary since it's been very simple). We can't figure out how to do this. There are articles by Farata and others on how this can be done but these seem to require the Java in a separate project in Eclipse. Has anyone managed to accomplish what we're trying to do - and if so, would you mind sharing the steps required? We're currently using JBoss but if we need to switch to Tomcat, Weblogic or JRun for the purposes of debugging this is not a problem. Thanks, Jamie. -- ::| Carlos Rovira ::| http://www.carlosrovira.com ::| http://www.madeinflex.com -- j:pn \\no comment
[flexcoders] Re: unable to hide datagrid column...help please
It sounds like you're using Flex 2.0.1. We struggled with a few similar DataGrid issues, but haven't had any trouble since upgrading to Flex 3. In 2.0.1, the best workaround we could come up with for column visibility problems was programatically toggle the last column's visibility property once data was loaded. It forced many of the display areas to refresh and didn't cause flicker. The code looked something like this: public static function refreshDataGrid(dg:DataGrid):void { var column:DataGridColumn = dg.columns[dg.columns.length-1]; column.visible = !column.visible; column.visible = !column.visible; } Then it's just a matter of calling this method at the right time. We did so when the dataProvider property was changed. We also had some functionality for showing sets of columns based on a dropdown. If you'll be doing this throughout your app, the best practice we've come across has been to extend the DataGridColumn class and add a groupId property. Then extend the DataGrid class and add a method like showGroup(groupId:String) or even a property like displayedGroup. The logic is pretty straightforward, and it's been an effective way for us to manage column sets. -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, Barry Evans [EMAIL PROTECTED] wrote: I got round this i think by setting the visible property of a column when a state's enterState event fired. I was using a single datagrid to display two different sets of columns, depending on a combobox selection. Hope this helps. Barry --- In flexcoders@yahoogroups.com, tomeuchre braz@ wrote: --- In flexcoders@yahoogroups.com, Jehanzeb Musani jehanzeb_bs@ wrote: That's exactly what I was saying. There is some issue with datagrid data binding in case of invisible columns. You can try manually setting the visible property of that column to false after rebinding the xmllist. That is what I do...it was just one of those that's strange... moments, so I captured an event after the grid was freshly bound and set the visible=false; on columns that needed it. It all happens in 1 hundredth of a blink, so I just did it and moved on. Never throught that it may have been a bug, but if you are switching dataProviders, logically it could be completely different columns, so its not so surprising that it gets reset.
[flexcoders] Re: Yahoo Maps
Hi Chip, I was also having trouble finding the right SWF and API source. I did get my app up and running after downloading a bunch of packages and examples from random places. I zipped them in a big ball and posted it here: https://share.adobe.com/adc/document.do?docid=3b5ccc88-bfb7-11dc-8eae-a591b7039fd5 Hope this helps. -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, Chip Moeser [EMAIL PROTECTED] wrote: Hello, Does anyone have a copy of the 'com.yahoo.maps' package they can email me off list? I am trying to update the current 'as2map.swf' and the only code I can find is the new 'com.yahoo.webapis.maps' package which is severely lacking. Best, -Chip chip.moeser at gmail
[flexcoders] Re: setting effect to UI component
Hello PS, I responded to this two days ago and the reply hasn't shown up yet, so I apologize if this eventually comes up as a dupe. If you ever want to know how to do something in actionscript, take your mxml example and put it in a project. Then goto project - properties - flex compiler, and add -keep-generated-actionscript into the field for additional compiler arguments. Now, when the compiler converts mxml to actionscript, the actionscript source will appear in the 'generated' folder. Along with using the generated code for examples, take a look at this resource; it explains how everything fits together: http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Partsfile=behaviors_068_09.html The gist of it is 1) Create new effect 2) set up from and to properties. 3) listen for a certain event to be dispatched 4) intercept that event, then play your effect Hope this helps. If you're still having issues, post some examples of your source. You may be making things more complicated than they need to be. -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, learner [EMAIL PROTECTED] wrote: hi all, what would I do if I have to set a resize effect to my custom component... My component is in as file and is getting added to a mxml using addChild method. So I can not do something like this : MyComp resizeEffect=Resize/ Is there any way to achieve same thing in as components ? Any help is greatly appreciated. Regards PS
[flexcoders] Re: Flex/AIR FTP program
It just sounds like you have the pl.maliboo.ftp source in the wrong place. Try simply moving it to the /src directory. If you're using the swc, place that in /libs. -Nick Matelli --- In flexcoders@yahoogroups.com, Chad Gray [EMAIL PROTECTED] wrote: I found this Flex FTP library on RIAForge.com http://maliboo.riaforge.org/ How do I use it in Flex3? I put the library files in the root of the project and added xmlns:ftp=pl.maliboo.ftp.core.* to the mx:WindowedAppliction tag, but when I start typing my import statement in the Script block it does not give me the option to load the library. I also get this error when trying to use it 1046: Type was not found or was not a compile-time constant: FTPEvent. AIR_ftp/src AIR_ftp.mxml import pl.maliboo.ftp.events.FTPEvent; import mx.controls.treeClasses.TreeItemRenderer; import mx.core.IDataRenderer; import flash.filesystem.File; import pl.maliboo.ftp.Commands; import pl.maliboo.ftp.FTPCommand; import pl.maliboo.ftp.FTPFile; import pl.maliboo.ftp.events.FTPEvent; import pl.maliboo.ftp.core.FTPClient; import pl.maliboo.ftp.utils.ConsoleListener; private var list:ConsoleListener; public function makeConnection (host:String, port:Number):void { if (list == null) list = new ConsoleListener(client, output); client.addEventListener(FTPEvent.CONNECTED, handleConnected); client.connect(host, port); } public function handleConnected (evt:FTPEvent):void { client.addEventListener(FTPEvent.LOGGED, handleLogged); client.login(username.text, passwd.text); }
[flexcoders] Re: Working with maps / latitude / longditude data
ESRI's AWS is very good and has libraries built just for Flex. I'd also recommend that as an option. The downside we've experienced involved some latency issues and a look field that wasn't as sharp as the competitors. Tying into Yahoo and Google are the other choices. Google doesn't have a Flex API, so I was too lazy to try implementing it. Yahoo has a decent API that works with Flex 3, but there's a SERIOUS issue in that the debugger will error-out if you try to debug an app with a YahooMapService component in it. The reason for this is that it uses LocalConnections and JavaScript call backs to interface with an old Flex 1.5 SWF. In my opinion, depending on the size and needs, Yahoo is still the best option. There's a mailing list just for Flex Yahoo Maps coders: http://tech.groups.yahoo.com/group/yws-maps/ Even if you don't use their API, their REST service is a super easy way to query addresses for lat/long data: http://developer.yahoo.com/maps/rest/V1/geocode.html For actually implementing the maps, the best tutorial I've found for Flex2/3 is here: http://www.actionscript.com/Article/tabid/54/ArticleID/Flex-2-Yahoo-Maps-Made-Easy/Default.aspx It requires a download of the ASTRA library and registration of an API key: http://developer.yahoo.com/flash/astra-webapis/ -Nick --- In flexcoders@yahoogroups.com, Paul Hastings [EMAIL PROTECTED] wrote: Giles Roadnight wrote: I'm considering doing a project that involves displaying latitude / longitude data on a map. i would recommend esri's aws. fairly rich API, fairly easy to work with, good support flex 2. Are there any examples or anything out there like this? http://api.arcwebservices.com/devguide/samples/awx/v4/flex/index.html
[flexcoders] Re: Flex Interview Questions
Tom makes a good point. It depends on what kind of skills you want to bring in. ecancil's suggestions are ok if you're looking to do a lot of work with custom components. When getting developers to help create standard application, I'd weigh a lot more heavily on the as3 questions. Aside from basic show me how you'd write X algorithm questions, you can ask more in depth ones about the workings of the language: 1) What's the difference between Java and AS3 getters and setters? 2) Explain how binding works in mxml components. 3) What's the difference between ChangeWatcher.watch, and BindingUtils.bindProperty? 4) Why would you want to keep a reference to a ChangeWatcher and call unwatch()? Architecture 5) How do you add event listeners in mxml components. Now AS3 components? 6) What does calling preventDefault() on an event do? How is this enforced? 7) (If applicable) Explain the lifecycle of a Cairngorm action. More 8) What are some ways to specify styles on components? 9) What is the problem with calling setStyle() 10) Explain the difference between creating an effect and setting the target as opposed to adding an effectListener 11) What do repeater components do? 12) How do you identify a component created in a repeater? I'm sure we can come up with plenty more questions. If you want to know the answers to any, simply ask in the forums. Some of these are more open ended. Also, for hit rate I'd expect and medium-level Flex developer to score maybe a 50% if this was a test graded with partial credit. 80-90%+ for experts. -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, Jeffry Houser [EMAIL PROTECTED] wrote: I'd have an easier time answering the questions as you go 'down' the list. I'd have problems explaining the first one in great detail without references in front of me (even though I deal with that stuff every day). :-) I think it's a great question, though. ecancil wrote: Id say they can answer all of the questions fairly satisfactorily if they're a good candidate. If they have a problem with one of the questions they usually have problems with the rest. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Paul Andrews paul@ wrote: On the basis of these questions, what's the 'hit rate' on suitable applicants? Paul - Original Message - From: ecancil ecancil@ To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Sent: Thursday, February 07, 2008 1:53 AM Subject: [flexcoders] Re: Flex Interview Questions I regularly conduct interviews for flex developers My regular questions are to explain the component lifecycle. I ask how invalidate / commitProperties work specifically I ask a lot of questions about dataServices I ask a general understanding of MVC I ask what frameworks they're familiar with --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Jimmi Prajapati jimmi.javaflex@ wrote: Hello Friends, From where can I find Flex Interview Questions. Thanks in Advance. Regards Thanks Jimmi -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Jeffry Houser Adobe Community Expert AIM: Reboog711 | Phone: 1-203-379-0773 -- My Company: http://www.dot-com-it.com My Podcast: http://www.theflexshow.com My Blog: http://www.jeffryhouser.com
[flexcoders] Re: Flex Interview Questions
1) What's the difference between Java and AS3 getters and setters? One's written in Java and the other isn't ? Extra credit for that one. Obviously the question only applies to interviewees with a Java background, but it illustrates an interesting feature of Flex. In Java, getter and setter methods have to be explicitly called. While in AS3, they're called automatically and externally indistinguishable from public properties. For instance trace(myClass.foo) might be referencing a public property or it might be referencing the method public get foo():Object. It makes no difference to an external class. --- You can expand on this a bit more to describe why this is useful. The implications are that, unlike in Java, all variables in a class are generally public. Java standard practices are to create only public getters and setters while keeping the variables private. The reason for only allowing methods to be publicly accessible is so that 1) they can be overridden and 2) their implementation can change without altering class interface. AS3 addresses both of these concerns because, as described above, a public property can be replaced with a getter and setter without changing the interface. And an inherited public property can actually be overridden by a subclass. For example, this is valid: public class A { public var foo:Object; } public class B extends A { override public function get foo():Object{return 'bar'}; override public function set foo(value:Object):void{}; } -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: Tom Chiverton [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Friday, February 08, 2008 10:14 AM Subject: Re: [flexcoders] Re: Flex Interview Questions On Thursday 07 Feb 2008, Uber_Nick wrote: 1) What's the difference between Java and AS3 getters and setters? My java is rather old school, but my getters and setters are explicitly coded methods rather than generated for me as in AS3. Here is an old (but fun) article: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html Paul -- Tom Chiverton Helping to simultaneously bully collaborative infomediaries on: http://thefalken.livejournal.com
[flexcoders] Re: Why upgrade to FB3?
In short: faster and more stable. FB3 is a lot smarter about compiling, so building a project after making a change goes a lot faster. Developers were increasingly frustrated and slowed by the long build times of our project with FB2.01. There were also a variety of small bugs in 2.01, such as issues recompiling styles, embedded assets, or external xml data. Occasionally it would cause FB2 to crash, but usually it would just require full cleans. These minor frustrations really built up and could waste a lot of time and productivity (as well as lower morale and excitement about the technology). There's no reason to put developers through using older, buggier tools when better options are available. Also, FB3 is based on a newer version of Eclipse. So better navigation (ctrl+3 is a lifesaver!), smarter memory usage, and enhanced stability all come with it. Not to mention all the plugin upgrades if you're using any of them (Subclipse, SpringIDE, Jupiter, etc)... -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, Mr Greg Murnock [EMAIL PROTECTED] wrote: For the big discussion of the day/week... I have been given the task to give a strong case on why we need to spend the money (proposed pricing schedule) on the upgrade to FB3, when available. Our company does not look to do AIR apps, we do not have a case to use Advanced Datagrid, we front CF7 with an Oracle DB (irrelevant) so the FDS is already there. Current F2 apps with charting working great. I want to upgrade but need more of a reason, for my [EMAIL PROTECTED] company - did I say that outloud, for us to purchase the upgrades. All comments are accepted. :) Greg Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[flexcoders] Re: Flex + WebORB for PHP, A very strage problem
Manu, Note the following. trace(Boolean('TRUE')); // returns true trace(Boolean('FALSE')); // also returns true Flex is interpreting the result from your PHP call as a String. Try returning lower-case 'true' and 'false'. Also, try using: list[i].aircon as Boolean instead of: Boolean(list[i].aircon) The former will not always convert to true (but will return null if it can't convert). Lastly, if you can't make it work, just try this workaround: vo.aircon = (''+list[i].aircon).toLowerCase()=='true'; -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, Manu Dhanda [EMAIL PROTECTED] wrote: Code for my Responder, where I am receiving the result: public function result(data:Object):void { //TODO: implement function var objList:ArrayCollection = new ArrayCollection(); var list:ArrayCollection = new ArrayCollection(data.result as Array); var vo:FlatVO; for(var i:int=0; ilist.length; i++){ vo = new FlatVO(); vo.userId = int(list[i].userId); vo.aircon = Boolean(list[i].aircon); objList.addItem(vo); } In here, I supposed to get vo.aircon as boolean[values as true/false for different rows/objects in FlatVO]. But, the strange thing is that I am receiving all the values for my boolean type as TRUE only. I had verified on my server side PHP code, and it is returning the corresponding values fine [as in TRUE and FALSE accordingly]. I am using WebORB for PHP with Flex. and in there, I had verified in the Services as well, that my service returning this object has the right values. Then how come I am receiving all the values as TRUE, I can not understand this. Any help will be great. Thanks. Igor Costa-2 wrote: If you paste a part of your code someone here in the list can answer you but it's hard to get what you really need. Regards Igor On Tue, Jun 3, 2008 at 11:45 AM, Manu Dhanda [EMAIL PROTECTED] wrote: Hii, In short, In Weborb Mgmt Services, I can see the object having a value of boolean type correctly.( that is it is returned correctly from the db). But when I receive it on Flex side, all is returned as true. How should I resolve this? Appreciate your time.. to respond it. thanks. -- View this message in context: http://www.nabble.com/Flex-%2B-WebORB-for-PHP%2C-A-very-strage-problem-tp17625304p17625304.html Sent from the FlexCoders mailing list archive at Nabble.com. -- Igor Costa www.igorcosta.com www.igorcosta.org -- View this message in context: http://www.nabble.com/Flex-%2B-WebORB-for-PHP%2C-A-very-strange-problem-tp17625304p17631029.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: As3Crypto - Can't read RSA Public Key
Hi Jim, I copied your code into a project and pulled in the latest As3Crypto source. Your project compiled and worked as expected. I was unable to replicate the error, and would assume it's an environment issue. -Nick Matelli --- In flexcoders@yahoogroups.com, Jim Boone [EMAIL PROTECTED] wrote: Hi, I posted this on the As3Crypto discussion list but there is very little activity there. Maybe someone in this group has encrypted something using an RSA public key that they might share. I am trying to read a RSA public key so I can encrypt data in my application. I assembled a test app just to learn how the library works. Unfortunately, I didn't get very far. I get the message I DONT KNOW HOW TO HANDLE DER stuff of TYPE 1 when I try to run the following code. I have downloaded the latest source from trunk but I still get the error. I generated the private and public keys using openssl as shown below: openssl genrsa -out private.pem 1024 openssl rsa -in private.pem -pubout -out public.pem Any clue what is happening here? ?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 com.hurlant.util.Hex; import com.hurlant.util.der.PEM; import com.hurlant.crypto.rsa.RSAKey; private var publicKey:String = -BEGIN PUBLIC KEY-+ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq63UvOM+wA3FYLl7X5v5US1bd+ BP43wScM3boptegIIIO0ghhzhtmCUv7/278Jow9xI/za0CTf8DL9pSDu8+T+RY7U+ WOMaX/IK9D9tqxztDdPu29qSJFenun1O9OL+HaUYaNWSTLirHMZN67/aITtuyV6++ ikAJfa9EOKAnT/CLIQIDAQAB+ -END PUBLIC KEY-; private function init():void { var rsaPublicKey:RSAKey = PEM.readRSAPublicKey(publicKey); var message:ByteArray = Hex.toArray(now listen to this); var encryptedMessage:ByteArray = new ByteArray; rsaPublicKey.encrypt(message,encryptedMessage,message.length); trace(Hex.fromArray(encryptedMessage)); } ]] /mx:Script /mx:Application ~~~ Error ~~ I DONT KNOW HOW TO HANDLE DER stuff of TYPE 1 Error: Error #2030: End of file was encountered. at flash.utils::ByteArray/readBytes() at com.hurlant.util.der::DER$/parse()[C:\flex\crypto_1.3\com\hurlant \util\der\DER.as:134] at com.hurlant.util.der::PEM$/readRSAPublicKey()[C:\flex \crypto_1.3\com\hurlant\util\der\PEM.as:84] at Test/init()[C:\flex\workspaces\smtoolsPrototype\Test\src\Test.mxml: 28] ~Jim
[flexcoders] Bindings on visual components being forgotten? (Flex 3 - 4.6)
Seeing a strange, rare, issue after updating an app to 4.6. I can't seem to reproduce it in a dev environment, so I'll list out my issue and setup to see if it sounds familiar to anyone. The problem: Visual components seem to occasionally forget the objects they're bound to. For instance, I have something like this: s:DropDownList id=cmbMonth dataProvider={model.months} selectedItem=@{model.selectedMonth} / s:Label text={model.selectedMonth} / When the problem occurs, the selectedMonth in the label component is correct, say, February. But the DropDownList will display a blank. Even though the DropDownList contains all the months, meaning models.months is bound correctly. I tried adding: requireSelection=true The addition changed the behavior. No more blanks! But now, instead of blanks, selectedMonth is showing something random like May. Background: App has been in production in various versions of Flex 3 for two years without ever seeing this. Upgrading to Flex 4 and swapping out some Halo components with equivalent Spark ones, users, myself included, began noticing this phenomenon. I cannot seem to reproduce it in a reliable fashion. But I've gotten some feedback based on some attempted fixes pushed out to users. Troubleshooting so far: Since it normally works, there's no super-obvious things missing, like an uninitialized pointer, missing Bindable tag, accidental = assignment instead of == comparison, etc. Also, we know the variable references are pointing to the correct place. model.selectedMonth is showing up fine for a label just underneath the dropdown. model.months is being referenced just fine by the dropdown itself. It's just the display of model.selectedMonth in the dropdown. Upon saving, the model.month property correctly propagates itself to the DB, even when the dropdown is displaying the wrong value. Switching between one-way and two-way bindings don't seem to make a difference either. I noted above that I tried forcing requireSelection=true, which does prevent the DropDownList from being blanked-out, but doesn't force it to stay on the correct value. I thought it might be related to just the DropDownList component, but the problem is also occurring on s:TextInput's text property. Seems like when it happens with the TextInput component (showing a blank value), it's doing so for all the TextInput components. I'm not so sure if it's happening for all DropDownList elements, though. App setup: I have an mx:ViewStack attached to hide/show effects with two containers inside (loggedOff/loggedOn), and a TabNavigator within that. I think the problems are only occurring after switching between states for the ViewStack. So after the components are hidden and come back. I remembered back to the Flex 2 ViewStack issue where bindings didn't refresh, and added the old workaround to my code: change=executeBindings(true) This didn't fix it. Anything else I can look at or try? Anyone else experience this before? Any chance it's related to the framework instead of my code?
[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)
I haven't tried explicitly re-setting the value manually or with BindingUtils, but that's something I'll try now! Should still be working without that. I have a feeling the problem is actually in the display logic of the component. Like perhaps some built-in efficiency code to ignore binding updates when it's hidden. But I'll have to deep-dive a little further to verify that. It's more likely something I'm missing or doing wrong. --- In flexcoders@yahoogroups.com, yang chen chenyang3@... wrote: Have you tried using binding util? To: flexcoders@yahoogroups.com From: nick14@... Date: Fri, 16 Mar 2012 20:08:47 + Subject: [flexcoders] Bindings on visual components being forgotten? (Flex 3 - 4.6) Seeing a strange, rare, issue after updating an app to 4.6. I can't seem to reproduce it in a dev environment, so I'll list out my issue and setup to see if it sounds familiar to anyone. The problem: Visual components seem to occasionally forget the objects they're bound to. For instance, I have something like this: s:DropDownList id=cmbMonth dataProvider={model.months} selectedItem=@{model.selectedMonth} / s:Label text={model.selectedMonth} / When the problem occurs, the selectedMonth in the label component is correct, say, February. But the DropDownList will display a blank. Even though the DropDownList contains all the months, meaning models.months is bound correctly. I tried adding: requireSelection=true The addition changed the behavior. No more blanks! But now, instead of blanks, selectedMonth is showing something random like May. Background: App has been in production in various versions of Flex 3 for two years without ever seeing this. Upgrading to Flex 4 and swapping out some Halo components with equivalent Spark ones, users, myself included, began noticing this phenomenon. I cannot seem to reproduce it in a reliable fashion. But I've gotten some feedback based on some attempted fixes pushed out to users. Troubleshooting so far: Since it normally works, there's no super-obvious things missing, like an uninitialized pointer, missing Bindable tag, accidental = assignment instead of == comparison, etc. Also, we know the variable references are pointing to the correct place. model.selectedMonth is showing up fine for a label just underneath the dropdown. model.months is being referenced just fine by the dropdown itself. It's just the display of model.selectedMonth in the dropdown. Upon saving, the model.month property correctly propagates itself to the DB, even when the dropdown is displaying the wrong value. Switching between one-way and two-way bindings don't seem to make a difference either. I noted above that I tried forcing requireSelection=true, which does prevent the DropDownList from being blanked-out, but doesn't force it to stay on the correct value. I thought it might be related to just the DropDownList component, but the problem is also occurring on s:TextInput's text property. Seems like when it happens with the TextInput component (showing a blank value), it's doing so for all the TextInput components. I'm not so sure if it's happening for all DropDownList elements, though. App setup: I have an mx:ViewStack attached to hide/show effects with two containers inside (loggedOff/loggedOn), and a TabNavigator within that. I think the problems are only occurring after switching between states for the ViewStack. So after the components are hidden and come back. I remembered back to the Flex 2 ViewStack issue where bindings didn't refresh, and added the old workaround to my code: change=executeBindings(true) This didn't fix it. Anything else I can look at or try? Anyone else experience this before? Any chance it's related to the framework instead of my code? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)
I have to refute the idea that bindings have ever been problematic. The way bindings work are very, very simple. When a variable is declared bindable, an event dispatched at the setter. And binding calling the getter then listens for that event, and re-calls the getter when triggered. BindingUtils functions do the same thing. After working and training with various versions of Flex for 6 years, the problems I've seen people have with bindings is that they're changing a non-binding object somewhere in the chain. It's usually pretty easy to fix-- just make the unbound object bindable. Have you seen any other specific issues? I'm pretty sure here that the problem isn't in the Bindings themselves. My best guess is either something stupidly obvious in my code (like declaring something as null instead of null-checking it), or more obscure like an of optimization in the spark component that's skipping update() cycles when it thinks the object isn't visible. But without being able to reproduce the issue with any kind of frequency, I can't be sure of that. Was mostly sending this out to see if anyone else had seen the issue. Since they haven't, I'm going to assume it's my code. I much appreciate your suggestions and response, but don't make unqualified statements blaming the core API! --- In flexcoders@yahoogroups.com, yang chen chenyang3@... wrote: MXML binding has always been problematic and very often you'll lose the binding at some point. For me binding utils has been much more reliable. Regards,Yang To: flexcoders@yahoogroups.com From: nick14@... Date: Mon, 19 Mar 2012 02:41:27 + Subject: [flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6) I haven't tried explicitly re-setting the value manually or with BindingUtils, but that's something I'll try now! Should still be working without that. I have a feeling the problem is actually in the display logic of the component. Like perhaps some built-in efficiency code to ignore binding updates when it's hidden. But I'll have to deep-dive a little further to verify that. It's more likely something I'm missing or doing wrong. --- In flexcoders@yahoogroups.com, yang chen chenyang3@ wrote: Have you tried using binding util? To: flexcoders@yahoogroups.com From: nick14@ Date: Fri, 16 Mar 2012 20:08:47 + Subject: [flexcoders] Bindings on visual components being forgotten? (Flex 3 - 4.6) Seeing a strange, rare, issue after updating an app to 4.6. I can't seem to reproduce it in a dev environment, so I'll list out my issue and setup to see if it sounds familiar to anyone. The problem: Visual components seem to occasionally forget the objects they're bound to. For instance, I have something like this: s:DropDownList id=cmbMonth dataProvider={model.months} selectedItem=@{model.selectedMonth} / s:Label text={model.selectedMonth} / When the problem occurs, the selectedMonth in the label component is correct, say, February. But the DropDownList will display a blank. Even though the DropDownList contains all the months, meaning models.months is bound correctly. I tried adding: requireSelection=true The addition changed the behavior. No more blanks! But now, instead of blanks, selectedMonth is showing something random like May. Background: App has been in production in various versions of Flex 3 for two years without ever seeing this. Upgrading to Flex 4 and swapping out some Halo components with equivalent Spark ones, users, myself included, began noticing this phenomenon. I cannot seem to reproduce it in a reliable fashion. But I've gotten some feedback based on some attempted fixes pushed out to users. Troubleshooting so far: Since it normally works, there's no super-obvious things missing, like an uninitialized pointer, missing Bindable tag, accidental = assignment instead of == comparison, etc. Also, we know the variable references are pointing to the correct place. model.selectedMonth is showing up fine for a label just underneath the dropdown. model.months is being referenced just fine by the dropdown itself. It's just the display of model.selectedMonth in the dropdown. Upon saving, the model.month property correctly propagates itself to the DB, even when the dropdown is displaying the wrong value. Switching between one-way and two-way bindings don't seem to make a difference either. I noted above that I tried forcing requireSelection=true, which does prevent the DropDownList from being blanked-out, but doesn't force it to stay on the correct value. I thought it might be related to just the DropDownList component, but the problem is also occurring on
[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)
Hi Rich, I'd answer your question if I could, but haven't worked much with Flex on mobile devices. Re-post your question as a new thread and hopefully a few others will see it. You've accidentally put it buried down the thread chain of a fairly obscure question :-) --- In flexcoders@yahoogroups.com, Richard Albrecht Rich@... wrote: Hi, First time writing to a group in many years. I'm basically a noob with Flash Builder 4.5 and flex. I right now have 2 questions: 1. I have an engineering app that I have running in the desktop. So the next step is take it mobile. Why don't the screens have the ability to zoom with a pinch? I have a screen that has a large datagrid and I want to make the text bigger, but then part of the grid moves off screen and you can't scroll over to see the hidden data. I thought this was available in all mobile apps. 2. The question on Scaling. What is the best way. What DPI should I have it set to. We also want a tablet version. Is there any good docs on the best way to accomplish this. Is using states a way. This one is I'm sure fairly complicated. Thanks and I hope I get faster responses here than on Adobe's forums. Thanks Rich
[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)
Nope, no difference with one vs two-way Bindings. I discovered this problem with DropDownLists that had one-way bindings and used the change event to update the value vo. I may have even been using selectedIndex instead of selectedItem-- don't remember. The problem persisted after I tried two-way bindings. Funny thing about it would be that the DropDownList would say May but the value of the VO would still be February. I'd then change the DropDownList to June and the VO would update to June. So the pointers were all referencing the right objects. Even stranger-- changing the VO again externally would not update the DropDownList. Something was going on with either the binding inside the DropDownList or the display/render function. I would have blamed that component if it weren't also happening on Input Boxes. --- In flexcoders@yahoogroups.com, Alex Harui aharui@... wrote: If you take off the two-way binding does it work? On 3/18/12 7:41 PM, Uber_Nick nick14@... wrote: I haven't tried explicitly re-setting the value manually or with BindingUtils, but that's something I'll try now! Should still be working without that. I have a feeling the problem is actually in the display logic of the component. Like perhaps some built-in efficiency code to ignore binding updates when it's hidden. But I'll have to deep-dive a little further to verify that. It's more likely something I'm missing or doing wrong. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , yang chen chenyang3@ wrote: Have you tried using binding util? To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com From: nick14@ Date: Fri, 16 Mar 2012 20:08:47 + Subject: [flexcoders] Bindings on visual components being forgotten? (Flex 3 - 4.6) Seeing a strange, rare, issue after updating an app to 4.6. I can't seem to reproduce it in a dev environment, so I'll list out my issue and setup to see if it sounds familiar to anyone. The problem: Visual components seem to occasionally forget the objects they're bound to. For instance, I have something like this: s:DropDownList id=cmbMonth dataProvider={model.months} selectedItem=@{model.selectedMonth} / s:Label text={model.selectedMonth} / When the problem occurs, the selectedMonth in the label component is correct, say, February. But the DropDownList will display a blank. Even though the DropDownList contains all the months, meaning models.months is bound correctly. I tried adding: requireSelection=true The addition changed the behavior. No more blanks! But now, instead of blanks, selectedMonth is showing something random like May. Background: App has been in production in various versions of Flex 3 for two years without ever seeing this. Upgrading to Flex 4 and swapping out some Halo components with equivalent Spark ones, users, myself included, began noticing this phenomenon. I cannot seem to reproduce it in a reliable fashion. But I've gotten some feedback based on some attempted fixes pushed out to users. Troubleshooting so far: Since it normally works, there's no super-obvious things missing, like an uninitialized pointer, missing Bindable tag, accidental = assignment instead of == comparison, etc. Also, we know the variable references are pointing to the correct place. model.selectedMonth is showing up fine for a label just underneath the dropdown. model.months is being referenced just fine by the dropdown itself. It's just the display of model.selectedMonth in the dropdown. Upon saving, the model.month property correctly propagates itself to the DB, even when the dropdown is displaying the wrong value. Switching between one-way and two-way bindings don't seem to make a difference either. I noted above that I tried forcing requireSelection=true, which does prevent the DropDownList from being blanked-out, but doesn't force it to stay on the correct value. I thought it might be related to just the DropDownList component, but the problem is also occurring on s:TextInput's text property. Seems like when it happens with the TextInput component (showing a blank value), it's doing so for all the TextInput components. I'm not so sure if it's happening for all DropDownList elements, though. App setup: I have an mx:ViewStack attached to hide/show effects with two containers inside (loggedOff/loggedOn), and a TabNavigator within that. I think the problems are only occurring after switching between states for the ViewStack. So after the components are hidden and come back. I remembered back to the Flex 2 ViewStack issue where bindings didn't refresh, and added the old workaround to my code: change=executeBindings(true) This didn't
[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)
It's been happening with all configurations, but intermittently. I've had 0 success reproducing it at will, even though myself and multiple users have come across it on non-dev environments. My troubleshooting has mostly been releasing things I think *might* have an impact, then asking users to send screen caps if they come across the issue again. It seems to be occurring regularly, although a hundred runs of the code below haven't shown it on my dev box. So I can't tell if there are any console messages at runtime. There are no compile-time warnings, and there weren't any of these issues when compiling with Flex 3 (swapping Spark components for Halo). Below is an 80-line, 4-file example I've been trying to use to attempt to reproduce the problem. I have not been successful reproducing it, but the structure and components used below closely resembled the full app. Only thing missing is that the full app has a set of Mate controllers and a bunch of AMF remote calls. Nothing those touch seem to be affected though. Since this problem is so hard to reproduce, I don't expect a resolution here. Just seeing if I'm doing something glaringly wrong or if the problems sound familiar to other developers. ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx minWidth=955 minHeight=600 xmlns:local=* fx:Declarations local:MyModel id=model / /fx:Declarations mx:ViewStack selectedIndex={model.viewStackIndex} s:NavigatorContent showEffect=Fade hideEffect=Fade local:Page1 model={model} / /s:NavigatorContent s:NavigatorContent showEffect=Fade hideEffect=Fade local:Page2 model={model}/ /s:NavigatorContent /mx:ViewStack /s:Application // MyModel.as package { [Bindable] public class MyModel { public var viewStackIndex:Number=0; public var one:String=one; public var two:String=two; public var three:String=three; public var four:String=four; } } // Page1.mxml ?xml version=1.0 encoding=utf-8? s:Group xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx width=400 height=300 xmlns:local=* fx:Declarations local:MyModel id=model / /fx:Declarations s:Button label=Forward x=150 y=100 click=model.viewStackIndex = (model.viewStackIndex == 0) ? 1 : 0;/ /s:Group // Page2.mxml ?xml version=1.0 encoding=utf-8? s:Group xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx width=400 height=300 xmlns:local=* fx:Script ![CDATA[ import mx.collections.ArrayList; ]] /fx:Script fx:Declarations local:MyModel id=model / /fx:Declarations s:TextInput x=10 y=10 text={model.one} / s:CheckBox x=250 y=10 label={model.two} selected={model.two=='two'} visible={model.two=='two'} / s:Button label=Back x=150 y=100 click=model.viewStackIndex = (model.viewStackIndex == 0) ? 1 : 0;/ s:Label x=10 y=200 text={model.three} / s:DropDownList x=250 y=200 selectedItem={model.four} dataProvider={new ArrayList(['bar', 'four', 'bar', 'bar', 'bar', 'bar'])} / /s:Group --- In flexcoders@yahoogroups.com, Alex Harui aharui@... wrote: So is this intermittent or just never works in this configuration? Are there console warning about not being able to detect changes? Can you make a 20-line test case? On 3/20/12 7:05 PM, Uber_Nick nick14@... wrote: Nope, no difference with one vs two-way Bindings. I discovered this problem with DropDownLists that had one-way bindings and used the change event to update the value vo. I may have even been using selectedIndex instead of selectedItem-- don't remember. The problem persisted after I tried two-way bindings. Funny thing about it would be that the DropDownList would say May but the value of the VO would still be February. I'd then change the DropDownList to June and the VO would update to June. So the pointers were all referencing the right objects. Even stranger-- changing the VO again externally would not update the DropDownList. Something was going on with either the binding inside the DropDownList or the display/render function