[flexcoders] Re: How to set the endpoint address in Coldfusion side?
The flex2gateway is defined in the services-config.xml file found in your_cf_install_path/wwwroot/WEB_INF/flex/ Depending on how you set up your flex project, this file will be used during compilation so your remote objects will know what 'destination=ColdFusion' actually means. After you edit this file, you'll need to restart ColdFusion for the changes to taken effect. --- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote: How do you know flex2gateway here.do I set it in somewhere? Thanks Mark
Re: [flexcoders]Architect an image gallery transition effect - design suggestions
Why not have two Image components, one on top of the other? As the user brings up on image you can fade one out and fade the other in. --- In flexcoders@yahoogroups.com, dorkie dork from dorktown dorkiedorkfromdorkt...@... wrote: I'm trying to create an image gallery component and I need some help. I have an Image component working. It has next and previous buttons that change the source of the Image component when they are clicked. This works fine so far. The problem is it looks like crap when it changes. How would you architect a source change effect so there would be a nice transition between the current image and the next or previous image? For example, I want it to handle a crossfade where one image fades out and the next fades in or a move in effect where one image moves off the screen (and fades out) and another image fades in and moves in to the current image location. I know there is a showEffect and hideEffect but I need something like a sourceChangeNextEffect and a sourceChangePreviousEffect.
[flexcoders] Re: How to test flash apps in the normal (non-debug) player with the debug player in installed?
Check out the Flash Switcher Firefox extension. --- In flexcoders@yahoogroups.com, tom s tcs2...@... wrote: Hi All, I have the flash debug player installed for FireFox and IE. What is the best way to test flash apps in the normal (non-debug) player on the *same machine*? (I don't have access to a spare machine right now). I want to do this test because I have read that the error thrown by ExternalInterface.call is different in the normal player than the debug player, but that was written many months ago, so I don't know if it is still true (e.g. in version 10.x) thanks tom
[flexcoders] Re: Best practices for using custom service type with Cairngorm ServiceLocator
Frankly, using the ServiceLocator in the first place is far from a best practice. In the past, I've done this to initialize my remote objects: var ro:RemoteObject = RemoteObject(ServiceLocator.getInstance().getRemoteObject(ro)); ro.endpoint = myEndpoint; ro.source = mySource; You can do something similar for your HTTPServices when you know what properties you want to set on them. --- In flexcoders@yahoogroups.com, adamratcliffe2002 a...@... wrote: I have an AIR application which uses the Merapi bridge to communicate with a local Java application. My service class wraps the bridge and I would like to initialize this service alongside the HTTPService I have defined in the ServiceLocator mxml. Should I extend the Cairngorm ServiceLocator to support my own service interface as an additional type or is there some better way of doing this? Cheers Adam
[flexcoders] Re: Auto-scrolling of selectable Text controls
I've run into this before. It appears to be a bug with leading. If you set it to zero, this won't happen, but the lines of text will be a little too close together. You can probably monkey patch it. --- In flexcoders@yahoogroups.com, Michael Prescott michael.r.presc...@... wrote: If you have a Text field with selectable text, it's possible to scroll the content by clicking on the text and dragging downwards. This leaves (in one simple case I've made) the top line of text obscured, and an apparent blank line at the bottom. Is there any way to prevent this without making the text non-selectable? Michael
[flexcoders] Re: Why no initial FlexEvent.SHOW event dispatched?
When a UIComponent is set to visible for the first time by the LayoutManager, the SHOW event is suppressed. The CREATION_COMPLETE event fired immediately after that call to setVisible, so you should be able to achieve whatever effect you're going for by registering the same function to listen for both the SHOW and CREATION_COMPLETE events. --- In flexcoders@yahoogroups.com, per.olesen [EMAIL PROTECTED] wrote: I was wondering why a flex control or container does not dispatch a FlexEvent.SHOW when showing the first time? Given this code: mx:Panel id=panel show=Alert.show('I am showing') creationComplete=Alert.show('I was created')/ mx:Button click=panel.visible = !panel.visible label=Show/Hide/ When the panel Panel is constructed, the creationComplete is fired and I see my Alert I was created. But I DO NOT get the Alert I am showing. If I then click the button to hide it and click it again to show it, I am getting the show event. Why no show event initially? This applies equally well to TitleWindow, Button, Box, ...
[flexcoders] Re: check compiler configurations in runtime
The stack trace trick works well. I've written a little class that automates the check. http://michaelvandaniker.com/blog/2008/11/25/how-to-check-debug-swf/ --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: If the app has debug info in it, the text in an Error().getStackTrace() will be different. I don't think there's a test to see if you're hooked to a debugger. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andres Serral Sent: Wednesday, November 19, 2008 10:40 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] check compiler configurations in runtime Hello. I´ve a simple question. Can I access to compiler configurations in runtime? Basically I need check if the app is in debugmode Thanks
[flexcoders] Re: extends, 2 questions
Just create the package structure for mx.core in your source folder and copy UIComponent to that directory. The compiler will use that UIComponent instead of the one in the SDK, so if you change the base class there everything should work as you expect. You'll need to grab Version.as as well because UIComponent.as includes it. --- In flexcoders@yahoogroups.com, bmilesp [EMAIL PROTECTED] wrote: Hello, i want to extend the core FlexSprite class AND have all the subclasses (eg. UIComponent) in the flex framework use the modified FlexSprite class. so i would make a packager and the class would extend FlexSprite: class ModFlexSprite extends FlexSprite{ //more properties here... } so i did this, and my idea was to just change the core UIComponent.as class to extend ModFlexSprite instead of FlexSprite. So this leads to question one: Is this the easiest way to achieve this? If so, the i guess i have to recompile the framework somehow, since building and running my app alone doesn't work. Question 2: how do i recompile the Flex Framework? thanks in advance! -b
[flexcoders] Re: May I save BitmapAsset instance to database?
I've never tried to extract and save the contents of an audio or video file to a database, so I'm not sure what the procedure would be. When I had to do something like this in the past I just saved the file to the server and stored the URL in the database. Like Jim suggested, Peter Elst's blog may be a good place to look if you want to go that route. --- In flexcoders@yahoogroups.com, markflex2007 [EMAIL PROTECTED] wrote: Hi Michael, Thanks. Would you please give me an idea how to save Video or Audio data to database like saving image with ByteArray. Thanks Mark --- In flexcoders@yahoogroups.com, Michael VanDaniker michael@ wrote: Your question is a bit vague, but I'll try and be of some help. You can use the ImageSnapshot class to get the ByteArray the backs your image. Then you can store those bytes in a database and pull them up later. If you're building an AIR application and saving the image to a local database you'll want to read up on the SQL utilities available to you here: http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html If you're building a browser app you can pass the ByteArray to a webservices or a remote object that will store the image in a database. http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html If you can be more specific about your problem, we can provide more help.
[flexcoders] Re: May I save BitmapAsset instance to database?
Your question is a bit vague, but I'll try and be of some help. You can use the ImageSnapshot class to get the ByteArray the backs your image. Then you can store those bytes in a database and pull them up later. If you're building an AIR application and saving the image to a local database you'll want to read up on the SQL utilities available to you here: http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html If you're building a browser app you can pass the ByteArray to a webservices or a remote object that will store the image in a database. http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html If you can be more specific about your problem, we can provide more help. --- In flexcoders@yahoogroups.com, markflex2007 [EMAIL PROTECTED] wrote: Hi, I create a BitmapAsset instance from image class and I want to save it to database and other people can see the image when he read out BitmapAsset instance from database. Do you think if it is possible? and how to save and read from database? Thanks Mark
[flexcoders] Re: creating a class - question extending
Image, like all UIComponents, has a zero argument constructor. Unless your imageWithData knows what its username is going to be without any outside info, it wouldn't make sense to do much of anything with the username in the constructor. If you're going to be instantiating your images in Actionscript you can just assign the username after the object is created. --- In flexcoders@yahoogroups.com, luvfotography [EMAIL PROTECTED] wrote: Hi, I'm trying to create a class that extends the image class, I need to associate a username with the image, Here is what I have: package { import mx.controls.Image; public class imageWithData extends Image { private var _username:String; public function imageWithData() { super(); // _username = ??? } public function set username(value:String):void { _username = value; } public function get username():String { return _username; } } } I am unclear as to what goes after the 'super()' do I need a _username = something? thanks,
[flexcoders] Re: Use the Hslider to control the image
displayObjectA can by masked by displayObjectB with the assignment displayObjectA.mask = displayObjectB; This will cause only the portions of displayObjectA that are under displayObjectB to show through. Also, you won't actually see any of displayObjectB. There is an example in the docs that demonstrate this. It shouldn't be difficult to apply a similar solution to your problem. http://livedocs.adobe.com/flex/3/langref/flash/display/DisplayObject.html#mask For your particular problem can control the width of the masked DisplayObject with your slider. --- In flexcoders@yahoogroups.com, ashlytu [EMAIL PROTECTED] wrote: I have asked this question before,but i might not make it clear enough. I need to use the hslider to control how many percent of the image will be shown in a panel,when I trag the slider to the zero, none of the picture shows ,and when I drag it to the right edge, and the whole picture is shown.Tim Hoff have told me a method ,but I guess I have to use mask, cause the image cannot move, but I have to be controlled by the Hslider. I don't know how to use the mask ,Would you please help me?Thanks!! Ashly
[flexcoders] Re: sortCompareFunction - First the number's then the null's
Use this as the sortCompareFunction on your column: public function compareValues(a:Object, b:Object):int { if(a == null b == null) return 0; if(a == null) return 1; if(b == null) return -1; if(a b) return -1; if(a == b) return 0; return 1; } --- In flexcoders@yahoogroups.com, hugocorept [EMAIL PROTECTED] wrote: Hi all, In my App I need a custom sortCompareFunction to resove my problem. My problem is, if I have a column with 1, 2, 1, 3, null, 2, null', by default flex sort like this null, null, 1, 1, 2, 2, 3 or 3, 2, 2, 1, 1, null, null. It means, first cames the null then the values. I need 1, 1, 2, 2, 3, null, null How can I have the reverse, first the values ASC, then the nulls. Thank you so much. Core Reagards
[flexcoders] Re: UM Extension
All you have to do is extend the right classes :) Your event class should extend UMEvent. UMEvent has a callbacks property, and within that Callbacks object you'll specify the functions you want called when your delegate finishes (successfully or otherwise). Like so: private function submit():void { var callbacks:Callbacks = new Callbacks(r); var myEvent:MyEvent = new MyEvent(MyEvent.MY_EVENT,callbacks); submitEvent.dispatch(); } private function r(o:Object):void { trace(o); } You should make the base class for your command com.universalmind.cairngorm.commands.Command. You need to call the super method within execute to set up view notification. When you call super in result or fault, the respective methods you specified in your Callbacks object will be called. --- In flexcoders@yahoogroups.com, Darrin Kay [EMAIL PROTECTED] wrote: I am trying to learn the UM extensions within Cairngorm, but there are no good examples of how this is done. Here is what I am trying to do, I have a view and when a user clicks a button an event is called. Then off to the command, and if the execute passes, I go to the result function in the command file. In the result function I load the data into the model, and change my view. On the new view I need to call a function after I know I have the data back. That is what I can not figure out. Please help.
[flexcoders] Re: Can anyone help me?
The docs have the usage. In short, the item is the object from your collection you want to operate on and the fieldName is the field the chart wants to know about. In your case you would have something like this: public function myDataFunction(series:Series, item:Object, fieldName:String):Object { if(fieldName == key) return(turnYourKeyIntoADate(item)); else if(fieldName == value) return(item.value); else return null; } --- In flexcoders@yahoogroups.com, kotha poornima [EMAIL PROTECTED] wrote: Thanks very much for your response.But i am not aware of this dataFunction.Can you provide me with an example.The link you sent is just showing the signature of the method. Thanks in Advance, Poornima From: Michael VanDaniker [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Friday, October 24, 2008 10:58:02 AM Subject: [flexcoders] Re: Can anyone help me? Since you're plotting dates you'll want to use a DateTimeAxis, but you need to make sure that your chart is actually getting Dates. In your current setup DateTimeAxis is trying to create Dates using the Date.parse method, but the format isn't one that the method can handle. That's why you're seeing Invalid date for each item. There are a couple of approaches you can take to get those Dates: 1) Feed the XML to the series the way you are and define a dataFunction for the series. The dataFunction lets you tell the chart how it should interpret the data. When you look at the key field, parse that field into a date and return it. http://livedocs. adobe.com/ flex/3/langref/ mx/charts/ chartClasses/ Series.html# dataFunction 2) Pre-process the XML into an ArrayCollection of objects and give that collection to the series. --- In [EMAIL PROTECTED] ups.com, kotha poornima poorni_agile@ ... wrote: Hi, This is Poornima. Currently iam working on flex, very new to flex. I just know the basics such as some UI designing and server-side programming in flex. Now i have to work on Flex Charting. I started that project by learning the basic charts but now i am having lots of doubts in that. Can any one help me? The request goes to the server and response come back to flex in the format of XML.XML file looks like: response data key24/10 05/key value500/ value /data data key24/10 06/key value510/ value /data data key24/10 07/key value520/ value /data data key24/10 08/key value530/ value /data data key24/10 09/key value540/ value /data data key24/10 10/key value550/ value /data response This is the xml response where KEY represents the date and time and VALUE represents a particular value for the key. data key24/10 05/key -- represents date and time date in the format of (DD/MM) 24/10 and time (HH) 05 value500/ value -- represents an integer value. /data Here Key represents x-axis and Value represents y-axis. 1. Which axis is better for this type of xml response? 2. If i use linear axis or category axis it is drawing the graph based on first characters of key means in this case of xml it is always taking 24 as the key (x-axis point) and different values (500,510,520, 530,540,550 etc) as values(y-axis points) showing a straight vertical line at a single point of x-axis ie 24. How can i overcome this problem and graph will work for different values of key ie graph should work for the days iam giving, months iam giving and also for hours iam giving? Is there any possibility to do that? 3.Once i tried the samething with DateTimeAxis in X-Axis but it is showing Invalid Date. Iam getting any Graph. How to draw the graph with datetime axis with this type of xml responses. 4.If i use DateTime Axis is it really change the graph according to the dataUnits i am giving? Can any one give me an idea on how to handle with these issues. Please send me replies. Waiting for all your replies.. Thanks in Advance. Poornima.
[flexcoders] Re: Cairngorm and AyncToken Error
I would guess that something is wrong with the line of code where you actually make the call to the RemoteObject. Maybe you're doing something like var token:AsyncToken = remoteObject.call; instead of var token:AsyncToken = remoteObject.call(); Can you post some of the code around your call? --- In flexcoders@yahoogroups.com, asaivanson [EMAIL PROTECTED] wrote: Does anyone have any idea why I'd be getting this error? Type Coercion failed: cannot convert mx.rpc.remoting.mxml::[EMAIL PROTECTED] to mx.rpc.AsyncToken In Cairngorm I'm dispatching an event which fires on creationComplete. The event triggers a RemoteObject, which throws this error from my Delegate. I'm not sure what I'm missing here...
[flexcoders] Re: Can anyone help me?
Since you're plotting dates you'll want to use a DateTimeAxis, but you need to make sure that your chart is actually getting Dates. In your current setup DateTimeAxis is trying to create Dates using the Date.parse method, but the format isn't one that the method can handle. That's why you're seeing Invalid date for each item. There are a couple of approaches you can take to get those Dates: 1) Feed the XML to the series the way you are and define a dataFunction for the series. The dataFunction lets you tell the chart how it should interpret the data. When you look at the key field, parse that field into a date and return it. http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/Series.html#dataFunction 2) Pre-process the XML into an ArrayCollection of objects and give that collection to the series. --- In flexcoders@yahoogroups.com, kotha poornima [EMAIL PROTECTED] wrote: Hi, This is Poornima. Currently iam working on flex, very new to flex. I just know the basics such as some UI designing and server-side programming in flex. Now i have to work on Flex Charting. I started that project by learning the basic charts but now i am having lots of doubts in that. Can any one help me? The request goes to the server and response come back to flex in the format of XML.XML file looks like: response data key24/10 05/key value500/value /data data key24/10 06/key value510/value /data data key24/10 07/key value520/value /data data key24/10 08/key value530/value /data data key24/10 09/key value540/value /data data key24/10 10/key value550/value /data response This is the xml response where KEY represents the date and time and VALUE represents a particular value for the key. data key24/10 05/key -- represents date and time date in the format of (DD/MM) 24/10 and time (HH) 05 value500/value -- represents an integer value. /data Here Key represents x-axis and Value represents y-axis. 1. Which axis is better for this type of xml response? 2. If i use linear axis or category axis it is drawing the graph based on first characters of key means in this case of xml it is always taking 24 as the key (x-axis point) and different values (500,510,520,530,540,550 etc) as values(y-axis points) showing a straight vertical line at a single point of x-axis ie 24. How can i overcome this problem and graph will work for different values of key ie graph should work for the days iam giving, months iam giving and also for hours iam giving? Is there any possibility to do that? 3.Once i tried the samething with DateTimeAxis in X-Axis but it is showing Invalid Date. Iam getting any Graph. How to draw the graph with datetime axis with this type of xml responses. 4.If i use DateTime Axis is it really change the graph according to the dataUnits i am giving? Can any one give me an idea on how to handle with these issues. Please send me replies. Waiting for all your replies.. Thanks in Advance. Poornima.
[flexcoders] Re: using components
You can access your top-level application anywhere in your code via Application.application. To call the method named myMethod, you would use the statement Application.application.myMethod(). You can easily add event listeners on sub-components if you give the components id's. Taking your example of a button within another component you could define it like so... !-- ExtendedPanel.mxml -- mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; mx:Button id=myButton / /mx:Panel !-- MyApp.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; ExtendedPanel id=ePanel/ /mx:Application and add an event listener within the the main application's script tag with the statement: ePanel.myButton.addEventListener(MouseEvent.CLICK,myClickHandler); You could also have your ExtendedPanel catch the button's click event and dispatch a custom event. Then you could do something like this: ePanel.addEventListener(MyCustomEvent.BUTTON_CLICK,myClickHandler); --- In flexcoders@yahoogroups.com, Deniz Davutoglu [EMAIL PROTECTED] wrote: Hi everyone, I try to break apart my flex app and I get faced with one issue. I create components for every part of app and load them as I need. But it creates some problems. First off all within component I cant call functions that are in main app mxml. Secondly I cant create events for sub component (for ex buttons) of my components. I dont want to create every component by by using action script. I want to use mxml. Did some one face this problem and create solution? Thanks Deniz
[flexcoders] Re: drawing a rectangle with a cutout
You could create separate sprites for each rectangle and apply the smaller one as a mask to whatever content is meant to show through the window. --- In flexcoders@yahoogroups.com, Christoph Leva [EMAIL PROTECTED] wrote: Hi all, I am trying to cut a smaller rectangle (name: cutout) out of a rectangle, which has the screen size. I read, that u can do it when you draw the cutout reverse, but I don't know how to do it. I use the flash.display.graphics class. I created both rectangles, using the drawRect() method. All commands to draw the rectangles are between beginFill() and endFill() methods and I can see them both on stage. Can I do the cutting out with the drawRect() Method, or is there another way? Christoph
[flexcoders] Re: Accordion control question
You'll want to check out the WindowShade component in flexlib --- In flexcoders@yahoogroups.com, burttram [EMAIL PROTECTED] wrote: Is there any way to prevent and accordion control item from opening, so that the header will just act as a button? I'm currently trying to use an accordion control as kind of a menu, such that several items with sub-categories will open to reveal a treeview in the appropriate accordion block (sorry for my lack of terminology), however there are several items that have no sub-categories (i.e. Home and Contact). What I'd like to do is to prevent that default action of opening from happening, and instead collapse all members of the accordion control at the same time. Example can be seen at http://beta.2b-studios.com/BDB.html Any advice or suggestions? Thanks in advance for your time, Brian
[flexcoders] Re: Gradient that is vertical and horizontal!
If 45 degree fill doesn't work out, you can implement bilinear interpolation. http://en.wikipedia.org/wiki/Bilinear_interpolation --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: s/45 degree radient fill/45 degree gradient fill/ -Josh On Wed, Sep 24, 2008 at 9:46 AM, Josh McDonald [EMAIL PROTECTED] wrote: It'll (probably) be faster to generate a bitmap at 400x400, using a 45 degree radient fill. Then simply scale that bitmap to 400x10. You'll only need to do this once, then use a bitmap fill. -Josh On Wed, Sep 24, 2008 at 5:57 AM, Tim Hoff [EMAIL PROTECTED] wrote: Btw, either way that you do it, you're probably going to have to layer a gradient rectangle over another gradient rectangle; with the proper opacity. The trick will be getting the colors to be what you want. -TH --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hey, if you can do it with the drawing API, cool. But, this is rather easy to do in Fireworks or Photoshop. Just flatten your image and you won't add that much size to the swf. -TH --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: I was hoping you wouldnt say that! :) --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: You're probably better off just creating an image and using that as the skin for a container. Might be a bit tricky getting this to work with a programmatic skin. -TH --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: Heres the problem, I need to draw a gradient that goes from 0 opacity black to 100% opacity black from left to right. However, this also needs to fade out the further down you go. The gradient is 10 pixels wide, and about 400 pixels tall. So its essentially a horizontal gradient that fades as it goes down... any ideas? -- 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 -- Therefore, send not to know For whom the bell tolls. It tolls for thee. http://flex.joshmcdonald.info/ :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. http://flex.joshmcdonald.info/ :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] Re: How to line up
You're going to have to be a bit more specific before we can help you. What things aren't looking good? How does sizing things with percentage values play into your problem? Anything that subclasses UIComponent can be sized with percentages. Flash Player is designed to display things consistently across browsers and platforms, so if you're having a problem with this aspect of the player you should file a bug with Adobe. --- In flexcoders@yahoogroups.com, markgoldin_2000 [EMAIL PROTECTED] wrote: Any suggestions about how to make things look good in every Browser? XP + IE7 = bad W 2003 + IE7 = good Vista + FireFox = nothing better that this I am trying to use percentage as much as possible but not every component can be sized using a percent value. Any hints? Thanks
[flexcoders] Re: how to search an arraycollection
If your collection is sorted by timestamp a binary search would be faster. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: You'll have to loop through yourself and keep track of the minimum difference From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of blc187 Sent: Wednesday, August 13, 2008 12:57 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] how to search an arraycollection I have an arraycollection of objects, each of which has a timestamp. ex: {timestamp:4342423432, value:5} I want to search the arraycollection for the object which has the closest timestamp to the time I'm looking for. Is there a way to search the arraycollection for an approximate value? As of right now I'm looping through each object in my arraycollection to find if the value is between 2 numbers. for(var i:int = 0; i dataProvider.length; i++) { if(myTimestamp dataProvider[i] myTimestamp dataProvider[i+1]) //this is the correct spot. }
[flexcoders] Re: how to search an arraycollection
Yes. If X isn't in the list, the search will end on either the position before or after where X should be. --- In flexcoders@yahoogroups.com, blc187 [EMAIL PROTECTED] wrote: can i use a binary search if the value i am searching for is not explicitly in my arraycollection? i want to get the closest value to the timestamp i am searching for. --- In flexcoders@yahoogroups.com, Michael VanDaniker michael@ wrote: If your collection is sorted by timestamp a binary search would be faster. --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: You'll have to loop through yourself and keep track of the minimum difference From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of blc187 Sent: Wednesday, August 13, 2008 12:57 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] how to search an arraycollection I have an arraycollection of objects, each of which has a timestamp. ex: {timestamp:4342423432, value:5} I want to search the arraycollection for the object which has the closest timestamp to the time I'm looking for. Is there a way to search the arraycollection for an approximate value? As of right now I'm looping through each object in my arraycollection to find if the value is between 2 numbers. for(var i:int = 0; i dataProvider.length; i++) { if(myTimestamp dataProvider[i] myTimestamp dataProvider [i+1]) //this is the correct spot. }
[flexcoders] Re: deprecated horizontalAxisRenderer
You best bet is step through the function that is throwing the null reference error. We might be working with different versions of the charting sdk, but the problem line, line 2087 CartesianChart.as, in my copy reads rect.top = _computedGutters.top; so it sounds like either rect or _computedGutters are null. I would suspect _computedGutters more than rect. You can set a break point at the beginning of CartesianChart.updateAxisLayout and see where it gets nulled out. After that you might be able to deduce what is wrong with the custom AxisRenderer you're using. If you need any more help, feel free to ask. If you can tell us when _computedGutters becomes null, we might be able to provide some insight as to why. Question for you: Was the AxisRenderer you found written for Flex 2 or 3? --- In flexcoders@yahoogroups.com, coder3 [EMAIL PROTECTED] wrote: thanks!!! if i use the out of box code, it works fine. but the problem is, i use an extended AxisRenderer .as class, http://bugs.adobe.com/jira/secure/attachment/12340/InnerAxisRenderer.as. now i got this run time error: do i need to modify the class? how? TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2087] at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1355] at mx.core::UIComponent/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:6214] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:657] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403] Michael VanDaniker wrote: Certainly! mx:ColumnChart dataProvider={collection} mx:horizontalAxis mx:CategoryAxis id=horizontalAxis categoryField=foo / /mx:horizontalAxis mx:verticalAxis mx:LinearAxis id=verticalAxis / /mx:verticalAxis mx:verticalAxisRenderers mx:AxisRenderer axis={verticalAxis}/ /mx:verticalAxisRenderers mx:horizontalAxisRenderers mx:AxisRenderer axis={horizontalAxis}/ /mx:horizontalAxisRenderers mx:series mx:ColumnSeries displayName=Column Series! xField=foo yField=bar/ /mx:series /mx:ColumnChart I didn't compile this, but it should be pretty close. Also, check out the example in the documentation for AxisRenderer: http://livedocs.adobe.com/flex/3/langref/mx/charts/AxisRenderer.html#includeExamplesSummary --- In flexcoders@yahoogroups.com, coder3 rrhuang@ wrote: not sure how to do it. is there an example? thanks Michael VanDaniker wrote: You have to tell your AxisRenderer which axis it should render by setting the axis property. --- In flexcoders@yahoogroups.com, coder3 rrhuang@ wrote: Hi All, i have flex2 code, and now shows warnings in flex 3 for example, mx:CartesianChart ::: mx:horizontalAxisRenderer mx:AxisRenderer styleName=noAxisStyle / /mx:horizontalAxisRenderer ::: /mx:CartesianChart will shows warning: 'horizontalAxisRenderer' has been deprecated. Please use 'CartesianChart.horizontalAxisRenderers' I don't know what to do so i just change mx:horizontalAxisRenderer to mx:horizontalAxisRenderers it compiled but it gives me runtime error as following. so i must miss something. what is it? thanks!! c Error: Property axis is not set for this AxisRenderer at mx.charts::AxisRenderer/measureLabels()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1738] at mx.charts::AxisRenderer/adjustGutters()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1364] at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2019] at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1355] at mx.core
[flexcoders] Re: deprecated horizontalAxisRenderer
You have to tell your AxisRenderer which axis it should render by setting the axis property. --- In flexcoders@yahoogroups.com, coder3 [EMAIL PROTECTED] wrote: Hi All, i have flex2 code, and now shows warnings in flex 3 for example, mx:CartesianChart ::: mx:horizontalAxisRenderer mx:AxisRenderer styleName=noAxisStyle / /mx:horizontalAxisRenderer ::: /mx:CartesianChart will shows warning: 'horizontalAxisRenderer' has been deprecated. Please use 'CartesianChart.horizontalAxisRenderers' I don't know what to do so i just change mx:horizontalAxisRenderer to mx:horizontalAxisRenderers it compiled but it gives me runtime error as following. so i must miss something. what is it? thanks!! c Error: Property axis is not set for this AxisRenderer at mx.charts::AxisRenderer/measureLabels()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1738] at mx.charts::AxisRenderer/adjustGutters()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1364] at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2019] at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1355] at mx.core::UIComponent/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:6214] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:657] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403] -- View this message in context: http://www.nabble.com/deprecated-horizontalAxisRenderer-tp18900354p18900354.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: deprecated horizontalAxisRenderer
Certainly! mx:ColumnChart dataProvider={collection} mx:horizontalAxis mx:CategoryAxis id=horizontalAxis categoryField=foo / /mx:horizontalAxis mx:verticalAxis mx:LinearAxis id=verticalAxis / /mx:verticalAxis mx:verticalAxisRenderers mx:AxisRenderer axis={verticalAxis}/ /mx:verticalAxisRenderers mx:horizontalAxisRenderers mx:AxisRenderer axis={horizontalAxis}/ /mx:horizontalAxisRenderers mx:series mx:ColumnSeries displayName=Column Series! xField=foo yField=bar/ /mx:series /mx:ColumnChart I didn't compile this, but it should be pretty close. Also, check out the example in the documentation for AxisRenderer: http://livedocs.adobe.com/flex/3/langref/mx/charts/AxisRenderer.html#includeExamplesSummary --- In flexcoders@yahoogroups.com, coder3 [EMAIL PROTECTED] wrote: not sure how to do it. is there an example? thanks Michael VanDaniker wrote: You have to tell your AxisRenderer which axis it should render by setting the axis property. --- In flexcoders@yahoogroups.com, coder3 rrhuang@ wrote: Hi All, i have flex2 code, and now shows warnings in flex 3 for example, mx:CartesianChart ::: mx:horizontalAxisRenderer mx:AxisRenderer styleName=noAxisStyle / /mx:horizontalAxisRenderer ::: /mx:CartesianChart will shows warning: 'horizontalAxisRenderer' has been deprecated. Please use 'CartesianChart.horizontalAxisRenderers' I don't know what to do so i just change mx:horizontalAxisRenderer to mx:horizontalAxisRenderers it compiled but it gives me runtime error as following. so i must miss something. what is it? thanks!! c Error: Property axis is not set for this AxisRenderer at mx.charts::AxisRenderer/measureLabels()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1738] at mx.charts::AxisRenderer/adjustGutters()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1364] at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2019] at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1355] at mx.core::UIComponent/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:6214] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:657] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403] -- View this message in context: http://www.nabble.com/deprecated-horizontalAxisRenderer-tp18900354p18900354.html Sent from the FlexCoders mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/deprecated-horizontalAxisRenderer-tp18900354p18900481.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: simple arraycollection question
I haven't run this code, but I don't see why it wouldn't work: this.source = event.result.source; I personally prefer looping through the returned collection and translating the raw objects into instances of a class I've defined. This allows for compile-time checking on anything you want to do with the local copies, and it lets you add methods and properties to those objects. var o:SomeClass = new SomeClass(event.result[i]); collection.addItem(o); --- In flexcoders@yahoogroups.com, Richard Baker [EMAIL PROTECTED] wrote: I have a .as class extending arraycollection. In the constructor I set up a webservice and listner to capture the result in resultHandler Ideally in resultHandler I'd do something like this=event.result; but it doesn't work, so I am looping over the event.result, adding it to the array collection like: this.addItem(event.result[i]); can I assign the whole array collection in one go. Probably missing something simple, but I just can't see it :( Thx
[flexcoders] Re: simple arraycollection question
As you loop over the objects you can save them in an array instead of in the collection. When the array is finished being populated you can set it to be the source on the collection. That would result in only one collection change event. --- In flexcoders@yahoogroups.com, Richard Baker [EMAIL PROTECTED] wrote: Ahh, yes, that does work. I was looping as you suggest, but the collection change event was firing each time. Now that I think about it I suppose the best ting to do would be to hook up the event listener on the last addition to the ac? Or is there a better practice out there somewhere? --- In flexcoders@yahoogroups.com, Michael VanDaniker michael@ wrote: I haven't run this code, but I don't see why it wouldn't work: this.source = event.result.source; I personally prefer looping through the returned collection and translating the raw objects into instances of a class I've defined. This allows for compile-time checking on anything you want to do with the local copies, and it lets you add methods and properties to those objects. var o:SomeClass = new SomeClass(event.result[i]); collection.addItem(o); --- In flexcoders@yahoogroups.com, Richard Baker bishbash64@ wrote: I have a .as class extending arraycollection. In the constructor I set up a webservice and listner to capture the result in resultHandler Ideally in resultHandler I'd do something like this=event.result; but it doesn't work, so I am looping over the event.result, adding it to the array collection like: this.addItem(event.result[i]); can I assign the whole array collection in one go. Probably missing something simple, but I just can't see it :( Thx
[flexcoders] Re: Remove Child
My guess is that you have something like this... mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Canvas id=canvas mx:LinkButton id=aboutMeLink /mx:Canvas /mx:Application If that's the case, the aboutMeLink is a child of canvas and you'll need to call canvas.removeChild(aboutMeLink); If you just want the LinkButton to not take up space you can set its includeInLayout property to false. --- In flexcoders@yahoogroups.com, Dan Vega [EMAIL PROTECTED] wrote: I have a variable and based on its true/false value I want to display a link. This is the link button, I don't just want to make it invisible because it still takes up available space, I would actually like to remove the child from the stage. mx:LinkButton id=aboutMeLink label=? click=showAbout(event)/ If I use the following this.removeChild(aboutMeLink); I get the following error, just wondering what im doing wrong. The supplied DisplayObject must be a child of the caller. Thank You Dan Vega
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
You'll want to listen for the change event on the slider. In the event handler you can do something like this... collection.filterFunction = filterByPriceRange; collection.refresh(); Then you'll want your filterByPriceRange function to return true if the price of the given object is between the values of slider. The ICollectionView livedocs page should help you set up the filter function. --- In flexcoders@yahoogroups.com, stinasius [EMAIL PROTECTED] wrote: hi guys i am tring to filter a datagrid with a price column using a slider that gets results which are btn two ranges min and max, can someone please help me. thanks
[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs
flexexamples is a great site for fully functioning code snippets. In the example here http://blog.flexexamples.com/2008/03/12/using-a-combobox-to-filter-items-in-a-datagrid-in-flex/ you'll want to swap out the CheckBox for a HSlider, obviously. Then you can call toggleFilter() when the slider changes. Your filterFunction will look something like this... private function processFilter(item:Object):Boolean { return item.value slider.values[0] item.value slider.values[1]; } I hope this helps. --- In flexcoders@yahoogroups.com, stinasius [EMAIL PROTECTED] wrote: hi am fairly new to flex. if you dont mind maybe you could post some small example on how to do it. thanks
Re: {Disarmed} RE: [flexcoders] mxml components
Are these the same instance or unique instances with in each of the class instances themselves (mainclass/class3)? MainClass.mxml: mx:script ![CDATA{ Import com.myapp.models.LoginClass; ... .. And Class3.mxml mx:script ![CDATA{ Import com.myapp.models.LoginClass; ... .. These are not instances. You create instances by either declaring them in MXML or using the new operator in script. The import statements make LoginClass available to MainClass and Class3 so you can create instances of LoginClass from within each of those components. You don't need an import statement if the class you reference is in the same package you are referencing it from.
[flexcoders] Re: mxml components
The import statement does not create instances. It just makes a class available to another class so it can use its methods and create instances of it. You don't need an import statement if the class you want to import is in the same package as the class you are referencing it from. You can import an entire package by using the wildcard character (import mx.controls.*). You create instances by using the new operator. When you declare an object in MXML that tag is compiled into a block of Actionscript that contains the new operator. --- In flexcoders@yahoogroups.com, Scott [EMAIL PROTECTED] wrote: The import class; is what creates the instance? So in other words, if I use the import thisfile.mxml in each of my other files, each one is creating another instance of the thisfile.mxml? From: flexcoders@yahoogroups.com on behalf of Michael VanDaniker Sent: Tue 7/29/2008 10:30 AM To: flexcoders@yahoogroups.com Subject: {Disarmed} Re: {Disarmed} RE: [flexcoders] mxml components Are these the same instance or unique instances with in each of the class instances themselves (mainclass/class3)? MainClass.mxml: mx:script ![CDATA{ Import com.myapp.models.LoginClass; ... .. And Class3.mxml mx:script ![CDATA{ Import com.myapp.models.LoginClass; ... .. These are not instances. You create instances by either declaring them in MXML or using the new operator in script. The import statements make LoginClass available to MainClass and Class3 so you can create instances of LoginClass from within each of those components. You don't need an import statement if the class you reference is in the same package you are referencing it from. -- This message has been scanned for viruses and dangerous content by MailScanner http://www.mailscanner.info/ , and is believed to be clean.
[flexcoders] Re: Flex localization
You can use Capabilities.language to get the local language. You don't have to bundle your resources directly into the application. You can use resource modules to externalize the bundles into separate swfs and load the required one at runtime based on the user's language. The documentation on resource bundles is very good: http://livedocs.adobe.com/flex/3/html/help.html?content=l10n_5.html --- In flexcoders@yahoogroups.com, vipinck [EMAIL PROTECTED] wrote: We have a flex app which is going to be distributed around the globe. We are looking for a localization solution, in which flash can detect the language (any method) and send the language code to server, and server will return back the display text. I know I can use the Flex's localization API, in which we have to bundle the language resources with Flex app. Is there any way to detect the local language from the flex app and send a message to server? -Vipin
[flexcoders] Re: Flex Inspiration and ideas
For full applications, the showcase on Flex.org http://flex.org/showcase http://flex.org/showcase is worth a look. On a lower level, the custom components in the flexbox http://flexbox.mrinalwadhwa.com/ could serve for some inspiration as well. Happy coding, -Michael --- In flexcoders@yahoogroups.com, brucewhealton [EMAIL PROTECTED] wrote: Hello all, I was going through some tutorials on Flex 3 just recently, that I found on Flex that were available on the Flex start screen when you start the application. The tutorial on creating a Flickr application was pretty interesting and rather simple to do. That is described here: http://learn.adobe.com/wiki/display/Flex/Part+I.+Creating+a+Simple+RIA I think there is a mp3 player that is described on the pages on adobe to which one is taken when from Flex when you click on the tutorial link. So, I thought I'd see if anyone could recommend some places where I could find examples, and presentations of things created with Flex... something to inspire one with ideas as to what can be done with Flex? In particular, I had a few ideas in mind... some things that I would bet some people have done with Flex and this could serve as a starting point for custom apps that I might be able to use. Some ideas of things that I'd like to find, an interactive calendar application, audio/video player, RSS feed reader, A Forum/Bulletin board application. I suppose the example Flickr application described here: http://learn.adobe.com/wiki/display/Flex/Part+I.+Creating+a+Simple+RIA could be modified to display only specific images from a specific account on Flickr. Thanks, Bruce
[flexcoders] Re: Timer memory leak
Have you tried using setTimeout instead of listening on Timer events? --- In flexcoders@yahoogroups.com, steve.baney [EMAIL PROTECTED] wrote: Howdy all! I've got a memory leak issue with my problem. I just added a third party countdown timer component to my project. I've narrowed down the culprit to the event listener that listens for the timer event and then calls an updateTime function. timer.addEventListener(timer, updateTime, false, 0, true); As you can see, it uses a weak reference, as it should. The updateTime function declares two event objects, and checks if the timer has reached zero. It either stops the timer and throws a completed event, or it throws an event to update the visual component to the new time. Removing the addEventListener function plugs the leak, but the visual component never gets updated. I've moved the declarations of the two events from within the updateTime to the class itself to stop the timer from creating new objects every time it fires, but the app still leaks. It seems that everything is technically correct, but calling a function evey second is just devouring memory. So I guess I'm looking for a workaround to update the display without an event listeneryeah that may be impossible... Any suggestions?
[flexcoders] Re: parallel coordinates component with Flex3
I recently worked on a project for an info viz course, and one of my group mates built a parallel coordinates plot. I've been blogging about the different visualizations we developed, and I was about to write up the pcp. It'll be a while until I get around to it though. One word of warning: pcp's often have hundreds of lines, and you're going to run into some major performance issues if you try and pull that off with the charting controls. We found that using the graphics class was much more efficient. --- In flexcoders@yahoogroups.com, brian.staats [EMAIL PROTECTED] wrote: I have started development (3 days into it) on parallel coordinates using Flex 3. However, I am not having much luck at the moment (between diving into the depths of flex charting and other obligations). I would like to encourage you and others to join an open source effort to completing a flex parallel coordinate component. I have pinged mjohnsson on the adobe forums to see if s(he) is interested as well... no response yet. http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60catid=585threadid=1373433enterthread=y I dont have much code at the moment, but Ill start the google project (or whatever) if I can get some partners in crime. You interested? Anyone else? --- In flexcoders@yahoogroups.com, Marcela mvs_cxgkm@ wrote: Hi, I'm looking for a start point on how to implement a paraller coordinates component for multidimensional visualization with Flex 3 and AS. So far, I've found only Java examples. Someone working on something similar or in the same problem? Thanks, Marcela --- In flexcoders@yahoogroups.com, Marcela mvs_cxgkm@ wrote: Hi, I'm looking for a start point on how to implement a paraller coordinates component for multidimensional visualization with Flex 3 and AS. So far, I've found only Java examples. Someone working on something similar or in the same problem? Thanks, Marcela
[flexcoders] Re: parallel coordinates component with Flex3
My blog is at http://michaelvandaniker.com http://michaelvandaniker.com and our class webpage can be found here https://wiki.cs.umd.edu/cmsc734_08/index.php?title=Main_Page . Our project involved a parallel coordinates plot, a heat map, and a rank-by-feature explorer. The application we built is tailored towards the dataset we worked with, so its going to take some massaging before it's ready for generic use. Krist is in the process of extending the application and we're putting together a more publishable paper than the one on the class webpage. --- In flexcoders@yahoogroups.com, brian.staats [EMAIL PROTECTED] wrote: Thanks Michael, Can you share your info viz blog? Id be interested in the other visualizations. --- In flexcoders@yahoogroups.com, Michael VanDaniker michael@ wrote: I recently worked on a project for an info viz course, and one of my group mates built a parallel coordinates plot. I've been blogging about the different visualizations we developed, and I was about to write up the pcp. It'll be a while until I get around to it though. One word of warning: pcp's often have hundreds of lines, and you're going to run into some major performance issues if you try and pull that off with the charting controls. We found that using the graphics class was much more efficient. --- In flexcoders@yahoogroups.com, brian.staats brian.staats@ wrote: I have started development (3 days into it) on parallel coordinates using Flex 3. However, I am not having much luck at the moment (between diving into the depths of flex charting and other obligations). I would like to encourage you and others to join an open source effort to completing a flex parallel coordinate component. I have pinged mjohnsson on the adobe forums to see if s(he) is interested as well... no response yet. http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60\ catid=585threadid=1373433enterthread=y I dont have much code at the moment, but Ill start the google project (or whatever) if I can get some partners in crime. You interested? Anyone else? --- In flexcoders@yahoogroups.com, Marcela mvs_cxgkm@ wrote: Hi, I'm looking for a start point on how to implement a paraller coordinates component for multidimensional visualization with Flex 3 and AS. So far, I've found only Java examples. Someone working on something similar or in the same problem? Thanks, Marcela --- In flexcoders@yahoogroups.com, Marcela mvs_cxgkm@ wrote: Hi, I'm looking for a start point on how to implement a paraller coordinates component for multidimensional visualization with Flex 3 and AS. So far, I've found only Java examples. Someone working on something similar or in the same problem? Thanks, Marcela
[flexcoders] Re: Getting error when trying to get id of label when adding evt listener
You want to look at the event's currentTarget instead of target. From the documentation for MouseEvent: target = The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. --- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote: Hello all, I am getting this error when I add an event listener like this to a lable and then calling the event.target.id. Here is the error: #1069: Property id not found on mx.core.UITextField and there is no default value Here is the code: import mx.controls.Label; private function WTF():void { var lbl:Label = new Label(); lbl.text = 'Testing measdfasdfas'; lbl.addEventListener(MouseEvent.CLICK,DOME); lbl.id = 'KKSKS'; addChild(lbl); } private function DOME(evt:MouseEvent):void { trace(evt.target.id); } I get the error when the evt.target.id is called, I am not sure why this error is being called. Is there another way to get the label's id? Thanks, timgerr
[flexcoders] Re: Invisible elements taking up space
You want to set includeInLayout to false --- In flexcoders@yahoogroups.com, whatabrain [EMAIL PROTECTED] wrote: When I hide an object using the visibility attribute, it still takes up space in the document. I know that in css, you can use the display style to fix this. How do you do it in flex? mx:VBox mx:HBox mx:Text text=hi/ /mx:HBox mx:HBox visible=false !-- This takes up space -- mx:Text text=hi/ /mx:HBox mx:HBox mx:Text text=hi/ /mx:HBox /mx:VBox
[flexcoders] Re: Faster: Canvas Object move VS Graphics clear/redraw
This feels like comparing apple and oranges. Can you provide a bit more information about the complexity of your graphics calls and how you're able to consider them as replacements to move operations? The little test I just ran seems to show that graphics operations are faster than calls to move. This isn't all that surprising as UIComponent.move has some conditionals and dispatches an event. Of course, my test doesn't account for the actual rendering of anything -- just the time it takes to execute the instructions to tell Flash Player how to render. var d:Number = getTimer(); var num:Number = 10; var a:Number; for(a = 0; a num; a++) { button.move(Math.random() * 500,Math.random() * 500); } trace((getTimer() - d)) // Outputs ~1719 d = getTimer(); for(a = 0; a num; a++) { graphics.clear(); graphics.lineStyle(1,0); graphics.drawRect(0,0,Math.random() * 500,Math.random() * 500); } trace((getTimer() - d)) // Outputs ~257
[flexcoders] Re: Animati a HSlider
You can tween the value property between your start and end values. For a tweening engine I recommend Tweener or TweenLite. --- In flexcoders@yahoogroups.com, Andreas Santoro [EMAIL PROTECTED] wrote: Hi, i try to animate a mx:HSlider. I wannt the slider to move smoothly to his new value. idea how to do this? Andreas Santoro Senior Consultant Plan-B GmbH Kolpingstr. 6 D-73433 Aalen Tel.: +49 (0) 177 1762129 Mail: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] Web: www.plan-b-gmbh.comhttp://www.plan-b-gmbh.com/ Geschäftsführer Tobias Schmailzl Ralph Sturm Registergericht Ulm HRB 720355 Sitz der Gesellschaft ist Aalen Ust.ID DE250875731
[flexcoders] Re: Passing objects to components
You've declared that the instance obj should be bindable, but that doesn't make the properties on the class Object bindable. What you can do is create a class for the object you want to pass your custom component and add the bindable metadata tag to the properties you want to bind on. You can also add the metadata tag to the class definition. That will make all of the properties of the class bindable. package { [Bindable] public class Obj extends Object { public function Obj() { super(); } public var str:String = ; } } --- In flexcoders@yahoogroups.com, Dan Vega [EMAIL PROTECTED] wrote: If I want to pass a string to my custom component its pretty easy. Lets say you have a custom button component and in that component you declare a public var str, when you create your custom button you can simply do the following. local:CustomButton str=Hello World/ This works fine, but If I create an object and I want to pass an object into the custom component it does not seem to be working. The button is displayed but the button label is not displayed. Here is a quick example to show what I am doing. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:local=* creationComplete=init() mx:Script ![CDATA[ [Bindable] public var obj:Object; private function init():void { obj = new Object(); obj.str=Hello Object; } ]] /mx:Script local:Screen obj={obj}/ /mx:Application Custom Component ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ [Bindable] public var obj:Object = new Object(); ]] /mx:Script mx:Button label={obj.str}/ /mx:Canvas -- Dan
[flexcoders] Re: How would you make a heat map?
I realize this is a fairly old thread, but it ended without much resolution. If there is anyone out there still interested in drawing heat maps, I have an implementation that might be worth checking out. http://michaelvandaniker.com/blog/2008/07/06/how-to-make-heat-maps-in-flex/ --- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] wrote: That makes sense :). How would I get those cool color blending effects in the examples above? If I were to do it now I would just draw a red circle or square if the threshold were between 15 and 20... Here's something that's pretty close to what I want to do. http://universalmind.com/demo/launchpad.cfm At 4:19 in the video they switch to a heat map view. Before that they just lay down little circles, which I can do. Maybe when they switch to the heat map view they just take their circles and add a lot of glow and blur to them and up the opacity to the outer colors (blue and green)...what do you guys think? --- In flexcoders@yahoogroups.com, Abyss Knight briggins@ wrote: It's been a very long time since I've worked with this sort of thing, but I would imagine you would first generate a histogram of all the possible concentrations and then map that into the color set you want to show (just putting everything into colored buckets). That way with any data set the variations are shown in different colors. Now, if you wanted to do simple thresholding (i.e. 15 x 20 is red) you could just iterate over the grid cells or whatever the division is. I hope that helps. I may be completely misunderstanding you or making absolutely no sense. If so, please forgive me. :) -- William --- In flexcoders@yahoogroups.com, Nate Pearson napearson99@ wrote: I'm good at extending UIComponent and making custom things...I just want to know conceptually how people would do it. Even if you've done this in a different language that's fine. I think both of you are thinking more about a grid than a map. I think I explained it poorly. Here's a pic of what I'm looking for. In this one it shows web page, but I would just overlay the same thing over a map. img src=http://www.itmanagement.earthweb.com/img/Liv-050301-Heatmap.jpg/ --- In flexcoders@yahoogroups.com, Jehanzeb Musani jehanzeb_bs@ wrote: Hello, I am not dead sure how one can do it in Flex as I am relative a newbie in Flex application development. However, I am working for a financial solutions provider in Dubai and we have designed heatmap component in .NET. We used custom rendering (GDI+) to draw this control in .NET. I believe you can do the same in Flex. If you are familiar with Flash or even if you know Flex Drawing API, you can opt custom rendering tu built this control. In my opinion, it will be better than implementing this functionality using datagrid. Hope this helps. Regards, Jehanzeb --- Nate Pearson napearson99@ wrote: I'm thinking about making a heat map overlay. I'm not sure how to go about it though. Does anyone have any ideas? Lets say you have a grid, the more points you have in one place the more red it is in that place, less would be yellow, then green, then blue. I don't know how I would code this though Any help is appreciated. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[flexcoders] Re: PopUpMenu Button item click....
PopUpMenuButton forwards event from it's internal Menu object. Menu only dispatches an itemClick event when the user clicks on a leaf node. You can monkey patch Menu to fire off events when an internal node is clicked by changing the mouseUpHander. By removing the check on isBranch from the line that reads if (item != null _dataDescriptor.isEnabled(item) !_dataDescriptor.isBranch(item)) the Menu will behave as you expect it to (I'm using the version of the SDK that shipped with Flex Builder 3 -- if you have another build things might be different). You can then use the properties of the event to do whatever processing you needed. --- In flexcoders@yahoogroups.com, sudha_bsb [EMAIL PROTECTED] wrote: Hi, I am having strange problem with PopupMenuButton. I am having a popupmenubutton with submenus as its items. When I click on the parent menu item( not on the sub menu item), how can i get the index of the parent menu item on which it is clicked. Which event gets triggered for this. The itemClick event is triggered only when we click on the sub menu item which is in the last hierarchy. Similarly when i click on the submenu item, i need the index of its parent menu with respect to popumenu button. Here is the code... When I click on Inbox or Calendar menu..i need its index(0 or 1)..Similarly when I click on Personal menu item...I need Inbox index(its parent menu index.) Please help ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.events.*; import mx.controls.*; //Event handler, invoked when you select from the menu. public function itemClickHandler2(event:MenuEvent):void { Alert.show(Menu label: + event.label + \n menu item index within parent menu: + event.index); } ]] /mx:Script !-- A an data provider in E4X format. -- mx:XMLList id=treeDP2 node label=Inbox node label=Personal / node label=Marketing/ node label=To Do/ /node node label=Calendar node label=Appointments data=6/ node label=Meetings/ /node node label=Deleted Items/ /mx:XMLList mx:Panel title=PopUpMenuButton Control Example paddingTop=10 paddingLeft=10 paddingRight=10 x=10 y=205 height=143 width=271 mx:Label width=100% color=blue text=Click the down arrow to open the menu./ mx:PopUpMenuButton id=p2 dataProvider={treeDP2} labelField=@label itemClick=itemClickHandler2(event);/ /mx:Panel /mx:Application Thanks, Sudha.
[flexcoders] Re: XML is NULL immediatelly following service call, but does appear valid in textarea
You're on the right track. Remoting calls are done asynchronously, so code that depends on the result of an HTTPService can't be placed immediately after the remoting call. The data will not have loaded before those lines are executed. The HTTPService's result attribute defines an event handler for when the XML is finished loading. That is why xmlObj = XML(bookData.lastResult) performs in the manner you'd expect. What you can do is call a function in place of that line and do your xmlObj assignment and all your other processing from there. With regard to calling a function when entering a state: If you have some event that is causing your application to change states, why not call the HTTPService from within that event handler? --- In flexcoders@yahoogroups.com, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a box in one state, I remove the box and then add another box. I do this so when the box is complete, I have something to trigger getting data from an xml file. (That doesn't seem right, is there a better way to trigger a function on entering a State ? ) I'm testing the data in 2 ways, 1 works and the other doesn't. the HTTPservice: mx:HTTPService id=bookData url=../media/books.xml resultFormat=e4x result=xmlObj = XML(bookData.lastResult) / When I send the service: bookData.send(); the data is sent to this textArea mx:TextArea text={xmlObj.toString()}/ So far so good, however, if I put this other test immediately after the service call, I'm getting the dreaded NULL reference error. trace(xmlObj.stock.(@id == 1).name); Does this mean I need to check for load completion, like an event listener on an UrlLoader ? (if so, How? ) The documentation seems to indicate it shouldn't be neccesary, so I'm not even sure that's the problem What's wrong ? The xml is below ?xml version=1.0 encoding=iso-8859-1? books stock id=1 nameThe Picasso Code/name authorDan Blue/author categoryFiction/category descriptionCubist paintings reveal a secret society of people who really look like that/description /stock /books