[flexcoders] Re: Loading XML in preloader/ before application onComplete
Hi I tried the psuedo code and works fine but when there is error and Alert is shown Alert.show(Security error + error.errorID.toString()); This alert is hidden behing the DownloadProgressbar. Can we bring it to front. Thanks ilikelfex --- In flexcoders@yahoogroups.com, Varun Shetty [EMAIL PROTECTED] wrote: Wow, that is pretty descriptive... thank you very much Rico...! umm.. so Extending the downloadprogressbar class is the way... I will try it out in sometime. Thank you very much for your help.. regards, Varun Shetty On Thu, Apr 3, 2008 at 1:26 PM, Rico Leuthold [EMAIL PROTECTED] wrote: Extend the DownloadProgressBar Class (name it e.g myPreloader) and override the preloader: override public function set preloader(value:Sprite):void { value.addEventListener(FlexEvent.INIT_COMPLETE, FlexInitComplete); // I added my download function to the INIT_COMPLETE event } Write sometihing like this as the event handler: private function FlexInitComplete(event:Event):void { Security.loadPolicyFile([you'll need a policy file I guess]); var getXMLReq:URLRequest = new URLRequest(http:// [whatever].xml); var xmlLoader:URLLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded); xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); try { xmlLoader.load(getXMLReq); } catch (error:Error) { trace(Unable to load requested document.); Alert.show(Security error + error.errorID.toString()); } } Then sth. like this ... private function xmlLoaded(event:Event):void { var loader:URLLoader = URLLoader(event.target); var theXML:XML = new XML(loader.data); } Check the DownloadProgressBar doc for some more events to complete the process In the Application tag set your preloader Application . . preloader=myPreloader . . / Hope that helps somehow ... for me it works. On 03.04.2008, at 17:28, Varun Shetty wrote: Hi, I am creating a flex application that has its UI elements and some basic data that are dependent upon a config.xml. Loading the config.xml on application preinitialize/initialize/onComplete would not be appropriate as my application preloading would be complete and I still dont see any UI elements on the screen. Creating second preloader on initialize would not look that great. I am pretty sure we can load the XML in the preloader and delay/deffer the application instantiation. Just not sure how to go about it and what API's should I look for or where exactly should I use them. Appreciate a lead on how to go about it. Thank you, Varun Shetty
[flexcoders] Bring Alert in front of DownloadProgressBar
Hi I am using the preloader in my application. I have override the below method. // Define the event listeners for the preloader events. override public function set preloader(preloader:Sprite):void { preloader.addEventListener (FlexEvent.INIT_COMPLETE,myHandleInitEnd); } // Event listeners for the FlexEvent.INIT_COMPLETE event. private function myHandleInitEnd(event:Event):void { Alert.show(Yahooo); } I want this Alert should come in front of DownloadProgressBar. If i run above code then Alert is hidden behind the DownloadProgressBar. Secondly if we can hide the DownloadProgressBar that will be awesome. Any pointers will be highly appeciated. I tried using visible=false but it does not work. Thanks ilikelfex
Re: [flexcoders] huge AMF messages
Thanks for your reply Seth! On 09/12/2008, at 8:19 PM, Seth Hodgson wrote: If you sent these in a RemoteObject call, that 10MB worth of data would go to the server in the body of a single HTTP POST. No progress events, and depending on the receiving server it may enforce size limits on body content of HTTP requests but they'd likely be higher than 10MB. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robin Burrer Sent: Tuesday, December 09, 2008 4:22 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] huge AMF messages Hi all, I planning to build an AIR application. In this application the user can create libraries that consist of multiple value Entry objects. Each EntryVO should look like this (there will be more properties of course) : package vo { [RemoteClass(alias=vo.EntryVO)] import flash.net.registerClassAlias; import flash.utils.ByteArray; public class EntryVO { [Bindable] public var image_data:ByteArray; [Bindable] public var image_name:String; public static function register():void { registerClassAlias(vo.EntryVO, EntryVO); } } } To simplify the uploading and downloading process I want to transfer images as ByteArrays to a .NetBackend. My question: What are my limitations here file size wise? Let's say I have 10 EntryVO. An each of these has an 1 MB byte array embedded. That means that my libraryVO (10 x 1 MB EntryVO) would have a file size of 10 MB. Will this work at all? Is there a progress event for remote operations? I guess it will take a while to transfer a 10 MB AMF message. Thanks for any input! Cheers Robin
[flexcoders] Best practice for calling asynchronous functions?
In my app, I make a wide variety of XML-RPC calls. Now, to avoid having to add/remove listeners all over the place, I've created a class (facade?) with functions like: function save(xml:XML, successFunc:Function, failureFunc:Function):void; function load(id:String, successFunc:Function, failureFunc:Function):void; Note, the class' state does not change when any of these functions are called. The class makes the necessary XML-RPC call and listens to the appropriate events before calling the relevant success or failure function. The class guarantees that either the successFunc or the failureFunc will be called at some point (but never both). This makes my calling code very neat: save(myXML, function(id:String):void { Alert.show(Successfully saved XML using id: + id); // now do the next step }, function(msg:String):void { Alert.show(Failed to save because: + msg); // now rollback }); One obvious drawback of this is that its not so easy to add multiple listeners to, say, the save operation. But, in my situation, I never need to. What say you all - good or bad practice? -- View this message in context: http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20930596.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Best practice for calling asynchronous functions?
- Original Message - From: Mark Carter [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, December 10, 2008 8:34 AM Subject: [flexcoders] Best practice for calling asynchronous functions? In my app, I make a wide variety of XML-RPC calls. Now, to avoid having to add/remove listeners all over the place, I've created a class (facade?) with functions like: function save(xml:XML, successFunc:Function, failureFunc:Function):void; function load(id:String, successFunc:Function, failureFunc:Function):void; Note, the class' state does not change when any of these functions are called. The class makes the necessary XML-RPC call and listens to the appropriate events before calling the relevant success or failure function. The class guarantees that either the successFunc or the failureFunc will be called at some point (but never both). This makes my calling code very neat: save(myXML, function(id:String):void { Alert.show(Successfully saved XML using id: + id); // now do the next step }, function(msg:String):void { Alert.show(Failed to save because: + msg); // now rollback }); One obvious drawback of this is that its not so easy to add multiple listeners to, say, the save operation. But, in my situation, I never need to. I would have thought it was very easy to add multiple listeners for the save operation - just have the single successFunc call multiple functions. The real problem may be that writing inline functions could make your code difficullt to follow if they get too complex - I'd probably use inline functions only for trivial cases. Effectively you've replaced event listeners with callback functions. I don't see the harm in it and I know a lot of people like using callbacks rather than full blown event handling. It does look quite neat and enforce cleaning up listeners. Paul What say you all - good or bad practice? -- View this message in context: http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20930596.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Is there anything like EventListnerList in JAVA?
Is there anything like EventListnerList in JAVA?
[flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader
My designers build the content, but it's rapid dev by non-technicals. I can do limited content prep, if I can automate it for them. I'll look into using implementing a SWFLoader that implements IFocusManagerComponent. Difficulty isn't that big of a concern -- it's either make this work or dump a months worth of work. Been googling for examples of this technique to see if it'll do what I need. You know of any existing implementations or articles on the topic? IT really seems like I can get either the flex content tab order working, or the loaded swf content working, but not both. Thanks for the help so far. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: If you don't own the content, the FCK won't help you. You'll need to wrap the content and implement your own tabbing scheme. Difficulty Rating 8 out of 10. You'd need a SWFLoader subclass that implements IFocusManagerComponent. It would need a keyFocusChange handler that calls preventDefault(). From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aut0poietic Sent: Tuesday, December 09, 2008 1:34 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader Thanks for the tip Alex. I'm googling now, but I'm curious how this could be of benefit to me for a MovieClip on stage. Content designers build the SWF's that my application loads in, which consists of simple MovieClips, images, vector graphics and some interactions (like drag/drops or a multiple choice question). It sounds like I'd have to specify a base class for every movieclip on stage that implemented IFocusManagerComponent. Am I far off, or is there some secret sauce in the kit? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: The CS3 entities need to implement IFocusManagerComponent. You might be able to use the Flash Component Kit to do that From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of aut0poietic Sent: Tuesday, December 09, 2008 7:47 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader Title pretty much says it all: I have a Flex 3 application which can basically be summed up as a SWF player which loads SWF's created in Flash CS3. When the SWF's are loaded, I can interact with them using the mouse (click/mouseover, etc). However, these items cannot be tabbed to. I've been hacking around on this all morning, without much luck. I've ensured that every item in the application either has a tabIndex and is .tabEnabled or has tabEnabled=false and tabChildren=true. I've even resorted to enumerating over the child MovieClips in the swf (using swfLoaderInstance.content.getChildAt()) and setting tabEnabled and focusRect are both true, and confirming that the tabIndex on these mc's was preserved. I'm at a serious loss as to what to do next -- I can't have controls/interactions that the user can't tab to. Am I missing something simple? A setting on the SWFLoader? The Application? Hope someone's had to deal with this before and knows a solution. Jer
Re: [flexcoders] Re: Parsley MVC :: some thoughts
- Original Message - From: Ralf Bokelberg [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, December 10, 2008 7:50 AM Subject: Re: [flexcoders] Re: Parsley MVC :: some thoughts Haha Amy, that's a good one. Maybe it should :) But seriously, dispatchEvent is nothing more than a function call, which calls all the event handler methods. Of cause you can think of pathologic examples like Paul likes to do :) But this is really the same with function calls. For several years before using flash I used a proprietary GUI OO tool that had a similar (though less sophisticated) event mechanism. In that system event dispatch did not actually take place until the code block had completed - only then would handlers be invoked. This was particularly important since the system also supported database access and transaction handling so it's particularly important to have discrete units of work that form part of a transaction without interruption. So I don't think that the synchronous event despatch mechanism is as obvious as it appears to some and I think it should really be a delayed propogation. Anyway, it's been an interesting thread. Paul It is completely synchronous and there is nothing like three lines later it does something strange to my code. It would be really bad, if something like this could happen. I would be happy to reconsider, if you can provide me with a example, which does what you were seeing. Cheers Ralf. On Wed, Dec 10, 2008 at 12:02 AM, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: Hi Amy Afaik this is not possible in Flashplayer. A block of code is always running through without any interuption. Colin Moock has a good chapter of how all this works in his nice AS3 book. Apparently the code in question didn't read the book to realize what it was doing wasn't possibl LOL. -- 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] SWF Security - how to prevent browsers - FireFox / IE cache swf file
Folks, How can restrict Firefox and other browsers to stop caching flex swf file. Because once swf file is cashed at client side, it can be easily be decompiled. I have seen some decompilers are, now, available to decompile AS3 - Flash Player 9 swf files. ~ MayKun
[flexcoders] Re: Socket and Pop3
Socket, ByteArray, Nobody ? --- In flexcoders@yahoogroups.com, quantum_ohm [EMAIL PROTECTED] wrote: Hi All ! I'm building a POP3 mail client in AIR, and can't figure out how to dispatch events (or where ) to send all the commands one after each other in a unique same shot. For now I have to send them individually like : USER then when I have the response PASS then STAT then RETR and so on... As the server needs to send a response before the AIR client can send another command. I think this is a kind of Synchronous/Asynchronous issue that I have some trouble to understand... is there any way to do that ? Thx for help :-)
Re: [flexcoders] Re: Parsley MVC :: some thoughts
Funny, I have a very similar example at my end that I wrote just now to prove to myself what was happening. I should have checked my email first ;-) On Wed, Dec 10, 2008 at 16:22, Paul Andrews [EMAIL PROTECTED] wrote: Here is a trivial example using dispatchEvent to show the synchronous invocation of listeners that could (if badly written) interfere with innocuous code. Normally when the click to count button is pressed, the count goes from 1 to 10. If the button to enable despatching the event is pressed, when the counter reaches 5 an event is despatched. The event handler updates the counter, adding 10 to it's value. The output shows that despatched events do indeed invoke the listeners synchronously and as this example shows, the listeners can interfere with the smooth running of code if they are badly written. Trivial example, certainly, but it shows the principle. Paul ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical applicationComplete=init() mx:Script ![CDATA[ public const UPSET_COUNTER_EVENT:String = upsetCounterEV; public var counter:int; public var counterEventEnabled:Boolean = false; public function init():void { this.addEventListener(UPSET_COUNTER_EVENT, eventListener); } public function eventListener(ev:Event):void { counter += 10; } public function clickHandler():void { counter=1; for (var i:int =1; i11; i++){ ta.text+=counter=+counter+\n; if ((i==5) (counterEventEnabled)){ this.dispatchEvent(new Event(UPSET_COUNTER_EVENT)); } counter++; } } ]] /mx:Script mx:TextArea id=ta height=200 width=200/ mx:Button label=click to enable event click=counterEventEnabled=true / mx:Button label=click to count click=clickHandler() / /mx:Application
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
guys am sorry for sounding so naive but i have still failed to make this work. i have a popup login that is called by clicking on a signin button on the main application and i would like that someone be a registered user to be able to login so his/her login details must match what is in the database and i am using coldfusion. when login is successful the child in the view stack should change to admin view. can someone please and i say please help me with this proble?
Re: [flexcoders] Is there anything like EventListnerList in JAVA?
What are you trying to do? Why do you need it? Give some more info... Java has event listeners on its GUI staff but you are not using it if you are using flex for the front end... On Wed, Dec 10, 2008 at 11:09 AM, nathanleewei [EMAIL PROTECTED]wrote: Is there anything like EventListnerList in JAVA? -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation [EMAIL PROTECTED],
[flexcoders] Re: Socket and Pop3
http://www.bytearray.org/?p=27 --- In flexcoders@yahoogroups.com, quantum_ohm [EMAIL PROTECTED] wrote: Hi All ! I'm building a POP3 mail client in AIR, and can't figure out how to dispatch events (or where ) to send all the commands one after each other in a unique same shot. For now I have to send them individually like : USER then when I have the response PASS then STAT then RETR and so on... As the server needs to send a response before the AIR client can send another command. I think this is a kind of Synchronous/Asynchronous issue that I have some trouble to understand... is there any way to do that ? Thx for help :-)
[flexcoders] UIMovieClip shows nondeterministic behaviour
I have a pretty big application. The app uses various in Flash created components. Everything works fine untill some certain point, which varies from test to test. At some point, my app crashes with a typeerror: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.flash::UIMovieClip/removeFocusEventListeners()[E:\dev\trunk\frameworks\projects\flash-integration\src\mx\flash\UIMovieClip.as:2466] at mx.flash::UIMovieClip/focusOutHandler()[E:\dev\trunk\frameworks\projects\flash-integration\src\mx\flash\UIMovieClip.as:2509] at flash.display::Stage/set focus() at mx.core::UIComponent/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6797] at mx.managers::FocusManager/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:396] at mx.managers::FocusManager/mouseDownHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:1388] The stacktrace is not that helpfull to me... seems a similar problem like: http://bugs.adobe.com/jira/browse/SDK-13182 The error is not reproduceable/hard to reproduce, since it happens randomly when trying to remove some displayobjects... Any infos or help would be appreciated!
[flexcoders] Re: Socket and Pop3
http://blog.emmanuelbonnet.com/2007/02/08/connexion-pop-par-socket- as3/ --- In flexcoders@yahoogroups.com, quantum_ohm [EMAIL PROTECTED] wrote: Thx for responding, but this info is about SMTP, not POP3. (I just want to retrieve mails) After lookin' at the code I found nothing which could solve my problem... :-( --- In flexcoders@yahoogroups.com, Cato Paus cato1@ wrote: http://www.bytearray.org/?p=27 --- In flexcoders@yahoogroups.com, quantum_ohm charly.antoine@ wrote: Hi All ! I'm building a POP3 mail client in AIR, and can't figure out how to dispatch events (or where ) to send all the commands one after each other in a unique same shot. For now I have to send them individually like : USER then when I have the response PASS then STAT then RETR and so on... As the server needs to send a response before the AIR client can send another command. I think this is a kind of Synchronous/Asynchronous issue that I have some trouble to understand... is there any way to do that ? Thx for help :-)
Re: [flexcoders] How to wite a javascript that calls to ActionScript
On Tue, Dec 9, 2008 at 6:14 PM, wkolcz [EMAIL PROTECTED] wrote: Sorry about that. Its not really my fault. Its the flexcoder list system. Actually I emailed one at 5pm yesterdays, waited for it to show up but it didnt. So I sent another one about 8:30 pm, it didn't show up either. Then I sent one this morning and it didn't show up for an hour (when all 3 showed up). Sometimes it happens. Anyway, did you solve your problem? Fidel.
[flexcoders] Still getting old swf
Hi folks, I'm getting the old swf everytime iam cleaning the code and building. I think my browser is caching the swf? Does this line in html will help? META HTTP-EQUIV=CACHE-CONTROL CONTENT=NO-CACHE Is it safe to add this line or do it will affect my performance of flex as nothing is cached. Let me know your views. Thanks, with Regards, Jitendra Jain Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
Re: [flexcoders] Best language for remoting
On Tuesday 09 Dec 2008, Fotis Chatzinikos wrote: Google for BlazeDZ, opensource and free a good replacement over lcds... The next version of the free ColdFusion engine Railo (due next month) will have Blaze intergrated, same as the pay-for Adobe one. -- Tom Chiverton Helping to interactively reintermediate cross-platform impactful attention-grabbing global m-commerce 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 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Best practice for calling asynchronous functions?
Mark, I've used to the same approach you describe but I didn't implemet failureFunc. This facade, in my case, detect a failure and display a message error. This approach take an advantage that you don't take care any more for failures and it will always be treat in the same way. This is a example method in my facade public function formDeleteAccount( listener: Function ): Operation To call this method you can use formDeleteAccount( handler ).send( params ) The send method return a AsyncToken and you can add more listener or put other params token for handler function. There is other methods like it: public function filterByText( listener: Function, text: String ): AsyncToken In this case, we use the compiler to force the correct params. I like this second approach and we will convert all the code to use it. If you have an interesting, I can send you all the code. But believe, I don't know if it is the best practice, but, for my problem, it run very well. -- Marco Catunda On Wed, Dec 10, 2008 at 6:34 AM, Mark Carter [EMAIL PROTECTED] wrote: In my app, I make a wide variety of XML-RPC calls. Now, to avoid having to add/remove listeners all over the place, I've created a class (facade?) with functions like: function save(xml:XML, successFunc:Function, failureFunc:Function):void; function load(id:String, successFunc:Function, failureFunc:Function):void; Note, the class' state does not change when any of these functions are called. The class makes the necessary XML-RPC call and listens to the appropriate events before calling the relevant success or failure function. The class guarantees that either the successFunc or the failureFunc will be called at some point (but never both). This makes my calling code very neat: save(myXML, function(id:String):void { Alert.show(Successfully saved XML using id: + id); // now do the next step }, function(msg:String):void { Alert.show(Failed to save because: + msg); // now rollback }); One obvious drawback of this is that its not so easy to add multiple listeners to, say, the save operation. But, in my situation, I never need to. What say you all - good or bad practice? -- View this message in context: http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20930596.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Re: flex login popup help needed pleaseeeeeeeee
On Wednesday 10 Dec 2008, stinasius wrote: guys am sorry for sounding so naive but i have still failed to make successful the child in the view stack should change to admin view. can someone please and i say please help me with this proble? Assuming you've got up to speed with remoting from Flex to ColdFusion, the steps are fairly simple. Flex reads the username and password and calls a CFC via. RemoteObject. CF checks them against whatever and returns the result. The Flex result handler checks the result and sets the viewStack.selectedIndex. -- Tom Chiverton Helping to continually synergize global distributed proactive systems 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 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Socket and Pop3
Thx for responding, but this info is about SMTP, not POP3. (I just want to retrieve mails) After lookin' at the code I found nothing which could solve my problem... :-( --- In flexcoders@yahoogroups.com, Cato Paus [EMAIL PROTECTED] wrote: http://www.bytearray.org/?p=27 --- In flexcoders@yahoogroups.com, quantum_ohm charly.antoine@ wrote: Hi All ! I'm building a POP3 mail client in AIR, and can't figure out how to dispatch events (or where ) to send all the commands one after each other in a unique same shot. For now I have to send them individually like : USER then when I have the response PASS then STAT then RETR and so on... As the server needs to send a response before the AIR client can send another command. I think this is a kind of Synchronous/Asynchronous issue that I have some trouble to understand... is there any way to do that ? Thx for help :-)
Re: [flexcoders] Create Flex Ajax Bridge menu option - Crashes FlexBuilder
On Friday 05 Dec 2008, polestar11 wrote: So often I have accidentally clicked the 'Create Ajax Bridge' menu option which is located just above the SVN 'Team' menu option. I then click cancel and ... wallah ... Flex Builder has crashed. Builder standalone or plugin ? -- Tom Chiverton Helping to authoritatively benchmark visionary sexy action-items 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 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] SWF Security - how to prevent browsers - FireFox / IE cache swf file
add this line in index.template.html meta http-equiv=pragma content=no-cache/ Thanks, with Regards, Jitendra Jain From: kuntamayu [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, 10 December, 2008 2:53:59 PM Subject: [flexcoders] SWF Security - how to prevent browsers - FireFox / IE cache swf file Folks, How can restrict Firefox and other browsers to stop caching flex swf file. Because once swf file is cashed at client side, it can be easily be decompiled.. I have seen some decompilers are, now, available to decompile AS3 - Flash Player 9 swf files. ~ MayKun Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
Re: [flexcoders] AIR app uninstall issue - database stays in applicationStorageDirectory forever?
On Wednesday 10 Dec 2008, Alen Balja wrote: away with it. Well, I guess I could tell them that Adobe knows better than them, and they did this for a reason, but I doubt they'd buy that. You'd think Adobe could manage an opt-in system for apps, where you set a flag in the descriptor, and then on uninstal the application is invoked with a 'clean up after yourself for user 'foo'' argument. Is there something in bugs.adobe.com for this already ? -- Tom Chiverton Helping to efficiently disseminate market-driven magnetic extensible relationships 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 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] AIR app uninstall issue - database stays in applicationStorageDirectory forever?
Well... Keeping with the theme of un-installers not cleaning up after themselves, and leaving out ugly hacks... How about an explicit clean up option in the application to delete all that stuff that the users can use before uninstalling IF they don't want it next time... Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alen Balja Sent: 10 December 2008 03:02 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] AIR app uninstall issue - database stays in applicationStorageDirectory forever? Because they have stored bookmarks, notes and other stuff with their product. They uninstall the product, install it again and they're still there. It's marked as critical with their QA and I don't think we could get away with it. Well, I guess I could tell them that Adobe knows better than them, and they did this for a reason, but I doubt they'd buy that. Anyway, looking forward to see some other ugly hack advices if anyone has similar expereince. Or if someone from Adobe like Alex knows some tricks.
[flexcoders] Catch Undefined state Error (ArgumentError)
Hi all, imagine the following scenario (isnt my case, but works): User input a string and press a button. Apps change the current state to the that string. That state doesnt exists :( So, checking the UIComponent.as, the ArgumentError its throw on the getState, not on setState. This method is probally called on the next frame, so, its cause that i cant: try { this.currentState = invalidState; } catch(e:ArgumentError) { Alert.show(Invalid state, Error); } I may run through the states array checking for the existance of the desire state, but, there is no other way to catch that error? That probally had been asked here, but i really didnt found it. Even googling Thanks in advanced.
Re: [flexcoders] Re: Parsley MVC :: some thoughts
Sorry, I mean With /synchronous event dispatch/, triggering an event 100 times will mean the listeners get invoked 100 times, even if the last invokation completely overwrites the work of the previous 99. On Wed, Dec 10, 2008 at 23:31, Jules Suggate [EMAIL PROTECTED] wrote: For several years before using flash I used a proprietary GUI OO tool that had a similar (though less sophisticated) event mechanism. In that system event dispatch did not actually take place until the code block had completed - only then would handlers be invoked. This was particularly important since the system also supported database access and transaction handling so it's particularly important to have discrete units of work that form part of a transaction without interruption. So I don't think that the synchronous event despatch mechanism is as obvious as it appears to some and I think it should really be a delayed propogation. I agree. For me at least, this was completely non-obvious and now that I know, feels plain bizarre. If asked before this thread, I would have answered that dispatchEvent() returned instantly and event handlers were invoked some other time such as after the current code block, or during the Player render cycle (but that would mean event handlers always executed in the next frame, perhaps causing problems with animations). That would give an implicit atomicity around the currently executing code and allow the VM to do smart things like rolling up multiple events of the same type within a given code block (or frame) into a single invokation of each listening handler. This way, triggering an event 100 times will mean the listeners get invoked 100 times, even if the last invokation completely overwrites the work of the previous 99. Yeah, interesting thread.
Re: [flexcoders] speed of the for each looping
Sorry, couldn't resist commenting on the term cognitive cruft! I love it! :)) On Wed, Dec 10, 2008 at 12:37, Maciek Sakrejda [EMAIL PROTECTED] wrote: Interesting. I decided to actually try my test above, and on 100 items, the for-each version takes ~50 milliseconds, versus ~25 milliseconds for the explicitly indexed loop. When doing some actual work in the loop (a trace), the numbers are 41.9 seconds for the for-each and 41.1 seconds for the indexed for. On a loop with a trace with 100 items, both forms take ~5 milliseconds. This is rather unscientific, but I don't have the profiler available (will it ever make it to Linux, Adobe?). So yes, it looks like for-each is a lot slower in some cases, but I'll maintain it still probably won't make a difference unless you've got a massive loop that does very little, or a deeply nested set of loops. Consider also the readability and maintainability benefits of a for-each: unless you need the index, it's just one more place to introduce bugs when refactoring, and it's cognitive cruft when trying to follow what's going on. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com
[flexcoders] Re: Anything other than a JS alert can delay a window close?
Another idea... How about setting up a timer in Flex to poll the server. If the server does not receive the poll in a certain amount of time then the client has disconnected and you can write the data to the database. It may work even better with BlazeDS (I don't know this - I'm kinda hoping it works). Hopefully you can tell if a client disconnects from something they have subscribed to via RTMP. Does anyone know? --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Use javascript and XMLHTTP to update the database instead of Flex? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Tuesday, December 09, 2008 5:34 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Anything other than a JS alert can delay a window close? Pretty much what I asked in the subject line. I need Flash to submit to a database before the window closes and the flash instance dies. Don't think that a pop up (alert) is an option for our sites. Using JS and ExternalInterface to communicate with flash (AS) to push to a HTTPRequest data to insert. ANY ideas? Any?
[flexcoders] drawing image from jpeg-encoded byte array
Hi there, This must be really simple but I just can't find the solution... How do I decode a jpeg-encoded byte array so that I can draw/display an image from it? The set pixels method obviously only works for raw image byte arrays. private function doEncodingAndDecoding():void { var originalBitMap:Bitmap = Bitmap(image1.content); var encoder:JPEGEncoder = new JPEGEncoder(); var myCompressedByteArray:ByteArray = encoder.encode(originalBitMap.bitmapData); myCompressedByteArray.position = 0; var newBitmapData:BitmapData = new BitmapData(image1.content.width, image1.content.height); var myRect:Rectangle = newBitmapData.rect; // :-( newBitmapData.setPixels(myRect,myCompressedByteArray); // var newBitmap:Bitmap = new Bitmap(newBitmapData); image2.source = newBitmap; } Thanks for any input! Robin
[flexcoders] Re: drawing image from jpeg-encoded byte array
As usual - after asking the list I found the solution myself :-) The Loader class + the loadBytes method. Cheers Robin On 10/12/2008, at 12:22 PM, Robin Burrer wrote: Hi there, This must be really simple but I just can't find the solution... How do I decode a jpeg-encoded byte array so that I can draw/display an image from it? The set pixels method obviously only works for raw image byte arrays. private function doEncodingAndDecoding():void { var originalBitMap:Bitmap = Bitmap(image1.content); var encoder:JPEGEncoder = new JPEGEncoder(); var myCompressedByteArray:ByteArray = encoder.encode(originalBitMap.bitmapData); myCompressedByteArray.position = 0; var newBitmapData:BitmapData = new BitmapData(image1.content.width, image1.content.height); var myRect:Rectangle = newBitmapData.rect; // :-( newBitmapData.setPixels(myRect,myCompressedByteArray); // var newBitmap:Bitmap = new Bitmap(newBitmapData); image2.source = newBitmap; } Thanks for any input! Robin
RE: [flexcoders] SWF Security - how to prevent browsers - FireFox / IE cache swf file
You should view the following from flex 360 conference on adobe media player. http://www.adobe.com/products/mediaplayer/ - get media player from here Feed URL is http://sessions.onflex.org/1733261879.xml presentation is called Encrypting flex protecting revenue by Andrew Westberg. Interesting if you wish to really protect your swfs. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jitendra jain Sent: 10 December 2008 11:11 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] SWF Security - how to prevent browsers - FireFox / IE cache swf file add this line in index.template.html meta http-equiv=pragma content=no-cache/ Thanks, with Regards, Jitendra Jain From: kuntamayu [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, 10 December, 2008 2:53:59 PM Subject: [flexcoders] SWF Security - how to prevent browsers - FireFox / IE cache swf file Folks, How can restrict Firefox and other browsers to stop caching flex swf file. Because once swf file is cashed at client side, it can be easily be decompiled. I have seen some decompilers are, now, available to decompile AS3 - Flash Player 9 swf files. ~ MayKun Add more friends to your messenger and enjoy! Invite them now. http://in.rd.yahoo.com/tagline_messenger_6/*http:/messenger.yahoo.com/invite/ Disclaimer --- This electronic message contains information which may be privileged and confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone on 0131 476 6000 and delete the material from your computer. Registered in Scotland number: SC 172507. Registered office address: Quay House 142 Commercial Street Edinburgh EH6 6LB. This email message has been scanned for viruses by Mimecast. ---
Re: [flexcoders] Re: Parsley MVC :: some thoughts
For several years before using flash I used a proprietary GUI OO tool that had a similar (though less sophisticated) event mechanism. In that system event dispatch did not actually take place until the code block had completed - only then would handlers be invoked. This was particularly important since the system also supported database access and transaction handling so it's particularly important to have discrete units of work that form part of a transaction without interruption. So I don't think that the synchronous event despatch mechanism is as obvious as it appears to some and I think it should really be a delayed propogation. I agree. For me at least, this was completely non-obvious and now that I know, feels plain bizarre. If asked before this thread, I would have answered that dispatchEvent() returned instantly and event handlers were invoked some other time such as after the current code block, or during the Player render cycle (but that would mean event handlers always executed in the next frame, perhaps causing problems with animations). That would give an implicit atomicity around the currently executing code and allow the VM to do smart things like rolling up multiple events of the same type within a given code block (or frame) into a single invokation of each listening handler. This way, triggering an event 100 times will mean the listeners get invoked 100 times, even if the last invokation completely overwrites the work of the previous 99. Yeah, interesting thread.
[flexcoders] Re: speed of the for each looping
--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
Re: [flexcoders] Best language for remoting
Stay away from WCF and webservices unless you want the pain of arguing with MS geeks about why they can't use SOAP 1.2.. On Tue, Dec 9, 2008 at 12:01, Sceneshift [EMAIL PROTECTED] wrote: Hey guys, When building larger applications with bigger database interactions, which is considered the best language to develop the back-end environment in? I have been using PHP in most of my projects, but using AMFPHP to pass objects just seems really clunky... It seems as though Adobe are pushing ColdFusion, but I was wondering what the general consensus is on which methods (webservices, remoting) and languages are considered to be the best for communicating with databases. -- View this message in context: http://www.nabble.com/Best-language-for-remoting-tp20905438p20905438.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: AIR app uninstall issue - database stays in applicationStorageDirectory forever?
If AIR won't do it and there are time constraints you may like to look into a full installer product like InstallAnywhere (http://www.acresso.com/products/ia/installanywhere-overview.htm) or InstallShield (http://www.acresso.com/products/is/installshield-overview.htm). --- In flexcoders@yahoogroups.com, Gregor Kiddie [EMAIL PROTECTED] wrote: Well... Keeping with the theme of un-installers not cleaning up after themselves, and leaving out ugly hacks... How about an explicit clean up option in the application to delete all that stuff that the users can use before uninstalling IF they don't want it next time... Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alen Balja Sent: 10 December 2008 03:02 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] AIR app uninstall issue - database stays in applicationStorageDirectory forever? Because they have stored bookmarks, notes and other stuff with their product. They uninstall the product, install it again and they're still there. It's marked as critical with their QA and I don't think we could get away with it. Well, I guess I could tell them that Adobe knows better than them, and they did this for a reason, but I doubt they'd buy that. Anyway, looking forward to see some other ugly hack advices if anyone has similar expereince. Or if someone from Adobe like Alex knows some tricks.
[flexcoders] inner classes and static initialization
I'm having a strange problem with the use of an inner class and I wanted to see if anyone thought that this was a bug or the correct behavior. Here's my test that shows the problem: package { use namespace MyNamespace; public class InternalClassTest { public static const mtInstance:InternalClassTest = new InternalClassTest(); public static function getInstance():InternalClassTest { return mtInstance; } MyNamespace var mtInternalClass:MyInternal; public function InternalClassTest() { mtInternalClass = new MyInternal(); } } } use namespace MyNamespace; internal class MyInternal { } The existence of the static constant that calls the InternalClassTest constructor is where the issue lies. I get this error: TypeError: Error #1007: Instantiation attempted on a non-constructor. at InternalClassTest()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:16] at InternalClassTest$cinit() at global$init()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:5] at TestApp()[C:\5DCVS_Flex\Testing\src\TestApp.as:35] at Testing()[C:\5DCVS_Flex\Testing\src\Testing.mxml:0] at _Testing_mx_managers_SystemManager/create() at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.1.0\frame\ works\projects\framework\src\mx\managers\SystemManager.as:2454] at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::d\ ocFrameHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\manag\ ers\SystemManager.as:2344] If I remove the call to new MyInternal() from the constructor of InternalClassTest, then I can get the same functionality by implementing the internal class in the following way: internal class MyInternal { { InternalClassTest.getInstance().mtInternalClass = new MyInternal(); } } So the problem seems to be that the MyInternal class has not been initialized when accessing the InternalClassTest class through a static method. The solution is kind of a pain, and certainly not exactly intuitive. From what I can tell it means that no singleton would be able to access an internal class through its constructor. This is in Flex Builder 3.0.1. with the Flex 3.1 SDK. Thanks for any thoughts. Dale
[flexcoders] lock first column in datagrid
Hi I'm building a datagrid with multiple columns, show and hide them at runtime, and need to lock the first column from scrolling horizontally. Is this possible? I can't seem to find anything in the API.
[flexcoders] AIR 1.5 upgrade issue?
Hello, So, I recently updated my developer environment to AIR 1.5, and noticed some strange behavior in an application I had developed on AIR 1.0. I am retrieving HTML from a database, and displaying it to the user via an mx:HTML/ control. Before upgrading, I had no problem using stylsheet and javascript references in the HTML. After upgrading (and changing nothing else), the HTML references are not being found. I have tried fiddling with the paths in the HTML I am retrieving, but haven't had much luck. Did something change in AIR 1.5 with the way an application handles the current directory? Thanks! -Ned
[flexcoders] Re: Tilelist image help
The images look the same to me. Are you complaining about the scaling? If so, it probably has something to do with constraints based on your layout. What does the debugger say the actual size is? Can you post a small example showing the problem. --- In flexcoders@yahoogroups.com, arulmurugan thiagarajan [EMAIL PROTECTED] wrote: Hi, http://www.calsoftgroup.com/samspick/index.html Using a Tilelist to show a books title, image, description, rating, authorurl. The image is not rendered it is different from what I am seeing in a picture viewer. mx:image width =100 height =150 / actual image width = 100 and height =150 (Image url http://www.calsoftgroup.com/samspick/assets/pic2/IndiaFrommidnighttoMilleniumandBeyond_ShashiTharoor.jpg ) See image of the book India : From Midnight to Millennium and Beyond under. (Choose History in drop down) Dono whats the problem. Pls help. regards, Arulmurugan
[flexcoders] Removing White pixels and shadow from Bitmap Data
Currently i m working with the BitmapData Class.My requirement is to remove the white background of an image. I have done this will using the threshold() method.But the issue is related to the shadow inside the image.Can any body suggest me how to remove this shadow from any image. Thnx Shardul Singh Bartwal Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/
[flexcoders] Adobe AIR - Get/Set Desktop Background
Is it possible to retrieve or change the desktop background from AIR ? I'm mainly concerned about achieving this for Windows. -- View this message in context: http://www.nabble.com/Adobe-AIR---Get-Set-Desktop-Background-tp20933083p20933083.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Problem uploading BitmapData as PNG on PHP server.
Here's my code... When this runs, test.png is created, but it has a small file size and is corrupt. Any help would be appreciated. public function saveImageToServer(event:Event):void { var bmp:BitmapData = getBitmapData(); var pngEncode:PNGEncoder = new PNGEncoder(); var saveRequest:URLRequest = new URLRequest(); var loader:URLLoader = new URLLoader(); var byteArray:ByteArray = new ByteArray(); var variables:URLVariables = new URLVariables(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; saveRequest.url = sm.uploadImageHelperFileAddress; byteArray = pngEncode.encode(bmp); saveRequest.method = URLRequestMethod.POST; variables.byteArray = byteArray; variables.directory = um.userName; variables.savePath = sm.savedImageDirectoryAddress; saveRequest.data = variables; loader.addEventListener(Event.COMPLETE, handleSaveSuccess); loader.addEventListener(IOErrorEvent.IO_ERROR, handleSaveError); loader.load(saveRequest); } ?php $png = $_POST['byteArray']; file_put_contents($filename, $png); echo success; ?
[flexcoders] Fastest filterfunction for large ArrayColeccions ?
Is there any way to speed a filterfunction for autocomplete component with a large ArrayColection? Thanks in advance Carlos G.
[flexcoders] Applying metadata in the middle of mxml - is it possible?
Hi, Basically, I would like to apply some (of my own) metadata to a component instance inside the mxml. Like this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:ApplicationControlBar mx:Metadata[MyMetadata]/mx:Metadata mx:Button id=foo label=Blah/ /mx:ApplicationControlBar /mx:Application And then only have the [MyMetadata] applied to the foo button instance. Is this possible? Placing it there makes the compiler bark. I guess this is due to the fact, that mxmlc will put it before a class definition. I then tried something like this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:ApplicationControlBar mx:Script[MyMetadata]/mx:Script mx:Button id=foo label=Blah/ /mx:ApplicationControlBar /mx:Application but this made the compiler bark too :-) about metadata requiring an associated definition. And of course it is right. My guess is the mxmlc compiler is translating the above to something like: acb = new ApplicationControlBar(); [MyMetadata] b = new Button(); acb.add(b); and of course then it is wrong with the metadata element there. Am I right? Can I do it some other way? I came up with this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:ApplicationControlBar myns:MetadataButton id=foo label=Blah/ /mx:ApplicationControlBar /mx:Application and then have a component MetadataButton.mxml with this content: ?xml version=1.0 ? mx:Button xmlns:mx=http://www.adobe.com/2006/mxml; mx:Metadata[MyMetadata]/mx:Metadata /mx:Button which works! But the MyMetadata annotation will change on the various buttons. So I would like to inline it, like this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:ApplicationControlBar mx:Button xmlns:mx=http://www.adobe.com/2006/mxml; mx:Metadata[MyMetadata]/mx:Metadata /mx:Button /mx:ApplicationControlBar /mx:Application but this makes the compiler bark again. Any help?
[flexcoders] Auto sizing columns in advanced datagrid
Hi all, I would have procedure that auto size columns width at the datagrid craetion based on cells or headers content. i appreciate any help regards lorenzo
[flexcoders] Re: Loading XML in preloader/ before application onComplete
Remove the ProgressBar. If there is an error, there is no progress to speak of. --- In flexcoders@yahoogroups.com, ilikeflex [EMAIL PROTECTED] wrote: Hi I tried the psuedo code and works fine but when there is error and Alert is shown Alert.show(Security error + error.errorID.toString()); This alert is hidden behing the DownloadProgressbar. Can we bring it to front. Thanks ilikelfex --- In flexcoders@yahoogroups.com, Varun Shetty varunet@ wrote: Wow, that is pretty descriptive... thank you very much Rico...! umm.. so Extending the downloadprogressbar class is the way... I will try it out in sometime. Thank you very much for your help.. regards, Varun Shetty On Thu, Apr 3, 2008 at 1:26 PM, Rico Leuthold rleuthold@ wrote: Extend the DownloadProgressBar Class (name it e.g myPreloader) and override the preloader: override public function set preloader(value:Sprite):void { value.addEventListener(FlexEvent.INIT_COMPLETE, FlexInitComplete); // I added my download function to the INIT_COMPLETE event } Write sometihing like this as the event handler: private function FlexInitComplete(event:Event):void { Security.loadPolicyFile([you'll need a policy file I guess]); var getXMLReq:URLRequest = new URLRequest(http:// [whatever].xml); var xmlLoader:URLLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded); xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); try { xmlLoader.load(getXMLReq); } catch (error:Error) { trace(Unable to load requested document.); Alert.show(Security error + error.errorID.toString()); } } Then sth. like this ... private function xmlLoaded(event:Event):void { var loader:URLLoader = URLLoader(event.target); var theXML:XML = new XML(loader.data); } Check the DownloadProgressBar doc for some more events to complete the process In the Application tag set your preloader Application . . preloader=myPreloader . . / Hope that helps somehow ... for me it works. On 03.04.2008, at 17:28, Varun Shetty wrote: Hi, I am creating a flex application that has its UI elements and some basic data that are dependent upon a config.xml. Loading the config.xml on application preinitialize/initialize/onComplete would not be appropriate as my application preloading would be complete and I still dont see any UI elements on the screen. Creating second preloader on initialize would not look that great. I am pretty sure we can load the XML in the preloader and delay/deffer the application instantiation. Just not sure how to go about it and what API's should I look for or where exactly should I use them. Appreciate a lead on how to go about it. Thank you, Varun Shetty
[flexcoders] Re: Loading XML in preloader/ before application onComplete
Scratch that - Didn't grok you were talking about the pre-loader. --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: Remove the ProgressBar. If there is an error, there is no progress to speak of. --- In flexcoders@yahoogroups.com, ilikeflex ilikeflex@ wrote: Hi I tried the psuedo code and works fine but when there is error and Alert is shown Alert.show(Security error + error.errorID.toString()); This alert is hidden behing the DownloadProgressbar. Can we bring it to front. Thanks ilikelfex --- In flexcoders@yahoogroups.com, Varun Shetty varunet@ wrote: Wow, that is pretty descriptive... thank you very much Rico...! umm.. so Extending the downloadprogressbar class is the way... I will try it out in sometime. Thank you very much for your help.. regards, Varun Shetty On Thu, Apr 3, 2008 at 1:26 PM, Rico Leuthold rleuthold@ wrote: Extend the DownloadProgressBar Class (name it e.g myPreloader) and override the preloader: override public function set preloader(value:Sprite):void { value.addEventListener(FlexEvent.INIT_COMPLETE, FlexInitComplete); // I added my download function to the INIT_COMPLETE event } Write sometihing like this as the event handler: private function FlexInitComplete(event:Event):void { Security.loadPolicyFile([you'll need a policy file I guess]); var getXMLReq:URLRequest = new URLRequest(http:// [whatever].xml); var xmlLoader:URLLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded); xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); try { xmlLoader.load(getXMLReq); } catch (error:Error) { trace(Unable to load requested document.); Alert.show(Security error + error.errorID.toString()); } } Then sth. like this ... private function xmlLoaded(event:Event):void { var loader:URLLoader = URLLoader(event.target); var theXML:XML = new XML(loader.data); } Check the DownloadProgressBar doc for some more events to complete the process In the Application tag set your preloader Application . . preloader=myPreloader . . / Hope that helps somehow ... for me it works. On 03.04.2008, at 17:28, Varun Shetty wrote: Hi, I am creating a flex application that has its UI elements and some basic data that are dependent upon a config.xml. Loading the config.xml on application preinitialize/initialize/onComplete would not be appropriate as my application preloading would be complete and I still dont see any UI elements on the screen. Creating second preloader on initialize would not look that great. I am pretty sure we can load the XML in the preloader and delay/deffer the application instantiation. Just not sure how to go about it and what API's should I look for or where exactly should I use them. Appreciate a lead on how to go about it. Thank you, Varun Shetty
Re: [flexcoders] Re: AIR app uninstall issue - database stays in applicationStorageDirectory forever?
Well, at least if we would be able to know that we're installing it and not just running it. Then I could at least hack that and clean old stuff before starting again fresh, this would also be acceptable for the client. So I guess there's no solution available unfortunately, apart from third party products like InstallAnywhere. On Wed, Dec 10, 2008 at 7:56 PM, valdhor [EMAIL PROTECTED]wrote: If AIR won't do it and there are time constraints you may like to look into a full installer product like InstallAnywhere (http://www.acresso.com/products/ia/installanywhere-overview.htm) or InstallShield (http://www.acresso.com/products/is/installshield-overview.htm). --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Gregor Kiddie [EMAIL PROTECTED] wrote: Well... Keeping with the theme of un-installers not cleaning up after themselves, and leaving out ugly hacks... How about an explicit clean up option in the application to delete all that stuff that the users can use before uninstalling IF they don't want it next time... Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Alen Balja Sent: 10 December 2008 03:02 To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: Re: [flexcoders] AIR app uninstall issue - database stays in applicationStorageDirectory forever? Because they have stored bookmarks, notes and other stuff with their product. They uninstall the product, install it again and they're still there. It's marked as critical with their QA and I don't think we could get away with it. Well, I guess I could tell them that Adobe knows better than them, and they did this for a reason, but I doubt they'd buy that. Anyway, looking forward to see some other ugly hack advices if anyone has similar expereince. Or if someone from Adobe like Alex knows some tricks.
[flexcoders] Re: Still getting old swf
Jitendra, You might have something buggy going on in your FlexBuilder (I'm assuming that's what you're building with), but I think your problem may be solved just by pressing Shift + Refresh in your browser. The HTTP-EQUIV tag might work, but it might not, depending on variables that I don't know much about. If you are viewing your application locally, as opposed to running it on a webserver, it definitely won't work. Ross --- In flexcoders@yahoogroups.com, jitendra jain [EMAIL PROTECTED] wrote: Hi folks,  I'm getting the old swf everytime iam cleaning the code and building. I think my browser is caching the swf?  Does this line in html will help? META HTTP-EQUIV=CACHE-CONTROL CONTENT=NO-CACHE  Is it safe to add this line or do it will affect my performance of flex as nothing is cached. Let me know your views.  Thanks, with Regards, Jitendra Jain Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
[flexcoders] Re: speed of the for each looping
if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
[flexcoders] Re: Parsley MVC :: some thoughts
--- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: Haha Amy, that's a good one. Maybe it should :) But seriously, dispatchEvent is nothing more than a function call, which calls all the event handler methods. Of cause you can think of pathologic examples like Paul likes to do :) But this is really the same with function calls. It is completely synchronous and there is nothing like three lines later it does something strange to my code. It would be really bad, if something like this could happen. I would be happy to reconsider, if you can provide me with a example, which does what you were seeing. I'm doing this from memory, because it looks like the client is working on how the search functionality works, but here's the place that the functionality broke: protected function profilePageLoaded(e:CollectionEvent):void{ /* Make sure we don't keep triggering this function for an old SearchProfiles */ var coll:ArrayCollection=e.currentTarget as ArrayCollection; coll.removeEventListener (CollectionEvent.COLLECTION_CHANGE, profilePageLoaded); dispatchEvent(new Event(PROFILES_CHANGED)); //ok to load a new page of results on whatever SearchProfile is current _isGettingProfiles=false; updateCache(); //check current _searchProfiles to see if we need to load more pages if (_searchProfiles.loadedProfiles_searchProfiles.profileCount) loadPageOfProfiles(); } Note that the _isGettingProfiles switch is still _after_ the dispatchEvent code. I moved it there from after updateCache (which doesn't care about or change this value), because when I had it _below_ that, the dispatchEvent would cause other code to execute the function that registers for this event again...but it wouldn't register for the event because that variable was still true. By moving it up a line (but still after the dispatchEvent, since that's where I felt it was more understandable for the people that have to maintain the code), it still executed before the event listener kicked in. Hope this clarifies; Amy
[flexcoders] Re: Parsley MVC :: some thoughts
--- In flexcoders@yahoogroups.com, Jules Suggate [EMAIL PROTECTED] wrote: For several years before using flash I used a proprietary GUI OO tool that had a similar (though less sophisticated) event mechanism. In that system event dispatch did not actually take place until the code block had completed - only then would handlers be invoked. This was particularly important since the system also supported database access and transaction handling so it's particularly important to have discrete units of work that form part of a transaction without interruption. So I don't think that the synchronous event despatch mechanism is as obvious as it appears to some and I think it should really be a delayed propogation. I agree. For me at least, this was completely non-obvious and now that I know, feels plain bizarre. If asked before this thread, I would have answered that dispatchEvent() returned instantly and event handlers were invoked some other time such as after the current code block, or during the Player render cycle (but that would mean event handlers always executed in the next frame, perhaps causing problems with animations). That would give an implicit atomicity around the currently executing code and allow the VM to do smart things like rolling up multiple events of the same type within a given code block (or frame) into a single invokation of each listening handler. This way, triggering an event 100 times will mean the listeners get invoked 100 times, even if the last invokation completely overwrites the work of the previous 99. That's what I would have thought, too, considering how obsessive the Flex team seems to be about optimizing. This was especially hard to debug in my case because the listener wasn't called immediately. I wonder if that's because it was in a different class...? -Amy
[flexcoders] Re: Best practice for calling asynchronous functions?
--- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: Mark Carter [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, December 10, 2008 8:34 AM Subject: [flexcoders] Best practice for calling asynchronous functions? In my app, I make a wide variety of XML-RPC calls. Now, to avoid having to add/remove listeners all over the place, I've created a class (facade?) with functions like: function save(xml:XML, successFunc:Function, failureFunc:Function):void; function load(id:String, successFunc:Function, failureFunc:Function):void; Note, the class' state does not change when any of these functions are called. The class makes the necessary XML-RPC call and listens to the appropriate events before calling the relevant success or failure function. The class guarantees that either the successFunc or the failureFunc will be called at some point (but never both). This makes my calling code very neat: save(myXML, function(id:String):void { Alert.show(Successfully saved XML using id: + id); // now do the next step }, function(msg:String):void { Alert.show(Failed to save because: + msg); // now rollback }); One obvious drawback of this is that its not so easy to add multiple listeners to, say, the save operation. But, in my situation, I never need to. I would have thought it was very easy to add multiple listeners for the save operation - just have the single successFunc call multiple functions. The real problem may be that writing inline functions could make your code difficullt to follow if they get too complex - I'd probably use inline functions only for trivial cases. Effectively you've replaced event listeners with callback functions. I don't see the harm in it and I know a lot of people like using callbacks rather than full blown event handling. It does look quite neat and enforce cleaning up listeners. Another way to handle it is with a token. The token rides the event, so there's no cleanup to be done...Once the event is handled the reference to it goes away, and so does the token and its responders. http://flexdiary.blogspot.com/2008/11/more-thoughts-on-remoting.html
[flexcoders] Re: Socket and Pop3
--- In flexcoders@yahoogroups.com, Cato Paus [EMAIL PROTECTED] wrote: http://blog.emmanuelbonnet.com/2007/02/08/connexion-pop-par-socket- as3/ this one helped me more ! Thx Cato :-) --- In flexcoders@yahoogroups.com, quantum_ohm charly.antoine@ wrote: Thx for responding, but this info is about SMTP, not POP3. (I just want to retrieve mails) After lookin' at the code I found nothing which could solve my problem... :-( --- In flexcoders@yahoogroups.com, Cato Paus cato1@ wrote: http://www.bytearray.org/?p=27 --- In flexcoders@yahoogroups.com, quantum_ohm charly.antoine@ wrote: Hi All ! I'm building a POP3 mail client in AIR, and can't figure out how to dispatch events (or where ) to send all the commands one after each other in a unique same shot. For now I have to send them individually like : USER then when I have the response PASS then STAT then RETR and so on... As the server needs to send a response before the AIR client can send another command. I think this is a kind of Synchronous/Asynchronous issue that I have some trouble to understand... is there any way to do that ? Thx for help :-)
Re: [flexcoders] Re: Parsley MVC :: some thoughts
The only way for a listener to not get called synchronously is if it is specifically setup to do that. For example in Flex you can call a method using callLater which will call it on the next frame. If you are not using Flex you can do the same thing by creating a timer with a duration of 1 and calling the method within the timer's handler. If you look through the Flex code you will see a lot of use of callLater as it works great for allowing data to update before you act upon it. On Wed, Dec 10, 2008 at 8:12 AM, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, Jules Suggate [EMAIL PROTECTED] wrote: For several years before using flash I used a proprietary GUI OO tool that had a similar (though less sophisticated) event mechanism. In that system event dispatch did not actually take place until the code block had completed - only then would handlers be invoked. This was particularly important since the system also supported database access and transaction handling so it's particularly important to have discrete units of work that form part of a transaction without interruption. So I don't think that the synchronous event despatch mechanism is as obvious as it appears to some and I think it should really be a delayed propogation. I agree. For me at least, this was completely non-obvious and now that I know, feels plain bizarre. If asked before this thread, I would have answered that dispatchEvent() returned instantly and event handlers were invoked some other time such as after the current code block, or during the Player render cycle (but that would mean event handlers always executed in the next frame, perhaps causing problems with animations). That would give an implicit atomicity around the currently executing code and allow the VM to do smart things like rolling up multiple events of the same type within a given code block (or frame) into a single invokation of each listening handler. This way, triggering an event 100 times will mean the listeners get invoked 100 times, even if the last invokation completely overwrites the work of the previous 99. That's what I would have thought, too, considering how obsessive the Flex team seems to be about optimizing. This was especially hard to debug in my case because the listener wasn't called immediately. I wonder if that's because it was in a different class...? -Amy -- 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
RE: [flexcoders] Re: speed of the for each looping
Is the enumeration order guaranteed to be the same for for-in and for each as an indexed loop? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato Paus Sent: Wednesday, December 10, 2008 9:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: speed of the for each looping if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
RE: [flexcoders] Re: flex login popup help needed pleaseeeeeeeee
Yep, that about says it. Stinasius, how far have you gotten? What is not working? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tom Chiverton Sent: Wednesday, December 10, 2008 8:01 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: flex login popup help needed please On Wednesday 10 Dec 2008, stinasius wrote: guys am sorry for sounding so naive but i have still failed to make successful the child in the view stack should change to admin view. can someone please and i say please help me with this proble? Assuming you've got up to speed with remoting from Flex to ColdFusion, the steps are fairly simple. Flex reads the username and password and calls a CFC via. RemoteObject. CF checks them against whatever and returns the result. The Flex result handler checks the result and sets the viewStack.selectedIndex. -- Tom Chiverton Helping to continually synergize global distributed proactive systems 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 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: [Bounce] Flex and Firefox 3.0.x performance
Thought I'd try again to see whether anyone has experienced this and what they did to solve it. --- In flexcoders@yahoogroups.com, schneiderjim [EMAIL PROTECTED] wrote: Flex: 2 Flash: 9 and 10 Has anyone experienced performance issues with a flex/flash app running on Firefox 3.0.x. After poking around my app for a bit and then doing nothing, the firefox 3.0.x process sits at about 40% CPU usage. Doing the same with Firefox 2.0.0.18 and the firefox process goes back down to 0% - 2% CPU usage ... more like I'd expect. Is there some configuration I should be aware of? framerate? As far as I know, we've never mucked around with anything other than the default settings.
Re: [flexcoders] Fastest filterfunction for large ArrayColeccions ?
On the off chance that your filterFunction is anonymous, you could try de-anonymizing it (i.e., declare it as a private member function wherever makes the most sense), since anonymous functions have some overhead. Other than that, it's hard to say without seeing the function. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: cegarza2 [EMAIL PROTECTED] Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Fastest filterfunction for large ArrayColeccions ? Date: Wed, 10 Dec 2008 09:54:13 - Is there any way to speed a filterfunction for autocomplete component with a large ArrayColection? Thanks in advance Carlos G.
[flexcoders] Re: Listening for both Mouse Down and Double Click events.
Brendan, I have the the doubleclick enabled, but I have listener on my component (with property doubleclickenabled = true) that needs to listen for both MOUSE_DOWN DOUBLE_CLICK. If DOUBLE_CLICK happens then I don't want Mouse_down to be handled. So I need my component to wait and see if the mouse_down was part of a double click or a just a mouse down. --- In flexcoders@yahoogroups.com, Brendan Meutzner [EMAIL PROTECTED] wrote: There is a double click event you can listen for on UIComponent... just make sure that doubleClickEnabled is set to true on the instance you're setting the listener on. Brendan On Tue, Dec 9, 2008 at 11:04 AM, flexaustin [EMAIL PROTECTED] wrote: Is it possible to listen for both a mouse down and doubleclick events without using some sort of timer? On mouse down start timer to listen for a another mouse down? If you listen for a mouse down and in the mouse down handler add another listener to listen for some other action is a possibility I guess, but would it add the listener in time? TIA -- Brendan Meutzner http://www.meutzner.com/blog/
[flexcoders] Re: Flex nested tree get data from mysql and php
So I took a few days to figure out how to create a parent child array using left, right keys and parent child relationship. You can use this code how ever you want. You have to have a table that holds left, right and parent information. ?php class CBSTree { public $tempArry; public $parentString; public $collectArry; public $parentArry; public function CBSTree() { $this-parentString; $this-tempArry = array(); $this-collectArry = array(); $this-parentArry = array(); } public function BuildTree($name) { /* setting up the database */ if(!$dbconnect = mysql_connect('localhost', 'root')) { echo Connection failed to the host 'localhost'.; exit; } if (!mysql_select_db('UrDataBase')) { echo Cannot connect to database 'test'; exit; } $table_id = 'dnt_cbs_table'; // Table name $query = SELECT node.name, node.CBSid, node.PARid FROM $table_id AS node, $table_id AS parent WHERE node.L BETWEEN parent.L AND parent.R AND parent.name = '$name' ORDER BY node.L; $result = mysql_query($query); while($row=mysql_fetch_object($result)){ $this-parentArry[] = $row-PARid; $this-collectArry[] = $row; } $this-CleanParentString(); return $this-tempArry[0][0]; } /** * CleanParentString() * This will break the $this-parentString into an array, remove duplicate numbers * then reassemble the array into a string ($this-parentString) ordered from lowest * to highest */ public function CleanParentString() { $temp = array_unique($this-parentArry); $this-parentArry = array_reverse($temp); $this-GroupCommonChildObjects(); } /** * GroupCommonChildObjects() * This will first get the last digit in the $this-parentString and then loop through * the array ($this-collectArry[]-parent) to make matches. If there is a match then * the object ($this-collectArray[]) is grouped in a temporary array. This temporary * array is then added to $this-tempArry; */ public function GroupCommonChildObjects() { for($e=0;$ecount($this-parentArry);$e++){ $arr = array(); for($i=0;$icount($this-collectArry);$i++){ if($this-collectArry[$i]-PARid == $this-parentArry[$e]){ $arr[] = ($this-collectArry[$i]); } } $this-tempArry[] = ($arr); } $this-DoTheWork(); } public function FindParent($num,$childArry) { for($i=0;$icount($this-tempArry);$i++){ for($x=0;$xcount($this-tempArry[$i]);$x++){ if($this-tempArry[$i][$x]-CBSid == $num){ $this-tempArry[$i][$x]-children = $childArry; } } } } public function DoTheWork() { while(count($this-tempArry)1){ $this-FindParent($this-tempArry[0][0]-PARid, $this-tempArry[0]); array_shift($this-tempArry); } } } --- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote: Hello all, I am working with nested arrayobjects and I cannot construct the needed data from my php/mysql backend. I am using nested sets (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html), with left and right keys. I need to construct the data (in php) and pass it to flex (using a remote call). I need/want to get the data to flex and put it into an arraycollection. Has any one done this? If so, can you post some code? I have been banging my head on this for a long time and cannot get the data into the right format for an array collection. Thanks for the help, timgerr
RE: [flexcoders] Re: speed of the for each looping
Keep in mind that getItemIndex is horribly inefficient. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato Paus Sent: Wednesday, December 10, 2008 6:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: speed of the for each looping if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
RE: [flexcoders] lock first column in datagrid
lockedColumnCount From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aphexyuri Sent: Tuesday, December 09, 2008 3:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] lock first column in datagrid Hi I'm building a datagrid with multiple columns, show and hide them at runtime, and need to lock the first column from scrolling horizontally. Is this possible? I can't seem to find anything in the API.
RE: [flexcoders] inner classes and static initialization
The definition doesn't exist at static initialization time so I think that's expected behavior. You'll see all of our code doing a null test then creating the instance inside of getInstance() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cadisella Sent: Tuesday, December 09, 2008 1:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] inner classes and static initialization I'm having a strange problem with the use of an inner class and I wanted to see if anyone thought that this was a bug or the correct behavior. Here's my test that shows the problem: package { use namespace MyNamespace; public class InternalClassTest { public static const mtInstance:InternalClassTest = new InternalClassTest(); public static function getInstance():InternalClassTest { return mtInstance; } MyNamespace var mtInternalClass:MyInternal; ! public function InternalClassTest() { mtInternalClass = new MyInternal(); } } } use namespace MyNamespace; internal class MyInternal { } The existence of the static constant that calls the InternalClassTest constructor is where the issue lies. I get this error: TypeError: Error #1007: Instantiation attempted on a non-constructor. at InternalClassTest()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:16] at InternalClassTest$cinit() at! global$ init()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:5] at TestApp()[C:\5DCVS_Flex\Testing\src\TestApp.as:35] at Testing()[C:\5DCVS_Flex\Testing\src\Testing.mxml:0] at _Testing_mx_managers_SystemManager/create() at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2454] at mx.managers::S! ystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2344] If I remove the call to new MyInternal() from the constructor of InternalClassTest, then I can get the same functionality by implementing the internal class in the following way: internal class MyInternal { { InternalClassTest.getInstance().mtInternalClass = new MyInternal(); ! ; nbsp; } } So the problem seems to be that the MyInternal class has not been initialized when accessing the InternalClassTest class through a static method. The solution is kind of a pain, and certainly not exactly intuitive. From what I can tell it means that no singleton would be able to access an internal class through its constructor. This is in Flex Builder 3.0.1. with the Flex 3.1 SDK. Thanks for any thoughts. Dale
RE: [flexcoders] UIMovieClip shows nondeterministic behaviour
The indication is that the object somehow got removed from the displaylist on the mouseDown. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of florian.salihovic Sent: Wednesday, December 10, 2008 4:11 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] UIMovieClip shows nondeterministic behaviour I have a pretty big application. The app uses various in Flash created components. Everything works fine untill some certain point, which varies from test to test. At some point, my app crashes with a typeerror: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.flash::UIMovieClip/removeFocusEventListeners()[E:\dev\trunk\frameworks\projects\flash-integration\src\mx\flash\UIMovieClip.as:2466] at mx.flash::UIMovieClip/focusOutHandler()[E:\dev\trunk\frameworks\projects\flash-integration\src\mx\flash\UIMovieClip.as:2509] at flash.display::Stage/set focus() at mx.core::UIComponent/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6797] at mx.managers::FocusManager/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:396] at mx.managers::FocusManager/mouseDownHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:1388] The stacktrace is not that helpfull to me... seems a similar problem like: http://bugs.adobe.com/jira/browse/SDK-13182 The error is not reproduceable/hard to reproduce, since it happens randomly when trying to remove some displayobjects... Any infos or help would be appreciated!
RE: [flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader
No examples of your situation, but DataGrid uses keyFocusChange and my blog's DG editor with two editable fields post also shows how to grab keyFocusChange and basically shutdown Flex's focus handling so you can run your own. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aut0poietic Sent: Tuesday, December 09, 2008 5:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader My designers build the content, but it's rapid dev by non-technicals. I can do limited content prep, if I can automate it for them. I'll look into using implementing a SWFLoader that implements IFocusManagerComponent. Difficulty isn't that big of a concern -- it's either make this work or dump a months worth of work. Been googling for examples of this technique to see if it'll do what I need. You know of any existing implementations or articles on the topic? IT really seems like I can get either the flex content tab order working, or the loaded swf content working, but not both. Thanks for the help so far. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: If you don't own the content, the FCK won't help you. You'll need to wrap the content and implement your own tabbing scheme. Difficulty Rating 8 out of 10. You'd need a SWFLoader subclass that implements IFocusManagerComponent. It would need a keyFocusChange handler that calls preventDefault(). From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of aut0poietic Sent: Tuesday, December 09, 2008 1:34 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader Thanks for the tip Alex. I'm googling now, but I'm curious how this could be of benefit to me for a MovieClip on stage. Content designers build the SWF's that my application loads in, which consists of simple MovieClips, images, vector graphics and some interactions (like drag/drops or a multiple choice question). It sounds like I'd have to specify a base class for every movieclip on stage that implemented IFocusManagerComponent. Am I far off, or is there some secret sauce in the kit? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: The CS3 entities need to implement IFocusManagerComponent. You might be able to use the Flash Component Kit to do that From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of aut0poietic Sent: Tuesday, December 09, 2008 7:47 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader Title pretty much says it all: I have a Flex 3 application which can basically be summed up as a SWF player which loads SWF's created in Flash CS3. When the SWF's are loaded, I can interact with them using the mouse (click/mouseover, etc). However, these items cannot be tabbed to. I've been hacking around on this all morning, without much luck. I've ensured that every item in the application either has a tabIndex and is .tabEnabled or has tabEnabled=false and tabChildren=true. I've even resorted to enumerating over the child MovieClips in the swf (using swfLoaderInstance.content.getChildAt()) and setting tabEnabled and focusRect are both true, and confirming that the tabIndex on these mc's was preserved. I'm at a serious loss as to what to do next -- I can't have controls/interactions that the user can't tab to. Am I missing something simple? A setting on the SWFLoader? The Application? Hope someone's had to deal with this before and knows a solution. Jer
RE: [flexcoders] Re: speed of the for each looping
No enumeration order of for..in is not guaranteed From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, December 10, 2008 8:55 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping Is the enumeration order guaranteed to be the same for for-in and for each as an indexed loop? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato Paus Sent: Wednesday, December 10, 2008 9:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: speed of the for each looping if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
RE: [flexcoders] Re: speed of the for each looping
To clarify (since to some it might seem like Alex is all but admitting that Adobe couldn't code their way out of a wet paper bag), ArrayCollection.getItemIndex() is horribly inefficient *by design*. There are always trade-offs when designing data structures, and it's impossible to make a data structure that's optimally efficient for everything. Making getItemIndex() efficient would have sabotaged other performance characteristics of ArrayCollection. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: Alex Harui [EMAIL PROTECTED] Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping Date: Wed, 10 Dec 2008 09:14:38 -0800 Keep in mind that getItemIndex is horribly inefficient. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato Paus Sent: Wednesday, December 10, 2008 6:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: speed of the for each looping if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
Re: RES: [flexcoders] Flex Builder caching PNGs
I find that after making changes to an image in Fireworks, I need to right-click my assets folder and say Refresh. This seems to work because it causes a recompile. --- In flexcoders@yahoogroups.com, Luciano Manerich Junior [EMAIL PROTECTED] wrote: Clean Build Project? De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de tom s Enviada em: terça-feira, 9 de dezembro de 2008 11:27 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] Flex Builder caching PNGs I'm @Embedding some PNGs to skin some buttons. If I Run once, then edit the PNG file, then Run again I get the old PNG (w/o the edits), not the new one. My current work-around is to rename the file after each change, but this is a pain. How do I get Flex Builder to not cache the PNGs / to check for changes on each compile? thanks tom
[flexcoders] Flex training
We might be getting funding for Flex training early next year. What are some good training vendors that will come on-site for Adobe Flex training? Thanks - Todd
Re: [flexcoders] RE: services-config.xml: compc or just mxmlc?
Seth, Thanks--this is really handy. But I think what I was asking is a little simpler: there are no modules (in the Flex sense of the word) here. I'm essentially just interested in building a main app and being able to extend it after-the-fact with an add-on that gets compiled into a single .swf application. That is: main app: src/index.mxml (the Application, but only a wrapper around Main.mxml) src/Main.mxml (the actual brains of the app) src/util1.as src/util2.as services-config.xml gets compiled into foo.swf (the default app) *and (separately) foo.swc (a library which includes all the classes compiled from the above sources except index.mxml) later on, someone else (with access to index.mxml, services-config.xml, and foo.swc, but not the sources, wants to extend this): extended version: src/index.mxml (same as above, but now modified to reference Extended.mxml) src/Extended.mxml src/util3.as lib/foo.swc (from above) services-config.xml (from above) this gets compiled into super-foo.swf (the extended app) Suppose that the extended version does not even change services-config.xml or add any objects with [RemoteAlias] metadata. Do I need to reference services-config.xml when (1) building the original foo.swc (2) building the super-foo.swf (3) both ? And if I do extend services-config.xml or add new [RemoteAlias] objects to the extended version, does the answer to the above change (obviously, it has to be at least 2 or 3)? I think what I'm really asking is when does the services-config.xml metadata get baked into a .swf (or .swc)? -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: Seth Hodgson [EMAIL PROTECTED] Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: [flexcoders] RE: services-config.xml: compc or just mxmlc? Date: Tue, 9 Dec 2008 09:43:18 -0800 Hi Maciek, I don't have any practical experience with attempting to compile service config and associated classes into modules and I don't know whether compc would support it or not, but based on some informal discussions with Alex and Jeff I wouldn't recommend it. The core issue is that AMF serialization mappings (client to server class aliases) within Flash Player aren't scoped per module or even app domain as loaded classes are - unfortunately they're scoped to a security domain (broader scope). This means that if the root swf loads two or more modules (each will be loaded in its own child ApplicationDomain by default), where these modules bake in overlapping sets of classes that use [RemoteClass] metadata things won't work. The modules will effectively trample each other's registered class aliases to point to their respective local classes. Say you have a class Foo ([RemoteClass(alias=com.Foo)]), that you've compiled into both modules. You now have two separate class defs on the client (one per module/sub app domain), but only one alias registered (scoped to the security domain both of these app domains belong to). When the loosing module receives a Foo off the network it will fail to deserialize correctly because the alias mapping points to the class def in the other module, which this module doesn't have access to. I think the best approach for now is to place your service config and all shared classes with [RemoteClass] metadata into your root swf, and then expose this to your modules through a controlled API - say a registry of network services or operations the modules can use. You may be able to get away with keeping non-shared classes with [RemoteClass] metadata in specific modules, but I haven't tried that. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Maciek Sakrejda Sent: Sunday, December 07, 2008 9:42 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] services-config.xml: compc or just mxmlc? Does compc care about the contents of the services-config.xml file? If I compile a .swc component with compc with one set of services defined, but then change the services-config.xml file and build a .swf with mxmlc, are the mxmlc service definitions used for everything? Is it some weird combination? I know I can probably poke at this through experimentation, but the docs explicitly *don't* list service-config as an option that does not apply to compc, so I was curious. -Maciek
[flexcoders] SpringGraph and ArrayCollection
Has anyone used an arraycollection with a springgraph? thanks for the help, timgerr
[flexcoders] Re: SocetMonitor not working as expected
Seems like this should be a no-brainer according to the docs and the examples I'm seeing online, but it just doesn't seem to work. I am running my client in a VM session(so I can easily enable/disable the network interface), but I don't think that is the issue since it does work if I don't specify a pollInterval. My onNetworkStatusChange() method has a Alert statement in it which isn't popping up, and it also sets a boolean property that something else is bound to to swap a status icon. Neither of these actions happen after the initial start() status event. Any one else experience this issue? --- In flexcoders@yahoogroups.com, Geoffrey [EMAIL PROTECTED] wrote: Trying out the SocketMonitor and what I'm experiencing is not what I'm expecting to happen. Here's a code snippet: __sm = new SocketMonitor(HOSTNAME, PORT_NUMBER); __sm.addEventListener(StatusEvent.STATUS, onNetworkStatusChange); __sm.start(); The onNetworkStatusChange() method gets called when start() is called. I expect that. It also get's called about 30 seconds after the network interface is disabled. I'm guessing it uses some sort of polling, so I guess I expect that. I really expected it to happen as soon as the interface goes down, so to speed up the network status recognition I set __sm.pollInterval = 1000. Once I do that, the only time onNetworkStatusChange() is called is when start() is called. It never gets a StatusEvent... no matter how many times I enable/disable the network interface. Any ideas on why I'm seeing this? Thanks, Geoff
[flexcoders] Re: flex login popup help needed pleaseeeeeeeee
Tom has it correct. You may have to take baby steps... Create your states and login window. Make sure you can switch states OK. Hard code the username and password and use these to check login from your login window. Get up to speed with RemoteObject and ColdFusion (Try the tutorial at http://tutorial1.flexcf.com/) Now try it with RemoteObject and ColdFusion. --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 10 Dec 2008, stinasius wrote: guys am sorry for sounding so naive but i have still failed to make successful the child in the view stack should change to admin view. can someone please and i say please help me with this proble? Assuming you've got up to speed with remoting from Flex to ColdFusion, the steps are fairly simple. Flex reads the username and password and calls a CFC via. RemoteObject. CF checks them against whatever and returns the result. The Flex result handler checks the result and sets the viewStack.selectedIndex. -- Tom Chiverton Helping to continually synergize global distributed proactive systems 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: UIMovieClip shows nondeterministic behaviour
Hi Alex, yes indeed, the object gets removed but i don't know how to identify which component actually is the source of the problem. What gets removed is a composite of components, each skind with a UIMovieClip. Sometimes, when i want to remove it, the error occours. but it is the sometimes, that bugs me. Best regards, Florian --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: The indication is that the object somehow got removed from the displaylist on the mouseDown. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of florian.salihovic Sent: Wednesday, December 10, 2008 4:11 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] UIMovieClip shows nondeterministic behaviour I have a pretty big application. The app uses various in Flash created components. Everything works fine untill some certain point, which varies from test to test. At some point, my app crashes with a typeerror: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.flash::UIMovieClip/removeFocusEventListeners()[E:\dev\trunk\frameworks\projects\fla sh-integration\src\mx\flash\UIMovieClip.as:2466] at mx.flash::UIMovieClip/focusOutHandler()[E:\dev\trunk\frameworks\projects\flash- integration\src\mx\flash\UIMovieClip.as:2509] at flash.display::Stage/set focus() at mx.core::UIComponent/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\ core\UIComponent.as:6797] at mx.managers::FocusManager/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\sr c\mx\managers\FocusManager.as:396] at mx.managers::FocusManager/mouseDownHandler()[E:\dev\3.1.0\frameworks\projects\fra mework\src\mx\managers\FocusManager.as:1388] The stacktrace is not that helpfull to me... seems a similar problem like: http://bugs.adobe.com/jira/browse/SDK-13182 The error is not reproduceable/hard to reproduce, since it happens randomly when trying to remove some displayobjects... Any infos or help would be appreciated!
[flexcoders] Date format in DataGrid?
I display data with DataGrid and dataProvider bind to a arraycollection (dataProvider={acUsers}), one column in the DataGrid is Date field. My question is how to change the Date display format in the DataGrid (like 2008-5-20). Thanks for help Mark
RES: [flexcoders] Date format in DataGrid?
Using a labelFunction. It will receive the data in current line and the column, and must return a String. mx:DataGridColumn labelFunction=dateLabelFunction/ private function dateLabelFunction(obj:User, column:DataGridColumn):String { return obj.date.getYear + -; //... } -Mensagem original- De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de markflex2007 Enviada em: quarta-feira, 10 de dezembro de 2008 16:48 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] Date format in DataGrid? I display data with DataGrid and dataProvider bind to a arraycollection (dataProvider={acUsers}), one column in the DataGrid is Date field. My question is how to change the Date display format in the DataGrid (like 2008-5-20). Thanks for help Mark -- 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
RE: [flexcoders] Date format in DataGrid?
labelFunction() and DateFormatter. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: Wednesday, December 10, 2008 1:48 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Date format in DataGrid? I display data with DataGrid and dataProvider bind to a arraycollection (dataProvider={acUsers}), one column in the DataGrid is Date field. My question is how to change the Date display format in the DataGrid (like 2008-5-20). Thanks for help Mark
Re: [flexcoders] problem with sample flex application with LCDS
The snippet of code you provde for data-management-config.xml... is that complete? I work with CF destinations rather than Java, and there is more information required for CF than I see in your example (ie. adaptor, channel, etc...). destination id=test adapter ref=coldfusion-dao/ channelschannel ref=cf-polling-amf//channels properties use-transactionstrue/use-transactions componentcom.company.cfc.lcds.rba.well.rba_well_operationalconditionsAssembler/component scoperequest/scope use-accessorstrue/use-accessors use-structsfalse/use-structs accessmethod-access-levelremote/method-access-level/access property-case force-cfc-lowercasefalse/force-cfc-lowercase force-query-lowercasefalse/force-query-lowercase force-struct-lowercasefalse/force-struct-lowercase /property-case metadata identity property=Well_ID/ query-row-typecom.company.model.lcds.rba.well.rba_well_operationalconditionsVO/query-row-type /metadata network/network server fill-method use-fill-containsfalse/use-fill-contains auto-refreshtrue/auto-refresh orderedfalse/ordered /fill-method /server /properties /destination It sounds like your mapping to hit your Assembler class is incorrect, and this would be the most likely place where something is in error causing that. HTH, Brendna On Wed, Dec 10, 2008 at 1:34 AM, shruti shety [EMAIL PROTECTED]wrote: Hi I have a print statement in the fill method of the class which extends AbstractAssembler.Thats not getting printed on the console. I dont get any errors also. When i click on the button the screen just refreshes. Thanks, Radhika --- On *Wed, 12/10/08, Brendan Meutzner [EMAIL PROTECTED]* wrote: From: Brendan Meutzner [EMAIL PROTECTED] Subject: Re: [flexcoders] problem with sample flex application with LCDS To: flexcoders@yahoogroups.com Date: Wednesday, December 10, 2008, 12:40 PM Can you elaborate a bit on what you mean by not getting called? Where is the failure occurring? Brendan On Wed, Dec 10, 2008 at 12:58 AM, shruti shety shruti.sheety@ yahoo.com[EMAIL PROTECTED] wrote: Hi, I am working on a sample application with flex (and LCDS data services) and have been experimenting with directly calling the fill method (extending AbstractAssembler) as a way of poking data into a server-side DB. Every time I try to run my test case fill is not getting called . I'd appreciate any pointers as to where I'm going wrong... I am directly using the lcds-sample. war, in that testdrive-dataservi ce code Sorry for the lengthy code attach. my mxml: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml xmlns=* backgroundColor=#FF mx:ArrayCollection id=products/ mx:DataService id=ds destination=inventory/ Product/ mx:DataGrid dataProvider={products} editable=true width=100% height=100% mx:columns mx:DataGridColumn dataField=name headerText=Name/ mx:DataGridColumn dataField=category headerText=Category/ mx:DataGridColumn dataField=price headerText=Price/ mx:DataGridColumn dataField=image headerText=Image/ mx:DataGridColumn dataField=description headerText=Description/ /mx:columns /mx:DataGrid mx:Button label=Get Data click=ds.fill(products)/ /mx:Application ProductAssembler. java extends AbstractAssembler * * * * package flex.samples. product; import java.util.List; import java.util.Collectio n; import java.util.Map; import flex.data.assembler s.AbstractAssemb ler; public class ProductAssembler extends AbstractAssembler { public Collection fill(List fillArgs) { List list = new ArrayList(); System.out.println( in service); return list; } public void createItem(Object item) { } } * * * * * * ** Product.as package { [Managed] [RemoteClass( alias=flex.samples. product.Product)] public class Product { public function Product() { } public var productId:int; public var name:String; public var description: String; public var image:String; public var category:String; public var price:Number; public var qtyInStock:int; } } * * * * * package flex.samples. product; import java.io.Serializabl e; public class Product implements Serializable { static final long serialVersionUID
Re: [flexcoders] Re: Listening for both Mouse Down and Double Click events.
Ahhh... I hear ya... AFAIK there's no way to delay an event from firing, so yeah write a Timer into your mouseDown, mouseUp, and click events to actually dispatch their meaning on that Timer's end event, and kill that Timer event listener if your doubleClick gets dispatched first... I remember having to write in the double click handling manually back in 1.0 when it didn't exist in the framework, and it was quite similar to this concept :-) Other folks may have a better suggestion, but that's how I'd approach. Brendan On Wed, Dec 10, 2008 at 11:06 AM, flexaustin [EMAIL PROTECTED] wrote: Brendan, I have the the doubleclick enabled, but I have listener on my component (with property doubleclickenabled = true) that needs to listen for both MOUSE_DOWN DOUBLE_CLICK. If DOUBLE_CLICK happens then I don't want Mouse_down to be handled. So I need my component to wait and see if the mouse_down was part of a double click or a just a mouse down. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Brendan Meutzner [EMAIL PROTECTED] wrote: There is a double click event you can listen for on UIComponent... just make sure that doubleClickEnabled is set to true on the instance you're setting the listener on. Brendan On Tue, Dec 9, 2008 at 11:04 AM, flexaustin [EMAIL PROTECTED] wrote: Is it possible to listen for both a mouse down and doubleclick events without using some sort of timer? On mouse down start timer to listen for a another mouse down? If you listen for a mouse down and in the mouse down handler add another listener to listen for some other action is a possibility I guess, but would it add the listener in time? TIA -- Brendan Meutzner http://www.meutzner.com/blog/ -- Brendan Meutzner http://www.meutzner.com/blog/
[flexcoders] Re: Flex training
--- In flexcoders@yahoogroups.com, twcrone70 [EMAIL PROTECTED] wrote: We might be getting funding for Flex training early next year. What are some good training vendors that will come on-site for Adobe Flex training? Thanks - Todd Go with Farata Systems - practitioners plus Adobe certified trainers. SD
Re: [flexcoders] Re: Flex training
Depending on where you are, New Toronto Group near, um, Toronto is quite good and also a certified training agency. www.newyyz.com. On Wed, Dec 10, 2008 at 2:25 PM, sdpbooks [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, twcrone70 [EMAIL PROTECTED] wrote: We might be getting funding for Flex training early next year. What are some good training vendors that will come on-site for Adobe Flex training? Thanks - Todd Go with Farata Systems - practitioners plus Adobe certified trainers. SD -- Andrew Wetmore
[flexcoders] Re: inner classes and static initialization
Thank you, that works. I'm guessing then that the inner classes are treated as globals in the same way that the static data members are, and initialzed after the static data members? It seems that all globals would be initialized before the class itself, as the class itself may (and in my case, did) require the use of them. This is coming from a Java background as well, where that seems to be the case. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: The definition doesn't exist at static initialization time so I think that's expected behavior. You'll see all of our code doing a null test then creating the instance inside of getInstance() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cadisella Sent: Tuesday, December 09, 2008 1:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] inner classes and static initialization I'm having a strange problem with the use of an inner class and I wanted to see if anyone thought that this was a bug or the correct behavior. Here's my test that shows the problem: package { use namespace MyNamespace; public class InternalClassTest { public static const mtInstance:InternalClassTest = new InternalClassTest(); public static function getInstance():InternalClassTest { return mtInstance; } MyNamespace var mtInternalClass:MyInternal; ! public function InternalClassTest() { mtInternalClass = new MyInternal(); } } } use namespace MyNamespace; internal class MyInternal { } The existence of the static constant that calls the InternalClassTest constructor is where the issue lies. I get this error: TypeError: Error #1007: Instantiation attempted on a non-constructor. at InternalClassTest()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:16] at InternalClassTest$cinit() at! global$ init()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:5] at TestApp()[C:\5DCVS_Flex\Testing\src\TestApp.as:35] at Testing()[C:\5DCVS_Flex\Testing\src\Testing.mxml:0] at _Testing_mx_managers_SystemManager/create() at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.1.0\frame\ works\projects\framework\src\mx\managers\SystemManager.as:2454] at mx.managers::S! ystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler\ ()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\SystemMana\ ger.as:2344] If I remove the call to new MyInternal() from the constructor of InternalClassTest, then I can get the same functionality by implementing the internal class in the following way: internal class MyInternal { { InternalClassTest.getInstance().mtInternalClass = new MyInternal(); ! ; nbsp; } } So the problem seems to be that the MyInternal class has not been initialized when accessing the InternalClassTest class through a static method. The solution is kind of a pain, and certainly not exactly intuitive. From what I can tell it means that no singleton would be able to access an internal class through its constructor. This is in Flex Builder 3.0.1. with the Flex 3.1 SDK. Thanks for any thoughts. Dale
[flexcoders] Re: Flex training
After going through formal training on Flex for a week earlier this year, I was underwhelmed. The course was taken directly from the book Adobe Flex 3 Training from the Source. The one good thing was that every participant got a free book. I would recommend using some of the excellent free resources available (eg. Adobe's Learn Flex in a week at http://www.adobe.com/devnet/flex/videotraining/ and 15 Minutes with Flex at http://www.theflexshow.com/blog/index.cfm/Fifteen-Minutes-With-Flex) and buy a good book. HTH Steve --- In flexcoders@yahoogroups.com, twcrone70 [EMAIL PROTECTED] wrote: We might be getting funding for Flex training early next year. What are some good training vendors that will come on-site for Adobe Flex training? Thanks - Todd
[flexcoders] Re: Flex training
If you have a group I would recommend an Adobe Training Class If 1-2 people a custom class/mentoring works great. Farata Systems is a good call in NYC Troy Web Consulting - Albany NY Certified Adobe Instructors + Mentoring This link can help you find a training partner http://partners.adobe.com/public/partnerfinder/tp/show_find.do
RE: [flexcoders] Re: inner classes and static initialization
I think there's Ecmascript history to the actual answer and I'm not enough of a language guy to offer the official answer, but basically, classes are initialized on-demand as they are used by the code. I think you ran into trouble in the setting of the const, not in the construction of the internal class From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cadisella Sent: Wednesday, December 10, 2008 11:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: inner classes and static initialization Thank you, that works. I'm guessing then that the inner classes are treated as globals in the same way that the static data members are, and initialzed after the static data members? It seems that all globals would be initialized before the class itself, as the class itself may (and in my case, did) require the use of them. This is coming from a Java background as well, where that seems to be the case. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: The definition doesn't exist at static initialization time so I think that's expected behavior. You'll see all of our code doing a null test then creating the instance inside of getInstance() From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of cadisella Sent: Tuesday, December 09, 2008 1:50 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] inner classes and static initialization I'm having a strange problem with the use of an inner class and I wanted to see if anyone thought that this was a bug or the correct behavior. Here's my test that shows the problem: package { use namespace MyNamespace; public class InternalClassTest { public static const mtInstance:InternalClassTest = new InternalClassTest(); public static function getInstance():InternalClassTest { return mtInstance; } MyNamespace var mtInternalClass:MyInternal; ! public function InternalClassTest() { mtInternalClass = new MyInternal(); } } } use namespace MyNamespace; internal class MyInternal { } The existence of the static constant that calls the InternalClassTest constructor is where the issue lies. I get this error: TypeError: Error #1007: Instantiation attempted on a non-constructor. at InternalClassTest()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:16] at InternalClassTest$cinit() at! global$ init()[C:\5DCVS_Flex\Testing\src\InternalClassTest.as:5] at TestApp()[C:\5DCVS_Flex\Testing\src\TestApp.as:35] at Testing()[C:\5DCVS_Flex\Testing\src\Testing.mxml:0] at _Testing_mx_managers_SystemManager/create() at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.1.0\frame\ works\projects\framework\src\mx\managers\SystemManager.as:2454] at mx.managers::S! ystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler\ http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\SystemMana\ ger.as:2344] If I remove the call to new MyInternal() from the constructor of InternalClassTest, then I can get the same functionality by implementing the internal class in the following way: internal class MyInternal { { InternalClassTest.getInstance().mtInternalClass = new MyInternal(); ! ; nbsp; } } So the problem seems to be that the MyInternal class has not been initialized when accessing the InternalClassTest class through a static method. The solution is kind of a pain, and certainly not exactly intuitive. From what I can tell it means that no singleton would be able to access an internal class through its constructor. This is in Flex Builder 3.0.1. with the Flex 3.1 SDK. Thanks for any thoughts. Dale
RE: [flexcoders] Re: UIMovieClip shows nondeterministic behaviour
Maybe you can test if getFocus() is contained within and move focus beforehand From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of florian.salihovic Sent: Wednesday, December 10, 2008 10:38 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: UIMovieClip shows nondeterministic behaviour Hi Alex, yes indeed, the object gets removed but i don't know how to identify which component actually is the source of the problem. What gets removed is a composite of components, each skind with a UIMovieClip. Sometimes, when i want to remove it, the error occours. but it is the sometimes, that bugs me. Best regards, Florian --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: The indication is that the object somehow got removed from the displaylist on the mouseDown. From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of florian.salihovic Sent: Wednesday, December 10, 2008 4:11 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] UIMovieClip shows nondeterministic behaviour I have a pretty big application. The app uses various in Flash created components. Everything works fine untill some certain point, which varies from test to test. At some point, my app crashes with a typeerror: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.flash::UIMovieClip/removeFocusEventListeners()[E:\dev\trunk\frameworks\projects\fla sh-integration\src\mx\flash\UIMovieClip.as:2466] at mx.flash::UIMovieClip/focusOutHandler()[E:\dev\trunk\frameworks\projects\flash- integration\src\mx\flash\UIMovieClip.as:2509] at flash.display::Stage/set focus() at mx.core::UIComponent/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\ core\UIComponent.as:6797] at mx.managers::FocusManager/setFocus()[E:\dev\3.1.0\frameworks\projects\framework\sr c\mx\managers\FocusManager.as:396] at mx.managers::FocusManager/mouseDownHandler()[E:\dev\3.1.0\frameworks\projects\fra mework\src\mx\managers\FocusManager.as:1388] The stacktrace is not that helpfull to me... seems a similar problem like: http://bugs.adobe.com/jira/browse/SDK-13182 The error is not reproduceable/hard to reproduce, since it happens randomly when trying to remove some displayobjects... Any infos or help would be appreciated!
Re: [flexcoders] Re: Flex training
Would people recommend taking the Certification Exam from Adobe? From what I hear and looking at the sample questions an experienced dev should ace it without much trouble. I wonder if it is worth the expense and whether its known enough that noting it on a resume carries weight. Thanks, - Ivo From: Anthony DeBonis [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, December 10, 2008 2:04:16 PM Subject: [flexcoders] Re: Flex training If you have a group I would recommend an Adobe Training Class If 1-2 people a custom class/mentoring works great. Farata Systems is a good call in NYC Troy Web Consulting - Albany NY Certified Adobe Instructors + Mentoring This link can help you find a training partner http://partners. adobe.com/ public/partnerfi nder/tp/show_ find.do
[flexcoders] Slider predetermined values
Is it possible to set predefined values for the slider? Say based on the contents of an array or something else Example:? slidersPossiblValues:Array = [2, 3.5, 7, 10, 24]; snapInterval={slidersPossiblValues}
RE: [flexcoders] Re: speed of the for each looping
So don't use for..in or for each... in if you care about the enumeration order. It could very possibly change in future versions of the Flash Player. Gordon Smith Adobe Flex SDK From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Wednesday, December 10, 2008 9:26 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping No enumeration order of for..in is not guaranteed From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, December 10, 2008 8:55 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping Is the enumeration order guaranteed to be the same for for-in and for each as an indexed loop? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato Paus Sent: Wednesday, December 10, 2008 9:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: speed of the for each looping if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
RE: [flexcoders] Re: speed of the for each looping
Yes. This thread has been about choosing between for loops, and speed, and readability have been discussed. Enumeration order is my primary deciding factor (when the option is available, which is not all that often) Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Wednesday, December 10, 2008 6:01 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping So don't use for..in or for each... in if you care about the enumeration order. It could very possibly change in future versions of the Flash Player. Gordon Smith Adobe Flex SDK From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Wednesday, December 10, 2008 9:26 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping No enumeration order of for..in is not guaranteed From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, December 10, 2008 8:55 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: speed of the for each looping Is the enumeration order guaranteed to be the same for for-in and for each as an indexed loop? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato Paus Sent: Wednesday, December 10, 2008 9:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: speed of the for each looping if you need to get the i you can use the getItemIndex::ArrayCollection --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Josh McDonald dznuts@ wrote: *nods* I find that it's often much easier to read when you use for..in and for each..in rather than regular for. And since you need to have a var current = list[i] or similar as the first line, If you only need an index to display, or it's 1-based as opposed to 0-based, using a for [each]..in and having the first inner line be ++idx will be easier to read than a bunch of statements within your loop that look like: var current = foo[i+1] or msg = you're at item # + (i + 1) The thing is, I nearly always find I need that i for something else other than just iterating, so even when I start out with a for each loop, about 80% of the time I wind up switching back so I have that i to get hold of. Since I know that this is quite likely to happen, I just cut to the chase and use the indexed loop. -Amy
Re: [flexcoders] SpringGraph and ArrayCollection
timgerr wrote: Has anyone used an arraycollection with a springgraph? I played around with this just last week for an experiment.. private function init():void { var p:Plan = _plan; _graph = new Graph(); var item:Item = new Item(p.id.toString()); item.data = p; _graph.add(item); add(item, _graph); roamer.currentItem = item; roamer.repulsionFactor = 0.4; roamer.showHistory = true; roamer.itemLimit=1000; } private function add(rootItem:Item, g:Graph):void{ var p:Plan = rootItem.data as Plan; for(var i:int=0; i p.children.length; i++){ var c:Plan = p.children.getItemAt(i) as Plan; var item:Item = new Item(c.id.toString()); item.data = c; g.add(item); g.link(rootItem, item); add(item, g); } } adobe:Roamer id=roamer top=0 bottom=0 left=0 right=0 width=100% height=100% itemRenderer=XMLItemView dataProvider={_graph} repulsionFactor={.75} autoLayout={true} doubleClickEnabled={true} autoFit={true} maxDistanceFromCurrent=10 / HTH. - shaun
[flexcoders] Best Practices: ArrayCollection of custom objects?
I have a class (DataType) that I've written that is intended to be used in an ArrayCollection of these objects (DataTypes). I would like to guarantee that this ArrayCollection can only be populated with objects of the DataType class. My initial thought was to extended the ArrayCollection class in the DataTypes class, then override the addItem() method and change the item:Object argument to item:CustomObject (which extends Object). Evidently this isn't permissible in Flex (we're still using Flex 2 here). Are there any best practices surrounding this task? Can anyone offer some advice on how I should go about ensuring that the objects added to this ArrayCollection are objects of my custom class? Thanks in advance.
[flexcoders] Re: Best Practices: ArrayCollection of custom objects?
Oh, just for clarification, item:CustomObject is actually item:DataType, which extends Object for the purpose I'm concerned with here.
[flexcoders] Creating multiple images and save
Hi all! I'm trying to create an little tool that initially loads an xml file containing the following: root xmlns= settings roundedCorners radius15/radius /roundedCorners dropShadow alpha0.7/alpha distance5/distance color0x00/color bgcolor0xff/bgcolor /dropShadow /settings files file names4.jpg/name folderimages/queue/folder /file file nameIMAGE_10.jpg/name folderimages/queue/folder /file file nameIMAGE_11.jpg/name folderimages/queue/folder /file /files /root Then I take each of those image files, make rounded corners and apply a drop shadow to them. Finally I need to send the created back to the server, but I'm not quite sure how to accomplish that.. Any help is appreciated Best regards Allan Pichler
[flexcoders] Re: AIR 1.5 upgrade issue?
Hi, Not sure if this is your problem, but I recall reading something recently about changes to the HTMLLoader.loadString() method in AIR 1.5. I googled and found this blog post (which offers a solution): http://arunbluebrain.wordpress.com/2008/12/09/changes-to-htmlloaderloadstring-in- air-15/ Cheers, Sunil
[flexcoders] Bindable dictionary
I noticed in the archives that Gordon kindly offered the class below. However, I believe the obvious limitation is that binding will fire for all keys each time that put() is called for one key. Has anyone developed a more sophisticated version in the interim, that is as efficient as separate properties? Thanks! package { import flash.events.Event; import flash.events.EventDispatcher; import flash.utils.Dictionary; public class BindableDictionary extends EventDispatcher { public function BindableDictionary() { super(); } private var dictionary:Dictionary = new Dictionary(); [Bindable(change)] public function get(key:Object):Object { return dictionary[key]; } public function put(key:Object, value:Object):void { dictionary[key] = value; dispatchEvent(new Event(Event.CHANGE)); } } }
[flexcoders] Unable to set up proxy for secure https in Blazeds
I am using Blazeds for the first time... trying to communicate with a secure api - and send a username and password over https, to receive xml response. But there seems to be a security sandbox violation between my flex app. and the Blaze/tomcat server I am using as my proxy on localhost: Connection to https://localhost:8400/Test/messagebroker/httpsecure halted - not permitted from http://localhost:8400/Test/Test-debug/Test.swf How do I get the Flex app. to send Test.swf via a secure channel? Would that solve my problem? Here is an excerpt from my proxy-config.xml: adapters adapter-definition id=http-proxy class=flex.messaging.services.http.HTTPProxyAdapter default=true/ adapter-definition id=soap-proxy class=flex.messaging.services.http.SOAPProxyAdapter/ /adapters default-channels channel ref=my-secure-http/ channel ref=my-http/ /default-channels destination id=photoshelter properties urlhttps://www.photoshelter.com/bsapi/1.1/?auth/url remoteusernameblah/remoteusername remotepasswordblah/remotepassword /properties adapter ref = http proxy/ /destination