Re: [flexcoders] Re: New Flex Mapping Framework
+1 on that, very nice. On Tue, Aug 24, 2010 at 10:00 AM, Ariel J arielj...@yahoo.com wrote: Bravo, this is very nice. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, bryan.dresselhaus bryan.dresselh...@... wrote: Hey guys, Just wanted to let you know about a new Flex Component Framework I've been working on for the last year or so. Its for building rich, interactive polygon based maps. It differs from a lot of mashup techniques that leverage google maps or mapquest in that its fully client side driven and offers a lot of flexibility and creativity. Please let me know what you think of the demo and documentation. http://www.libertyvanguard.com/liberty-gis Demo: http://www.libertyvanguard.com/applications/LibertyGISDemo/LibertyGISDemo.html Documentation: http://www.libertyvanguard.com/documentation/LibertyGIS-asdoc/index.html Regards, Bryan Dresselhaus
Re: [flexcoders] OpenResource in FlashBuilder 4
Maybe try re-setting the shortcut in Preferences General Keys to what you want? Tim On Fri, Aug 20, 2010 at 12:50 PM, flexcodemonkey michael_reg...@dell.comwrote: Anyone know how to get the keyboard shortcut ctrl+shift+R for Open Resource to work in Flash Builder 4?!? Under the Navigate menu in the Flash Perspective ,there is two menu items. One is being created by the Flash Navigation. But, I am unable to disable this via customizing the Flash perspective as Flash Builder will not let me select OK and save my changed if I unselect Flash Navigation. Hmm... Really annoying not to have the keyboard shortcut work...
Re: [flexcoders] DataProvider in AdvancedDataGrid itemRenderer
Try {outerDocument.list} or {parentDocument.list} ? http://flextips.corank.com/tech/framed/using-parentdocument-or-outerdocument- Tim On Aug 6, 2010, at 10:44 AM, Davis Ford davisf...@zenoconsulting.biz wrote: Can someone tell me what's wrong with this code? It generates the error: 1120: Access of undefined property list List exists, but it seems like the scope of the DropDownList can't see it? I've seen other example like this...how can I bind to the dataProvider on the list if the property/var lives in the parent container? ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx= http://ns.adobe.com/mxml/2009 http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx minWidth=955 minHeight=600 fx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var list:Array = [one, two, three]; ]] /fx:Script mx:AdvancedDataGrid id=grid width=100% height=100% mx:columns mx:AdvancedDataGridColumn mx:itemRenderer fx:Component s:DropDownList dataProvider = {list}/ /fx:Component /mx:itemRenderer /mx:AdvancedDataGridColumn /mx:columns /mx:AdvancedDataGrid /s:Application
Re: [flexcoders] Flex 4 Spark HSlider ThumbSkin with ellipses?
The thumb graphic is a Rect/ whose radiusX/radiusY settings make it appear circular, e.g.: s:Rect height=20 width=20 radiusX=10 radiusY=10 s:stroke s:SolidColorStroke caps=none color=#5380D0 / /s:stroke s:fill s:SolidColor color=#ff/ /s:fill /s:Rect The HSliderThumbSkin.mxml file contains this kind of markup in the !-- fill -- section. -Tim On Tue, Jun 1, 2010 at 8:34 AM, turdontherun flexmonkeypatc...@gmail.comwrote: Hi. I am having trouble locating the HSlider Skin classes (for Flex 4 Spark component) that use an ellipse for the thumb. All the classes I find in the SDK source seem to be using rects? Am I delusional? Anyone have any ideas where the source for this is? (I am trying to create a derivative skin and the HSlider skins are where I want to start from...however, the source for the skins that I can find don't look like what I am seeing in a compiled app.) Thanks, -Kyle
Re: [flexcoders] Flex 4 Release - Anyone else having issues?
baseColor was changed to chromeColor in the Flex 4 SDK. Tim On Tue, Mar 23, 2010 at 7:54 AM, Deane Venske de...@venske.net wrote: Hi Mark, I caught that one (it made 100% sense to me that change) my issue is that baseColor seems to not be a valid attribute on UI components that have always had that. Any ideas on that? Thanks, Deane On 3/23/2010 8:36 AM, mark.jonk...@comcast.net wrote: Hi Deane do a quick search across all your mxml files and in the namespace declarations, replace any that look like this: xmlns:mx=library://ns.adobe.com/flex/halo with xmlns:mx=library://ns.adobe.com/flex/mx The /halo got replaced with /mx sometime around beta 2. Sincerely Mark R. Jonkman - Original Message - From: Deane Venske de...@venske.net To: flexcoders@yahoogroups.com Sent: Tuesday, March 23, 2010 10:31:16 AM GMT -05:00 US/Canada Eastern Subject: [flexcoders] Flex 4 Release - Anyone else having issues? Hi guys, Not sure if anyone else is getting similar issues to me. I installed the release version of the trial (after stupidly removing the beta) and I am finding unending issues. Things like baseColor not being able to be resolved or 'backgroundAlpha' is only supported by type X with the thems(s) 'halo'. What is driving me insane is I refactored this app last week to start from scratch in flash builder 4, so that I could get rid of a lot of my spaghetti code. I just can't understand how you go from B2 to release and change this much... Thanks, Deane
Re: [flexcoders] flexbuilder wierdness...
You might look at mx:RadioButtonGroup as an example of a non-visual component that contains visual sub-components. http://livedocs.adobe.com/flex/3/langref/mx/controls/RadioButtonGroup.html Although after reading the API description it sounds like it might have a special relationship with the compiler. Fwiw. Tim On Tue, Mar 16, 2010 at 7:31 PM, aceoohay pa...@compuace.com wrote: I am trying to work with what looks like a decent footer datagrid component from http://code.seanhess.net/?p=17cpage=2#comment-3502 I runs quite nicely, but wreaks havoc on flexbuilder 3. The demo when edited in design mode of FB3 will not allow the selection of anything but the footer component, and that piece it claims is not a visual component which I am sure it is not. If I comment It seems as though the footer sub-component is defined using a setter/getter. I suspect the footer sub-component is similar to the columns sub-component of the datagrid, in that it isn't itself a visual component, but can contain them. I further suspect that it is not defined correctly, and may need metadata or something to tell FB3 how to deal with it. Anybody with any ideas on how to modify this component to work play well with FB3? Or general pointers on how to create a non visual sub-component that contains visual sub-components? I have looked at and used the Alex Harui's footer grid, and the syntax is cumbersome and counter intuitive and a bit dodgy in some aspects. I seen the derivative works but they use the same syntax. Paul
Re: [flexcoders] Re: Httpservices as3 class
Do I infer correctly that your HTTPService is working properly but that you're having problems when binding the results to the GUI? You can see the data that has been returned? Are you using ResultEvent or AsyncResponder? If you're using AsyncResponder with the public release of the beta, note below: // these handlers stubs are necessary because of Adobe bug http://bugs.adobe.com/jira/browse/SDK-22883 protected function onFaultEventHandler(e:FaultEvent): void{}; protected function onResultEventHandler(e:ResultEvent):void {}; overrideprotected function onResult(e:ResultEvent , token:Object=null):void { var ans: String = decodeURI(e.result.toString());// UTF-8 to string // I am using JSON, not XML, and here the results are converted to an ArrayCollection // and then an event is dispatched which the GUI is listening for, passing the ArrayCollection } } Regards Tim Romano On 3/9/2010 10:00 AM, valdhor wrote: Does anybody have a httpservice class, implemented in as3, for flahs builder 4? I am trying to create an application in as3, connecting and returnig dynamic data from php... So I need to have my hhtpservice created at runtime and calling my data functions dynamically... snip I tried to created one, but I have some problems when loading and setting data to my dataproviders...
Re: [flexcoders] Need to filter UTF-8 characters from string
On 3/9/2010 2:29 AM, flex flex wrote: I have a string of which contains lots of special characters from different standerds. I want to filter the string and want only those characters which are supported by UTF-8. Does anyone have any idea for this? I have a sample string as- !#x22;#$%#38;#x27;()*+,-./0123456789:;#x3C;=#x3E;@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#x22;#x27;#38;#x3C;#x3E;¡¢£¤¥¦§¨©ª#x22;®¯°±²³´µ·¸¹º#x22;¼½¾¿×÷ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿOEoeS(s(Yf^~--#x27;#x27;,#x22;#x22;#x22;+++o...0/00EUR^(TM) http://en.wikipedia.org/wiki/UTF-8 Regards Tim Romano
Re: [flexcoders] Re: Capturing and Saving an image in Flex (BitmapData)
You could then create a URLRequest object, which specifies the POST URL and the byte array of image data you want to send. (See http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequest.html#data).Youcan then pass the URLRequest object to a URLLoader to do the actual sending/loading etc. Tim On Fri, Mar 5, 2010 at 8:50 AM, Wally Kolcz wko...@isavepets.com wrote: I have this so far. Where I have the ?? is where I would like to know a way to either transfer the newly created image to a folder on the server...or I am at the point I could just let them download it/save it and then reupload it (dont prefer that). public function saveImage():void { var bitmapData:BitmapData = new BitmapData(canvas.width, canvas.height); var rightNow:Date = new Date(); bitmapData.draw(canvas,new Matrix()); var bitmap : Bitmap = new Bitmap(bitmapData); var jpg:JPEGEncoder = new JPEGEncoder(); var ba:ByteArray = jpg.encode(bitmapData); ??(UserDataModel.getInstance().person.username + '-' + rightNow + '.jpg'); Alert.show(Your image has been saved and is in your photo gallery, Image Saved); } On 3/5/2010 10:21 AM, Michael wrote: In order to save the image file to disk, you need to use the AIR File API, which is available only to AIR applications. You can capture the image, encode it as PNG or JPEG using mx.graphics.codec.JPEGEncoder or mx.graphics.codec.PNGEncoder, then upload the resulting byte to a server. Then your server application can save the file to disk on the server. I found these two links helpful: http://stackoverflow.com/questions/780018/in-flex-how-do-i-create-populate-and-display-a-bitmap http://blog.everythingflex.com/2008/02/25/create-images-with-air-and-jpegencoder/ Hope this helps, Michael Portuesi --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Wally Kolcz wko...@... wko...@... wrote: Can someone point me to an example of using the BitmapData.draw() to capture an image of a container on the screen and save it to the harddisk of the server. I see some that show me how to capture and process the image, but the saving it to the server is a mystery. I want my kids to be able to save their drawings/colorings to the web site art gallery. Thanks!
[flexcoders] My Flex app seems to have stopped working in Firefox after installing latest Windows security patches
This morning I installed several Windows XP and IE security patches (list below). The Flex app I've been developing, which uses HTTPService to get JSON-formatted results from a webservice, seems to have stopped working in Firefox 3.6 (yet it still works in IE and in Opera). 2010-03-0408:39:42:234 900 70Agent * Updates to install = 4 2010-03-0408:39:42:625 900 70Agent * Title = Security Update for Windows XP (KB972270) 2010-03-0408:39:42:625 900 70Agent * Title = Update for Microsoft Silverlight (KB979202) 2010-03-0408:39:42:625 900 70Agent * Title = Update for Windows XP (KB955759) 2010-03-0408:39:42:625 900 70Agent * Title = Cumulative Security Update for Internet Explorer 8 for Windows XP (KB978207) Anyone else having similar problems? Thanks Tim Romano
Re: [flexcoders] Re: Missing component in flexbuilder 3
I think that's a reasonable expectation. I would file a bug at http://bugs.adobe.com/flex . But I also believe that if it RadioButtonGroup shows up in the component list a component that extends RadioButtonGroup should show up in the custom components list. Tim
Re: [flexcoders] Missing component in flexbuilder 3
That typically means that the custom component doesn't extend UIComponent or another Flex component based on UIComponent. If it already extend one of those types, I'm not sure why else it wouldn't show up. What SDK/Builder version are you using? Tim On Wed, Feb 24, 2010 at 1:46 PM, aceoohay pa...@compuace.com wrote: I created a a component called ValidatedRadioButtonGroup. Intellisense finds it, I can use it and everything is good. Flexbuilder does not show it in the components panel. Which means I can't easily drag it onto forms during development. Any ideas? Paul
Re: [flexcoders] Strategies for switching between testing and deployment addresses
I'm too new at Flex to do anything fancy like reading files from the O/S file system, so I use the Project compile option. -locale en_US -define=CONFIG::debug,true Then I have me some constants: public static const DEBUGMODE:Boolean = CONFIG::debug; public static const DEBUG_BASEURL:String = http://localhost/foo/; public static const RELEASE_BASEURL:String = http://www.somedomain.com/foo;; And then in my wrapper for the HTTPService: if ( SearchConstants.DEBUGMODE) { baseURL = SearchConstants.DEBUG_BASEURL ; }else{ baseURL= SearchConstants.RELEASE_BASEURL ; } All you have to do is change the compiler settings to debug, false and -- voilà -- or wa-la if you like that better. There's still the forgetting to change the compiler options issue, but it's probably a good habit to examine the Compiler options before each compile, and this approach inculcates a good habit. Take this with a grain of salt; I'm new to Flex; my expertise, if I have any at all, is not in Flex programming. Regards Tim Romano On 2/21/2010 8:00 PM, David Adams wrote: I've been writing some small programs that use HTTPService calls to fetch data from a back-end. During testing, I'm using 127.0.0.1 or an IP address on my subnet. When I deploy, I update the IP address in service definitions to the right external address and build the app. Or at least I mean to. It's all too easy to accidentally change the addresses for internal testing and then forget to switch them back before building. Is there a best practice or simple strategy for putting the IP address somewhere outside of the source code that it can easily be edited without a rebuild? Thanks for any advice. __
Re: [flexcoders] SQL Question
Hard to know for sure from the way you've put the question, but the IN lists seem malformed to me. Correct: IN (a, b, c) Incorrect: (a, b, c) Regards Tim Romano On 2/20/2010 6:04 PM, Wally Kolcz wrote: I know this is out of the core topic, but I am banging my head on this simple issue..or probably is... I am trying to write a SQL query (in ColdFusion) for my database (MySQL 5) when I am looking for a passed in argument value in the column (which is set as a varchar). I am passing in '0' for the ageGroup and 'kids' for the accountType I have 'kids' My Query is: Select CONCAT(roomDisplay, (National)) as roomDisplay, CONCAT(cfqueryparam value=#arguments.ageGroup#, -, roomDisplay, -, National) as roomID FROM chatrooms WHERE cfqueryparam value=#arguments.accountType# IN (accountType) AND cfqueryparam value=#arguments.ageGroup# cfsqltype=cf_sql_integer / IN (ageGroups) ORDER BY roomDisplay ASC I have a record where 'ageGroups' is '0, 1, 2, 3, 4, 5, 6, 7, 8' and the 'accountType' is 'kids, siblings, parents' I keep getting 0 returns but I know both values exist in at least 1 record What am I doing wrong? No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.435 / Virus Database: 271.1.1/2702 - Release Date: 02/21/10 19:34:00
[flexcoders] best place to make feature requests
Where's the best place to make feature requests for FlashBuilder? Thanks
[flexcoders] ExternalInterface : debugging, DOM, Export Release Build
My browser-deployed Flex app, built in FB4, is using the ExternalInterface. The Flex app gets some search terms from the user, goes out to a webservice for some data, and then pushes some html markup out to a DIV in the HTML document using the ExternalInterface.call() method. I send the content across the bridge as a parameter to javascript function that appends a child to the target DIV. Nice and simple with the EI. However, I have a couple of questions about the logistics of developing this sort of application in FlashBuilder. When Export Release Build is chosen from the Project menu in FB4, it destroys and recreates the HTML deployment wrapper for the SWF. Is there any way for the developer to provide an HTML document template to FB, marked up with comments/metadata tags, such that only the Adobe browser-sniffing code and SWF-embed code gets overwritten but the rest of the HTML document (the user-portion) remains intact? Also, is it possible to set up a project in FB4 that uses the ExternalInterface, where you can step through code in the debugger and also see pushed content being rendered in the HTML document hosting the SWF? In debug mode it seems not possible to work with your actual HTML host document and its javascript functions-- or am I missing something obvious? I am pretty new to FB and that could easily be the case. Finally, will future versions of the ExternalInterface expose the DOM of the hosting document via ActionScript object wrappers? Thanks
Re: [flexcoders] HTTPService token: a bug or by design?
To answer my own dumb question. var token: AsyncToken; token = send(); var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault, token); token.addResponder(myResponder); function onResult(e:ResultEvent , token:Object=null):void {} On 2/8/2010 6:05 PM, Tim Romano wrote: I've run into one bug in the mx.rpc.http.HTTPService class in FB4 beta 2 -- the AsyncResponder's onResult function fires *twice* unless you wire up a dummy eventhandler. And so I am wondering if the following is not also a bug: var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); var token: AsyncToken; token = send(); token.addResponder(myResponder); function onResult(e:ResultEvent , token:Object=null):void {} The token parameter is always null in the onResult function. Isn't that parameter supposed to contain the token to which the Responder was added? Thanks Tim Romano
[flexcoders] HTTPService token: a bug or by design?
I've run into one bug in the mx.rpc.http.HTTPService class in FB4 beta 2 -- the AsyncResponder's onResult function fires *twice* unless you wire up a dummy eventhandler. And so I am wondering if the following is not also a bug: var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); var token: AsyncToken; token = send(); token.addResponder(myResponder); function onResult(e:ResultEvent , token:Object=null):void {} The token parameter is always null in the onResult function. Isn't that parameter supposed to contain the token to which the Responder was added? Thanks Tim Romano
Re: [flexcoders] Steve Jobs on Flash .......
If the rumors about Bing are true, then this panning could also have something to do with Silverlight. If I were at MSFT and my role was to ensure that Silverlight succeeded in knocking Flash off (as Word knocked off WordPerfect back in the day, e.g.) then I'd be looking for chinks in Adobe's armor wherever they may be. On 2/1/2010 2:26 PM, Paul Andrews wrote: It's just commercial tactics. You'd never guess he has his own tied-in development system to support. Why wouldn't he knock flash? hworke wrote: http://news.yahoo.com/s/pcworld/20100201/tc_pcworld/stevejobsdissesapplerivalsduringtownhallmeeting http://news.yahoo.com/s/pcworld/20100201/tc_pcworld/stevejobsdissesapplerivalsduringtownhallmeeting Jobs has previously called out Adobe Flash, currently the dominant animation platform on the Web, for being too slow to be useful and Flash Lite, Adobe's versio n of Flash for mobile devices, as not advanced enough for the iPhone. So it's no surprise to hear Jobs called out Flash during Apple's Town Hall, but his language this time sounds a little over the top. Jobs reportedly called Adobe a lazy company, and said that when a Mac crashes it's usually because of Flash. Whether or not that's true, it's clear that Jobs is not a fan of Adobe's multimedia platform. The iPhone is routinely criticized for its inability to render Flash-based Web pages, videos and games, and early criticisms about the iPad also decry the lack of Flash compatibility on Apple's latest device.
[flexcoders] rendering HTML markup in AdvancedDataGrid
I am considering using an AdvancedDataGrid in hierarchical mode but am not sure it can do what my app needs to do, or if it can, whether the approach will be efficient--execute quickly and use up a lot of memory. I haven't worked with the AdvancedDataGrid before. The grid will look like this: [v] Category A [v] Title 1 * passage one blah blah blah * passage two [v] Title 2 [v] Title 3 . . . [v] Title n [v]Category B [v] Title 1 [v] Title 2 [v] Title 3 . . . Title n etc etc When the user clicks on a Title node to expand it, some passages excerpted from the corresponding document would be fetched from the database, already formatted as HTML like this: span class='foo'this is an excerpt span class='abc'100 to 1000/span characters in length/span. A style sheet must control how the css classes in the passage excerpts are rendered. The grid might have as many as 100 rows, and each row could contain a couple of paragraphs of html text. Up to 1K each, but more typically around 100-200 characters. If I create an item-renderer using TextArea, will 100 TextAreas be created if the grid has 100 Title rows even if only 3 titles are expanded by the user? Or are the item renderers created only for the rows that actually get expanded and displayed? Is there another way to render HTML markup in the ADG? Thanks
Re: [SPAM] [flexcoders] rendering HTML markup in AdvancedDataGrid
Thanks for the reply, Tracy, about the ItemRenderers. +1 on the htmlText warning. I've used the htmlText of the TextArea in an AIR app, which I'm converting from local DB to webservice mode now. The html rendering in Flex of the sort of html markup example I gave below is better than bad but is far from rich. Adobe gets a very low passing grade from me on its htmlText + CSS rendering in Flex. I don't need typographic control (kerning, ligatures, etc) but I do want support for basic CSS-- I could never get padding and margins to work. Font-family, bold, italics, font-size do work. Tim On 2/6/2010 2:08 PM, Tracy Spratt wrote: Item Renderers are only created for the visible rows plus a few buffers. Performance is primarily determined by the rendering and item data access. Be aware that htmlText only renders a small subset of html tags. Tracy Spratt, Lariat Services, development services available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Tim Romano *Sent:* Saturday, February 06, 2010 12:36 PM *To:* flexcoders@yahoogroups.com *Subject:* [SPAM] [flexcoders] rendering HTML markup in AdvancedDataGrid I am considering using an AdvancedDataGrid in hierarchical mode but am not sure it can do what my app needs to do, or if it can, whether the approach will be efficient--execute quickly and use up a lot of memory. I haven't worked with the AdvancedDataGrid before. The grid will look like this: [v] Category A [v] Title 1 * passage one blah blah blah * passage two [v] Title 2 [v] Title 3 . . . [v] Title n [v]Category B [v] Title 1 [v] Title 2 [v] Title 3 . . . Title n etc etc When the user clicks on a Title node to expand it, some passages excerpted from the corresponding document would be fetched from the database, already formatted as HTML like this: span class='foo'this is an excerpt span class='abc'100 to 1000/span characters in length/span. A style sheet must control how the css classes in the passage excerpts are rendered. The grid might have as many as 100 rows, and each row could contain a couple of paragraphs of html text. Up to 1K each, but more typically around 100-200 characters. If I create an item-renderer using TextArea, will 100 TextAreas be created if the grid has 100 Title rows even if only 3 titles are expanded by the user? Or are the item renderers created only for the rows that actually get expanded and displayed? Is there another way to render HTML markup in the ADG? Thanks No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.435 / Virus Database: 271.1.1/2671 - Release Date: 02/06/10 07:35:00
[flexcoders] my HTTPService POSTs are showing up as GETs in FB4 beta 2: is POST implemented?
I would be grateful if someone could confirm that HTTPService POST actually works in FB4 beta 2.When I set the method = POST, the header shows up as a GET in the Fiddler traffic monitor, and so the parameters I'm trying to send to the remote server never arrive; only the name/value pairs in the query string arrive at the destination URL. Thanks
[flexcoders] Dog woofs, Cat meows; can the same listener listen to either and how do you remove the eventlistener?
The question is at the very bottom. Here's the scenario: Let's say I have a base class Animal, and subclasses Dog and Cat that extend Animal. Animal has a protected Speak() method which Dog and Cat each override: when aDog instance and aCat Speak(), they each raise an event, a CreatureSpeakingEvent. class Dog extends Animal { override protected class Speak() { var sound:String = woof; var eventObj:CreatureSpeakingEvent = new CreatureSpeaking ( CreatureSpeakingEvent, sound, true, false ); this.dispatchEvent(eventObj); } } class Cat extends Animal { override protected class Speak() { var sound:String=meow; var eventObj:CreatureSpeakingEvent = new CreatureSpeakingEvent ( CreatureSpeakingEvent, sound, true, false ); this.dispatchEvent(eventObj); } } In the main class, which can instantiate either or both of these animals, a listener is attached to the CreatureSpeakingEvent event: var aDog = new Dog(); var aCat = new Cat(); aDog.addEventListener(CreatureSpeakingEvent, onCreatureSpeaking); aCat.addEventListener(CreatureSpeakingEvent, onCreatureSpeaking); The onCreatureSpeaking() function listens: private function onCreatureSpeaking(e:CreatureSpeakingEvent) { // is the following cast to the base-class Animal acceptable? Animal (e.target).removeEventListener(CreatureSpeakingEvent, onCreatureSpeaking); } Thanks for the help! Tim
Re: [flexcoders] Problem losing values from query results to RESULT.DATA
What happens if you don't put any quotes around the column aliases? Tim On 1/19/2010 4:55 PM, charliecrystle wrote: Weird issue: I have a query that works fine--produces expected results: SELECT COUNT(tagsLU.tagid) as 'tagcount', tag.tagname as 'tagname' FROM TagsLU Inner Join tag on tag.tagid=tagslu.tagid Group By tag.tagname Order By tagcount DESC
Re: [flexcoders] question about inheritance and events and overriding methods
Thanks very much, Aaron, for taking the time to compile the code on your end. Without your help, I'd have been spinning my wheels on this for days It appears to be a compiler/debugger bug in beta 2. I started commenting out code and recompiling and then uncommenting and recompiling and eventually the error icon jumped to a line with no code on it at all. So I closed FB completely and reopened it and the code compiled and I was able to debug it. I got rid of the calls to super() BTW and moved the params parameter out of the constructor to the execute() function. Tim On 1/18/2010 9:10 PM, Aaron Hardy wrote: I just tried it on my machine and it compiled without any problems after I took out the dependencies I didn't have access to. I never got the error you mentioned. Maybe it's referring to something else? Cut everything out of your project (maybe make a new one) except the onResult function you believe may be the cause and see if you still get the error. I suspect you won't. Good luck! Aaron
Re: [flexcoders] question about inheritance and events and overriding methods
I am having trouble with an override, getting Method marked override must override another method. No problem at all doing this: in the BASE CLASS: protected function foo(): void{} in the SUBCLASS override protected function foo(): void{} But the error given above occurs here: in the BASE CLASS protected function onResult(e:ResultEvent, token:Object=null):void {} in the SUBCLASS override protected function onResult(e:ResultEvent, token:Object=null):void {} I don't see why it's not working. All of the requirements set out here seem to be satisfied: http://livedocs.adobe.com/flex/3/html/help.html?content=04_OO_Programming_11.html I've included the class implementations below. Is the cause of the error evident? Thanks again for the help, it's appreciated doubly because I'm stumped by this. Tim === BASE CLASS == package TESTREST { import mx.rpc.http.HTTPService; import mx.rpc.AsyncResponder; import mx.rpc.AsyncToken; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import OEREST.events.*; import OEUTIL.BindableArrayCollection; import json.*; import OEUTIL.SearchConstants; public class MYHTTPSERVICEBASE extends HTTPService { private var _params: Object; private function get Params(): Object {return _params;} public function MYHTTPSERVICEBASE(destination: String, params:Object = null) { var _params: Object=params; var baseURL: String; if ( SearchConstants.DEBUGMODE) { baseURL = SearchConstants.DEBUG_BASEURL ; }else{ baseURL= SearchConstants.RELEASE_BASEURL ; } super(baseURL, destination); } public function execute(): void { var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken; if ( this.Params == null) { this.method=GET; token = this.send(); } else { this.method=POST; token = this.send(Params); } token.addResponder(myResponder); } protected function foo(): void {} protected function onResult(e:ResultEvent, token:Object=null):void {} protected function onFault(evt:FaultEvent, token: Object=null):void {} } } == SUBCLASS package TESTREST { public class TestService extends TESTREST.MYHTTPSERVICEBASE { import mx.rpc.events.ResultEvent; protected const DEBUGMODE:Boolean = CONFIG::debug; protected const DEBUG_BASEURL:String = http://localhost/OESharpDeploy/; protected const RELEASE_BASEURL:String = ; import TESTREST.events.*; import json.JParser; public function TestService() { var dest: String =getServiceURL(); var selTitles : Array =new Array(1,2,3,4,5,6,7,8,9,10,11,12); var ss:String = JParser.encode(selTitles); var params:Object = {selectedTitles: ss}; super( dest, params); } private function getServiceURL(): String { if (DEBUGMODE) { return DEBUG_BASEURL + /SSQ.ashx ; }else{ return RELEASE_BASEURL + /SSQ.ashx ; } } override protected function foo(): void{} override protected function onResult(e:ResultEvent, token:Object=null):void {} } } On 1/17/2010 10:49 PM, Aaron Hardy wrote: I'm not sure I understand your question clearly but if I assume correctly I think the answer will be yes, there is no need for each descendant to instantiate its own responder. Aaron On Sun, Jan 17, 2010 at 6:37 PM, Tim Romano tim_rom...@yahoo.com mailto:tim_rom...@yahoo.com wrote: Thank you, Aaron, for the helpful answers. My intention would be to have each of the descendants of MYHTTPSERVICEBASE point to a different destination and raise an event specific to that destination, and to have a separate listeners for each kind of event. If I've understood you correctly, there is no need for each of the descendants to instantiate their own Responder and no requirement for them to override the base execute() method too. Tim /* this method is in the descendant class and overrides the base method */ private overrides function onResult(e:ResultEvent, token:Object=null):void { // raise a specific event } /* these two methods are in the base class */ publicfunction execute() : void { myResponder = new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken
[flexcoders] not legal to override a function with an optional parameter, e.g. foo(s: String=null) ?
I've been asking general questions about inheritance and am splitting this question off as a separate one because it's very specific. It appears that you cannot override a function with optional parameters? protected function foo(a:String, s:String=null): void {} Isn't the signature considered the same if you do this? override protected function foo(a:String, s:String=null): void{} Thanks Tim
[flexcoders] question about inheritance and events and overriding methods
Let's say I have a class MYHTTPSERVICEBASE which extends mx.rpc.http.HTTPService. This base class of mine checks whether it is being run in debug mode or release, and sets the base URL to localhost or the remote host. Then I have individual http service classes that extend MYHTTPSERVICEBASE. I want my http service layer to dispatch messages that my GUI layer will be listening for: publicfunction execute() : void { myResponder = new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken = this.send(); token.addResponder(myResponder); } privatefunction onResult(e:ResultEvent, token:Object=null):void { // Got Data? then instantiate and dispatch a bubbling event object that encapsulates the data // the GUI layer will be listening for this event } Questions: Can the event object be dispatched from within the MYHTTPSERVICEBASE? Will the GUI hear it if it's dispatched from the base class? In a class that extends MYHTTPSERVICEBASE, can I override the onResult() method that has been registered with the Responder by the base class? Thanks for the help!
Re: [flexcoders] question about inheritance and events and overriding methods
Thank you, Aaron, for the helpful answers. My intention would be to have each of the descendants of MYHTTPSERVICEBASE point to a different destination and raise an event specific to that destination, and to have a separate listeners for each kind of event. If I've understood you correctly, there is no need for each of the descendants to instantiate their own Responder and no requirement for them to override the base execute() method too. Tim /* this method is in the descendant class and overrides the base method */ private overrides function onResult(e:ResultEvent, token:Object=null):void { // raise a specific event } /* these two methods are in the base class */ publicfunction execute() : void { myResponder = new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken = this.send(); token.addResponder(myResponder); } privatefunction onResult(e:ResultEvent, token:Object=null):void { // this method is overridden by descendants } On 1/17/2010 3:38 PM, Aaron Hardy wrote: I'll take a crack at it. Can the event object be dispatched from within the MYHTTPSERVICEBASE? Sure. I think there may be a separate underlying question here though. Are you asking how? Maybe you can clarify? Will the GUI hear it if it's dispatched from the base class? First of all, if the service classes you're talking about aren't on a display list (it's very likely they are NOT) then an event doesn't bubble in the traditional sense. Nothing will hear the event unless it specifically has added an event listener to your service object. So if you want any view component to hear the event being dispatched by your service object, the view component will need to add an event listener to your service object. Depending on the framework you're using, there may be some other mechanism whereby the view can hear about a command's completion. Something else you can do (though some architecture developers will cringe) is dispatch the event off the stage, the system manager, or the base application from your command and then the view would add an event listener to whichever object that is. In a class that extends MYHTTPSERVICEBASE, can I override the onResult() method that has been registered with the Responder by the base class? Yes. In the case of your sample code, if you override onResult in your class that extends MYHTTPSERVICEBASE, it is the overriding function that is passed into the responder. That is, when you reference onResult, you're referencing the most extended onResult function, not just the onResult function in the class from which onResult is referenced. I hope that makes sense. It's very likely I misinterpreted your questions. Aaron
Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
Tracy, Yes. Thanks for the info. Tim On 1/13/2010 12:51 AM, Tracy Spratt wrote: You are using Firefox, I bet. I have sent this behavior and I think it is just a bug in FF. Tracy Spratt, Lariat Services, development services available The status bar says Transferring data from localhost... and that status message never goes away. sn ip
[flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
I started learning FlashBuilder/Flex by diving in and writing an AIR application against SQLite with asynchronous connections and Responder objects. The responder's resultsHandler is passed a flash.data.SQLResult object that exposes a complete status property. Lovely. Now I am trying to rewrite that AIR application as a browser-deployed Flex app using an HTTPService against a RESTful webservice that returns JSON data. The webservice is working, and the Flex HTTPService is pulling the JSON string down, but there doesn't seem to be anything analogous to the complete property that was available with the asynch data connection in the AIR app. Not so lovely. The result-handler specified in the HTTPService responder has two parameters, the ResultEvent and the AsyncToken. The ResultEvent exposes a statusCode property. The result-handler can be called more than once. The ResultEvent.statusCode = 200 each time the handler is called. How do you know when the remote data are complete? I will keep googling as I'm sure this question must be commonplace, but so far I haven't found the answer. Thanks for the help.
Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
Jeff, Thanks for the reply. I am confused by the behavior of my Flex app. The status bar says Transferring data from localhost... and that status message never goes away. But, as you suggested, the data are complete: I pop the raw JSON string returned by the webservice into a TextArea, and it's all there, a string literal representing an array of objects:[{...},{...},{...}], and the string literal decodes into a well-formed ActionScript array. Is there something my results-handler has to do to clear that status message? Tim Maybe I’m missing something here, but to my understanding when the result event of your HTTP service fires, your call IS complete. You should have access to the json string that was pulled back from the service. Is there something else you need that the json string doesn’t’ supply?
Re: [flexcoders] Default width of horizontal spark list
Have you tried setting 'width' on the List? e.g., s:List width=300 dataProvider={this.items} Tim On Mon, Jan 11, 2010 at 10:49 AM, r_woess r_wo...@yahoo.de wrote: Hi, here you can see a simple example with a horizontal list. after adding text into the textinput and pressing enter, new items will be added to the list. the with of the list automatically grows, if you add more items. but i can't find a way, to set the with correctly, if the width is lower than the default width. is there a possibilty to set the width correctly? if no item is in the list, it should be 0px if 1 item is in the list, it should be the with of the first item and so on . ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/halo width=100% height=100% fx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var items:ArrayCollection=new ArrayCollection(); private function addItem():void { this.items.addItem(this.tiItem.text); this.tiItem.text=; } ]] /fx:Script fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:HGroup width=100% height=100% s:List dataProvider={this.items} s:layout s:HorizontalLayout/ /s:layout s:itemRenderer fx:Component s:ItemRenderer s:layout s:HorizontalLayout/ /s:layout s:Label text={data}/ s:Label text= / /s:ItemRenderer /fx:Component /s:itemRenderer /s:List s:TextInput id=tiItem enter=this.addItem();/ /s:HGroup /s:Application
[flexcoders] Channel.Security.Error : guidance please
If I understand this document correctly: http://kb2.adobe.com/cps/142/tn_14213.html the Channel.Security.Error (Security error accessing url) that I get when trying to access a webservice hosted at www.flash-mx.com from my desktop FlashBuilder (beta 2) development environment is probably the result of there not being a crossdomain.xml policy file at the root of www.flash-mx.com that permits access from *. mx:WebService id=webService wsdl=http://www.flash-mx.com/ws/months.cfc?wsdl; mx:operation name=getMonths resultFormat=object result=getMonths_result(event); fault=getMonths_fault(event); / /mx:WebService Do RESTful webservices avoid cross-domain security issues when the SWF client is running on a domain other than the one hosting the webservice? Thanks
[flexcoders] possible to derive rowIndex from DataGrid's rightClick event?
In an AIR app, I'd like to be able to know what row of a DataGrid the user has right-clicked on.* The rightClick event of the DataGrid is a MouseEvent and does not expose rowIndex (unlike the rowClick event which is of type ListEvent). Is there a way to derive the rowIndex in the grid's rightClick eventhandler? Thanks *I'm hoping to make a CheckBoxDataGrid interactive in two ways -- normal check-box multi-selection mode, which is working fine, but also a right-click-on-single-row mode, where the row is not selected but is temporarily the subject of the user's attention -- possibly for a context-menu.
[flexcoders] padding P element with CSS in htmlText of TextArea
While I've been able to apply some CSS styles (e.g. fontFamily, fontSize, fontWeight, fontStyle, letterSpacing) to the content of p elements and to indidivual class selectors in the htmlText of a TextArea in an AIR application (FB4 beta2), attempts to set other styles, such as padding and margin, have not worked. Are padding and margin not implemented? If not, will they be? CSS + HTML are a powerful duo. I hope Adobe has plans to exploit this capability fully for the TextArea in AIR applications. For many text-presentation purposes CSS support would be entirely adequate, and typographic control would offer far more precision and granularity than is actually needed while introducing unnecessary complexity. Not that typography isn't a very slick feature, but please don't let CSS+HTML fall by the wayside. Regards Tim
Re: [flexcoders] Flex 3: AIR Local Database
The answer to your question about large scale is yes, AIR + SQLite can handle large datasets but with some caveats. I have a SQLite database that is several hundred megabytes. The main tables contain 4 million rows, 275000 rows, and 3500 rows. Queries that join these tables, when the query makes use of indexes, execute in under 100 milliseconds. Snappy. However, some things in the AIR implementation of SQLite are causing index optimizations with the LIKE() operator not to work, both in regular statements and in prepared statements. I am not sure what these things are because the differences between the AIR implementation of SQLite and SQLite proper haven't been documented. They could be things like overloading certain core SQLite functions, or compiling statements/prepared statements with one of the functions that cause the optimizer not to use an index. As a result of these mysterious things, if you run a query like SELECT * from MEMBERSHIP where MEMBER_LASTNAME LIKE 'Johns%' the query will do a full table scan. Do a more complex column value starts-with query that involves joins, and the table scan can translate to very poor performance. For example, when I execute my query at the SQLITE3.EXE command-line, where the index IS used, the query executes in under 100ms but the identical query takes 45-50 seconds in AIR. Also, to keep the front-end responsive when working with large datasets, you will have to use asynchronous data connections not synchronous connections. The coding is somewhat more complicated but also I found the AIR debugger to be less than robust when working with asynchronous connections and data events. However, everything worked OK with Responders, so I'd recommend the use of responder objects over the event-dispatch architecture. I have no experience to offer you with concurrency issues and SQLite. My AIR + local-db application is single-user. Regards TR jwc_wensan wrote: In all the articles I have read and some examples, it only talks about using SQLite as the database on the users' PC/Mac. Is that the only database that can be used locally? Can that database handle a large-scale commercial AIR app with tens of thousands of records? Also, since the AIR app is installed on the users PC/Mac, is there any reason to use mx:Modules? If the user needs/requires that data remain local, is AIR the best solution? Does Flex 4 solve any issues? Thoughts, options, suggestions? Thanks in advance, Jack
[flexcoders] where to get official answer to question about AIR's SQLite implementation and LoadableExtensions mechanism support?
A simple function I need does not exist in the SQLite engine core but the SQLite gurus are telling me to write my own function in C and load it at runtime as a loadable extension. (I have good reasons, BTW, for not wanting the function to execute in the client--it really belongs in the back-end.) http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions The LoadableExtensions mechanism is disabled by default, and Adobe in its implementation of SQLite may not have enabled the LoadableExtensions mechanism; or if it is enabled, a developer does not know whether it is officially enabled or an undocumented use-at-your-own-risk feature. Where would one get an official answer to the LoadableExtension supported/not-supported question? I've tried the AIR forum at Adobe but my question was not answered there. Thanks
[flexcoders] basic code behind question
It seems a class whose constructor takes arguments cannot be used as the code-behind class. Is that so? When I try to use this class in the root tag of my mxml component, there's an error: no default constructor in the base class TestArgs. Thanks package { import mx.containers.TitleWindow; import mx.controls.LinkButton; public class TestArgs extends TitleWindow { public var aLinkButton:LinkButton; private var _arg1: String; //public function TestArgs(){} public function TestArgs(arg1:String) { super(); _arg1 = arg1; } } }
[flexcoders] launching popup TitleWindow from a reused mxml component
I posted a question the other day about how to prevent a popup from being dragged outside the bounds of the application window. Since I'm fairly new at Flex, some obvious things are not immediately obvious to me. I think my popup window can be dragged outside the main application window because this in my method call below: PopUpManager.addPopUp(popwin, this, true); actually refers to an isntance of my (reusable) mxml component which is launching the popup, not to the main application window. If the parent DisplayObject referred to by this is not the main application window, is the default behavior that the popup can be dragged outside the main application window? Thanks
[flexcoders] PopupWindow dragging and enforcing main app window bounds
First, thanks to Tracy for answering my question about the columns array of the DataGrid. My question relates to dragging popup-windows. It's possible to drag a popup window outside the main application window's bounds, and if the user happens to release the mouse button at the wrong moment, the popup window can no longer be grabbed. My popup is defined in ActionScript like this: public class MyPopupWindow extends TitleWindow { ... } and is instantiated like this: var popwin = new MyPopupWindow(); var isModal:Boolean=true; PopUpManager.addPopUp(popwin, this, isModal); How would I get a reference to the main application window's bounds? MyPopupWindow instances could be popped up from deep inside nested containers. Do I keep getting parents of parents until there are no more parents to get? If I pass this rectangle to the MyPopupWindow constructor, can MyPopupWindow use those values to prevent itself from being dropped outside those confines, in the stopDragging() method that it inherits from Panel, and relocate itself? What properties contain its its current location relative to the main window's bounds? Or do I need to implement this in the class instance that invokes the PopUpManager.addPopUp method? Thanks
RE: [flexcoders] how to wait for more than one httpserivice/remoteobject result to finish?
You don't really get much in the way of thread control in Flex, but a neater way might still be to create something of a pseudo-barrier. At the time each object is fired, you would also add a token to the barrier, latching it and increasing the counter on that token. Each event listener could then call off to the barrier, passing the same token fired as a property of the event to decrease against that token on the barrier - at the point all tokens are unblocked (ie, reach 0) you can open the barrier. Your other code would sleep (I was almost going to say spinwait... hm, no :) until the barrier is unlatched. This could avoid you needing to write a handler for each event - the problem with the below example is what happens when you need three, or four, of seven events to be waited on. Just something to give some thought to anyway. --Tim From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Wesley Acheson Sent: Friday, 21 August 2009 5:20 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] how to wait for more than one httpserivice/remoteobject result to finish? private var list1Result:ResultEvent; private var list2Result:ResultEvent; private function handleList1Result(event:ResultEvent):void { list1Result = event; if(list2Result) { handleResults(list1Result, list2Result); } } private function handleList2Result(event:ResultEvent):void { list2Result = event; if(list1Result) { handleResults(list1Result, list2Result); } } private function handleResults(result1:ResultEvent, result2:ResultEvent):void { //your code here } On Thu, Aug 20, 2009 at 8:35 PM, coder3 rrhu...@hotmail.commailto:rrhu...@hotmail.com wrote: Hi my application needs to wait until two (or more) resultHandlers to get their results and use them together. for example, mx:RemoteObject id=myRO destination=test fault=FaultHandler(event) mx:method name=getList1 result=handleList1Result(event)/ mx:method name=getList2 result=handleList2Result(event)/ /mx:RemoteObject at application creationComplete, it calles myRO.getList1() and myRO.getList2() what can i do to make sure i get both results before i do anything else? i know it can call myRO.getList1(), then in the handleList1Result(event:ResultEvent), after it gets the list1 result, then it calls myRO.getList2(), but i would like to know a better, more clear way. thanks C -- View this message in context: http://www.nabble.com/how-to-wait-for-more-than-one-httpserivice-remoteobject-result-to-finish--tp25067471p25067471.html Sent from the FlexCoders mailing list archive at Nabble.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 __ Notice: This email and attachments (if any) is for the exclusive use of the addressee and may contain information that is privileged and confidential. Any unauthorised use of the contents of the email and/or attachments is expressly prohibited. If you are not the addressee of this email, please notify me immediately by email and then immediately destroy any electronic or paper copy of this email and/or attachments. Carsales.com Ltd and its related companies do not accept responsibility for the views expressed in the email or for the consequences of any computer viruses that may be transmitted with this email. This email is subject to copyright. No part of it should be reproduced, adapted or transmitted without the written consent of the copyright owner.
RE: [flexcoders] Fields grouping?
How about mx.containers.Form ? --Tim From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Nick Middleweek Sent: Wednesday, 19 August 2009 3:08 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Fields grouping? hi guys, Is there a component that allows us to group fields/ objects together? I can't find a built in object, I'm after something visual that i can use to group fields, such as all the address fields together and another group to collate the numerous emails and phone numbers... Can I draw it? Is there a line tool? Thanks! :) Nick __ Notice: This email and attachments (if any) is for the exclusive use of the addressee and may contain information that is privileged and confidential. Any unauthorised use of the contents of the email and/or attachments is expressly prohibited. If you are not the addressee of this email, please notify me immediately by email and then immediately destroy any electronic or paper copy of this email and/or attachments. Carsales.com Ltd and its related companies do not accept responsibility for the views expressed in the email or for the consequences of any computer viruses that may be transmitted with this email. This email is subject to copyright. No part of it should be reproduced, adapted or transmitted without the written consent of the copyright owner.
[flexcoders] Embedding Emmentaler Fonts
Hi, I'm trying to embed the Emmentaler font from lilypond (www.lilypond.org) in order to be able to output musical notation with Flex. If I embed the font like this: mx:Style @font-face { src: url(/usr/share/lilypond/2.12.1/fonts/otf/emmentaler-26.otf); fontFamily: Emmentaler; fontName: Emmentaler-26; } .MyTextStyle { embedFonts: true; fontFamily: Emmentaler; } /mx:Style mx:Label text=Hello id=myLabel styleName=MyTextStyle/ I get a compile error saying: Error: exception during transcoding: Font for alias 'Emmentaler' with plain weight and style was not found at: file:/usr/share/lilypond/2.12.1/fonts/otf/emmentaler-26.otf. The font is present at that path. Details of the font are here, it's GPL as part of the lilypond source. http://lilypond.org/doc/v2.12/Documentation/user/lilypond/The-Feta-font#The-Feta-font Can anyone give me any clues as to how to embed it? Cheers, Tim.
[flexcoders] Re: TileList displaying wrong index
Cool, glad that you figured it out. No hard feelings. -TH --- In flexcoders@yahoogroups.com, steve horvath flexcod...@... wrote: I figured it out. The problem was due to the fact that I had a bind tag set on the ArrayCollection getter that is updated whenever a CollectionChange occurs. I will post a more complete question next time. Thanks to Tim and Tracy for trying to help. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute applicationComplete=init() mx:Label id=label1 text={albumsThumbnailList.selectedIndex} x=10 y=12/ mx:Label id=label2 text={presentedAlbumIndex} x=10 y=38/ mx:TileList id=albumsThumbnailList direction=vertical dataProvider={presentedAlbums} selectedIndex={presentedAlbumIndex} x=160 y=10 change=presentedAlbumIndex=albumsThumbnailList.selectedIndex height=400/ mx:Button click=test() x=29 y=136/ mx:Script ![CDATA[ import mx.events.CollectionEvent; import mx.collections.ArrayCollection; private var _includedAlbums:ArrayCollection = new ArrayCollection([zero,one,two,three,four,five,six,seven]\ \ ); [Bindable] private var presentedAlbumIndex:int = -1; private function init():void { _includedAlbums.addEventListener(CollectionEvent.COLLECTION_CHANGE, function():void { dispatchEvent(new Event(albumDataChanged)); } ); } private function test():void { _includedAlbums.removeItemAt(1); presentedAlbumIndex--; } [Bindable(event=albumDataChanged)] private function get presentedAlbums():ArrayCollection { return _includedAlbums; } ]] /mx:Script /mx:Application --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: My apologies. I really didn't mean to come across as brash. I realize you are trying to help and I do appreciate it. Let me put together a small app and I'll post it here. Steve --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Yes, _includedAlbums.selectedItem should have been albumsThumbnailList.selectedItem. And no, the code below is not sufficient to reproduce the problem. For instance, where is presentations.currentPresentation.presentedAlbumIndex defined? If you want someone's help here, make it easy for them to copy and paste a small Application for testing. Besides that, excuse the hell out of me. Go ahead and continue to look at it for hours. -TH --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: The code below is sufficient to reproduce the problem. _includedAlbums is an ArrayCollection, so no .selectedItem property on that. In any case, I am already happily setting the presentedAlbumIndex by other means. It's the TileList selectedIndex that I need to update properly. --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Not sure what to tell you without having a sample application to play with. But, you could try some brute force techniques, like: _includedAlbums.removeItemAt(1); presentations.currentPresentation.presentedAlbumIndex = _includedAlbums.getItemIndex(_includedAlbums.selectedItem); -TH --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: I've been looking at this for hours. Does anyone know why I am seeing this behavior? Or at least tell me how I can debug to provide more information. --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: I have a TileList: mx:Label id=label1 text={albumsThumbnailList.selectedIndex} / mx:Label id=label2 text={presentations.currentPresentation.presentedAlbumIndex} / mx:TileList id=albumsThumbnailList backgroundAlpha=0 useRollOver=false initialize=mySizeBinding(event); dataProvider={presentations.currentPresentation.presentedAlbums} itemRenderer=PresentationAlbumRenderer selectedIndex={presentations.currentPresentation.presentedAlbumIndex} change=albumChangeHandler() / public function test():void { _includedAlbums.removeItemAt(1); dispatchEvent(new Event(albumToggledEvent)); presentedAlbumIndex--; } BEFORE test(): label1 == 5 label2 == 5 AFTER test(): label1 == 5 label2 == 4 Problem is, when the 5th index is currently selected and I delete an item earlier in the list (like index 2), the data provider updates the list. But the selectedIndex doesn't get updated. (See test() function.) I noticed when I comment out the removeItemAt line, the index gets updated just fine. How do I update the data provider and index in the same operation and get the TileList to bind correctly? Can I perhaps subclass
[flexcoders] Re: TileList displaying wrong index
Not sure what to tell you without having a sample application to play with. But, you could try some brute force techniques, like: _includedAlbums.removeItemAt(1); presentations.currentPresentation.presentedAlbumIndex = _includedAlbums.getItemIndex(_includedAlbums.selectedItem); -TH --- In flexcoders@yahoogroups.com, steve horvath flexcod...@... wrote: I've been looking at this for hours. Does anyone know why I am seeing this behavior? Or at least tell me how I can debug to provide more information. --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: I have a TileList: mx:Label id=label1 text={albumsThumbnailList.selectedIndex} / mx:Label id=label2 text={presentations.currentPresentation.presentedAlbumIndex} / mx:TileList id=albumsThumbnailList backgroundAlpha=0 useRollOver=false initialize=mySizeBinding(event); dataProvider={presentations.currentPresentation.presentedAlbums} itemRenderer=PresentationAlbumRenderer selectedIndex={presentations.currentPresentation.presentedAlbumIndex} change=albumChangeHandler() / public function test():void { _includedAlbums.removeItemAt(1); dispatchEvent(new Event(albumToggledEvent)); presentedAlbumIndex--; } BEFORE test(): label1 == 5 label2 == 5 AFTER test(): label1 == 5 label2 == 4 Problem is, when the 5th index is currently selected and I delete an item earlier in the list (like index 2), the data provider updates the list. But the selectedIndex doesn't get updated. (See test() function.) I noticed when I comment out the removeItemAt line, the index gets updated just fine. How do I update the data provider and index in the same operation and get the TileList to bind correctly? Can I perhaps subclass TileList and override a function? Some other way? I tried looking into the internals of ListBase, inspecting selectedIndex, and generally browsing around at runtime. I noticed that selectedIndex does get set to 4 momentarily. Then it gets set right back to 5 again. I'm guessing it may have to do with the updateDisplayList or something like that.
[flexcoders] Re: TileList displaying wrong index
Yes, _includedAlbums.selectedItem should have been albumsThumbnailList.selectedItem. And no, the code below is not sufficient to reproduce the problem. For instance, where is presentations.currentPresentation.presentedAlbumIndex defined? If you want someone's help here, make it easy for them to copy and paste a small Application for testing. Besides that, excuse the hell out of me. Go ahead and continue to look at it for hours. -TH --- In flexcoders@yahoogroups.com, steve horvath flexcod...@... wrote: The code below is sufficient to reproduce the problem. _includedAlbums is an ArrayCollection, so no .selectedItem property on that. In any case, I am already happily setting the presentedAlbumIndex by other means. It's the TileList selectedIndex that I need to update properly. --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Not sure what to tell you without having a sample application to play with. But, you could try some brute force techniques, like: _includedAlbums.removeItemAt(1); presentations.currentPresentation.presentedAlbumIndex = _includedAlbums.getItemIndex(_includedAlbums.selectedItem); -TH --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: I've been looking at this for hours. Does anyone know why I am seeing this behavior? Or at least tell me how I can debug to provide more information. --- In flexcoders@yahoogroups.com, steve horvath flexcoders@ wrote: I have a TileList: mx:Label id=label1 text={albumsThumbnailList.selectedIndex} / mx:Label id=label2 text={presentations.currentPresentation.presentedAlbumIndex} / mx:TileList id=albumsThumbnailList backgroundAlpha=0 useRollOver=false initialize=mySizeBinding(event); dataProvider={presentations.currentPresentation.presentedAlbums} itemRenderer=PresentationAlbumRenderer selectedIndex={presentations.currentPresentation.presentedAlbumIndex} change=albumChangeHandler() / public function test():void { _includedAlbums.removeItemAt(1); dispatchEvent(new Event(albumToggledEvent)); presentedAlbumIndex--; } BEFORE test(): label1 == 5 label2 == 5 AFTER test(): label1 == 5 label2 == 4 Problem is, when the 5th index is currently selected and I delete an item earlier in the list (like index 2), the data provider updates the list. But the selectedIndex doesn't get updated. (See test() function.) I noticed when I comment out the removeItemAt line, the index gets updated just fine. How do I update the data provider and index in the same operation and get the TileList to bind correctly? Can I perhaps subclass TileList and override a function? Some other way? I tried looking into the internals of ListBase, inspecting selectedIndex, and generally browsing around at runtime. I noticed that selectedIndex does get set to 4 momentarily. Then it gets set right back to 5 again. I'm guessing it may have to do with the updateDisplayList or something like that.
[flexcoders] Re: Question about event.label
For Menu controls, if the data provider is an Array of Strings, Flex uses each String value as the label. When a menu item is clicked, the item's label is passed to the ItemClickEvent's label property. It would be necessary to use name-value pairs, in the dataProvider, if you used the Menu's labelField or labelFunction properties. -TH --- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote: The label is not defined in this example. How can the label be called without an error? (('right side with ' + event.label)/) Thanks for your time. ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script public function showMsg(msg:String):void { mx.controls.Alert.show('You just clicked on ' + msg); } /mx:Script mx:Panel width=100 height=100 mx:PopUpMenuButton id=menuBtn dataProvider={['One','Two','Three']} click=showMsg('left side') itemClick=showMsg('right side with ' + event.label)/ /mx:Panel /mx:Application
[flexcoders] Re: PopUp databinding - possible?
import mx.core.Application; -TH --- In flexcoders@yahoogroups.com, Dave Cates dave.ca...@... wrote: Hi Tracey, Thanks for your advice. The compiler is ing access of undefined property Application¹ Any ideas? Thanks, Dave. From: Tracy Spratt tr...@... Reply-To: flexcoders@yahoogroups.com Date: Fri, 7 Aug 2009 10:31:06 -0400 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] PopUp databinding - possible? Sure. In the pop-up, define a bindable variable, say [Bindable]private var _app:MyMainAppFileName; In a creation complete handler, assign: _var = Application.application as MyMainAppFileName; Now you can bind to any bindable property in MyMainAppFileName If that is backwards to what you want, then I advise dispatching events from the Pop-up. Remember, binding is just an event mechanism that is created by the compiler. Tracy Spratt, Lariat Services, development services available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dave Cates Sent: Friday, August 07, 2009 10:01 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] PopUp databinding - possible? Hi all, I have an mxml component that I am displaying via the popup manager method. But, I have data that is sent to this popup that needs to be data bound database updates etc. So, how do you databind to the vars inside the popup? If the MXML component was on the stage as normal I¹d have no problems but the popup, my nature, is created at run-time. So is it possible and if so, how?! Thanks! Dave.
[flexcoders] Re: Stacked column chart with a twist
This might be the thread that you remembered Richard. The next to last post has a link to a great chart by Tom Gonzalez. http://www.mail-archive.com/flexcoders@yahoogroups.com/msg124244.html http://www.mail-archive.com/flexcoders@yahoogroups.com/msg124244.html -TH 0--- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote: I seem to recall a blog post recently about doing a stacked column chart where the height of the total column was based on a value in the data set, rather than summing each column segment. Or, to put it another way, the column height is determined by data, then each series gets a percentage of the column height. Or to put it another way, it's a percentage column chart with varying column height. Does anyone recall where that was?
RE: [flexcoders] Any suggestion for server (java) side run-time styling solution?
I'm a bit puzzled that you mention the need to compile in changes. Surely a SWF can load in an external css file? If so, could the swf not typically be made to access a CSS file (via whatever method) specifically for that user via their credentials, or via a token? This would allow run-time loading, and the ability to store, modify and retrieve it however you like on the server-side. Tim Rowe Software Engineer carsales.com Ltd From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of guy.tomer Sent: Saturday, 1 August 2009 6:39 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Any suggestion for server (java) side run-time styling solution? Hi, We read the documentation about loading styles from out side but unfortunately they all discuss loading swf compiled files. While it is possible to let an editor edit the style on the server and then run the compiler on the server to generate a swf file, it looks like redundant complexity. The server is a cluster and it'll require additional set-up for every server. Does anyone have a different solution? Just to clarify - the requirement is to have the client load the style in run-time. This style should be manageable on a management interface running on a java server. Thanks, Guy __ Notice: This email and attachments (if any) is for the exclusive use of the addressee and may contain information that is privileged and confidential. Any unauthorised use of the contents of the email and/or attachments is expressly prohibited. If you are not the addressee of this email, please notify me immediately by email and then immediately destroy any electronic or paper copy of this email and/or attachments. Carsales.com Ltd and its related companies do not accept responsibility for the views expressed in the email or for the consequences of any computer viruses that may be transmitted with this email. This email is subject to copyright. No part of it should be reproduced, adapted or transmitted without the written consent of the copyright owner.
[flexcoders] Re: how to cleanly reduce the height of a TitleWindow's title bar
Hi Andrew, Have you tried the headerHeight Style in CSS? TitleWindow { header-height: 20; } -TH --- In flexcoders@yahoogroups.com, Andrew Ball anb...@... wrote: I'm unhappy with how tall the title bars are by default for TitleWindows in my application. We have some (possibly modified) Panels with shorter titlebars. Does anyone know of a clean way to get the title bars of the TitleWindows to be a bit shorter without hard-coding any sizes? I'm looking for something like a CSS attribute I can use in the style I have designated for the title bar, which already selects the font, size, and color of the text in the title bar. Thanks for your help, Andrew -- === Andrew D. Ball åå® deus caritas est http://www.ibiblio.org/adball/blog/
[flexcoders] Re: What kind of data types should i use?
In AS, the Number and Date types should work fine. -TH --- In flexcoders@yahoogroups.com, yonghan79 yongha...@... wrote: Hi all,i need help please..I got fields in mysql table which use decimal and datetime..I'm intending to use VO,what kind of data types should i use? I post the sql and the php class here in http://www.pastebin.org/3965 .. Thanks a lot...
[flexcoders] Re: String validators and turning off the red
Here's a simple way: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ public function turnOff(e:Event):void { sv.enabled = false; test.errorString = ; } public function turnOn(e:Event):void { sv.enabled = true; } ]] /mx:Script mx:TextInput id=test/ mx:Button top=60 label=Turn Off click=turnOff(event)/ mx:Button top=60 left=100 label=Turn On click=turnOn(event)/ mx:StringValidator id=sv required=true source={test} property=text enabled=true/ /mx:Application -TH --- In flexcoders@yahoogroups.com, timgerr tgallag...@... wrote: Hello all, I have a question for ya. I have a text input that I attach a string validator so the text input is required. So I put my mouse in the box then take it out, not the box is red. I then hit a button to turn the string validator off, but the box remains red. How can I tell a text input to not be red anymore. Here is some code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ public function TurnOff(e:Event):void { sv.enabled = false; } ]] /mx:Script mx:TextInput id=test/ mx:Button label=Hello/ mx:StringValidator id=sv required=true source={test} property=text enabled=true/ /mx:Application Thanks, Timgerr
[flexcoders] Re: Combobox emtpy inside of tabNavigator
If you cast your service call result to a [Bindable] collection, and bind the collection to the ComboBox's dataProvider, the ComboBox should display populated. With binding you don't have to worry about timing. When the ComboBox is instantiated it will pull the data; if it exists. If not, the data will get pushed to the ComboBox; when it arrives. -TH --- In flexcoders@yahoogroups.com, flexaustin flexaus...@... wrote: So I have a tabNavigator with 3 tabs. I have set creationPolicy =all so that to the user it displays quickly. The issue that I have a combobox on tab#3 of the tabNav. and when I set creation=all and tab#3 is selected the combobox is empty. If set the creationpolicy=auto the data shows up in the combobox. I assume that what is happening is that tab#3 is getting created imeediately before the data arrives. FYI the data is requested the minute the entire tab is shown, which when creation is complete always shows tab #1. Thus I think the vbox and its children are getting created without the data. So I assume some how I need to invalideSize and invalidateProps on the combobox when tab#3 is clicked so it will pull in the data? TIA, J
[flexcoders] Re: Problem with Flex tree and arraycollection
What is the uid for the tree ui? Thanks, Timgerr Sent from my iPhone
[flexcoders] Re:Problem with Flex tree and arraycollection
It looks like the only part that I can hilight is the last node that was added. Timgerr Sent from my iPhone
[flexcoders] Re: Synchronizing two ArrayCollections
Cool, I kind of like this way better though: private function dgClick():void { var curTick:String = dgOrdExt.selectedItem.Ticker; for each ( var exits:Exits in Array_Exits ) { if ( exits.Ticker == curTick ) { dgExits.selectedIndex = Array_Exits.getItemIndex( exits ); } } } A little cleaner than using a counter. -TH --- In flexcoders@yahoogroups.com, Craig cra...@... wrote: Thanks that worked beautifully my final code follows: private function dgClick():void { var curTick:String = dgOrdExt.selectedItem.Ticker; for (var i:int = 0; i Array_Exits.length; i++) { if ( Exits(Array_Exits.getItemAt(i).Ticker ==c urTick) { dgExits.selectedIndex = i; } } } --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Going to have to loop: var curTick:String = dg1.selectedItem.Ticker; for (var i:int = 0; i dg2.dataProvider.length; i++) { if ( Object(dg2.dataProvider.getItemAt(i)).Ticker == curTick ) { dg2.selectedIndex = i; } } Depending on your model, you could use for each instead. Also, replace dg2.dataProivider with the appropriate ArrayCollection name and replace Object with your VO class name; if you're using one. I'd use the change event instead of click. -TH --- In flexcoders@yahoogroups.com, Craig craigj@ wrote: Take 3... after further review, to simplify things I have bound 2 separate ArrayCollection to separate DataGrids they both share one common field - Ticker.. I'd like to select the corresponding row programmatically in the second datagrid which contains the value for 'Ticker' that is selected in the first datagrid. So far this does not work... mx:DataGrid id=dg1 click='onClick() / mx:DataGrid id=dg2 / private function onClick(): void { var curTick:String = dg1.selectedItem.Ticker; dg2.selectedItem.Ticker = curTick; dg2.selectedIndex= dg2.selectedItem.Ticker.rowindex; } Any suggestions?... Anyone?? I imagine the ListCollection will work but not sure the syntax. --- In flexcoders@yahoogroups.com, Craig craigj@ wrote: Actually after thinking about it, I should just add the 2nd Webservice result to the first ArrayCollection data model. They both share the same field 'Ticker' but have different fields thereafter. The first result is Array_OrdExt and the second is Arrray_Exits. The Array Build routines for both are below. [Bindable] public var Array_Exits:ArrayCollection; public function Exits_Result(e:ResultEvent):void { Array_Exits = e.result as ArrayCollection; for (var i:int=0;iArray_Exits.length;i++) { var Current_exit:Exits = new Exits(); Current_exit = new Exits(Array_Exits.getItemAt(i)); Array_Exits.setItemAt(Current_exit, i); } } [Bindable] public var Array_OrdExt:ArrayCollection; private function OrdExt_result(e:ResultEvent):void { Array_OrdExt = e.result as ArrayCollection; for (var i:int=0;iArray_OrdExt.length;i++) { var Current_ordext:OrdExt = new OrdExt(); Current_ordext = new OrdExt(Array_OrdExt.getItemAt(i)); Array_OrdExt.setItemAt(Current_ordext, i); } } These build from two WebsServices results WSDL format (XML). For the second one, which is Array_Exits... can I just add it to the first one with the same result event? I would like to use the first field of each collection 'Ticker' as the WHERE Ticker=Ticker then do the Get and Set... The Data Model for each Array is OrdExt.as and Exits.as is structured as follows: package DTO.OrdEnt { [Bindable] public class OrdEnt { public var Ticker:String = ; public var Company:String = ;..continues public function OrdEnt(obj:Object=null){ if (obj!=null){ this.Ticker=obj.Ticker; this.Company=obj.Company;..continues --- In flexcoders@yahoogroups.com, Craig craigj@ wrote: I need to create a DataModel.as that will synchronize two arraycollections and allow me to update a Form based on the contents of the 2nd arraycollection.index.item(s) when the first arraycollection selecteditem is clicked as the dataprovider for a datagrid. The 2 arraycollections are populated via webservices from sql database, (which I can not InnerJoin from 4 different tables due to performance)... so I end with two separate arraycollections: One populates a Datagrid, the other is just resident in an ArrayCollection: Here is some of the sample code: mx:columns mx:DataGridColumn dataField=Ticker headerText=Ticker/ positions:KindColumn id=Kind headerText=Kind dataField=Kind itemRenderer=com.steury.baseClasses.CellFieldTrd/ mx:DataGridColumn id=EnterPrice
[flexcoders] Re: Synchronizing two ArrayCollections
Going to have to loop: var curTick:String = dg1.selectedItem.Ticker; for (var i:int = 0; i dg2.dataProvider.length; i++) { if ( Object(dg2.dataProvider.getItemAt(i)).Ticker == curTick ) { dg2.selectedIndex = i; } } Depending on your model, you could use for each instead. Also, replace dg2.dataProivider with the appropriate ArrayCollection name and replace Object with your VO class name; if you're using one. I'd use the change event instead of click. -TH --- In flexcoders@yahoogroups.com, Craig cra...@... wrote: Take 3... after further review, to simplify things I have bound 2 separate ArrayCollection to separate DataGrids they both share one common field - Ticker.. I'd like to select the corresponding row programmatically in the second datagrid which contains the value for 'Ticker' that is selected in the first datagrid. So far this does not work... mx:DataGrid id=dg1 click='onClick() / mx:DataGrid id=dg2 / private function onClick(): void { var curTick:String = dg1.selectedItem.Ticker; dg2.selectedItem.Ticker = curTick; dg2.selectedIndex= dg2.selectedItem.Ticker.rowindex; } Any suggestions?... Anyone?? I imagine the ListCollection will work but not sure the syntax. --- In flexcoders@yahoogroups.com, Craig craigj@ wrote: Actually after thinking about it, I should just add the 2nd Webservice result to the first ArrayCollection data model. They both share the same field 'Ticker' but have different fields thereafter. The first result is Array_OrdExt and the second is Arrray_Exits. The Array Build routines for both are below. [Bindable] public var Array_Exits:ArrayCollection; public function Exits_Result(e:ResultEvent):void { Array_Exits = e.result as ArrayCollection; for (var i:int=0;iArray_Exits.length;i++) { var Current_exit:Exits = new Exits(); Current_exit = new Exits(Array_Exits.getItemAt(i)); Array_Exits.setItemAt(Current_exit, i); } } [Bindable] public var Array_OrdExt:ArrayCollection; private function OrdExt_result(e:ResultEvent):void { Array_OrdExt = e.result as ArrayCollection; for (var i:int=0;iArray_OrdExt.length;i++) { var Current_ordext:OrdExt = new OrdExt(); Current_ordext = new OrdExt(Array_OrdExt.getItemAt(i)); Array_OrdExt.setItemAt(Current_ordext, i); } } These build from two WebsServices results WSDL format (XML). For the second one, which is Array_Exits... can I just add it to the first one with the same result event? I would like to use the first field of each collection 'Ticker' as the WHERE Ticker=Ticker then do the Get and Set... The Data Model for each Array is OrdExt.as and Exits.as is structured as follows: package DTO.OrdEnt { [Bindable] public class OrdEnt { public var Ticker:String = ; public var Company:String = ;..continues public function OrdEnt(obj:Object=null){ if (obj!=null){ this.Ticker=obj.Ticker; this.Company=obj.Company;..continues --- In flexcoders@yahoogroups.com, Craig craigj@ wrote: I need to create a DataModel.as that will synchronize two arraycollections and allow me to update a Form based on the contents of the 2nd arraycollection.index.item(s) when the first arraycollection selecteditem is clicked as the dataprovider for a datagrid. The 2 arraycollections are populated via webservices from sql database, (which I can not InnerJoin from 4 different tables due to performance)... so I end with two separate arraycollections: One populates a Datagrid, the other is just resident in an ArrayCollection: Here is some of the sample code: mx:columns mx:DataGridColumn dataField=Ticker headerText=Ticker/ positions:KindColumn id=Kind headerText=Kind dataField=Kind itemRenderer=com.steury.baseClasses.CellFieldTrd/ mx:DataGridColumn id=EnterPrice labelFunction={myPrice} dataField=EnterPrice headerText=EnterPrice/ mx:DataGridColumn id=ClosePrice labelFunction={myClosePr} dataField=Close headerText=Price/ positions:ProfitColumn id=Profit headerText=Profit dataField=Profit labelFunction={perCent} itemRenderer=com.steury.baseClasses.CellFieldInt/ /mx:columns __ positions:DgOrdExt id=dgOrdExt width=100% height=50% textAlign=center dataProvider={Array_OrdExt} itemClick=onTick4() One Array is Array_OrdEx and the other Array is Array_Exits. When I select an item on the dgOrdExt DataGrid, I simply want to populate the text values of a Form with the appropriate Items in the second datagrid... Here is the trick... they both share the same 'Ticker' value, but just different other variables... so it's not too difficult, it's just trickier than my novice programming skills can handle - easily. [Bindable] public var ExtTicker:String; So the OnTick4() event will contain
[flexcoders] Re: Screen resolution
1024 x 768 is usually the minimum resolution required for commercial apps. Although you also need to account for the browser header as well. While you can never anticipate every user's browser configuration, this is a good baseline for most. -TH --- In flexcoders@yahoogroups.com, christophe_jacquelin christophe_jacque...@... wrote: Hello, When you are developping a Flex application, which screen resolution do you choose to be acceptable for most of the users ? Thank you, Christophe,
Re: [flexcoders] Re: Having problems iterating ResultSet returned to Flex via Blaze
thx for the response...I've actaully tried this approach with no success... Also, it seems that Blaze passes back an ObjectProxy and from what I gathered online you should be able to use the ArrayUtil.toArray against this as well, which I also tried unsuccessfully... For now, I'm passing a List back from java after iterating through the ResultSet in my java class. On Thu, Jul 16, 2009 at 9:56 AM, valdhor valdhorli...@embarqmail.comwrote: I don't use Java or BlazeDS but when I get data from PHP via AMF, I usually send back an array of objects. On the Flex side I do this: datagridArrColl = new ArrayCollection(ArrayUtil.toArray(event.result)); myDatagrid.dataProvider = datagridArrColl; --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, tim...@... tim...@... wrote: I'm currently returning a SQL ResultSet from my Java class via Blaze to Flex and I'm trying to figure out how to bind for example a datagrid directly to the ResultSet object in Flex or iterate through it and then bind to the result. If anybody could point me in the right direction I'd greatly appreciate it! Thx, Tim.
[flexcoders] Re: multiple axis question.
Use a secondVerticalAxis and secondVerticalAxisRenderer (placement=right). -TH --- In flexcoders@yahoogroups.com, shaded shad...@... wrote: I'm have a chart with 3 sets of line graph data, id like to have 2 of those set to have the same y axis, and the third to have its own. The docs don't really do a good job of explaining this. Can anyone help sample code mx:Panel title=Multiple Data Series width=100% height=100% mx:LineChart id=myChart dataProvider={srv.lastResult.root.consump} showDataTips=true height=100% width=100% mx:horizontalAxis mx:CategoryAxis id=dateAxis categoryField=date/ /mx:horizontalAxis mx:verticalAxis mx:CategoryAxis id=priceAxis / /mx:verticalAxis mx:verticalAxisRenderers !--mx:AxisRenderer placement=left axis={kWAxis}/-- mx:AxisRenderer placement=left axis={priceAxis}/ /mx:verticalAxisRenderers mx:series mx:LineSeries id=consump xField=date yField=value displayName=Consumption (kWh) /mx:LineSeries mx:LineSeries id=cbl dataProvider={srv.lastResult.root.cbl} xField=cbldate yField=cblval displayName=CBL /mx:LineSeries mx:LineSeries id=price verticalAxis={priceAxis} dataProvider={srv.lastResult.root.price} xField=pricedate yField=priceval displayName=Price ($kWh) /mx:LineSeries /mx:series /mx:LineChart mx:Legend dataProvider={myChart}/ /mx:Panel
[flexcoders] Re: TileList Item Spacing
There isn't a horizontaGap or verticalGap between the tiles in a TileList. So, you'd have to use an itemRenderer to fake it. Add a transparent container to the itemRenderer, that contains the itemRenderer content; centered within the transparent container. You can then adjust the perceived gaps with padding, and/or by adjusting the rowHeight/columnWidth of the TileList. -TH --- In flexcoders@yahoogroups.com, wwwpl ww...@... wrote: I need to increase the spacing horizontally and vertically between the items in my TileList. I don't see how to do it. Please advise.
[flexcoders] Having problems iterating ResultSet returned to Flex via Blaze
I'm currently returning a SQL ResultSet from my Java class via Blaze to Flex and I'm trying to figure out how to bind for example a datagrid directly to the ResultSet object in Flex or iterate through it and then bind to the result. If anybody could point me in the right direction I'd greatly appreciate it! Thx, Tim.
[flexcoders] Re: Possible to create a chart with clustered overlaid columns? (picture inside)
Very nice! -TH --- In flexcoders@yahoogroups.com, sa3376 sa3...@... wrote: --- In flexcoders@yahoogroups.com, gmoniey22 gmoniey22@ wrote: I haven't been able to find an example of this, or any indication in the docs of how to do this, but I would imagine it is possible. I want to chart some data that is hierarchical. Essentially each parent has a few children. I want the children to be clustered columns inside a big column which indicates the parent (which is the sum of all the children) I found this example image which kinda shows what I am thinking of: http://peltiertech.com/images/2009-02/MariBar_OverlapColumns.png Thanks! I'm impressed with what I've seen from Tom Gonzalez/Axiis ... this chart in particular: http://www.axiis.org/examples/HClusterColumnExample.html
[flexcoders] Re: Possible to create a chart with clustered overlaid columns? (picture inside)
Here's another way. You would have some challenges with data tips, but nothing that can't be handled. Hope that this gives you some ideas: Multi-Clustered Column Chart Sample http://www.timothyhoff.com/projects/MultiClusteredColumnChartSample/Mul\ tiClusteredColumnChartSample.html -TH --- In flexcoders@yahoogroups.com, EddieBerman eddieberman2...@... wrote: While I haven't yet attempted that layout, here are my thoughts on one potential path: You'll need 5 series, with the first one (series 0) being the composite (as the series are drawn from 0 to n, and if the composite column was the last one it would draw over the previous columns). You'll need to adjust the individual series columnWidthRatios and offsets so that series 0 and series 1 start at the same x position, and (obviously) series 1-4 take up the space of 5 series columns. You'll need to have an itemRenderer for series 0. Override updateDisplayList() and set the unscaledWidth to be wide enough to span series 1-4. Here are some potentially helpful links: 1) demonstrates tampering with columnWidthRatio and offsets: http://www.stretchmedia.ca/code_examples/offset_calculator/SeriesOffsetC\ \ alculator.html http://www.stretchmedia.ca/code_examples/offset_calculator/SeriesOffset\ \ Calculator.html 2) QuietlyScheming shows an example of complex stacking which you'll need since series 0 is a composite: http://demo.quietlyscheming.com/ChartSampler/app.html http://demo.quietlyscheming.com/ChartSampler/app.html That's only a start as you'll still need to also create a custom legend and deal with the challenge of having the first 4 clusters blue-ish and the next 4 orange-y. Having custom itemRenderers should help with that coloring issue. Good luck! -Eddie B. --- In flexcoders@yahoogroups.com, gmoniey22 gmoniey22@ wrote: I haven't been able to find an example of this, or any indication in the docs of how to do this, but I would imagine it is possible. I want to chart some data that is hierarchical. Essentially each parent has a few children. I want the children to be clustered columns inside a big column which indicates the parent (which is the sum of all the children) I found this example image which kinda shows what I am thinking of: http://peltiertech.com/images/2009-02/MariBar_OverlapColumns.png Thanks!
[flexcoders] Re: setStyle not valid
I try change cause no work and me no Google. --- In flexcoders@yahoogroups.com, ag_rcuren robert.vancuren...@... wrote: --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: styleLabel.setStyle(fontSize, 72); -TH --- In flexcoders@yahoogroups.com, j2me_soul j2me_soul@ wrote: I try to change the style at runtime mx:Button x=38 y=44 label=ΪÖйúºÈ²Ê click=butClickHandler(event)/ mx:Label id=styleLabel text=I'm Label/ private function butClickHandler(event:MouseEvent):void { /* it doesn't work */ styleLabel.setStyle(font-size, 72); } Try this: styleLabel.setStyle(fontSize, 72); Flex Style names are camel cased so instead of font-size it is fontSize
[flexcoders] Re: Possible to change the Fill Color for ColumnSeries on itemRollOver?
Here's a slightly different approach: Chart Labeled Renderer Roll-Over Sample http://www.timothyhoff.com/projects/ChartLabeledRendererSample/ChartLab\ eledRendererSample.html -TH --- In flexcoders@yahoogroups.com, gmoniey22 gmonie...@... wrote: Is it possible to change the fill color of 1 column when the mouse is over it? I can't seem to figure it out I have something along these lines: mx:SolidColor id=barColor color=0x00FF00/ mx:SolidColor id=hoverBarColor color=0xFF/ mx:ColumnChart id=chart type=overlaid itemRollOver=updateHoverColor(event) itemRollOut=updateColor(event) mx:horizontalAxis mx:CategoryAxis categoryField=range/ /mx:horizontalAxis mx:series mx:ColumnSeries id=series xField=range yField=value fill={barColor}/ /mx:series /mx:ColumnChart And my hover function looks like: private function updateHoverColor(event:ChartItemEvent):void { var col:ColumnSeriesItem = ColumnSeriesItem(event.hitData.chartItem); col.fill = hoverBarColor; } Unfortunately, nothing happens. No errors are thrown, but the color of the column which is being hovered over is not changed. I also tried adding the mouseOver/rollOver callbacks to the ColumnSeries, and used a function as such: private function updateHoverColor(event:ChartItemEvent):void { event.target.setStyle(fill, hoverBarColor); } but that resulted in the color of all of the columns to change. Anyone have any ideas? Thanks!
[flexcoders] Re: Image Loader COMPLETE event wont fire for some images
Hi Gary, There is a 2880 pixel limit for images. Your image is too wide. -TH --- In flexcoders@yahoogroups.com, toofah_gm ga...@... wrote: I am seeing cases when the image loader COMPLETE event will not fire. Does anyone know why this is the case? I wonder if there is something wrong with some of my images that causes a bug in FLEX. Here is an example: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute applicationComplete=init() mx:Script ![CDATA[ private function init():void { myImage.addEventListener(ProgressEvent.PROGRESS, progressEventHandler); myImage.addEventListener(Event.COMPLETE, completeEventHandler); myImage.addEventListener(Event.UNLOAD, unloadEventHandler); reload(); } private function reload():void { // myImage.load(http://www.google.com/intl/en_ALL/images/logo.gif;); myImage.load(http://www.mangumfamily.org/bar.jpg;); } private function progressEventHandler(evt:ProgressEvent):void { trace(PROGRESS: bytesLoaded=+evt.bytesLoaded+, bytesTotal=+evt.bytesTotal); } private function completeEventHandler(evt:Event):void { trace(COMPLETE); } private function unloadEventHandler(evt:Event):void { trace(UNLOAD); } ]] /mx:Script mx:Image id=myImage/ mx:Button label=Reload Image y=308 click=reload()/ /mx:Application Notice that COMPLETE never gets called. If you copy the URL into a web browser it loads fine. If you change the url in the code to the Google one, it loads fine. What is wrong with my image? Maybe I need to log a bug to FLEX. Thanks for your help! Gary
[flexcoders] Re: Image Loader COMPLETE event wont fire for some images
What happens if you convert the jpg to a png with transparency? I seem to remember a problem with the alphas for a jpg. -TH --- In flexcoders@yahoogroups.com, toofah_gm ga...@... wrote: TH, Thanks for the quick response. If the image is too wide, why does http://www.mangumfamily.org/bar3.jpg; work? It has the same dimensions, just no transparency. Gary --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hi Gary, There is a 2880 pixel limit for images. Your image is too wide. -TH --- In flexcoders@yahoogroups.com, toofah_gm garym@ wrote: I am seeing cases when the image loader COMPLETE event will not fire. Does anyone know why this is the case? I wonder if there is something wrong with some of my images that causes a bug in FLEX. Here is an example: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute applicationComplete=init() mx:Script ![CDATA[ private function init():void { myImage.addEventListener(ProgressEvent.PROGRESS, progressEventHandler); myImage.addEventListener(Event.COMPLETE, completeEventHandler); myImage.addEventListener(Event.UNLOAD, unloadEventHandler); reload(); } private function reload():void { // myImage.load(http://www.google.com/intl/en_ALL/images/logo.gif;); myImage.load(http://www.mangumfamily.org/bar.jpg;); } private function progressEventHandler(evt:ProgressEvent):void { trace(PROGRESS: bytesLoaded=+evt.bytesLoaded+, bytesTotal=+evt.bytesTotal); } private function completeEventHandler(evt:Event):void { trace(COMPLETE); } private function unloadEventHandler(evt:Event):void { trace(UNLOAD); } ]] /mx:Script mx:Image id=myImage/ mx:Button label=Reload Image y=308 click=reload()/ /mx:Application Notice that COMPLETE never gets called. If you copy the URL into a web browser it loads fine. If you change the url in the code to the Google one, it loads fine. What is wrong with my image? Maybe I need to log a bug to FLEX. Thanks for your help! Gary
[flexcoders] Re: Image Loader COMPLETE event wont fire for some images
Well, probably a question better answered by Alex. I suspect that the transparency is adding to the file size and hitting the size limit. But, at this point, it's just a guess. Try cropping the image down to see if you get to a point that it works. -TH --- In flexcoders@yahoogroups.com, toofah_gm ga...@... wrote: I tried this as well...I think that the original file is actually a PNG and not a JPG...unfortunately, this does not make a difference either. Gary --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: What happens if you convert the jpg to a png with transparency? I seem to remember a problem with the alphas for a jpg. -TH --- In flexcoders@yahoogroups.com, toofah_gm garym@ wrote: TH, Thanks for the quick response. If the image is too wide, why does http://www.mangumfamily.org/bar3.jpg; work? It has the same dimensions, just no transparency. Gary --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hi Gary, There is a 2880 pixel limit for images. Your image is too wide. -TH --- In flexcoders@yahoogroups.com, toofah_gm garym@ wrote: I am seeing cases when the image loader COMPLETE event will not fire. Does anyone know why this is the case? I wonder if there is something wrong with some of my images that causes a bug in FLEX. Here is an example: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute applicationComplete=init() mx:Script ![CDATA[ private function init():void { myImage.addEventListener(ProgressEvent.PROGRESS, progressEventHandler); myImage.addEventListener(Event.COMPLETE, completeEventHandler); myImage.addEventListener(Event.UNLOAD, unloadEventHandler); reload(); } private function reload():void { // myImage.load(http://www.google.com/intl/en_ALL/images/logo.gif;); myImage.load(http://www.mangumfamily.org/bar.jpg;); } private function progressEventHandler(evt:ProgressEvent):void { trace(PROGRESS: bytesLoaded=+evt.bytesLoaded+, bytesTotal=+evt.bytesTotal); } private function completeEventHandler(evt:Event):void { trace(COMPLETE); } private function unloadEventHandler(evt:Event):void { trace(UNLOAD); } ]] /mx:Script mx:Image id=myImage/ mx:Button label=Reload Image y=308 click=reload()/ /mx:Application Notice that COMPLETE never gets called. If you copy the URL into a web browser it loads fine. If you change the url in the code to the Google one, it loads fine. What is wrong with my image? Maybe I need to log a bug to FLEX. Thanks for your help! Gary
[flexcoders] Re: Possible to change the Fill Color for ColumnSeries on itemRollOver?
Ha, yeah if it works you get extra points. :) I tried using the chart's itemRollOver event, but ran into a snafu trying to drill down and change the fill of the BoxItemRenderer. It seems to have a getStyle method, but no setStyle(). Got past that, but the stroke style got me. Would probably be best to extend the Chart and handle the item roll-over there; with styles. Someone else can do that though. -TH --- In flexcoders@yahoogroups.com, gmoniey22 gmonie...@... wrote: I wasn't aware that you could do it through css. I like that solution better than mine (particularly because it works). --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Here's a slightly different approach: Chart Labeled Renderer Roll-Over Sample http://www.timothyhoff.com/projects/ChartLabeledRendererSample/ChartLab\ \ eledRendererSample.html -TH --- In flexcoders@yahoogroups.com, gmoniey22 gmoniey22@ wrote: Is it possible to change the fill color of 1 column when the mouse is over it? I can't seem to figure it out I have something along these lines: mx:SolidColor id=barColor color=0x00FF00/ mx:SolidColor id=hoverBarColor color=0xFF/ mx:ColumnChart id=chart type=overlaid itemRollOver=updateHoverColor(event) itemRollOut=updateColor(event) mx:horizontalAxis mx:CategoryAxis categoryField=range/ /mx:horizontalAxis mx:series mx:ColumnSeries id=series xField=range yField=value fill={barColor}/ /mx:series /mx:ColumnChart And my hover function looks like: private function updateHoverColor(event:ChartItemEvent):void { var col:ColumnSeriesItem = ColumnSeriesItem(event.hitData.chartItem); col.fill = hoverBarColor; } Unfortunately, nothing happens. No errors are thrown, but the color of the column which is being hovered over is not changed. I also tried adding the mouseOver/rollOver callbacks to the ColumnSeries, and used a function as such: private function updateHoverColor(event:ChartItemEvent):void { event.target.setStyle(fill, hoverBarColor); } but that resulted in the color of all of the columns to change. Anyone have any ideas? Thanks!
[flexcoders] Re: setStyle not valid
styleLabel.setStyle(fontSize, 72); -TH --- In flexcoders@yahoogroups.com, j2me_soul j2me_s...@... wrote: I try to change the style at runtime mx:Button x=38 y=44 label=ΪÖйúºÈ²Ê click=butClickHandler(event)/ mx:Label id=styleLabel text=I'm Label/ private function butClickHandler(event:MouseEvent):void { /* it doesn't work */ styleLabel.setStyle(font-size, 72); }
[flexcoders] Actionscript on JSR223
Does anyone happen to know of any JSR223 (Java platform scripting) implementation(s) of ActionScript for dynamic use? I'm currently looking through a lot of our business data validation logic which is implemented in two places arguably unnecessarily - both on the front-end in AS and then again on the back-end in Java. The scripting.dev.java.net project page still seems to be absent of any AS interpreters. It would seem far more logical to be able to just implement this once in a single language. Two options I can see are using a Java-AS convertor, or to write this all in AS and validate the data again on the back-end against the same code. The latter would be preferable, mostly due to the stigma around here about generated code. Though much of this code might work as javascript if we dropped the typing on data, that's far from an ideal solution. Any project suggestions here would be appreciated. Thanks, Tim Rowe Software Engineer carsales.com Ltd Level 1, 109 Burwood Road Locked Bag Hawthorn VIC 3211 t: 03 9093 8600 (Reception) t: 03 9093 8757 (Direct) f: 03 9093 8697
[flexcoders] Re: Continuous Multi-colored Line Chart
That one is a little tricky. But, here's one way that you can do it: http://www.timothyhoff.com/projects/LineRendererSample/LineRendererSampl\ e.html http://www.timothyhoff.com/projects/LineRendererSample/LineRendererSamp\ le.html (right click to view source) -TH --- In flexcoders@yahoogroups.com, kenny14390 kenny14...@... wrote: Hi all. It's been a year since my last question and this one seems like an interesting problem. First to give you some background, I'm making a stats page for a game. The game consists of three rounds and each round consists of five clicks. Each click can either add or subtract points from your score. So after each round I'd like to show a line chart to plot out the value of the users' points (y axis) against each click (x axis). Since the second round starts with the points from the first and the third from the second, the graph of the entire game (all three rounds) is continuous. In order to graphically distinguish which clicks came from a certain round, I would really like to have the line be broken up into three colored segments. I couldn't find a good solution so I tried to hack my own by simply drawing three individual segments head to tail. However, this doesn't work for two reasons: the line needs to be continuous and it needs to show data tips. The three segments at a glance appear to be continuous, but I set the line to be curved so it's smooth. Back-to-back lines don't curve corners and all of a sudden a smooth line has a sharp angle. Secondly, since the ending point of the first or second round is the starting point of the next round, hovering over that point on the chart displays two data tips; one for each round (displaying the same point values). Does anyone know of anything built in to simply say starting at x-value X change line color to #xx? Thanks!
[flexcoders] Re: getting the xml data from a dispatched event
import com.nutrition.Panelcreatemealitem; -TH --- In flexcoders@yahoogroups.com, Jason B nos...@... wrote: It wont accept your suggestions Severity and Description Path Resource Location Creation Time Id 1120: Access of undefined property Panelcreatemealitem. /src Main.mxml line 105 1246801954900 468962 --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Wow, I've got to say; What a mess. However, you can get it to work with the following changes: [Bindable] private var customMeals:XMLListCollection = new XMLListCollection(); // addToMeal event Handler private function addToMealHandler(event:Event):void { customMeals.addItem((event.target as Panelcreatemealitem).mealDetails); Alert.show(customMeals.toString()); } You have some naming conflicts and, since you're dealing with xml, you'll need to use an XMLListCollection; instead of an ArrayCollection. -TH --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: Heres my three mxml files two of which are under the com/ folder and get imported...hope that helps ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=init() styleName=plain xmlns:nutrition=com.nutrition.* paddingLeft=10 paddingTop=10 paddingRight=10 paddingBottom=10 mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.collections.ICollectionView; import mx.collections.XMLListCollection; import com.nutrition.MealItem; import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.rpc.http.HTTPService; // initialize private function init():void { //load calories httpservice_load(/main.php/flexnutrition/loadcalories, this[loadcaloriesResultHandler]); hsNutrition.send(); addEventListener('addToMeal', addToMealHandler); addEventListener('removeMeal', removeMealHandler); addEventListener('learnAboutThis', learnaboutthisswf); } private function httpservice_load(url_src:String, resulthandler:Function):void{ httpService.url = url_src; //var tmp:String = resulthandler.toString(); //if(tmp != none) httpService.addEventListener(ResultEvent.RESULT, resulthandler); httpService.send(); } private function learnaboutthisswf(event:Event):void{ vfc_guy.load(/uploads/swf/ + loadswf_var); } [Bindable] private var nutritionData:XML; [Bindable] private var maindata:XML; [Bindable] public var loadswf_var:String; [Bindable] public var createmeals_loadswf_var:String; //load all calories for main meals private function loadcaloriesResultHandler(event:ResultEvent):void { maindata = event.result as XML; vfc_guy.load(/uploads/swf/ + maindata.swf); } // nutrition result handler private function nutritionResultHandler(event:ResultEvent):void { nutritionData = event.result as XML; } // nutrition fault handler private function nutritionFaultHandler(event:FaultEvent):void { Alert.show(event.toString()); } // create breakfast private function createBreakfast():void { vsMain.selectedIndex = 1; plantype = 'Breakfast'; } // create lunch private function createLunch():void { vsMain.selectedIndex = 1; plantype = 'Lunch'; } // create dinner private function createDinner():void { vsMain.selectedIndex = 1; plantype = 'Dinner'; } [Bindable] private var plantype:String; [Bindable] private var customMeals:ArrayCollection = new ArrayCollection; // addToMeal event Handler private function addToMealHandler(event:Event):void { trace(event.target); //customMeals.addItem((event.target as mealitem).mealDetails); Alert.show(event.toString()); } // removeMeal event Handler private function removeMealHandler(event:Event):void { customMeals.removeItemAt(ls.selectedIndex); } ]] /mx:Script mx:HTTPService id=hsNutrition url=/main.php/flexnutrition/nutritioncal result=nutritionResultHandler(event) fault=nutritionFaultHandler(event) resultFormat=e4x/ mx:HTTPService id=httpService url= resultFormat=e4x/ mx:Label id=totalcalories text={'Today\'s Meal Plan is based on a ' + maindata.totalcalories + ' Calorie Diet'} fontWeight=bold fontSize=18/ !--mx:Button label=Print Meal Menu /-- mx:ViewStack id=vsMain width=100% height=100% mx:Canvas id=nutrition_canvas width=100% height=100% mx:SWFLoader id=vfc_guy source= height=400 width=400 autoLoad=true x=700 y=100 / mx:HBox width=100% height=100% mx:VBox width=40% height=100% nutrition:MealPanel id=pnlBreakfast meal={nutritionData.breakfast} title=Breakfast : Please select one meal from below({maindata.breakfast} Cal Goal)/ mx:HBox horizontalCenter=right mx:Button label=Create
[flexcoders] Re: getting the xml data from a dispatched event
Wow, I've got to say; What a mess. However, you can get it to work with the following changes: [Bindable] private var customMeals:XMLListCollection = new XMLListCollection(); // addToMeal event Handler private function addToMealHandler(event:Event):void { customMeals.addItem((event.target as Panelcreatemealitem).mealDetails); Alert.show(customMeals.toString()); } You have some naming conflicts and, since you're dealing with xml, you'll need to use an XMLListCollection; instead of an ArrayCollection. -TH --- In flexcoders@yahoogroups.com, Jason B nos...@... wrote: Heres my three mxml files two of which are under the com/ folder and get imported...hope that helps ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=init() styleName=plain xmlns:nutrition=com.nutrition.* paddingLeft=10 paddingTop=10 paddingRight=10 paddingBottom=10 mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.collections.ICollectionView; import mx.collections.XMLListCollection; import com.nutrition.MealItem; import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.rpc.http.HTTPService; // initialize private function init():void { //load calories httpservice_load(/main.php/flexnutrition/loadcalories, this[loadcaloriesResultHandler]); hsNutrition.send(); addEventListener('addToMeal', addToMealHandler); addEventListener('removeMeal', removeMealHandler); addEventListener('learnAboutThis', learnaboutthisswf); } private function httpservice_load(url_src:String, resulthandler:Function):void{ httpService.url = url_src; //var tmp:String = resulthandler.toString(); //if(tmp != none) httpService.addEventListener(ResultEvent.RESULT, resulthandler); httpService.send(); } private function learnaboutthisswf(event:Event):void{ vfc_guy.load(/uploads/swf/ + loadswf_var); } [Bindable] private var nutritionData:XML; [Bindable] private var maindata:XML; [Bindable] public var loadswf_var:String; [Bindable] public var createmeals_loadswf_var:String; //load all calories for main meals private function loadcaloriesResultHandler(event:ResultEvent):void { maindata = event.result as XML; vfc_guy.load(/uploads/swf/ + maindata.swf); } // nutrition result handler private function nutritionResultHandler(event:ResultEvent):void { nutritionData = event.result as XML; } // nutrition fault handler private function nutritionFaultHandler(event:FaultEvent):void { Alert.show(event.toString()); } // create breakfast private function createBreakfast():void { vsMain.selectedIndex = 1; plantype = 'Breakfast'; } // create lunch private function createLunch():void { vsMain.selectedIndex = 1; plantype = 'Lunch'; } // create dinner private function createDinner():void { vsMain.selectedIndex = 1; plantype = 'Dinner'; } [Bindable] private var plantype:String; [Bindable] private var customMeals:ArrayCollection = new ArrayCollection; // addToMeal event Handler private function addToMealHandler(event:Event):void { trace(event.target); //customMeals.addItem((event.target as mealitem).mealDetails); Alert.show(event.toString()); } // removeMeal event Handler private function removeMealHandler(event:Event):void { customMeals.removeItemAt(ls.selectedIndex); } ]] /mx:Script mx:HTTPService id=hsNutrition url=/main.php/flexnutrition/nutritioncal result=nutritionResultHandler(event) fault=nutritionFaultHandler(event) resultFormat=e4x/ mx:HTTPService id=httpService url= resultFormat=e4x/ mx:Label id=totalcalories text={'Today\'s Meal Plan is based on a ' + maindata.totalcalories + ' Calorie Diet'} fontWeight=bold fontSize=18/ !--mx:Button label=Print Meal Menu /-- mx:ViewStack id=vsMain width=100% height=100% mx:Canvas id=nutrition_canvas width=100% height=100% mx:SWFLoader id=vfc_guy source= height=400 width=400 autoLoad=true x=700 y=100 / mx:HBox width=100% height=100% mx:VBox width=40% height=100% nutrition:MealPanel id=pnlBreakfast meal={nutritionData.breakfast} title=Breakfast : Please select one meal from below({maindata.breakfast} Cal Goal)/ mx:HBox horizontalCenter=right mx:Button label=Create your own Breakfast click=createBreakfast()/ /mx:HBox nutrition:MealPanel id=pnlSnack1 meal={nutritionData.snack1} title=Snack : Please select one snack from below({maindata.snack1} Cal Goal)/ !--mx:Button label=Create your own Lunch click=createLunch()/-- nutrition:MealPanel id=pnlLunch meal={nutritionData.lunch} title=Lunch : Please select one meal from below({maindata.lunch} Cal Goal)/ nutrition:MealPanel id=pnlSnack2 meal={nutritionData.snack2} title=Snack : Please select one snack from below({maindata.snack2} Cal Goal)/ !--mx:Button label=Create your own Dinner click=createDinner()/-- nutrition:MealPanel id=pnlDinner meal={nutritionData.dinner} title=Dinner : Please select one meal from
[flexcoders] Re: getting the xml data from a dispatched event
The zip file doesn't contain any code in the src folder. Kind of hard to see what's happening without it. -TH --- In flexcoders@yahoogroups.com, Jason B nos...@... wrote: any Idea? --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote: yes heres the results Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.cov\ erflow.Panelcreatemealitem1006 How can I access the object data, it's in a file thats under the folder /com/nutrition/file.mxml --- In flexcoders@yahoogroups.com, Sam Lai samuel.lai@ wrote: I'd add a trace statement just before it to see what type of object event.target is - it could be that the target is the UI component, and not the data object. //throws error on this line trace(event.target); customMeals.addItem((event.target as mealitem).mealDetails); 2009/7/2 Jason B nospam@: I've got an problem when the user clicks on button Add to Meal it throws an error because it can't seem to reference the data in mealDetails object inside the com/ directory? I'm trying to add the item to the list control. I have the code located here in case you want more details http://files.getdropbox.com/u/228472/mealsflex.zip [Bindable] private var customMeals:ArrayCollection = new ArrayCollection; //throws error on this line customMeals.addItem((event.target as mealitem).mealDetails); ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; width=310 height=320 title={mealDetails.title} horizontalAlign=center mx:Metadata [Event(name=addToMeal)] [Event(name=learnAboutThis)] /mx:Metadata mx:Script ![CDATA[ import mx.controls.Alert; [Bindable] public var mealDetails:Object; private function calldispatch():void { parentApplication.createmeals_loadswf_var = mealDetails.swf; dispatchEvent(new Event('learnAboutThis', true)); } ]] /mx:Script mx:Image source={'/uploads/nutrition/' + mealDetails.imgsource } width=285 height=159/ mx:Label text={mealDetails.serving}/ mx:Button label=Add to Meal click=dispatchEvent(new Event('addToMeal', true))/ mx:Button label=Learn About This click=calldispatch()/ /mx:Panel -- 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: Bitmap downsampling
Well, if it's not in the docs, you know what to do - they're open and take comments for a reason :) --Tim From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Bjorn Schultheiss Sent: Thursday, 2 July 2009 4:04 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Bitmap downsampling Can't believe this cost me 9 hours of brain time and the answer was in a constant all along. StageQuality.BEST Where's the documentation for this No-one is using, not even Aviary. thanks anyway Timmaay.. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Tim Rowe tim.r...@... wrote: Bjorn, Does the current method you're using appear to have any anti-aliasing at all? In the past, resizing with Image using img.resize((height, width), Image.ANTIALIAS) (where img is mx.controls.Image) has worked - I'm sure there'd be a similar method for BitmapData. Of course, if you're not specifying antialiasing and the method call doesn't assume it by default, then yeah, you're going to get horrible image quality on downsize as a typical algorithm will pick nearest-neighbor to the new target pixel. --Tim From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of Bjorn Schultheiss Sent: Thursday, 2 July 2009 2:34 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Bitmap downsampling Hi, I'm having a lot of trouble with down-sampling a bitmapData. I tried the smoothing option first public function produceResizedBitmapData(image:DisplayObject, transform:Matrix):BitmapData { var temp:BitmapData = new BitmapData(image.width, image.height, true, 0x00FF); temp.draw(image); var clone:BitmapData = new BitmapData(image.width*transform.a, image.height*transform.d, true, 0x00FF); clone.draw(temp, transform, null, null, null, true); temp.dispose(); return clone; } except the quality was poor, once the image was of a certain size. For example scaling a 2500px image down to 200px. I've tried using clevrLib plus a pixelBender bilinear sampler but no go. I've noticed it works in picnik so it must be possible. Can anyone push me in the right direction.
[flexcoders] Re: htmlText truncation when changing from embedded to device font
That's all that I have Toby. Maybe someone else would like to jump in. -TH --- In flexcoders@yahoogroups.com, tphipps toby.phi...@... wrote: Tim, Thanks for the detailed reply. Unfortunately, this only fixes half the problem... With your recommended changes in place, the size of the TextArea now restores after a brief flicker, but the HTML formatting of the content is still lost. Even if I reassign the HTML text to the TextArea inside your updateTextSize function so it happens after the font change is complete, only the raw text appears, and the formatting (even non-font-dependent formatting such as br/, li etc.) is lost. I read and appreciate your point about the bold face text requiring an embedded bold font, but even the non font-dependent formatting (as above) is lost. Any ideas on how to restore the formatting after the font change? Thanks again, Toby --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: I'll let the engineers let you know why this is happening. But, you can get it to work with the following steps (hack): 1) Remove height=200 from the test Text control. 2) Add this function: private function updateTextSize():void { test.invalidateSize(); } 3) On the ComboBox change event, execute callLater(updateTextSize); Note: If you use embedded fonts, a boldface font must be available for b/b to work. -TH --- In flexcoders@yahoogroups.com, tphipps toby.phipps@ wrote: Hi all, I've seeing some strange behaviour with a mx:Text component using htmlText. It seems that when the fontFamily of the text component is changed at runtime from an embedded font to a device font (or vice versa), the content is truncated, and the HTML formatting lost. However, when changing from one device font to another (or one embedded font to another), it works just fine. Take this example (view source enabled but without the actual font files included - any OTF should work fine): http://dev.nx.sg/lab/fontchange/FontChange.html This app initializes the text component with some htmlText using a device font (_sans in this case). Once loaded, try changing the font to another device font (e.g. Courier New or Myriad) with the dropdown. Everything's fine. Now change to an embedded font, and note the truncation and loss of formatting. The reverse happens if I initalize the field with an embedded font - changing to another embedded font works fine but changing to a device font ends up truncating again. Anyone got any ideas how to make this work? Thanks, Toby.
[flexcoders] Re: htmlText truncation when changing from embedded to device font
One other thing that you could try would be to create the TextArea dynamically each time with AS, set the styleName, set the text and addChild(). You would have to removeChild() each time as well. Not sure if this would solve your problem, but maybe it's worth a try. -TH --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: That's all that I have Toby. Maybe someone else would like to jump in. -TH --- In flexcoders@yahoogroups.com, tphipps toby.phipps@ wrote: Tim, Thanks for the detailed reply. Unfortunately, this only fixes half the problem... With your recommended changes in place, the size of the TextArea now restores after a brief flicker, but the HTML formatting of the content is still lost. Even if I reassign the HTML text to the TextArea inside your updateTextSize function so it happens after the font change is complete, only the raw text appears, and the formatting (even non-font-dependent formatting such as br/, li etc.) is lost. I read and appreciate your point about the bold face text requiring an embedded bold font, but even the non font-dependent formatting (as above) is lost. Any ideas on how to restore the formatting after the font change? Thanks again, Toby --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: I'll let the engineers let you know why this is happening. But, you can get it to work with the following steps (hack): 1) Remove height=200 from the test Text control. 2) Add this function: private function updateTextSize():void { test.invalidateSize(); } 3) On the ComboBox change event, execute callLater(updateTextSize); Note: If you use embedded fonts, a boldface font must be available for b/b to work. -TH --- In flexcoders@yahoogroups.com, tphipps toby.phipps@ wrote: Hi all, I've seeing some strange behaviour with a mx:Text component using htmlText. It seems that when the fontFamily of the text component is changed at runtime from an embedded font to a device font (or vice versa), the content is truncated, and the HTML formatting lost. However, when changing from one device font to another (or one embedded font to another), it works just fine. Take this example (view source enabled but without the actual font files included - any OTF should work fine): http://dev.nx.sg/lab/fontchange/FontChange.html This app initializes the text component with some htmlText using a device font (_sans in this case). Once loaded, try changing the font to another device font (e.g. Courier New or Myriad) with the dropdown. Everything's fine. Now change to an embedded font, and note the truncation and loss of formatting. The reverse happens if I initalize the field with an embedded font - changing to another embedded font works fine but changing to a device font ends up truncating again. Anyone got any ideas how to make this work? Thanks, Toby.
[flexcoders] Re: ListEvent itemRenderer field null when parent is out of view
Here's another work-around Brian: public function handleTreeItemChange(event:ListEvent):void { callLater(getItemRenderer); } public function getItemRenderer():void { debugTextArea.text = ListEvent's itemRenderer: + testTree.itemToItemRenderer(testTree.selectedItem); } -TH --- In flexcoders@yahoogroups.com, lachance.brian lachance.br...@... wrote: Hi, Tim, Thanks for the tip! I hadn't thought of that as a direct workaround of sorts, but that does open the doors for another way to get it to work, I think :) It's not-so-much accessing the data that's the problem with this bug (which I probably should have explained), but rather some of the fields of the itemRenderer--specifically, the depth field. I guess I could, instead of relying on that field, just traverse the tree upwards from the selectedItem and calculate the depth manually in the bug case. Thanks again, Tim! -Brian --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hi Brian, Nice post. Yeah, that is wierd; looks like a bug. You can get around it for now, by looking at the data instead: public function handleTreeItemChange(event:ListEvent):void { debugTextArea.text = ListEvent's selectedItem: + testtree.selectedit...@label mailto:testtree.selectedit...@label ; } -TH --- In flexcoders@yahoogroups.com, lachance.brian lachance.brian@ wrote: Hi, Group! I'm having some trouble with the Tree component in the Flex framework: When browsing a Tree with an XML-based dataProvider, I seem to be unable to retrieve the itemRenderer field of the ListEvent event that gets fired when the selected item changes (ListEvent.CHANGE). The itemRenderer field is expected to not be null, but, I'm apparently expecting the wrong thing. Has anyone ever ran into this issue? I've searched the Adobe JIRA system and Google (and this list!), and I've yet to find a helpful result. There were some previous bugs in the bug repository, but they were transferred over from an old system. I've submitted the request for more information, so we'll see where that goes. An example MXML file follows below. To see the bug, scroll down through the XML list until the parent item is out of view. Then, select one of the children currently in view and press the left-key to try to go to the parent item. Notice that the itemRenderer is null, and this is where my problem arises. Thank you in advance for any help you're able to provide! MXML file: http://pastebin.com/fd4614a P.S. This is my first time posting on a newsgroup, so I hope that the formatting and whatnot worked out in an acceptable way. I apologize if that's not the case.
[flexcoders] Re: itemrenderer in datagrid does not refresh
Sorry if this comes through twice. Instead of using the creationComplete and dataChange events, add this to the itemRenderer's script: override public function set data(value:Object):void { super.data = value; if ( value != null ) checkEmail(); } -TH --- In flexcoders@yahoogroups.com, kshah0...@... kshah0...@... wrote: I tried it but no luck: Here is the code: ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100% creationComplete=checkEmail() dataChange=checkEmail() mx:states mx:State name=redo mx:RemoveChild target={emailButton}/ mx:SetProperty target={butt} name=width value=70/ /mx:State mx:State name=undo mx:RemoveChild target={reemailButton}/ mx:SetProperty target={butt} name=width value=70/ /mx:State /mx:states mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import mx.controls.Alert; private function checkEmail():void { if(data != null data.STATUS != null data.STATUS.length 0 data.STATUS == 'V') { reemailButton.visible = true; currentState='redo'; } else if(data.STATUS == 'O') { emailButton.visible = true; currentState='undo'; } else emailButton.visible = false; trace(email: + data.STATUS + : + emailButton.visible); } public function sendMail():void { //var u:URLRequest = new URLRequest(mailto:; + data.email); //navigateToURL(u,_self); userLogin.send(); //Alert.show(mailto: + data.email); } public function sendMail2():void { //var u:URLRequest = new URLRequest(mailto:; + data.email); //navigateToURL(u,_self); userLogin2.send(); //Alert.show(mailto: + data.email); } [Bindable] private var loginResult:String; public function getLoginResult(event:ResultEvent):void{ loginResult = event.result.toString(); Alert.show(loginResult); //parentDocument.genericlist.removeAll(); // parentDocument.xmlforGrid.send(); } [Bindable] private var loginResult9:String; public function getLoginResult9(event:ResultEvent):void{ loginResult9 = event.result.toString(); Alert.show(loginResult9); // parentDocument.genericlist.removeAll(); // parentDocument.xmlforGrid.send(); } ]] /mx:Script --- In flexcoders@yahoogroups.com, Jeffry Houser jeff@ wrote: Implement the onDataChange event in your itemRenderer . kshah0097@ wrote: I have a external Itemrenderer that I am using in a Datagrid. Everytime I search the datagrid by filterfunction, the itemrenderer does not refresh or displays out of order. Any ideas on how I can prevent this from happening? -- 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 -- 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] Re: ListEvent itemRenderer field null when parent is out of view
Ha, still a bug and a hack though; hence the use of callLater. :) -TH --- In flexcoders@yahoogroups.com, lachance.brian lachance.br...@... wrote: Wow, it looks like I need to read the documentation a bit closer: the itemToItemRenderer method looks like a pretty-obvious candidate! Thanks, Tim! --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Here's another work-around Brian: public function handleTreeItemChange(event:ListEvent):void { callLater(getItemRenderer); } public function getItemRenderer():void { debugTextArea.text = ListEvent's itemRenderer: + testTree.itemToItemRenderer(testTree.selectedItem); } -TH --- In flexcoders@yahoogroups.com, lachance.brian lachance.brian@ wrote: Hi, Tim, Thanks for the tip! I hadn't thought of that as a direct workaround of sorts, but that does open the doors for another way to get it to work, I think :) It's not-so-much accessing the data that's the problem with this bug (which I probably should have explained), but rather some of the fields of the itemRenderer--specifically, the depth field. I guess I could, instead of relying on that field, just traverse the tree upwards from the selectedItem and calculate the depth manually in the bug case. Thanks again, Tim! -Brian --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hi Brian, Nice post. Yeah, that is wierd; looks like a bug. You can get around it for now, by looking at the data instead: public function handleTreeItemChange(event:ListEvent):void { debugTextArea.text = ListEvent's selectedItem: + testtree.selectedit...@label mailto:testtree.selectedit...@label ; } -TH --- In flexcoders@yahoogroups.com, lachance.brian lachance.brian@ wrote: Hi, Group! I'm having some trouble with the Tree component in the Flex framework: When browsing a Tree with an XML-based dataProvider, I seem to be unable to retrieve the itemRenderer field of the ListEvent event that gets fired when the selected item changes (ListEvent.CHANGE). The itemRenderer field is expected to not be null, but, I'm apparently expecting the wrong thing. Has anyone ever ran into this issue? I've searched the Adobe JIRA system and Google (and this list!), and I've yet to find a helpful result. There were some previous bugs in the bug repository, but they were transferred over from an old system. I've submitted the request for more information, so we'll see where that goes. An example MXML file follows below. To see the bug, scroll down through the XML list until the parent item is out of view. Then, select one of the children currently in view and press the left-key to try to go to the parent item. Notice that the itemRenderer is null, and this is where my problem arises. Thank you in advance for any help you're able to provide! MXML file: http://pastebin.com/fd4614a P.S. This is my first time posting on a newsgroup, so I hope that the formatting and whatnot worked out in an acceptable way. I apologize if that's not the case.
RE: [flexcoders] Bitmap downsampling
Bjorn, Does the current method you're using appear to have any anti-aliasing at all? In the past, resizing with Image using img.resize((height, width), Image.ANTIALIAS) (where img is mx.controls.Image) has worked - I'm sure there'd be a similar method for BitmapData. Of course, if you're not specifying antialiasing and the method call doesn't assume it by default, then yeah, you're going to get horrible image quality on downsize as a typical algorithm will pick nearest-neighbor to the new target pixel. --Tim From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Bjorn Schultheiss Sent: Thursday, 2 July 2009 2:34 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Bitmap downsampling Hi, I'm having a lot of trouble with down-sampling a bitmapData. I tried the smoothing option first public function produceResizedBitmapData(image:DisplayObject, transform:Matrix):BitmapData { var temp:BitmapData = new BitmapData(image.width, image.height, true, 0x00FF); temp.draw(image); var clone:BitmapData = new BitmapData(image.width*transform.a, image.height*transform.d, true, 0x00FF); clone.draw(temp, transform, null, null, null, true); temp.dispose(); return clone; } except the quality was poor, once the image was of a certain size. For example scaling a 2500px image down to 200px. I've tried using clevrLib plus a pixelBender bilinear sampler but no go. I've noticed it works in picnik so it must be possible. Can anyone push me in the right direction.
[flexcoders] Re: Problem using b in htmlText
Since you are not closing the a tags, it looks like the /b closing tag is not getting recognized. Just add /a and it works fine: ![CDATA[ ba href=event:1One/a/ba href=event:2 Twoa href=event:2 Two ]] -TH --- In flexcoders@yahoogroups.com, greenfishinwater greenfishinwa...@... wrote: I am using Flex 3 and have a Text compnent using htmlText. I am using the tags a and b, what I have noticed is that if I use b before a then all the following text is in Bold, even though I use /b to end Bold. This is an example of the code I am using showing the difference. Why? mx:Text width=100% y=250 mx:htmlText ![CDATA[ ba href=event:1One/ba href=event:2 Twoa href=event:2 Two ]] /mx:htmlText /mx:Text mx:Text width=100% y=350 mx:htmlText ![CDATA[ a href=event:1bOne/ba href=event:2 Twoa href=event:2 Two ]] /mx:htmlText /mx:Text
[flexcoders] Re: ListEvent itemRenderer field null when parent is out of view
Hi Brian, Nice post. Yeah, that is wierd; looks like a bug. You can get around it for now, by looking at the data instead: public function handleTreeItemChange(event:ListEvent):void { debugTextArea.text = ListEvent's selectedItem: + testtree.selectedit...@label mailto:testtree.selectedit...@label ; } -TH --- In flexcoders@yahoogroups.com, lachance.brian lachance.br...@... wrote: Hi, Group! I'm having some trouble with the Tree component in the Flex framework: When browsing a Tree with an XML-based dataProvider, I seem to be unable to retrieve the itemRenderer field of the ListEvent event that gets fired when the selected item changes (ListEvent.CHANGE). The itemRenderer field is expected to not be null, but, I'm apparently expecting the wrong thing. Has anyone ever ran into this issue? I've searched the Adobe JIRA system and Google (and this list!), and I've yet to find a helpful result. There were some previous bugs in the bug repository, but they were transferred over from an old system. I've submitted the request for more information, so we'll see where that goes. An example MXML file follows below. To see the bug, scroll down through the XML list until the parent item is out of view. Then, select one of the children currently in view and press the left-key to try to go to the parent item. Notice that the itemRenderer is null, and this is where my problem arises. Thank you in advance for any help you're able to provide! MXML file: http://pastebin.com/fd4614a P.S. This is my first time posting on a newsgroup, so I hope that the formatting and whatnot worked out in an acceptable way. I apologize if that's not the case.
[flexcoders] Re: Time Difference between two columns in DataGrid using itemrenderer
Hi Don, The itemRenderer's data Object contains BOTH fields for that row in the dataProvider. You can start by trying to pass the date strings into a DataFormatter and cast as Date, or try DateField.stringToDate(). If the format of the date string isn't compatible, and you can't change what the server sends, you might have to parse the string manually and create a Date object from scratch. Once you have the two date strings converted to Dates, you're ready to compare them. There are a few utilities that you'll be able to find through a search, that work with comparing dates. I found this very quickly (looks like it rounds to full days though): private function calcuateDays( start:Date, end:Date ) :int { var daysInMilliseconds:int = 1000*60*60*24; return ( (end.time - start.time) / daysInMilliseconds ); } You'd probably want to use a Number instead of int, and round the number as desired. And, probably search anyway. -TH --- In flexcoders@yahoogroups.com, Don Kerr fusionp...@... wrote: I have two columns in a datadrid, startTime (e.g. 04:30 PM) and endTime (e.g. 06:00 PM). Both are strings and varchar in the database. I want to add a column to the datagrid that displays the difference between these two times expressed in hours (e.g. 1.5 Hours). I'm trying to use an itemrenderer to do this calculation, but I've yet to be successful. Having trouble converting the strings to date, then calculate the hours. Can anyone help? Thanks, Don
[flexcoders] Re: text input that only accepts numbers
Look at the restrict property, lest we revert to the stone-ages. -TH --- In flexcoders@yahoogroups.com, kshah0...@... kshah0...@... wrote: What type of Flex validator component can I use so a Text Input component can only accept numbers? I've tried the NumberValidator but it does not have character limit.
[flexcoders] Re: Charting: Drilling down into a legend label
Not out of the box. But, you could extend Legend and assign a custom LegendItem to legendItemClass. LegendItem is a UIComponent, so it would be easy to extend and add mouse event listeners/handlers. In the custom LegendItem, you could use the legendData and/or element vars, to drive the drill-down. Haven't done this myself, but sounds like fun. :) -TH --- In flexcoders@yahoogroups.com, Brad Bueche brad.bue...@... wrote: I was just going through an old Flex 2 charting app I did. And one of the things I, and my prospective users, wanted to do was to drill down into a legend label. (I got drill-down in the charts workingthanks to quietlyscheming --- that stuff was not documented anywhere then!) I'm thinking of resurrecting that... Even though it was my first flex application it still looks and operates better than anything I have done in php, html, javscript, or C# asp.net since!! Now, seeing it again, I don't know why I every let it die. It was a skunk works project. You know, outside the work your supposed to be doing! (Then you have to take the time to sell it around on the quietbut I got busy) So, anyway, CAN you drill down into a legend item in FB3 or FB4? brad
[flexcoders] Re: Extending Custom Panel with RadioButtons - Help
Hi Wally, Pretty close, just a few minor tweaks needed: // add the event parameter public function changeStartType( event:Event ):void // change to group addressRB.group = startLocation; airportRB.group = startLocation; protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); // gap between label and edges of button var margin:int = 4; // set the sizes addressRB.setActualSize(addressRB.getExplicitOrMeasuredWidth(), addressRB.getExplicitOrMeasuredHeight()); airportRB.setActualSize(airportRB.getExplicitOrMeasuredWidth(), airportRB.getExplicitOrMeasuredHeight()); // position the buttons in the panel addressRB.move(145,5); airportRB.move(255,5); } -TH --- In flexcoders@yahoogroups.com, Wally Kolcz wko...@... wrote: Using an example from the web I am trying to create a custom Panel component that had radio buttons in the panel header for a specific piece of a web site. The panel works and I am getting 2 radio buttons but no labels for either button and the radioGroup's changeStartType() is not being called . What am I doing wrong? Here is the AS: package com.wallykolcz.views.components { import edu.umich.body.Maps; import flash.events.Event; import mx.containers.Panel; import mx.controls.Button; import mx.controls.RadioButton; import mx.controls.RadioButtonGroup; public class RadioButtonPanel extends Panel { //Create Radio Button Group and Buttons private var startLocation:RadioButtonGroup = new RadioButtonGroup(); private var addressRB:RadioButton = new RadioButton(); private var airportRB:RadioButton = new RadioButton(); private var maps:Maps; //constructor public function RadioButtonPanel() { super(); } public function changeStartType():void { if (startLocation.selectedValue == address){ maps.start_txt.text = Enter Starting Address; maps.frmAirport.includeInLayout = false; maps.frmAirport.visible = false; maps.frmAddress.includeInLayout = true; maps.frmAddress.visible = true; maps.submit_btn.visible = true; }else{ maps.start_txt.text = Choose Your Airport; maps.frmAddress.includeInLayout = false; maps.frmAddress.visible = false; maps.frmAirport.includeInLayout = true; maps.frmAirport.visible = true; maps.submit_btn.visible = true; } } protected override function createChildren():void{ super.createChildren(); //instantiate new radiobuttons and assign properties addressRB.value=address; addressRB.label=My Address; addressRB.groupName = startLocation; airportRB.value=airport; airportRB.label=Airport; airportRB.groupName=startLocation //add event listener for change event and call method startLocation.addEventListener(Event.CHANGE, changeStartType); //add the buttons to rawChildren rawChildren.addChild(addressRB); rawChildren.addChild(airportRB); } protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ super.updateDisplayList(unscaledWidth, unscaledHeight); //gap between label and edges of button var margin:int = 4; //position the buttons in the panel addressRB.move(145, 15); airportRB.move(255,15) }
[flexcoders] Re: Extending Custom Panel with RadioButtons - Help
You need to add maps as a child in createChildren(). -TH --- In flexcoders@yahoogroups.com, Wally Kolcz wko...@... wrote: Thanks! The labels are now showing perfectly! However, I am getting an error when I attempt to check the radio buttons: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.wallykolcz.views.components::RadioButtonPanel/changeStartType()[D:\w\ kolcz\My Documents\Flex3\landingPage\src\com\wallykolcz\views\components\RadioBut\ tonPanel.as:34] Line 34 (in this case since I chose Airport to make this error) is part of this: public function changeStartType(e:Event):void { if (startLocation.selectedValue == address){ maps.start_txt.text = Enter Starting Address; maps.frmAirport.includeInLayout = false; maps.frmAirport.visible = false; maps.frmAddress.includeInLayout = true; maps.frmAddress.visible = true; maps.submit_btn.visible = true; }else{ maps.start_txt.text = Choose Your Airport; maps.frmAddress.includeInLayout = false; maps.frmAddress.visible = false; maps.frmAirport.includeInLayout = true; maps.frmAirport.visible = true; maps.submit_btn.visible = true; } } I did import and create a variable for the 'maps' component in which this panel is inside. import edu.umich.body.Maps; private var maps:Maps; Is there something I am missing? If you need a visual reference you can see the concept site at http://www.med.umich.edu/prmc/landing/helipad From: Tim Hoff timh...@... Sent: Wednesday, June 24, 2009 8:04 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Extending Custom Panel with RadioButtons - Help Hi Wally, Pretty close, just a few minor tweaks needed: // add the event parameter public function changeStartType( event:Event ): void // change to group addressRB.group = startLocation ; airportRB.group = startLocation ; protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number): void { super .updateDisplayList(unscaledWidth, unscaledHeight); // gap between label and edges of button var margin:int = 4; // set the sizes addressRB.setActualSize(addressRB.getExplicitOrMeasuredWidth(), addressRB.getExplicitOrMeasuredHeight()); airportRB.setActualSize(airportRB.getExplicitOrMeasuredWidth(), airportRB.getExplicitOrMeasuredHeight()); // position the buttons in the panel addressRB.move(145,5 ); airportRB.move(255,5 ); } -TH --- In flexcoders@yahoogroups.com, Wally Kolcz wkolcz@ wrote: Using an example from the web I am trying to create a custom Panel component that had radio buttons in the panel header for a specific piece of a web site. The panel works and I am getting 2 radio buttons but no labels for either button and the radioGroup's changeStartType() is not being called . What am I doing wrong? Here is the AS: package com.wallykolcz.views.components { import edu.umich.body.Maps; import flash.events.Event; import mx.containers.Panel; import mx.controls.Button; import mx.controls.RadioButton; import mx.controls.RadioButtonGroup; public class RadioButtonPanel extends Panel { //Create Radio Button Group and Buttons private var startLocation:RadioButtonGroup = new RadioButtonGroup(); private var addressRB:RadioButton = new RadioButton(); private var airportRB:RadioButton = new RadioButton(); private var maps:Maps; //constructor public function RadioButtonPanel() { super(); } public function changeStartType():void { if (startLocation.selectedValue == address){ maps.start_txt.text = Enter Starting Address; maps.frmAirport.includeInLayout = false; maps.frmAirport.visible = false; maps.frmAddress.includeInLayout = true; maps.frmAddress.visible = true; maps.submit_btn.visible = true; }else{ maps.start_txt.text = Choose Your Airport; maps.frmAddress.includeInLayout = false; maps.frmAddress.visible = false; maps.frmAirport.includeInLayout = true; maps.frmAirport.visible = true; maps.submit_btn.visible = true; } } protected override function createChildren():void{ super.createChildren(); //instantiate new radiobuttons and assign properties addressRB.value=address; addressRB.label=My Address; addressRB.groupName = startLocation; airportRB.value=airport; airportRB.label=Airport; airportRB.groupName=startLocation //add event listener for change event and call method startLocation.addEventListener(Event.CHANGE, changeStartType); //add the buttons to rawChildren rawChildren.addChild(addressRB); rawChildren.addChild(airportRB); } protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ super.updateDisplayList(unscaledWidth, unscaledHeight); //gap between label and edges of button var margin:int = 4; //position the buttons in the panel addressRB.move(145, 15); airportRB.move(255,15) }
[flexcoders] Re: Extending Custom Panel with RadioButtons - Help
Ok, so take maps out of the RadioButtonPanel AS component and make the startLocation RadioButtonGroup public. Next create a Event in the component, that will be dispatched when the radio buttons are clicked: After the import statements add: [Event(name=changeMap,type=flash.events.Event)] Then in changeStartType(), replace the if statement with: var event:Event = new Event( changeMap ); dispatchEvent( event ); Now you can listen for the event: wallyk:RadioButtonPanel changeMap=handleChangeMap( event )/ The event handler would then perform the changes, from outside of the component: private function handleChangeMap( event:Event ):void { if (event.currentTarget.startLocation.selectedValue == address){ start_txt.text = Enter Starting Address; }else{ start_txt.text = Choose Your Airport; } } It makes sense to do it this way because the content of the panel could change and you might want to re-use your component.. -TH --- In flexcoders@yahoogroups.com, Wally Kolcz wko...@... wrote: How can I do that? maps is the 'page' that this panel is on. I need to control the elements that are inside the panel: wallyk:RadioButtonPanel width=100% height=20% title=Start Address Type: paddingLeft=5 includeInLayout=true visible=true mx:Label id=start_txt / mx:Form id=frmAddress width=100% height=100% mx:FormItem label=Street Address: fontWeight=bold mx:TextInput id=address_txt fontWeight=normal / /mx:FormItem mx:FormItem label=City: fontWeight=bold mx:TextInput id=city_txt fontWeight=normal / /mx:FormItem mx:FormItem label=State: fontWeight=bold mx:TextInput id=state_txt fontWeight=normal maxChars=2 / /mx:FormItem mx:FormItem label=Zip Code: fontWeight=bold mx:TextInput id=zip_txt fontWeight=normal maxChars=5/ /mx:FormItem mx:Button label=Get Directions click=showDirections(address_txt.text, city_txt.text, state_txt.text, zip_txt.text); / /mx:Form mx:Form width=100% id=frmAirport height=100% includeInLayout=false visible=false mx:ComboBox id=addresscbb labelField=label fontWeight=normal mx:ArrayCollection mx:Object label=Capital Region International Airport address=4100 Capital City Boulevard city=Lansing state=MI zipcode=48906/ mx:Object label=Kalamazoo/Battle Creek International Airport address=5235 Portage Road city=Kalamazoo state=MI zipcode=49002/ mx:Object label=Gerald R. Ford International Airport address=5500 44th St SE city=Grand Rapids state=MI zipcode=49512/ mx:Object label=Bishop International Airport address=3425 W Bristol Road city=Flint state=MI zipcode=48507/ mx:Object label=Detroit Metropolitan Wayne County Airport address=9000 Middlebelt Road city=Romulus state=MI zipcode=48174/ mx:Object label=Capital Region International Airport address=655 Aviation Drive city=Mason state=MI zipcode=48854/ /mx:ArrayCollection /mx:ComboBox /mx:Form mx:Button label=Map Route id=submit_btn visible=false / /wallyk:RadioButtonPanel From: Tim Hoff timh...@... Sent: Wednesday, June 24, 2009 8:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Extending Custom Panel with RadioButtons - Help You need to add maps as a child in createChildren(). -TH --- In flexcoders@yahoogroups.com, Wally Kolcz wkolcz@ wrote: Thanks! The labels are now showing perfectly! However, I am getting an error when I attempt to check the radio buttons: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.wallykolcz.views.components::RadioButtonPanel/changeStartType()[D:\w\ \ kolcz\My Documents\Flex3\landingPage\src\com\wallykolcz\views\components\RadioBut\ \ tonPanel.as:34] Line 34 (in this case since I chose Airport to make this error) is part of this: public function changeStartType(e:Event):void { if (startLocation.selectedValue == address){ maps.start_txt.text = Enter Starting Address; maps.frmAirport.includeInLayout = false; maps.frmAirport.visible = false; maps.frmAddress.includeInLayout = true; maps.frmAddress.visible = true; maps.submit_btn.visible = true; }else{ maps.start_txt.text = Choose Your Airport; maps.frmAddress.includeInLayout = false; maps.frmAddress.visible = false; maps.frmAirport.includeInLayout = true; maps.frmAirport.visible = true; maps.submit_btn.visible = true; } } I did import and create a variable for the 'maps' component in which this panel is inside. import edu.umich.body.Maps; private var maps:Maps; Is there something I am missing? If you need a visual reference you can see the concept site at http://www.med.umich.edu/prmc/landing/helipad From: Tim Hoff TimHoff@ Sent: Wednesday, June 24, 2009 8:04 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Extending Custom Panel with RadioButtons - Help Hi Wally, Pretty close, just a few
[flexcoders] Re: Mate CacheSetter
Just a stab Richard, but do the binding brackets make any difference? PropertyInjector targetKey=foo source={ legacyModel } sourceKey=foo/ -TH --- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote: Any Mate users here? The forums are down again. I'm trying to use the newish CacheSetter tag, as follows: CacheSetter cache=global cacheKey=legacyModel instance={this.model}/ Elsewhere: PropertyInjector targetKey=foo source=legacyModel sourceKey=foo/ This gives the error: 1069 Property foo not found on String If I use the class name instead it complains because the class in question has constructor arguments. What's the correct approach here? Thanks.
[flexcoders] Re: tilelist rowCount not working...
Assuming that the direction=horizontal, the rowCount should work; unless you are setting an explicit width and the number of items will spill into an additional row. They have to go somewhere, right? What happens if you remove the width property? -TH --- In flexcoders@yahoogroups.com, grimmwerks gr...@... wrote: Argh. No one's had this issue of setting a rowCount and it not being honored? On Jun 24, 2009, at 2:14 PM, grimmwerks wrote: I'm using FB3 and setting a tileList's rowCount=2 in the mxml - but then once adding data it's definately 3 rows I see. I've even tried adding tilelist.rowCount=2 on the dataChange but it's just not doing a THING. Only other option is to set the data it loads in to only 2 rows-amount and 'paging' through but that just seems stupid... -- 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: tilelist rowCount not working...
From the docs: rowCount Number of rows to be displayed. If the height of the component has been explicitly set, this property might not have any effect. -TH --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: Assuming that the direction=horizontal, the rowCount should work; unless you are setting an explicit width and the number of items will spill into an additional row. They have to go somewhere, right? What happens if you remove the width property? -TH --- In flexcoders@yahoogroups.com, grimmwerks grimm@ wrote: Argh. No one's had this issue of setting a rowCount and it not being honored? On Jun 24, 2009, at 2:14 PM, grimmwerks wrote: I'm using FB3 and setting a tileList's rowCount=2 in the mxml - but then once adding data it's definately 3 rows I see. I've even tried adding tilelist.rowCount=2 on the dataChange but it's just not doing a THING. Only other option is to set the data it loads in to only 2 rows-amount and 'paging' through but that just seems stupid... -- 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: MenuBar ItemRenderers on Sub-Menus
An easy way would be to extend MenuBar: package { import mx.controls.Menu; import mx.controls.MenuBar; import mx.core.ClassFactory; public class MyMenuBar extends MenuBar { public function MyMenuBar() { super(); } override public function getMenuAt( index:int ) : Menu { var menu:Menu = super.getMenuAt( index ); menu.styleName = myMenuItemRendererStyleName; menu.itemRenderer = new ClassFactory( MyMenuItemRenderer ); return menu; } } } -TH --- In flexcoders@yahoogroups.com, lampei lam...@... wrote: I'm trying to create a custom itemrenderer for the sub menus of an itemrenderer, but am running into some issues...the main one being that I cannot seem to access the sub menus to create them. The docs state: You can define an item renderer for the pop-up submenus of the MenuBar control. Because each pop-up submenu is an instance of the Menu control, you use the class MenuItemRenderer to define an item renderer for the pop-up submenus. To set the item renderer for a pop-up submenu, access the Menu object using the menus property. However, I'm having trouble trying to figure out when the menus have been set, and how to change their itemrenderer once I *do* get the check working. Anyone have any insight into how to accomplish this? It seems to be pretty straight forward...when menus has values, set an itemrenderer on the items within it. Thanks.
[flexcoders] Re: Flex Browse File
Not sure if this available for flex, but for air: var file:File = new File(); file.addEventListener(Event.SELECT, dirSelected); file.browseForDirectory(Select a directory); function dirSelected(e:Event):void { trace(file.nativePath); } -TH --- In flexcoders@yahoogroups.com, reversible_82 reversible...@... wrote: Hi guys, I'm trying to browse and select a folder from the local file system,i was reading about the FileReferenceList class to browse a file, but that does not let me select a folder, just a file, do you know how can I get Around this, or some source to read. I need to select a folder from the local system not a file. Thanks
[flexcoders] Re: htmlText truncation when changing from embedded to device font
I'll let the engineers let you know why this is happening. But, you can get it to work with the following steps (hack): 1) Remove height=200 from the test Text control. 2) Add this function: private function updateTextSize():void { test.invalidateSize(); } 3) On the ComboBox change event, execute callLater(updateTextSize); Note: If you use embedded fonts, a boldface font must be available for b/b to work. -TH --- In flexcoders@yahoogroups.com, tphipps toby.phi...@... wrote: Hi all, I've seeing some strange behaviour with a mx:Text component using htmlText. It seems that when the fontFamily of the text component is changed at runtime from an embedded font to a device font (or vice versa), the content is truncated, and the HTML formatting lost. However, when changing from one device font to another (or one embedded font to another), it works just fine. Take this example (view source enabled but without the actual font files included - any OTF should work fine): http://dev.nx.sg/lab/fontchange/FontChange.html This app initializes the text component with some htmlText using a device font (_sans in this case). Once loaded, try changing the font to another device font (e.g. Courier New or Myriad) with the dropdown. Everything's fine. Now change to an embedded font, and note the truncation and loss of formatting. The reverse happens if I initalize the field with an embedded font - changing to another embedded font works fine but changing to a device font ends up truncating again. Anyone got any ideas how to make this work? Thanks, Toby.
[flexcoders] Re: Accurate way of measuring a datagrid
If you can't get it to work, you could always use a Repeater instead. In this case, since you want to display all of the items, this would probably work out better. -TH --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: Yeah, maybe not. Good luck; this is a common challenge that many have not been successful solving. -TH --- In flexcoders@yahoogroups.com, djhatrick djhatrick@ wrote: Tom: Thanks for that, but unfortunately that method is inaccurate( Maybe it doesn't work for very good for factories... Here's how i am getting my height, i am setting a height on my value object after i add my labels in a vertical column, then i listen for an event on my collection dataProvider, the last item, which I then loop through and calculate the values? See my examples: idSGrid.measureHeightOfItems 612 Measuring each row height 560 idSGrid.measureHeightOfItems 612 Measuring each row height 560 It's off by 72 pixels... that's quite a difference. Patrick --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hi Patrick, private function resizeDataGrid():void { myDataGrid.height = myDataGrid.measureHeightOfItems(0, myDataGrid.dataProvider.length) + myDataGrid.headerHeight + 2; } mx:DataGrid id=myDataGrid valueCommit=resizeDataGrid() -TH --- In flexcoders@yahoogroups.com, djhatrick djhatrick@ wrote: My datagrid won't measure correctly, i have variable row height, but it can't seem to get it right, I don't want any scroll bars..., is there an easy way to override some function so i can get the actual rowheight of each row and determine my height correctly Thanks,Patrick Wow, i had to rejoing Flexcoders Google Groups are better than yahoogroups, sorry yahoogroups,