[flexcoders] Re: flash builder: how to create an as3 project WITHOUT flex sdk
I may be wrong but I believe this is because MXMLC is used to compile AS projects in Flash Builder and the compiler may change with different versions of Flex. You can always look at the library path for your project to verify whether or not Flex is included in your project (it shouldn't be for AS projects). --- In flexcoders@yahoogroups.com, Ariel J arielj...@... wrote: Update -- From the Flash Builder Help: ActionScript projects Based on the Flash API, not the Flex framework, ActionScript projects let ActionScript developers use Flash Builder to code, build, and debug ActionScript-only applications. Yet, when I create a new AS project, it asks which Flex sdk i want to use. Huh? --- In flexcoders@yahoogroups.com, Ariel J arieljake@ wrote: When I go to the ActionScript 3.0 Reference for the Adobe Flash Platform, I am able to specify filters for the runtime and products. I have specified AIR 2.0 and FP 10.1, Flash CS4, but no Flex. How do I create a project in Flash Builder to match these limitations?
[flexcoders] Re: Adobe AIR - interimittent online/offline storage (à la Google Gears)
I have a similar setup for an app that needs to pull data from a server at certain times. This is not generally critical so the server stuff needs to fail silently and allow the app to continue about it's business. To do this I wrote a ServerMonitor class that wraps air.net.URLMonitor. With URLMonitor you point it at a URL and the object will poll that URL for availability at whatever interval you set. There is a StatusEvent that will be dispatched whenever availability changes. All I do is listen for this event and do things in my app accordingly. --- In flexcoders@yahoogroups.com, mark.embrey mark.c.emb...@... wrote: What is the best way to to store data locally while offline and to automatically detect a connection and sync local data with remote services? thanks!
[flexcoders] Re: TextArea text change event doesn't work in all cases
Maybe Event.CUT or Event.CLEAR? --- In flexcoders@yahoogroups.com, s_grollins s.groll...@... wrote: Hello everyone, I've recently come across a problem wherein we have a textarea with a listener listening for Event.CHANGE events - the problem with this is that an event isn't dispatched when a user selects text in the textarea using their mouse, and then right-clicks and deletes text using the menu. I've tried attaching MouseEvent listeners but have had no luck - does anyone have any suggestions? Am I overlooking something?
[flexcoders] Re: Air File Is Damaged Error
Have you recently changed sign certificates? Had a similar problem when our certain expired. Ended up having to migrate the old one to the new for each update. --- In flexcoders@yahoogroups.com, James garymoorcroft_...@... wrote: Yes but the fact that other air files I make are working shows that it's not a flex/air related problem doesn't it? If it is this though how would I fix it? --- In flexcoders@yahoogroups.com, Johannes Nel johannes.nel@ wrote: one thing which can cause this is if the update.xml file and the air file have different versions. On Fri, Feb 12, 2010 at 2:54 PM, James garymoorcroft_ict@wrote: I keep getting the same The application could not be installed because the AIR file is damaged. etc... message every time I attempt to test the install of an air file I've just made from an application in flex. I've tried exporting other applications for release build and they work fine but it just seems this particular one won't work so I know it's not a flex problem. I've tried starting a whole new project and creating a new app and copying and pasting all of the code from the app I need into this new app and exporting that for release build from there but again I get the same error. Is there any way of finding out what is causing this error and is there a fix for this? -- j:pn \\no comment
[flexcoders] Re: Flex/PHP securing functions
Have you looked into remoting with Zend AMF? When using Zend AMF you can use Zend's authentication features. Examples here: http://framework.zend.com/manual/en/zend.amf.server.html Authentication/access control stuff is at the bottom. --- In flexcoders@yahoogroups.com, Scott h...@... wrote: I've worked a lot with coldfusion and flex using cflogin/roles. I have a project that I'm working on now that the backend will be done in PHP. Since this is a pet project I'm using flash builder 4 to learn before the release (And I'm really liking it!) I've found documentation with connecting flex to php through an httpservice call. I modified this using a php class/function call instead of calling a httpservice. However, this doesn't protect the php functions on the server. Is there a method like the coldfusion cflogin/roles in php? I'm assuming that session information is not available in PHP (as it isn't in coldfusion as well). Thanks Scott
[flexcoders] DateFormatter am/pm returning null
This is a really peculiar problem I'm faced with. I'm using DateFormatter to format a date object into a string (of course) but part of my string comes back null every time. The format string is MM/DD/ L:NN A, which should give something like 01/26/2010 4:16 PM. In my AIR app I end up with 01/26/2010 4:16 null however. This happens with every formatter that uses this format string in this app. To test for a bug in the formatter code I made a separate AIR app and had it format the current date (by using new Date() as the date to format) with the above format string and it worked perfectly. This test fails in the original app. So I think DateFormatter is working just fine. If I get rid of the A on the format string everything works fine, I just don't get am/pm. My data is coming from a local SQLite database and, upon examination in the Flex debugger it looks fine. I'm using Flex 3.4 and my format string is coming from a .properties file (date formats are localized). Anyone have some insight?
[flexcoders] Re: Loading videos/sound in Flex (web) out of a ByteArray
This article may be of some use for Sound: http://www.adobe.com/devnet/flash/articles/dynamic_sound_generation/index.html --- In flexcoders@yahoogroups.com, Mark auroraborea...@... wrote: Hello, I am working on a flex project for my job, and we have seem to of hit a road block. we have two parts to our project, one part which is written in AIR that is used to create case files, which is really just a zip with a XML file and 'assets', as in pictures, text, audio, video, hyperlinks, and whatever else we may want to use in the future The way the zip library we are using works is that we get the individual file information out of the zip by calling a function which returns a ByteArray representation of the data However, our problem is using the limitations of the Flash/Flex Web-browser plugin (not air) which does not have any of the file functions, so we cannot save the files we extract from the zip to the hard drive, (which we do with the AIR portion of the project), we are forced to keep them as ByteArrays. But, we are having problems with a part of our program which previews these assets, namely Audio and Video files in the browser, it appears that the VideoDisplay and Sound classes do not accept ByteArrays, but only streams or a URLbut we cannot give it a URL because we just don't have one, the files are in memory as a ByteArray object. Is there any cool way to convert a ByteArray into a Sound /VideoDisplay that anyone knows of? If not, we are going to have to resort to using an external php script to do the work of unzipping files on the server, which defeats the purpose of having it all in one file anyway. ~Mark
[flexcoders] Re: file extension missing when save the file.
Are you running Windows by chance? I had a problem with missing file extensions on Windows because the system default is to hide extensions for known file types. A quick Google search will tell you how to disable this. Unfortunately there is no way you can know if your users have this enabled or disabled so you need to write some code to handle this possibility. --- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: Hi, I did this var fileRef:FileReference = new FileReference; fileRef.save(bytes, 'books.xls'); but the popup save window only have books. I need the window have books.xls Why the extension is missing.Please help. Thanks Mark
[flexcoders] Re: Escaping slashes in a file name in AIR
I agree that slashes in filename is pretty stupid but it does seem to be how Mac OS handles it and it is what the user expects. If I didn't know better I'd probably expect the same thing. Like I said in my original post: it's a problem that's not a problem and yet it is. Anyway, thanks for the idea but I don't think it will work. Even if I store the original file url and name I'll have no way of knowing if subsequently added slashes are meant to be in the name or should be interpreted as folder. I think the solution is to adjust user expectations. --- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote: I have no idea if this actually would work, but something like this? private var origUrl:String private function saveFile():void { var f:File = new File(); origUrl = f.url; f.addeventlistener(Event.SELECT,onfileselected) f.browseForSave(blah); } private function onfileselected(event:Event) { var f:File = event.target as File; // compare f.url with origUrl to get some sort of relative path in order to escape the path delimiters and save it as a file. } Sorry, I'm just off to bed or I'd run it up, but would be interested to know if it does work at all. Thanks! putting a / in a filename, no matter how it's rendered by the OS seems pretty stupid to me, however. -Original Message- From: flexcoders@yahoogroups.com on behalf of seanmcmonahan Sent: Tue 1/19/2010 7:04 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Escaping slashes in a file name in AIR So this is a problem that's not really a problem yet it is. I think it's best explained with an example: A user wants to save a file so we open the save dialog box via File.browseForSave(). User then selects a folder my folder and types in a name like my/file/with/slashes.txt and hits the save button. What happens is AIR interprets this as save a file slashes.txt in the folder my folder/my/file/with. To me this seems perfectly reasonable and correct. In fact, I would say this IS the correct behavior. However my users feel that what should happen is that a file with the name my/file/with/slashes.txt should be saved out in my folder. I haven't tested on Windows but on Mac OS using Safari and Chrome the user's expected behavior is what happens. In Firefox the slashes are converted to underscores. This leads me to believe that these browsers are all getting the name back and escaping the slashes. In AIR I'm not seeing anyway to get the filename and escape it as the select that is fired when the user clicks save returns a File object with a name property set to slashes.txt -- that is, whatever is after the last slash. Does anyone know how to capture the filename and escape slashes or is that just not going to happen? __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
[flexcoders] Escaping slashes in a file name in AIR
So this is a problem that's not really a problem yet it is. I think it's best explained with an example: A user wants to save a file so we open the save dialog box via File.browseForSave(). User then selects a folder my folder and types in a name like my/file/with/slashes.txt and hits the save button. What happens is AIR interprets this as save a file slashes.txt in the folder my folder/my/file/with. To me this seems perfectly reasonable and correct. In fact, I would say this IS the correct behavior. However my users feel that what should happen is that a file with the name my/file/with/slashes.txt should be saved out in my folder. I haven't tested on Windows but on Mac OS using Safari and Chrome the user's expected behavior is what happens. In Firefox the slashes are converted to underscores. This leads me to believe that these browsers are all getting the name back and escaping the slashes. In AIR I'm not seeing anyway to get the filename and escape it as the select that is fired when the user clicks save returns a File object with a name property set to slashes.txt -- that is, whatever is after the last slash. Does anyone know how to capture the filename and escape slashes or is that just not going to happen?
[flexcoders] Re: File Locked in AIR after Saving File to Local File System using FileReferenc
Since you are using AIR look at using File instead of FileReference. --- In flexcoders@yahoogroups.com, edlueze edlu...@... wrote: Hi Folks: I am trying to use the FileReference.save() function in AIR to save an XML object to the local file system. I'm using the following code: public static function exportAllTablesToLocalFile():void { var xmlAllProjectFiles:XML = ProjectFiles /; //Consolidate all of the Project Files together xmlAllProjectFiles.appendChild( Alerts.xmlAlerts ); xmlAllProjectFiles.appendChild( Charts.xmlCharts ); //etc... var fileReference:FileReference = new FileReference(); //FileReference points to the local file fileReference.save(xmlAllProjectFiles, AllProjectFiles.xml); //Save the table as a local file } This code works perfectly fine, but I've noticed that it will lock the file. Consequently if I try and replace the file the operation will silently fail! The same thing doesn't seem to happen using regular Flex within a browser when I try it with similar test code. Is this a problem with AIR or am I doing something wrong? Should I be closing the file after it's been saved. Should I be doing something with the FileReference complete message? Thanks!
[flexcoders] Re: Anyone using demonsterdebugger ?
Love demonster -- saved butt so many times. I believe you need to initialize the debugger. Something like this (sorry, typing on my phone, don't have the code in front of me); var d:MonsterDebuggrr = new MonsterDebugger(this); where this refers to the application. I'll doublecheck my setup when I get to the office. --- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote: Hi, I've installed the http://demonsterdebugger.com/ and my MonsterDebugger.trace(this, Hello World!); works fine but I can't seem to inspect any objects as explained here... I just get a timeline thing moving along the bottom and the Hello World message is displayed. Is there anything specific I need to do or look out for? Thanks for any help... Cheers, N
[flexcoders] Re: Anyone using demonsterdebugger ?
Yeah, the code I posted earlier is how you setup MonsterDebugger. Here's the link I used to get rolling: http://demonsterdebugger.com/features/howitworks --- In flexcoders@yahoogroups.com, seanmcmonahan s...@... wrote: Love demonster -- saved butt so many times. I believe you need to initialize the debugger. Something like this (sorry, typing on my phone, don't have the code in front of me); var d:MonsterDebuggrr = new MonsterDebugger(this); where this refers to the application. I'll doublecheck my setup when I get to the office. --- In flexcoders@yahoogroups.com, Nick Middleweek nick@ wrote: Hi, I've installed the http://demonsterdebugger.com/ and my MonsterDebugger.trace(this, Hello World!); works fine but I can't seem to inspect any objects as explained here... I just get a timeline thing moving along the bottom and the Hello World message is displayed. Is there anything specific I need to do or look out for? Thanks for any help... Cheers, N
[flexcoders] Re: container layout performance: MXML or ActionScript?
While I don't have any cold hard facts about MXML vs AS performance I'd wager that, all things equal, AS out performs MXML. As far as my practice, I typically use MXML for layout and do everything else in AS. Coming from a web dev/HTML background I find it very easy to visualize a layout written in MXML and feel that any lost performance (which is probably minimal) allows me increased productivity as a developer. --- In flexcoders@yahoogroups.com, zaproheeks zaprohe...@... wrote: Given two almost identical (more on that below) container classes one implemented in MXML, the other in ActionScript, which one is likely to be more performant? I'm not a Flex expert, but I know that even if MXML is ActionScript, there a number of things that are quite different. For instance, the layout of components is entirely taken care by MXML while in AS3 we have to do it by hand. Also binding is much more natural and common in MXML (stuff like property={object.value}) while typically (at least in my code) I have no Bindings in my AS3 classes. Another difference is that if some of the contained objects are affected by runtime conditions, since MXML hides away how the layout is actually performed, I end up doing adjustments on Creation Complete event, which will cause new re-render events. If I had implemented the class directly in AS3 I could have done everything inside createChildren() and maybe it would have been more performant? What's your experience / best practices toward MXML / AS3 containers and conditional layout?
[flexcoders] Re: Localizing Flex App Demos
I found this quite useful: http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Runtime_Localization Currently supporting an app that is in English, German and French using the method described in that article. --- In flexcoders@yahoogroups.com, s_hernandez01 s_hernande...@... wrote: Does anyone know any links that demos and gives a tutorial of an API from google, yahoo, or whoever on localizing a flex app with many languages? -Sal
[flexcoders] AIR App Not Compiling After Updating AIR SDK to 1.5.3
I just updated my AIR SDK to 1.5.3 from 1.5.2 and when I attempt to build my application I get the following error: Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'MyApp'. I've done some searching and not come up with anything. Fortunately I backed up my Flex SDK folder before doing this update (using 3.4). Reverting back to that allows the app to compile. Unfortunately, my signing certificate just expired and though I have a new one I need to use AIR 1.5.3 to migrate properly. Does anyone have any thoughts on what my problem is?
[flexcoders] Re: AIR App Not Compiling After Updating AIR SDK to 1.5.3
Aha! Fnder! Sometimes it's not a lot of fun to be a Windows guy trapped in a Mac office ;) Following this thread on the Adobe forums: http://forums.adobe.com/thread/526625, it seems you cannot just drag and drop the new AIR SDK files in the Finder on Mac OS. You need to use the following command: ditto -V /Volumes/AIR\ SDK /Applications/Adobe\ Flex\ Builder\ 3/sdks/3.4.0 It is well now. --- In flexcoders@yahoogroups.com, seanmcmonahan s...@... wrote: I just updated my AIR SDK to 1.5.3 from 1.5.2 and when I attempt to build my application I get the following error: Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'MyApp'. I've done some searching and not come up with anything. Fortunately I backed up my Flex SDK folder before doing this update (using 3.4). Reverting back to that allows the app to compile. Unfortunately, my signing certificate just expired and though I have a new one I need to use AIR 1.5.3 to migrate properly. Does anyone have any thoughts on what my problem is?
[flexcoders] Re: Encrypt image
SSL will cover you on encrypted transfer. If the stored images are encrypted you might check out something like as3crypto: http://code.google.com/p/as3crypto/. --- In flexcoders@yahoogroups.com, Christophe christophe_jacque...@... wrote: Hello, I am working on a flex medical application. Image are stored on the server and the Flex application display the images. How to encrypt the images when they are transfered on the internet network between the server and the client computer ? Thank you, Christophe,
[flexcoders] Re: language switch on mac does not work?
I'd start by ensuring you have the Greek framework resources setup for Flex (see: http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Runtime_Localization#Huh.3F_French_framework_resources.3F). It's possible that pasting works because you are pasting in UTF-8 characters but typing won't because Flex expects the locale to be whatever it was when you started the app. I used the linked article to setup a localized app (in English, French and German so far) and it was an invaluable resource. Also, the Mac equivalent of Windows' Alt-Shift is Option-Shift. In AIR the key code is the same: Keyboard.ALTERNATE. --- In flexcoders@yahoogroups.com, Fotis Chatzinikos fotis.chatzini...@... wrote: To clarify a bit more I am interested in ALT-SHIFTing (in windows - what is needed on a Mac) into a different language than the default. Foe example from English to Greek, German, or any other 2nd, 3rd ... language. If i copy and paste Greek text into a text box this works.. But typing directly via the keyboard the character set remains English (even though the browser shows Greek as the input...) Anybody from Adobe can throw some light? TIA, Fotis On Mon, Nov 23, 2009 at 3:02 PM, fotis.chatzinikos fotis.chatzini...@... wrote: Hello all, I have tried to google this but I do not seem to find anything... Anyone knows if this is a known bug? Is there a solution? TIA, Fotis
[flexcoders] Re: Any issues with Windows 7(64bit) and Flex Builder
Had an issue when using copylocale.exe with JRE not being installed. Never had this problem on Vista x64 but it was easily fixed by installing Java. Aside from that everything seems fine to me. --- In flexcoders@yahoogroups.com, Jeffry Houser j...@... wrote: I've had no issues. ;) Greg Hess wrote: Hi All, I would like to replace my dev workstation with a farrari, slow compiles are killing me. I have been shopping around and would like to buy a new quad core, 8G ram and Windows 7(64bit) but want to make sure I wont have any issues with my dev tools before making the plunge. Has any one had any issues moving to Windows 7(64bit), it is not listed as a supported OS in the Flex builder system requirements? I am running Eclipse with the Flex builder plugin. Any help much appreciated, Greg -- Jeffry Houser, Technical Entrepreneur Adobe Community Expert: http://tinyurl.com/684b5h http://www.twitter.com/reboog711 | Phone: 203-379-0773 -- Easy to use Interface Components for Flex Developers http://www.flextras.com?c=104 -- http://www.theflexshow.com http://www.jeffryhouser.com -- Part of the DotComIt Brain Trust
[flexcoders] ObjectUtil.copy() and Dictionaries
I have an AIR project setup in Flex Builder 3 that copies a subclass of flash.utils.Dictionary just fine with ObjectUtil.copy() when the target player is set to 9.0.28. However, when the target player is set to 10.0.0 I get the following error when attempting to make a copy: TypeError: Error #1034: Type Coercion failed: cannot convert flash.utils::diction...@2743cf71 to com.elasticsales.utils.ElasticDictionary. Does any one have any insight into why this is happening?
[flexcoders] Re: AIR 1.5.1 Transaction issue: when begin() is called, it doesn't do anything.
I can recommend three things as I've been doing a fair amount of debugging lately: 1) Check out MonsterDebugger for debugging from your release build 2) Try opening your SQLConnection before calling begin(). I think begin opens a connection but I'm not entirely sure. Also try adding an event listener for the open event to ensure your connection is being opened as well. 3) How are you building the release build? Recently I'd experienced some issues related to an Ant build script that targeted Flash Player 10 while the Flex Debugger targeted 9.0.28. Setting the Ant script to target 9.0.28 cleared up my problems. Check this article for details: http://kb2.adobe.com/cps/404/kb404341.html --- In flexcoders@yahoogroups.com, handitan handi...@... wrote: Hi all, I have this weird issue that I am having. I am using transaction on this function call functA(). And functA() has been called many times, the transaction worked perfect. BUT...for a reason that I still don't know, the transaction sometimes will not work. And it seems that this phenomenon only happens on the release build because I couldn't reproduce it at all when I am debugging it. How do I find out that the issue was the transaction on release build? I log the before I call transaction begin, and its result and fault handler. I notice that the begin got called but it never got to neither result nor fault handler, which just baffled me. And I did make sure my transaction listener are NOT using weak references. Here's a snip of the code if you are curious: public class AsyncTransactionClass extends EventDispatcher { public function functA():void { sqlStatement = new SQLStatement; sqlStatement.text = some query; sqlStatement.sqlConnection = a sql connection; sqlStatement.sqlConnection.addEventListener(SQLEvent.BEGIN,transactionSetupResultHandler); sqlStatement.sqlConnection.addEventListener(SQLErrorEvent.ERROR,transactionSetupFaultHandler); sqlStatement.sqlConnection.begin(); } private function transactionSetupResultHandler(pEvent:SQLEvent):void { trace(I AM AT RESULT); } private function transactionSetupFaultHandler(pEvent:SQLErrorEvent):void { trace(I AM AT FAULT); } } Does anyone else have this problem? I am really out of ideas now on how to solve this. Thank you.
[flexcoders] Re: multiple filter function of combobox and two checkboxes
While I don't have an example handy I can hopefully put you on the path. First thing, it doesn't matter what controls you are using to set the filter: the filter will function in the exact same way. For CheckBox and ComboBox you pretty much just listen for the change event and filter when the event fires. Another thing to note is that ArrayCollection is basically just a wrapper for Array. So you can easily convert your ArrayCollection to an Array by calling the toArray method and then take advantage of Array's filter method (http://livedocs.adobe.com/flex/3/langref/Array.html#filter%28%29). When you're done just convert your Array back to an ArrayCollection with a statement like new ArrayCollection(myFilteredArray). --- In flexcoders@yahoogroups.com, stinasius stinas...@... wrote: hi guys, this is the biggest obstacle i have face ever since i started coding in flex. i kindly ask for an example of filtering an array collection using two checkboxes and a combobox. thanks
[flexcoders] AIR Ant Build Script
So I posted a question about Ant build scripts for AIR a few weeks ago and got some great answers, so here's another one. I have an Ant build script that I'm using to build my AIR project. It builds everything and packages the application just fine. The app runs with no noticeable problems until you try to do any serialization with a class we have: ElasticDictionary. This class merely extends flash.utils.Dictionary with some convenience methods (like length() -- code is below). I have the [RemoteObject] metadata and this works flawlessly when the project is run from the Flex Builder debugger. It also works perfectly when the release build is exported via the Flex Builder Export Release Build... dialog. So my question is: what am I missing in my Ant build script that Flex Builder does for me? The class, ElasticDictionary, is in the project's src folder and I'm using the 3.4 SDK. Relevant (at least what I *think* is relevant) code below. Thanks in advance for your help! Ant Build Script: exec executable=${MXMLC} failonerror=true arg value=-debug=false/ arg value=+flexlib=${SDK_HOME}/frameworks/ arg value=+configname=air/ arg value=-file-specs=${MAIN_SOURCE_FILE}/ arg value=-output=${BUILD_DIR}/${APP_ROOT_FILE}/ arg value=-keep-as3-metadata+=RemoteClass/ arg value=-library-path+=${SDK_HOME}/frameworks/libs/ arg value=-library-path+=${SDK_HOME}/frameworks/libs/air/ arg value=-include-libraries=${LIBS_DIR}/applicationupdater.swc/ arg value=-include-libraries=${LIBS_DIR}/Degrafa_Beta3.1_Flex3.swc/ arg value=-locale=en_US,fr_FR,de_DE/ arg value=-source-path=${LOC_DIR}/{locale}/ arg value=-source-path=${PROP_DIR}/ /exec SDK_HOME refers to the location of the Flex 3.4 SDK. LIBS_DIR points to the project's SWC's. LOC_DIR to localization files; PROP_DIR to properties (.properties) files. --- The ElasticDictionary class: /** * Used instead of ordinary dictionaries so that their data type can be preserved when saving in a serailized format */ package com.project.utils { import flash.utils.Dictionary; [Bindable] [RemoteClass] public dynamic class ElasticDictionary extends Dictionary { public function ElasticDictionary(weakKeys:Boolean=false) { super(weakKeys); } public function get length():uint { return getKeys().length; } public function getKeys():Array { var keys:Array = new Array(); for(var key:Object in this) { keys.push(key); } return keys; } public function getValues():Array { var values:Array = new Array(); for(var key:Object in this) { values.push(this[key]); } return values; } } }
[flexcoders] Re: SharedObject problem/bug? Cannot store a subclass of ByteArray.
I'm having a similar problem with a subclass of Dictionary. Unfortunately I haven't has an opportunity to try this fix yet, but maybe you'll find it useful: http://stackoverflow.com/questions/850466/properly-serializing-flash-utils-dictionary-to-a-sharedobject --- In flexcoders@yahoogroups.com, Geoffrey geoff...@... wrote: Muzak, thank you for your help. However, I have already tried [RemoteClass] (which I mentioned in the original post). I also looked at the link that you provided and decided to try more combinations, but none worked. I have tried [RemoteClass] with and w/o [Bindable], [RemoteClass(alias=ByteArrayPlus)], and I made sure to use my class beforehand. In all cases I can get a custom class to retain its type, but ByteArrayPlus always gets read as ByteArray from the SharedObject. I believe this may be a problem peculiar to ByteArray, but I don't know exactly why that would be so. Again, the challenge is this: make any class that extends ByteArray, write it to a SharedObject (to the disk), read it from the SharedObject, and have it retain its class. I know it sounds straightforward, but I cannot get it to work. --Geoff --- In flexcoders@yahoogroups.com, Muzak p.ginneberge@ wrote: Add a RemoteClass metadata tag to the custom class: Example at the bottom of the article http://cookbooks.adobe.com/post_How_to_keep_the_type_of_your_objects_when_serializ-8323.html - Original Message - From: Geoffrey geoffhom@ To: flexcoders@yahoogroups.com Sent: Wednesday, October 28, 2009 12:45 PM Subject: [flexcoders] SharedObject problem/bug? Cannot store a subclass of ByteArray. Hi, I have a subclass of ByteArray (let's call it ByteArrayPlus), which I want to write to a SharedObject. I can store it fine, but when I read it back, it says it's of type ByteArray, not ByteArrayPlus. Does anyone have an idea what may be wrong? Has anyone gotten this to work? FYI, I am already using registerClassAlias(). And it works fine with a custom class, and with a custom class extending another custom class. I also tried implementing IExternalizable, but that did not help. I also tried [RemoteClass] and [RemoteClass(alias=ByteArrayPlus)]. Also, ByteArrayPlus is really simple: I only added a String (name) to it. This is my first post to FlexCoders. Any help appreciated. --Geoff
[flexcoders] [Resolved] Re: AIR Ant Build Script
Found a few resources on this: 1) http://kb2.adobe.com/cps/404/kb404341.html 2) http://74.125.93.132/search?q=cache:w_Jda-ZeRfUJ:www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/+flex+builder+release+build+optionscd=7hl=enct=clnkgl=usclient=safari What I ended up doing was dumping the config xml from Flex Builder and from Ant and noticed that the difference was that FB targeted Flash Player 9.0.28 while Ant targeted 10. Switching Ant to target 9.0.28 resolved the issue. Of course this raises the issue: why does this work in 9.x but not 10. --- In flexcoders@yahoogroups.com, seanmcmonahan s...@... wrote: So I posted a question about Ant build scripts for AIR a few weeks ago and got some great answers, so here's another one. I have an Ant build script that I'm using to build my AIR project. It builds everything and packages the application just fine. The app runs with no noticeable problems until you try to do any serialization with a class we have: ElasticDictionary. This class merely extends flash.utils.Dictionary with some convenience methods (like length() -- code is below). I have the [RemoteObject] metadata and this works flawlessly when the project is run from the Flex Builder debugger. It also works perfectly when the release build is exported via the Flex Builder Export Release Build... dialog. So my question is: what am I missing in my Ant build script that Flex Builder does for me? The class, ElasticDictionary, is in the project's src folder and I'm using the 3.4 SDK. Relevant (at least what I *think* is relevant) code below. Thanks in advance for your help! Ant Build Script: exec executable=${MXMLC} failonerror=true arg value=-debug=false/ arg value=+flexlib=${SDK_HOME}/frameworks/ arg value=+configname=air/ arg value=-file-specs=${MAIN_SOURCE_FILE}/ arg value=-output=${BUILD_DIR}/${APP_ROOT_FILE}/ arg value=-keep-as3-metadata+=RemoteClass/ arg value=-library-path+=${SDK_HOME}/frameworks/libs/ arg value=-library-path+=${SDK_HOME}/frameworks/libs/air/ arg value=-include-libraries=${LIBS_DIR}/applicationupdater.swc/ arg value=-include-libraries=${LIBS_DIR}/Degrafa_Beta3.1_Flex3.swc/ arg value=-locale=en_US,fr_FR,de_DE/ arg value=-source-path=${LOC_DIR}/{locale}/ arg value=-source-path=${PROP_DIR}/ /exec SDK_HOME refers to the location of the Flex 3.4 SDK. LIBS_DIR points to the project's SWC's. LOC_DIR to localization files; PROP_DIR to properties (.properties) files. --- The ElasticDictionary class: /** * Used instead of ordinary dictionaries so that their data type can be preserved when saving in a serailized format */ package com.project.utils { import flash.utils.Dictionary; [Bindable] [RemoteClass] public dynamic class ElasticDictionary extends Dictionary { public function ElasticDictionary(weakKeys:Boolean=false) { super(weakKeys); } public function get length():uint { return getKeys().length; } public function getKeys():Array { var keys:Array = new Array(); for(var key:Object in this) { keys.push(key); } return keys; } public function getValues():Array { var values:Array = new Array(); for(var key:Object in this) { values.push(this[key]); } return values; } } }
[flexcoders] Re: bytearray.readObject doesn't convert my objects back
Do you think the class being dynamic is causing this issue? I ask because I have a similar problem with a dynamic class that extends Dictionary. It works fine in Flash Player 9.0.28 but not in 10. --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Yeah, I think that's because Proxy is an odd beast. It is dynamic and can have any property and you're responsible for implementing all those methods that help iterate the object. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of flexaustin Sent: Friday, October 30, 2009 9:40 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: bytearray.readObject doesn't convert my objects back Can't even use an JSON encoding at com.adobe.serialization.json::JSONEncoder/objectToString() jason --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, flexaustin flexaustin@ wrote: What about using the JSONEncoder and JSONDecoder? Will I have the same issue? Jason --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, flexaustin flexaustin@ wrote: Just realized need return type. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, flexaustin flexaustin@ wrote: Getting error 1144: Interface method readExternal in namespace flash.utils:IExternalizable is implemented with an incompatible signature public class Data extends EventDispatcher implements IExternalizable public function writeExternal(output:IDataOutput) { output.writeObject(_nodes); output.writeObject(_edges); output.writeObject(_span); output.writeObject(_groups); output.writeObject(_root); output.writeObject(_tree); } public function readExternal(input:IDataInput) { _nodes = input.readObject(); _edges = input.readObject(); _span = input.readObject(); _groups = input.readObject(); _root = input.readObject(); _tree = input.readObject(); }
[flexcoders] Re: Delay / Pause between script executions
You definitely want to use Timer here. When you create a timer you can set the interval for the timer and you can set the number of times you want the timer to execute. Using your example you'd get something like: myTimer = new Timer(5000, 3); This will create a timer that executes every 5 seconds and it will do this three times. Now you need two event handlers to handle the actual code execution. Timer has two events of interest timer and timerComplete. TimerComplete is dispatched on the final execution of the timer (based on how many iterations you set). Timer is dispatched on every other execution. So wire up some event listeners for these two events and you're pretty much in business. The only other thing you might need to know is what iteration the Timer is on. Fortunately Timer has a property, currentCount, that tells you the current iteration. You can access this in your event handler by reading event.target as this will be pointing to your Timer object. Check out the livedocs page for any details I missed: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/Timer.html --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Hi Flexcoders, I know this may sound very elementary but I cannot figure the hell out of me how to achieve this. I have a label control. I want to display different messages after every 5 seconds, such as: myLabel.text = This is my first message // Need to delay for about 5 seconds here myLabel.text = This is my second message // Need to delay for about 5 seconds here myLabel.text = This is my last message I cannot figure out how to properly use the pause or timer utilities in achieving this. Any idea would be appreciated. Thanks. Regards, Angelo
[flexcoders] Re: Passing associative array to custom component
In your example, switch the curly braces ( { ) with the square braces ( [ ). --- In flexcoders@yahoogroups.com, icepero icep...@... wrote: I built a custom button component and it has a property that accepts an array of values. In the main.mxml file, how can I pass an array when defining the property? main.mxml has this button code: comp:updateButton id=update cubeName={_cubeName} viewName={_viewName} serverChartId={_serverChartId} titleDims=xxx enabled=false/ for title dims, I tried: titleDims=[{Month: comboBox1.text, Year:comboBox2.text, Sales Order:comboBox3.text}] but I get a 1084: Syntax error: expecting rightparen before colon The keys will have spaces in them like 'Sales Order' How can I declare the array in mxml?
[flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
Using Flex Builder 3 I had to add the leading slash to Embeds when using Ant as well. I'm pretty sure one of the previous posters is right: it's all about the paths and FB does some magic behind the scenes (adds a leading slash perhaps?) that Ant doesn't. --- In flexcoders@yahoogroups.com, Josh On j...@... wrote: Thanks, I had the problem which prevented ant from seeing the asset files, and that was fixed by adding a slash to the front of the asset path. That problem caused a compile error. This error only happens at run-time and only after compiling with recent builds using ant. I also tried using flex tasks and it produced the same runtime errors. It all works perfectly when I compile using flex_sdk_4.0.0.7219, with ant or otherwise. Josh From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of ag_rcuren Sent: Thursday, October 15, 2009 5:57 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK? I had this problem once and it turns out that when you are using Flex builder it does some magic to the build path. This does not happen when you build with ant and I had to move some files around so that mxmlc could find everything. I believe that mxmlc can only see the src path and its sub directories, someone correct me if I am wrong. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail josh@ wrote: It works when compiling using interface in flex - using all sdks. I get the problem when I compile using ANT, so it is most likely my own doing. My build.properties file: SRC_DIR = ${basedir} DEPLOY_DIR = ../bin-debug # Flex 4-Beta 2 4.0.0.10485 Tue Sep 22 2009 # Flex 4-Beta 1 4.0.0.7219 Wed May 13 2009 # FLEX_HOME = C:\\flex_sdk_4.0.0.10547 # FLEX_HOME = C:\\flex_sdk_4.0.0.7219 # FLEX_HOME = C:\\flex_sdk_4.0.0.10485 # FLEX_HOME = C:\\flex_sdk_4.0.0.10988 FLEX_HOME = C:\\flex_sdk_4.0.0.10963 MXMLC_EXE = ${FLEX_HOME}\\bin\\mxmlc.exe FLASHPLAYER_EXE = ${FLEX_HOME}\\runtimes\\player\\10\\win\\FlashPlayer.exe FLEX_TASK_JAR = ${FLEX_HOME}\\ant\\lib\\flexTasks.jar My build.xml: ?xml version=1.0 encoding=utf-8? project name=EmbedTest basedir=../src/ property file=../build/build.properties / echoMXMLC_EXE: ${MXMLC_EXE}/echo !-- - CLEAN - deletes all files from bin-debug -- target name=clean delete includeemptydirs=true fileset dir=${DEPLOY_DIR} includes=**/*/ /delete /target !-- COMPILE -- target name=compile_embed_test echoCOMPILE/echo exec executable=${MXMLC_EXE} dir=${basedir} failonerror=true arg line='${SRC_DIR}\EmbedTest.as' / arg line=-o '${DEPLOY_DIR}\EmbedTest.swf' / arg line=-debug / /exec /target !-- LAUNCH -- target name=launch echoLAUNCH/echo exec executable=${FLASHPLAYER_EXE} errorproperty=trace.output arg line='${DEPLOY_DIR}\EmbedTest.swf' / /exec /target target name=clean compile launch depends=clean,compile_embed_test,launch/ /project The source: package { import flash.display.Bitmap; import flash.display.Sprite; public class EmbedTest extends Sprite { [Embed(source='/image_assets/ui/arrow.gif')] private static var Arrow:Class; public function EmbedTest() { var arrow_bm:Bitmap = new Arrow(); addChild(arrow_bm); } } } I still get the same results as below when using ant with these parameters. Any thoughts appreciated. Josh --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail josh@ wrote: Hi, I am embedding a graphic at compile using the Embed metatag in an AS3 project using Flash Builder 4. It compiles in both Beta 1 (build 4.0.0.7219) and Beta 2 (Flex 4-Beta 2 4.0.0.10485) - but in beta 2 it throw runtime errors. Here is how I embed:[Embed(source='/image_assets/ui/arrow.gif')] //the first slash is necessary for the compilerprivate static var Arrow:Class; Here is how I use the asset:new Scrollbar.Arrow() // as a Bitmap This is the runtime error I get after compiling with no errors in 4.0.0.10485 and later:VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.ReferenceError: Error #1065: Variable Scrollbar_Arrow is not defined. Has the method for embedding assets changed in an Actionscript project? Or am I missing something? likely! Thanks, Josh
[flexcoders] Re: ADOBE AIR: Is it possible to move some files to appStorage during installati
Just had to deal with this myself recently. There is no way to do this during install which leaves you with a couple of options: 1) Do a test to see if it's the first time the application has been run and copy the files to app storage 2) Test for the existence of the files in app storage, if they don't exist, copy them from the app directory. #1 is basically a more complicated version of #2 so I'll just give you the quick and dirty #2 version: This code is in my SQLService class. This is just the class I use to handle all my SQL stuff. _dbFile = File.applicationStorageDirectory.resolvePath(_dbPath); _dbTemplateFile = File.applicationDirectory.resolvePath(_dbPath); // If the file does not exists in storage or the one in the application directory is newer, copy it from the applciation directory if(!_dbFile.exists || (_dbTemplateFile.modificationDate _dbFile.modificationDate updateDbFile)) { _dbTemplateFile.copyTo(_dbFile, true); } This post should help you with the first run part: http://www.mikechambers.com/blog/2007/11/07/detecting-whether-an-air-application-has-run-before/ Adobe has a resource about this as well (that's what I used) but I cannot find it at the moment and my bookmark is on my work computer. --- In flexcoders@yahoogroups.com, handitan handi...@... wrote: Ugh, I just tried moving file programmatically from app to appStorage. It gave me security error. Please enlighten me. --- In flexcoders@yahoogroups.com, handitan handitan@ wrote: Hi all, To my knowledge, it's not possible unless it's being done through programmatically. I have some sqlite DBs as part of my AIR package. I would like to have those DBs completely moved to the application storage when the package is installed on my client computer. Any ideas? Thx!
[flexcoders] Re: Key Return for button
If you are using Form defautButton is the easiest way to go. Otherwise listening for the key down or key up events is what you want to do. --- In flexcoders@yahoogroups.com, Christophe christophe_jacque...@... wrote: Hello, I have a button on a page of a flex application. I want that a press on the key Return has the same effect as a click on the button. How to do that ? Thank you, Christophe,
[flexcoders] Re: change decimal separator to comma on input field
Try listening for TextInput's valueCommit event. In you event handler do the number formatting. --- In flexcoders@yahoogroups.com, awesome cubesp...@... wrote: Hi, I am banging my head for a couple of hours with this problem and i'm drawing a blank. Please anyone for some help on this subject.. I have a form which is updating mysql table with one of the columns named 'price' with data type decimal(5,2). In flex i used php service generator to create php for crud db operations. Everything works except i cannot enable input with decimal symbol comma instead of dot. valueObjects:Products id=products price={parseFloat(priceTextInput.text)} / mx:NumberFormatter id=euroPriceInput precision=2 rounding=none decimalSeparatorFrom=, decimalSeparatorTo=. useThousandsSeparator=false / mx:TextInput id=priceTextInput text={euroPriceInput.format(products.price)} width=200/ If I type price in format 12.34 it updates correctly but when I use 12,34 it saves 12,00. Use of numberformatter does not make a difference. What am I missing? Thank you in advance. -- View this message in context: http://www.nabble.com/change-decimal-separator-to-comma-on-input-field-tp25780609p25780609.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: New to FlexBuilder Development Tool
Not sure if that demo uses the Flex charting components, but another thing to be aware of is that charting is only available in Flex Builder Professional. I think you get a 30 or 60 day demo so if you just installed that shouldn't be the problem. --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Finally, I got my own FlexBuilder standard edition. I am quite new to this tool. I have mostly developed apps by simply using the command line compiler. I am browsing for some examples to load to my FB3 and I found this example: http://demo.quietlyscheming.com/ChartSampler/app.html As you can see from this site, the source can be downloaded (zip file). I have already downloaded the zip file and was trying to load it through FB3 via menu item - File | Import | Flex Project but it gives me the message that it is not a valid Flex Project. Next that I did was to simply unzip the file and copy the source codes (including the directory structure of those in the zip) and placed them into the source folder (SRC) of the New Flex Project which I created. When I try to run the application, it gives me a message saying Errors exist in required project(s): ChartSampler Proceed with Launch? How would I be able to load properly all the components which I have downloaded from the demo site and run it successfully? Am I missing something? Thanks.
[flexcoders] Re: Ant Task to Build Air Package
SUCCESS!! Thanks so much! This worked perfectly for me. --- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote: I have this : java jar=${ADT.JAR} fork=true failonerror=true arg value=-package/ arg value=-storetype/ arg value=${STORETYPE}/ arg value=-keystore/ arg value=${AIR_CERT_PATH}/ arg value=-keypass/ arg value=${KEY_PASSWORD}/ arg value=-storepass/ arg value=${KEY_PASSWORD}/ So it looks like I'm using -keypass as well as -storepass , with the same password. No idea why! I built this script over a year ago, so have completely forgotten the whys and wherefores, but it's still working for me without asking for any passwords. Hope that helps. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of seanmcmonahan Sent: 28 September 2009 20:18 To: flexcoders@yahoogroups.com Subject: [flexcoders] Ant Task to Build Air Package I'm working on an Ant build script to build and package my Air application. So far it works pretty well except I cannot get the script to use the password for the signing certificate. ADT is invoked like this: java jar=${ADT.JAR} fork=true failonerror=true arg value=-package/ arg value=-storetype/ arg value=${STORETYPE}/ arg value=-keystore/ arg value=${KEYSTORE}/ arg value=-storepass/ arg value=${STOREPASS}/ arg value=${AIR_NAME}/ arg value=${BUILD_DIR}/temp-app.xml/ !-- Copy the main SWF -- arg value=-C/ arg value=${BUILD_DIR}/ arg value=${APP_ROOT_FILE}/ !-- Copy the assets -- arg value=-C/ arg value=${RELEASE_DIR}/ arg value=assets/ /java When I run the script from Flex Builder everything works fine until, I presume, it gets to the storepass. If I run this build from the Termninal on Mac OS I can manually type in the password when the build script gets to the storepass and then the script will complete the build. So my build script mostly works, anyone have any thoughts on how to get it to entirely work? Ideally I'd like to be able to run the script from Flex Builder, but using the Terminal or Command Prompt is fine as well, I just don't want to have to type the password in for the certificate. Thanks! __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
[flexcoders] Ant Task to Build Air Package
I'm working on an Ant build script to build and package my Air application. So far it works pretty well except I cannot get the script to use the password for the signing certificate. ADT is invoked like this: java jar=${ADT.JAR} fork=true failonerror=true arg value=-package/ arg value=-storetype/ arg value=${STORETYPE}/ arg value=-keystore/ arg value=${KEYSTORE}/ arg value=-storepass/ arg value=${STOREPASS}/ arg value=${AIR_NAME}/ arg value=${BUILD_DIR}/temp-app.xml/ !-- Copy the main SWF -- arg value=-C/ arg value=${BUILD_DIR}/ arg value=${APP_ROOT_FILE}/ !-- Copy the assets -- arg value=-C/ arg value=${RELEASE_DIR}/ arg value=assets/ /java When I run the script from Flex Builder everything works fine until, I presume, it gets to the storepass. If I run this build from the Termninal on Mac OS I can manually type in the password when the build script gets to the storepass and then the script will complete the build. So my build script mostly works, anyone have any thoughts on how to get it to entirely work? Ideally I'd like to be able to run the script from Flex Builder, but using the Terminal or Command Prompt is fine as well, I just don't want to have to type the password in for the certificate. Thanks!