Re: [flexcoders] Re: Flex Builder on Linux been scrapped ?
Howard, once something gets traction, then licenses and boxes can be bought. In spite of our stripped to the bone status, money somehow appears for projects that have to get done. Howard Fore wrote: How were you going to buy Flex Builder even if it was going to be available on Linux?
Re: [flexcoders] Flex Builder on Linux been scrapped ?
I was thinking the same... thomas parquier wrote: As eclipse is java based, how does fb happen to be incompletely ported to linux ? What about opening source of fb ? There must be some java developers who will be able to work on fb.
Re: [flexcoders] Re: Flex Builder on Linux been scrapped ?
Well most or all decisions are based on emotion, despite what we rationalists think, but I take your point. I'd like to write something here thats actually useful and might contribute a tiny item to the knowledge pile at Adobe, without boring everybody with personal details- 1) windows + Adobe puts me over budget at home, and I am accustomed to using all-open software, and one of the appeals of Flex Builder on Linux was I could learn it without forking over money. and yes it galls me to send money to MS. 2) My company is a Linux shop and no license money is available for experimental projects; CTO wants Java and the only way I can convince him Flex/Flash is better is to show something else that works. 3) I need to see what its like developing without the Flex Builder framework. I am already the only one in the building who uses an IDE or visual debugger. Just as I had no idea how Sun was going to make money on Java ( opposed to IBM who does) I don't know how Adobe can make money giving away tools, but it sure looks like open tools are going to win the battle in the long run, and proprietary tools will lose market share. Maybe Adobe can sell the visual designer stuff? Open source software people are so wary of proprietary tools because we have seen over and over how tool sets get munged over time, or even abandoned, how open tools have vastly better tech support, and now finally with Eclipse, open tools are achieving parity with the visual IDE stuff from vendors. It seemed to me that Adobe was following a semi-open model with Flex, for instance open bug reporting, and that attracted me in the first place. and so forth John daxdr9 wrote: If your willing to drop Flex because they don't sell an IDE for Linux, you're basing a technical decision on emotion.
Re: [flexcoders] Flex Builder on Linux been scrapped ?
Paul Andrews wrote: A really difficullt viewpoint to understand. FB != Flex - there's always the SDK - most people don't use the design view that much - do they? won't I lose the debugger too? as noted I have to try it... Linux doesn't have the Design View. but you do seem happy to bet your customers come only from the linux world. not going to specify any OS for customers, building Flash for web interfaces. I don't have a problem with open source, but many people see it as a mantra for ife, ... mostly it depends on what you have invested in, I've let my Windows investment drop in favor of Linux, and I'm not sorry. I have yet to meet anyone outside the geek/software development world using Linux, well we ARE talking about development platforms, not end user platforms. Anyway netbooks and Android phones are colonizing the lower Windows space - food for a business discussion elsewhere.
Re: [flexcoders] Flex Builder on Linux been scrapped ?
If Adobe drops Linux support for Flex, then I will probably drop Flex. I won't maintain a Windows or Mac box at home, and my company really doesn't want to invest in any more Windows apps. I don't want to invest myself in technology I can't run independently of whoever I happen to be working for today. Seeing the fickleness of the corporate owners of development tools is what sent us to Linux and open source tools in the first place. We can't bet our products on some whim of Adobe. My current all-Linux proof-of-concept project will be blown out of the water, and I'll have to get up to speed on Java. -grieving already John and at a time when Linux is gnawing away at laptop market from below and the desktop market is dying...
Re: [flexcoders] Flex Builder on Linux been scrapped ?
Guy I could use the bare SDK of course. I hadn't really tried it before because the Flex Builder Eclipse plugin seemed like a good idea. And there is *some* support for it in the community, I don't know how much. You're right I should try that before I give up. blame Adobe is not quite right, trust is more like it. Watching Java slowly worm its way out of Sun's grasp to the point where its now more or less open-source should provide a positive prediction for the eventual outcome, but Adobe ain't Sun, but then Sun ain't either now. Does Adobe have the right corporate culture to nurture an open-source project? I like the way they are running Flex otherwise, but maybe I indulged in wishful thinking on the Linux support. John Guy Morton wrote: Wouldn't you still be able to build your own IDE using the free SDK? As I understand it a lot of people do this now to avoid having to buy FB, and I imagine Linux users would be relatively common within that group. If sales for a linux version of FB are too low to justify the ongoing cost of development, you can hardly blame Adobe for that. Their support for *nix is better than most. Guy
Re: [flexcoders] Flex Builder on Linux been scrapped ?
well thanks for that Matt, I'll wait for announcements. John Matt Chotin wrote: I'm going to continue to stay out of the fray, but just to be clear, that conversation is about Flex Builder, not the SDK. We will always support developers on Linux, it's a question of what we tools beyond the SDK we provide. We'll be looking to share more information on our plans in a few weeks. Matt
Re: [flexcoders] Cant receive socket data
hmmm. I could easily append some bytes and see what happens, but not 'til Monday when I go back to work. Thanks! Maciek Sakrejda wrote: Interesting. We ran into this issue with URLStream: http://bugs.adobe.com/jira/browse/FP-748 -- maybe your problem is related? Actually, searching Adobe JIRA for XMLSocket turns up a number of bugs that sound vaguely like what you're experiencing... -Maciek
[flexcoders] Cant receive socket data
I have a Flex 3.0 app which can connect to a remote socket server, and send it XML, but nothing happens ( no event fires, no error in debugger) in Flex when the server returns data. The remote server is appending a nullbyte to the xml message, and thinks its sending the data. Ideas? - the server code ( perl) snippet: my $NULLBYTE = pack( 'c', 0 ); if ( $1 eq new ) { print STDOUT request is: $1 sending xml data\n; print CONNSOCK $simdata ; print CONNSOCK $NULLBYTE; } the flex code snippet: | var socket:XMLSocket = *new *XMLSocket(); socket.addEventListener(Event.CONNECT, connected); socket.addEventListener(DataEvent.DATA, dataReceived); socket.connect(localhost, 8989); *private function *connected(event:Event):*void* { socket.send(xmldata); } *private function *dataReceived(dataEvent:DataEvent):*void* { trace(dataEvent.data); var xml:XML = *new *XML(dataEvent.data); } Thanks John |
Re: [flexcoders] Cant receive socket data
yikes, please ignore extraneous asterisks in snippet. this is corrected: - the server code ( perl) snippet: my $NULLBYTE = pack( 'c', 0 ); if ( $1 eq new ) { print STDOUT request is: $1 sending xml data\n; print CONNSOCK $simdata ; print CONNSOCK $NULLBYTE; } the flex code snippet: var socket:XMLSocket = new XMLSocket(); socket.addEventListener(Event.CONNECT, connected); socket.addEventListener(DataEvent.DATA, dataReceived); socket.connect(localhost, 8989); private function connected(event:Event):void { socket.send(xmldata); } private function dataReceived(dataEvent:DataEvent):void { trace(dataEvent.data); var xml:XML = new XML(dataEvent.data); } Thanks
Re: [flexcoders] Cant receive socket data
Thanks - but I added this code and no change. The events don't fire. socket = new XMLSocket(); configureListeners(socket); private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CLOSE, closeHandler); dispatcher.addEventListener(Event.CONNECT, connectHandler); dispatcher.addEventListener(DataEvent.DATA, dataHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); } private function closeHandler(event:Event):void { trace(closeHandler: + event); } etc etc etc copied from http://livedocs.adobe.com/flex/3/langref/flash/net/XMLSocket.html#includeExamplesSummary Maciek Sakrejda wrote: You are an optimist: you are not listening for flash.events.IOErrorEvent.IO_ERROR or flash.events.SecurityErrorEvent.SECURITY_ERROR from the XMLSocket.
Re: [flexcoders] Cant receive socket data
More debugging: If I send connect, request data (a short XML text which the server is looking for), then connect again, The data comes through. Note: I am watching in a packet sniffer and I never see the policy file come across any port, though I am able to connect. Note2: if I remove the nullbyte from the perl code no data ever appears. -puzzled John
Re: [flexcoders] Cant empty context menu- previous answers don't work...
Thanks Doug, I'll stop trying to make this work and change the interface idea. Flex team: this seems like a collision between proprietary ideas of how to build a framework and Open Source culture. Obviously a developer ought to be able to do whatever he likes with right-click events. John Doug McCune wrote: This is specifically (and has always been) impossible. You cannot ever get rid of those context menu items. As in never ever ever. The best you can hope for is supressing the context menu and replacing it with your own, which is sort of possible with a javascript hack I believe (google stuff about javascript flash context menu, I think Dan of polygeek.com was doing some tests trying to figure it out). Doug On Tue, Jan 13, 2009 at 4:51 PM, john fisher j...@jpfisher.net wrote:
Re: [flexcoders] Re: Generating random colors, excluding others
from: http://livedocs.adobe.com/flex/3/html/Capturing_User_Input_4.html here is some Adobe code to create random colors: function changeColor(event:ContextMenuEvent):void { square.transform.colorTransform = getRandomColor(); } function getRandomColor():ColorTransform { return new ColorTransform(Math.random(), Math.random(), Math.random(),1,(Math.random() * 512) - 255, (Math.random() * 512) -255, (Math.random() * 512) - 255, 0); } HTH John
[flexcoders] Cant empty context menu- previous answers don't work...
-This was discussed as recent;y as late last month, but I have tried all the solutions and they are not working.- -problem: I want to get control of the contextMenu, and I need to remove the built-in items. I am able to add menuitems -I tried advice from these sources: http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetailsproductId=2postId=2201 flexcoders 12/29/2008 -they said: if you run hidebuiltins() on the systemmanager you can wipe the menu clean. When I look in the debugger I see that a list of print, zoom and so forth are indeed made false, but when I run the app, I get the standard Flash context menu with show redraw debugger settings about adobe flash and I can't find these labels in the debugger, though they must be there *somewhere*. I *do* see my new menu with only a single item. Its as if the flash palyer itself adds the menu workaround: I'd be just as happy to get a right-click event on my sprite, and dump the context menu altogether! building in: Flex3.0 flexbuilder for Linux running on: Firefox 3.x on Linux, Flash debugger v 9 0 11 5 0 thanks John
Re: [flexcoders] Cant empty context menu- previous answers don't work...
well since nobody had time to answer yet, I kept digging. here's one bug: if you add Settings as part of the string which forms your custom menuitem label, not just the whole String which could collide with the Settings menu, but part of a custom string, it won't show at all in the menu, and no error is thrown. Parameters is acceptable, but thats all I know one way or the other. see Alex's previous comment: http://tech.groups.yahoo.com/group/flexcoders/message/125171 this code definitely does NOT clear the two standard menuitems, Settings... and About... nor the debugger-player's debugger and show redraw regions var menuItem:ContextMenuItem = new ContextMenuItem(Our switch: Change Parameters); menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,createParamPopUp); var customContextMenu:ContextMenu = new ContextMenu(); customContextMenu.hideBuiltInItems(); customContextMenu.customItems.push(menuItem); Though it does add an item, and run the associated function. Has anyone cleared the *whole* contextMenu out? or Taken control of mouse-rt-click events so as to avoid the standard contextMenu? John
Re: [flexcoders] Creating an ArrayCollection object for charting
Can I define this better? Anybody got an idea? john fisher wrote: ## This does not work: simpleData = new ArrayCollection([]); var st:String = new String(); #left out the loops here for clarity# st += '{' + name: + '' + statNode.name + ', ' ; # looped here through data # var elname:String = element.name(); var elvalue:Number = element.valueOf() ; st += elname + : + elvalue + , ; var newst:String = st.slice(0, st.length-2 ); cuts off last white space and comma newst += '}' ; simpleData.addItem( newst as Object ) ; trace(ServerPopUp:makeChart simpledata: = + ObjectUtil.toString(simpleData) ); ServerPopUp:makeChart simpledata: = (mx.collections::ArrayCollection)#0 filterFunction = (null) length = 1 list = (mx.collections::ArrayList)#1 length = 1 source = (Array)#2 [0] {name:se2, inpps:2233, refresh:3000, outpps:7799, conns:2211, inbps:1144, inpkts:3322, outbps:2233, outpkts:4433, inbytes:4455, outbytes:5544,cps:6655} uid = 9543B87D-14F5-0BC6-E2F0-B289C8EC32FC sort = (null) source = (Array)#2 # thanks John
Re: [flexcoders] Creating an ArrayCollection object for charting
Thanks Maciek... I actually started that way, but it failed. I'll try again and post if I can't get it to work. Maciek Sakrejda wrote: It looks like you're creating a String that looks like the code for the object (i.e., { foo: 'bar' }), and then casting that to Object. That won't do what you want. The thing is still a String. You need to actually programmatically create the Object.
Re: [flexcoders] Creating an ArrayCollection object for charting
Bless you! this is the syntax I didn't get- and behold, it works! excellent. Maciek Sakrejda wrote: then inside that loop, for each property you want to graph: currItem[element.name()] = element.valueOf();
[flexcoders] Creating an ArrayCollection object for charting
I am feeding data to a chart from an arraycollection. When I test it by using a literal to create the data object the chart works fine, but when I assemble the data piece by piece, the chart fails. A correction of my syntax would be great, and explanation even better! I have tried creating an object, then using addItem to add it to simpleData, and I have tried using addItem directly in simpleData, and here I try it using a string- the result is, as you can see from the trace output, that it was added as an array, not an object at least thats what *I* see. # #3 This works: simpleData = new ArrayCollection([]); simpleData.addItem({name:se2, inpps:2233, refresh:3000, outpps:7799, conns:2211, inbps:1144, inpkts:3322, outbps:2233, outpkts:4433, inbytes:4455, outbytes:5544, cps:6655}); trace(ServerPopUp:makeChart2 simpledata THAT WORKS: = + ObjectUtil.toString(simpleData) ); ServerPopUp:makeChart2 simpledata THAT WORKS: = (mx.collections::ArrayCollection)#0 filterFunction = (null) length = 1 list = (mx.collections::ArrayList)#1 length = 1 source = (Array)#2 [0] (Object)#3 conns = 2211 cps = 6655 inbps = 1144 inbytes = 4455 inpkts = 3322 inpps = 2233 name = se2 outbps = 2233 outbytes = 5544 outpkts = 4433 outpps = 7799 refresh = 3000 uid = CBEA58EB-CF06-51A8-8887-B289C8E48C2A sort = (null) source = (Array)#2 ## This does not work: simpleData = new ArrayCollection([]); var st:String = new String(); #left out the loops here for clarity# st += '{' + name: + '' + statNode.name + ', ' ; # looped here through data # var elname:String = element.name(); var elvalue:Number = element.valueOf() ; st += elname + : + elvalue + , ; var newst:String = st.slice(0, st.length-2 ); cuts off last white space and comma newst += '}' ; simpleData.addItem( newst as Object ) ; trace(ServerPopUp:makeChart simpledata: = + ObjectUtil.toString(simpleData) ); ServerPopUp:makeChart simpledata: = (mx.collections::ArrayCollection)#0 filterFunction = (null) length = 1 list = (mx.collections::ArrayList)#1 length = 1 source = (Array)#2 [0] {name:se2, inpps:2233, refresh:3000, outpps:7799, conns:2211, inbps:1144, inpkts:3322, outbps:2233, outpkts:4433, inbytes:4455, outbytes:5544,cps:6655} uid = 9543B87D-14F5-0BC6-E2F0-B289C8EC32FC sort = (null) source = (Array)#2 # thanks John
Re: [flexcoders] People with blogs
Nate, along with the other two plugin suggestions I can tell you that with various WP plugins you can get. *anything* to display inside your WP. I have an (internal) demo running now that allows raw html, swf files, php code to run in WP pages or posts. Beware of security issues with the php ajaxed-wp exec-php raw-html John Nate Pearson wrote: Sorry this is a little off topic. I'm trying to start a flex blog but I'm not sure how to copy code from flex builder into Wordpress and have the formating stay the same. Is there some plugin that you use? How do you guys do it? Thanks a lot! -Nate
Re: [flexcoders] multiple data sources not loading except in MXMLapp
Tracy, Fotis... apologies. I set up the same experiment at home and it works fine. Of course because *there was no error message or event* gr I wasted two days tracking it down. so close this question . and thanks John Tracy Spratt wrote: ..it just jumps from service.send()to the next function in the init file ..., that is normal, because of the async nature of RPC calls. The code does NOT wait until the call returns. How are you debugging? You need a breakpoint or trace or alert in the handler. Also, verify that the fault handler is not being called. If you are invoking send, you should get either a result or fault. Also, verify the url by pasting it into a browser, you should see valid xml. I see the one in the component is different from the one in the main app that works. Use the same one both places. Then debug the data source itself, to see if it is getting the call I assume service is an instance variable in the component? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of john fisher Sent: Friday, November 21, 2008 5:49 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] multiple data sources not loading except in MXMLapp Tracy Spratt wrote: Have you debugged to see if httpResult is being called? thats it exactly, it never gets called I added the e4x and no difference. When debugging it just jumps from service.send() to the next function in the init file. I think I should make a dummy mxml app and see if the same code works there One problem, you are not seetting resultFormat=e4x in the component code, so the line, xmlFeed = event.result as XML; certainly will fail. But step into or put a trace in httpResult first. Tracy
[flexcoders] multiple data sources not loading except in MXMLapp
The problem: I have multiple data sources and multiple visualizations planned. I am using the Flare libraries for some ( and I have also asked this on their forum) I find that I cannot load data (XML) using URLLoader or HTTPService from a subclass or MXML component. HTTPService works fine in my MXML app. Symptom: no error, var is null after loading. Am I hitting known limitations? John
Re: [flexcoders] multiple data sources not loading except in MXMLapp
OOps I am NOT able to get two HTTPServices working in one MXML app. Is there a way around this? john fisher wrote: The problem: I have multiple data sources and multiple visualizations planned. I am using the Flare libraries for some ( and I have also asked this on their forum) I find that I cannot load data (XML) using URLLoader or HTTPService from a subclass or MXML component. HTTPService works fine in my MXML app. Symptom: no error, var is null after loading. Am I hitting known limitations? John
Re: [flexcoders] multiple data sources not loading except in MXMLapp
great. good news = I am doing something wrong never mind Flare - the data is never getting there... here's what I have: an xml source and a graphml source. Each will drive a visualization. Maybe more sources to come... here's what I want to do: make a class or component for each type of visualization, and pull the data in inside the class. so far: when I make a component and try to use HTTPService or URLloader I get no data. when I tried two httpservice tags in the MXMLapp, I get data from only one, I assume because the event never fires in one... But I'd rather call HTTPService from inside the component anyway. # this works in the mxmlapp: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:ns1=flare.flex.* xmlns:demo=com.flare.* xmlns:local=* applicationComplete=rawData.send() mx:HTTPService url= http://john.znyx.com/oaflowdemo/mygraphml_realdata2.xml; id=rawData resultFormat=e4x result=gmrResultHandler(event); fault=gmrFaultHandler(event); / [Bindable] public var gmrFeed:XML; private function gmrResultHandler(event:ResultEvent):void { gmrFeed = event.result as XML; } ### this doesn't work in the component: [Bindable] private var xmlFeed:XML; private function useHttpService():void { service = new HTTPService(); //service.destination = service.method = POST; service.addEventListener(result, httpResult); service.addEventListener(fault, httpFault); service.url=http://john.com/oaflowdemo/mygraphml.xml;; service.send(); } private function httpResult(event:ResultEvent):void { xmlFeed = event.result as XML; } Tracy Spratt wrote: Why do you want two? You can, but do you really need to? Tracy
Re: [flexcoders] multiple data sources not loading except in MXMLapp
More info: I am following this http://livedocs.adobe.com/flex/3/html/data_access_2.html#195243 http://livedocs.adobe.com/flex/3/html/data_access_2.html#195243 ( see below) http://livedocs.adobe.com/flex/3/html/data_access_2.html#195243 and I have left out two things I see- destination and parameters parameters would be destination and rooturl, both of which seem optional? Broken: the result event is not firing and calling the httpResult function in my code ### adobe docs sample # private var service:HTTPService public function useHttpService(parameters:Object):void { service = new HTTPService(); service.destination = sampleDestination; service.method = POST; service.addEventListener(result, httpResult); service.addEventListener(fault, httpFault); service.send(parameters); } public function httpResult(event:ResultEvent):void { var result:Object = event.result; //Do something with the result. } thanks for the help, John
Re: [flexcoders] multiple data sources not loading except in MXMLapp
Tracy Spratt wrote: Have you debugged to see if httpResult is being called? thats it exactly, it never gets called I added the e4x and no difference. When debugging it just jumps from service.send() to the next function in the init file. I think I should make a dummy mxml app and see if the same code works there One problem, you are not seetting resultFormat=e4x in the component code, so the line, xmlFeed = event.result as XML; certainly will fail. But step into or put a trace in httpResult first. Tracy
Re: [flexcoders] multiple data sources not loading except in MXMLapp
Tracy Spratt wrote: ..it just jumps from service.send()to the next function in the init file ..., that is normal, because of the async nature of RPC calls. The code does NOT wait until the call returns. How are you debugging? You need a breakpoint or trace or alert in the handler. I have breakpoints in the app: at service.send() and in the result handler and the do-something-else function that follows. Breakpoints ( see below) fire in this order: 1,2,4 3 never fires ### a stripped down file that does NOT work ### ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete =init(); mx:Script![CDATA[ import mx.controls.Alert; [Bindable] private var xmlFeed:XML; import mx.rpc.http.HTTPService; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; private var service:HTTPService private function init() :void { useHttpService(); loadData(xmlFeed ); } private function useHttpService():void {### BREAKPOINT 1 ## service = new HTTPService(); //service.destination = service.method = POST; service.addEventListener(result, httpResult); service.addEventListener(fault, httpFault); service.url=http://john.znyx.com/oaflowdemo/mygraphml_realdata2.xml;; service.resultFormat = e4x ; service.send(); ### BREAKPOINT 2 ## } private function httpResult(event:ResultEvent):void { ### BREAKPOINT 3 ## xmlFeed = event.result as XML; } private function httpFault(event:FaultEvent):void { var faultstring:String = event.fault.faultString; Alert.show(faultstring); } private function loadData(data:XML):void {### BREAKPOINT 4 ## } ]]/mx:Script /mx:Application ## end of file ### Also, verify the url by pasting it into a browser, yep checked that Then debug the data source itself, to see if it is getting the call I don't see anything in the logs no matter how I access the file, so I'll have to pursue that... a different xml file on a different server fails in the same way...
Re: [flexcoders] Re: updating data in Actionscript
well then I *really* don't understand what you are up to, and haven't tried the BlazeDS... so any further discussion with me will probably result in me learning from you instead of helping. it *sounds* like your set-up is over-complex, but no doubt you have requirements to follow. to me theres a swf and theres a data source somewhere behind a URL, and thats all you need John netdeep wrote: The problem is that I'm transferring an ActionScript object to the server, populating it with the data, and then returning the ActionScript via BlazeDS and remoting (so these objects get converted to Java objects on the server and back to ActionScript when the come into flex). And the ArrayCollection is buried deep in the the object and I also build the series items for the chart on the fly in Actionscript. So I don't have access to the series items in the chart I create (for instance to reassign the dataproviders), nor do I have easy access to the ArrayCollections themselves since they are buried in the ActionScript objects. Here's some pseudocode of how the charts get created which illustrates the problem. in ReportObject for each ChartObject in ReportObject create CartesianChart for each AxisObject in ChartObject create DateTimeAxis and assign it to chart for each SeriesObject in AxisObject create Series and assign it to axis bind SeriesObject.data to Series.dataprovider So when I get the next ReportObject pushed to the flex app from the server, the structure of the Report is exactly the same (i.e. x# axes, x# series for a given axis, etc) but the data has been updated and the series do not pick this up.
Re: [flexcoders] updating data in Actionscript
I am using an httpservice to xml files on other servers. The display changes when the file changes, mostly. All you have to do is bind the dataprovider. Maybe your problem is different? Theres lots of documentation for what I am doing John I have been trying to find an answer for this with no success. How do you get flex to refresh data bindings using objects which are passed via remoting?
Re: [flexcoders] udefined property error without function
I am calling addChild inside the mx script section of a mxml file. If it has to be called inside a method, then I need some instruction. JF Fotis Chatzinikos wrote: public var myDemoClass:Zdemos ; public var myDataFilePath:String = http://.realdata2.xml; ; myDemoClass = new Zdemos(myCanvas,myDataFilePath); myCanvas.addChild(myDemoClass.getUIComponent()); Are you trying to call addChild in the class itself? In your first example (that is working) addchild is called inside a method In the second example (not working) the code is in no method...
Re: [flexcoders] udefined property error without function
oh %^$ thats what I get for typing anything instead of cutpaste! sorrybut The *actual* error has the capital P so unfortunately its not this simple pilot error, though I am not ruling out some other dumb pilot error any other idea? Paul Andrews wrote: - You'll notice that in the error there's a mention of myDataFilepath not myDataFilePath in the error, so somewhere you've got the wrong variable name.. Paul
Re: [flexcoders] Re: Debugging: general advice
ah, I did not grok that trace() would work with all classes, d'oh, I'll have to get trace working. I used my own before, but of course it doesn't work outside the main mxml code. thanks Amy wrote: - I use trace() when it _is_ in the browser,
Re: [flexcoders] Debugging: general advice
Thanks Josh, xray seems to be not at Flex3 yet, and the last news was 2007. Though it seems to be just what I need. The debugger in Linux Flex Builder Eclipse debugger works fine AFAIK. I guess I'll make a copy of my code that exercises the bad line of execution automatically. Josh McDonald wrote: I use a lot of logging (with a simple framework that allows me to do some better things than mx.ILogger), the occasional trace() and Alert, and a lot of single-stepping and breakpoints. But I don't know how good the debugging support is on Linux, so that might not be an option. You could also look into X-Ray. -Josh On Tue, Nov 11, 2008 at 11:30 AM, john fisher [EMAIL PROTECTED] wrote:
Re: [flexcoders] udefined property error without function
No you nailed it. I didn't understand about having to use a function. I'm sure I moved my eyes over the very document, but it just didn't stick. Thanks. John Paul Andrews wrote: I have a feeling this error may not be to do with these particular snippets. Paul
[flexcoders] udefined property error without function
context: an mxml app, with classes written by me ( Zdemos) and Flare classes. myCanvas is the id of a canvas in the flex part of the file and it works. I don't understand--- this compiles: public var myDemoClass:Zdemos ; public var myDataFilePath:String = http://.realdata2.xml; ; private function init(): void { myDemoClass = new Zdemos(myCanvas,myDataFilePath); myCanvas.addChild(myDemoClass.getUIComponent()); } this doesn't: public var myDemoClass:Zdemos ; public var myDataFilePath:String = http://.realdata2.xml; ; myDemoClass = new Zdemos(myCanvas,myDataFilePath); myCanvas.addChild(myDemoClass.getUIComponent()); Errors: access to undefined property myCanvas/myDemoClass/myDataFilepath thanks for help John
[flexcoders] Debugging: general advice
I read a thread from a few weeks ago, and Amy was using Alert to debug in the browser. So am I, and its moderately successful, but I wonder if there is a better way? I: linux, eclipse, flex builder For instance I'd like to step through on classes that aren't invoked until the user clicks. Is there any way to do this other than re-writing the code to call the bad section automatically? yes the damn debugging flash crashes FireFox all the time. sigh. fortunately I can type kill and Firefox remembers where I was tips and dope-slaps welcome. John
Re: [flexcoders] Security and dual localhost address question
1) is all this running on one machine? 2) which OS? 3) what does your hosts file say? I had same problem, localhost vs name.com I am running Apache 2.x not Tomcat on Linux, Flex3 my crossdomain ?xml version=1.0? !-- http://john.znyx.com/crossdomain.xml -- cross-domain-policy allow-access-from domain=name.domain.com/ allow-access-from domain=localhost/ allow-access-from domain=ip/ allow-access-from domain=domain.com/ /cross-domain-policy my hosts file 127.0.0.1 localhost name.domain.com 127.0.1.1 name.domain.com ip name name.domain.com ... HTH John ralcab wrote: I am building a Flex (version 2) application on my machine with a Tomcat server that is hosting the application, a couple of servlets and an Axis2 web service. The application runs fine if I load it from an address starting with http://127.0.0.1:8080. However, the web-service call will fail if I load the exact same application from http://localhost:8080. The gives me a Security error accessing url Alert. I've read in the past that Flash is strict about the interpretations of domains, so I'm not surprised by this behavior. Further, I am theorizing this is happening because the WSDL file for the service uses the numeric address rather than localhost. Since that is the only usage of the numeric IP address I can find (all the URLs I have constructed use localhost). I have a crossdomain.xml file that is reachable at http://127.0.0.1:8080:8080/crossdomain.xml;. It's not solving the problem. The crossdomain file has this format: cross-domain-policy allow-access-from domain=* to-ports=* secure=false/ /cross-domain-policy The web service is built using Apache Axis2. So, its address in the WSDL is: http://l27.0.0.1:8080/axis2/services/TestService. Is there some special location or content to the policy file that I'm missing? Thank you.
Re: [flexcoders] Re: Security and dual localhost address question
aha! the hosts file ( see Fotis for location I believe he has it right for WinXP) lists ip addresses with domain names so your PC knows that me.mydomain.com equates to 200.111.86.76 The key here is that the OS reads the hosts file first and then asks DNS, so whatever you put in will override what your public DNS server says. see name resolution and domain name service IIRC Windows help is pretty good on this... When Tomcat ( or any app ) Gets an http request it has to be able to figure out the IP address from either localhost or name.domain.com hence the need for hosts file and DNS. If your browser says http://...; it still uses the network interface, even if its all on one machine. this is a Good Thing. If it uses file://... then not. This is why the raw ip address works and localhost doesn't - see? HTH sorry if its a bit pedantic John ralcab wrote: (3) Excuse my ignorance, but what's a host file? I'm self taught on this and pretty new to it.
Re: [flexcoders] Re: Security and dual localhost address question
Fotis, you may be right, but messing with the hosts file and the crossdomain file did fix the problem for me, albeit on a Linux box. It probably also matters what the setup for his Tomcat is too. It puzzled me too, because I am accustomed to having localhost resolve correctly, though its in the hosts file by default on *nix OSes.. dunno what Windows does. If the problem is resolving localhost the solution is in the places we pointed him John Fotis Chatzinikos wrote: John, appart from your correct info on dns, I do not think thats John's problem, (confict on Johns' here :-)... He is using http://localhost:8080 and localhost works without manually adding it in the hosts file (usually ?) On Wed, Nov 5, 2008 at 9:24 PM, john fisher [EMAIL PROTECTED] wrote:
Re: [flexcoders] What classes are available to Flex applications vs AS3 applications?
Me too: I am trying to move an app based on an AS class ( using the Flare classes ) into an MXML app, and I'd appreciate any tutorial on this. John ivo wrote: Ive found that I can import many classes under the packages below, but not all. The whole trial and error method of finding which classes are available got old rather quick.
Re: [flexcoders] Do you use a Mac?
yeah, thanks, have that. Its much better than a couple of years ago. Probably plenty good enough for a bushwhacker like me if I just took some time with it. J Guy Morton wrote: Inkscape is a reasonable Illustrator-replacement, and it's free.
Re: [flexcoders] first time using the AdvancedDataGrid and can use some help.
Mark: Amy set me on to this post, which I found very helpful: http://dispatchevent.org/roger/as3-e4x-rundown/ This assumes you are using format as e4x just my also-a-newbie suggestion: using children() and child() methods made it possible for me to drill down into quite a bit more nested XML than yours. oh yeah beware there are differences ( not very well understood be me yet) between XML: and XMLListCollection. John Mark wrote: I'm finding a few examples in the help and online but with everything I see the XML only goes about 2 deep. I'm having a hard time setting up the datagrid to be broken out by Person, then Project, then by Date with the hours. Can anyone lend a hand on how to put together this datagrid. I'm sure it's right in my face but I just don't see it. Thanks, Mark
Re: [flexcoders] Re: getStyle(fill) from chart series fails
good idea, I should trace that way... This code ( in the adobe example) works: var star:* = myChart.series[z].getStyle(fill); [object SolidColor] This code FAILS: series1 = new ColumnSeries(); // snipped other property settings var star:* = series1.getStyle(fill); undefined and yet This FAILS too mySeries.push(series1); //snip // add all the series to the chart myChart.series = mySeries; var starrr:* = myChart.series[0].getStyle(fill); undefined NOTE the chart as displayed has colors as assigned, so I know the setStyle is working... Continuing to experiment John Amy wrote: If it were me, I'd put the result of the getStyle() into a variable with a * type and set a break point to look at it in the variables window, rather than trying to trace it out.
Re: [flexcoders] Do you use a Mac?
Just in case anybody cares, it is also possible to use Flex Builder on Linux. Since I don't normally use any non-free software, and I do a lot of Linux sys admin, thats good for me. There are a few apps I can't duplicate, like Illustrator and Google Sketchup and Rhino, but mostly I don't miss anything from Windows-land. true I don't care about iTunesmusic, but I do subscribe to podcasts. (I don't do professional graphics or audio.) In the last year or so the package system for Ubuntu has gotten mature, so that software installation is just select and click. It used to be a PITA sometimes. Most of the sys admin apps now work in KDE, too. Theres a few things that still don't work, but in Linux you can be pretty sure they'll be fixed. I like OSX, too, and used DOS and Windows since 1985. just sayin'
Re: [flexcoders] Re: How to keep Tree control synchronized with the database. Please Help
@mark: thanks will check it out @anuj: this is just exactly what the adobe sample code does, except not directly to the database. anuj sharma wrote: ... Can I use the Timer class to create a timer instance which will periodically call HTTP a
Re: [flexcoders] Re: How to keep Tree control synchronized with the database. Please Help
Anuj I meant, search through the online adobe docs for 'timer polling example' or other keywords like those. there are many many examples in the online docs at Adobe. John anuj sharma wrote: Hi John I am not sure i get what you are trying to say. Can you be please elaborate little bit more. Thanks Anuj On Wed, Oct 22, 2008 at 10:13 AM, john fisher [EMAIL PROTECTED] wrote: @mark: thanks will check it out @anuj: this is just exactly what the adobe sample code does, except not directly to the database. anuj sharma wrote: ... Can I use the Timer class to create a timer instance which will periodically call HTTP a
[flexcoders] getStyle(fill) from chart series fails
I must be doing something simple wrong here. What I am doing: creating a column chart entirely in AS, and controlling the colors, and series, and legend in AS. The legend will be in a grid, instead of automatic in the chart. once the XML data is acquired, the makeserviceschart assembles the chart, including choosing which data to include, and which colors to use, and then finally calls drawlegend, passing the grid and chart objects, in order to assemble the legend in a Grid. What doesn't work: The legend gets the data name ( label) correct, but doesn't get the fill color. Back inside the makeserviceschart, I can't trace out the fill color using getStyle either, even though I have just set it using setStyle. The getStyle syntax is a cutpaste from the Adobe example code app: http://blogs.adobe.com/flexdoc/2008/07/customized_legend_layout.html which DOES work on my system // SMALL SNIPPET // set the color from the colorlist array of SolidColors series1.setStyle(fill, colorlist[count]) ; //THIS WORKS CORRECTLY // in the legend building func // Apply the current series' displayName to the LegendItem's label. li.label = colChart.series[z].displayName; display( li.label ) ; // YEP THIS WORKS display( colChart.series.length) ; // YEP THIS WORKS // Get the current series' fill. var sc:SolidColor = colChart.series[z].getStyle(fill); // NOPE NO COLORS SHOW UP display(color sc = + sc ); // NOPE TRACES NULL display(series color fill = + colChart.series[z].getStyle(fill) ); //NOPE TRACES UNDEFINED // I tried toString() and toString(16) and sc.color // BIG CODE SNIPPET //THE CHART FUNCTION public function makeserviceschart():void { var myChart:ColumnChart; var series1:ColumnSeries ; var mySeries:Array=new Array(); var data_items:Array = new Array(inpkts,...inbytes,outbytes); // dummy user-selected data choices // THE DATA simpleServicesData = new ArrayCollection([]); //subset of the XML // various data munging ops snipped out here myChart = new ColumnChart(); myChart.showDataTips = true; myChart.dataProvider = simpleServicesData; // Define the category axis. var hAxis:CategoryAxis = new CategoryAxis(); hAxis.categoryField = name ; hAxis.dataProvider = simpleServicesData; myChart.horizontalAxis = hAxis; // define the vertical axis var vAxis:LogAxis = new LogAxis(); // makes logarithmic vAxis.interval = 10 ; myChart.verticalAxis = vAxis; //create the colors var colorlist:Array = new Array( new SolidColor(0x8dd3c7, .8),, ); // Add the series: var count:int = 0 ; for each (var item:String in data_items){ series1 = new ColumnSeries(); series1.xField=name; series1.yField= item ; series1.displayName = item; series1.setStyle(fill, colorlist[count]) ; //THIS WORKS CORRECTLY mySeries.push(series1); count++ ; } // add all the series to the chart myChart.series = mySeries; // Attach chart and legend to the display list. // first kill off the previous version of the chart serviceschart.removeAllChildren(); serviceschart.addChild(myChart); //Create a dynamically sized grid for numerous legend items drawlegend(myChart, serviceslegend) ; } //THE LEGEND TO GRID FUNC called by makeserviceschart // taken from here: http://blogs.adobe.com/flexdoc/2008/07/customized_legend_layout.html private function drawlegend(colChart:ColumnChart, myGrid:Grid):void { // empty grid object myGrid.removeAllChildren(); //SNIPPED OUT SETUP OF VARS for (var j:int = 0; j numRows; j++) { var gr:GridRow = new GridRow(); myGrid.addChild(gr); for (var k:int = 0; k rowSize; k++) { // As long as the series counter is less than the number of series... if (z colChart.series.length) { var gi:GridItem = new GridItem(); gr.addChild(gi); var li:LegendItem = new LegendItem(); // Apply the current series' displayName to the LegendItem's label.
Re: [flexcoders] How to keep Tree control synchronized with the database. Please Help
I am working on a similar problem... I don't use PostGres, but there may be some sort of export to XML function. *If* that can fire on changes ( or you set up the inserts/updates that way), then you have something that an httpservice can acquire directly. But somebody still has to ask the file if it changed... unless You use a socket connection to stuff an event into the dataprovider. Theres some examples in the adobe docs. or you poll, but don't refresh the whole html page, just the data in the swf, and only when it changes. My users cant tell the difference between polling and the socket connection in the two demos I made. I'm just a newbie, so if there is another way, I'd sure like to hear about it. John Paul Andrews wrote: Isn't this simply a problem that multiple calls are required to poll the database for change? I think the OP really needs a push type service. There's no way to know that the database table has changed without polling the database..
Re: [flexcoders] Syntax of using a variable to make an object
Thanks Paul. Paul Andrews wrote: The curly bracket syntax is for compile time declaration only where the compiler knows all of the values at the time of compilation. In your example variables are involved so the compiler gives you an error. AHA he said. Generally speaking the variable equivalent of var o:Object = { x: 1234}; would be var o:Object = new Object(); o.x = 1234; obviously I warn't raised on OO style I was still looking for * your code is trying to have the variable name as a vaiable itself, so the equivalent would be: o[x] = 1234; var variableName:String = x; var variableValue:Number = 1234; o[variableName] = variableValue. excellent. Thanks very much I'm rather suspicious of your XML handling code, but I won't go there! Oh that was almost pseudo-code, to make it easier to read, without explaining the whole razzmatazz of hoops I am jumping through. No doubt there will be extensive re-factoring once it all works and my understanding grows.
Re: [flexcoders] AS equivalent for perl's chop/chomp?
thanks Guy and of course you're right if they irritate my sense of code style, I can just wrap them up. Just thought I'd ask in case I missed something. John Guy Morton wrote: I don't think so...I've never seen one, but what's hard about using String.replace? Aren't the following functionally equivalent? //perl's chomp String.replace(/[\r\n]*$/); //perl's chop String.replace(/.$/); I guess if you really care, you could extend the String class to add them? Guy
[flexcoders] Syntax of using a variable to make an object
I am stuck on some basic AS syntax. Here is some Adobe sample code: [Bindable] public var dpac:ArrayCollection = new ArrayCollection([ {A:2000},{A:3000}, {A:6000} ]); public function addDataItem():void { var o:Object = {A:2000}; dpac.addItem(o); } Inside a loop, I need to add a data item to an arraycollection, but I need to get the name of the data and the result of the data from an XML file. OK I've got those two things working, but now my name and dataresult are variables not ints and strings. [Bindable] public var dpac:ArrayCollection = new ArrayCollection; for each ( var something:XML in myXML.children()) { var dataresult:Obj = something ; // don't know type of result ahead of time... var name:String = something.name ; var o:Object = { name + ':' + dataresult } // WRONG! dpac.addItem(o); } I am going wrong where I try to create an object out of method-results or variables that can be additem'ed to an arraycollection. And I don't really get the curly brace syntax, as you can see... Thanks for guidance here... John PS what is the proper name for this like 'passing by reference vs passing by value' or?
[flexcoders] AS equivalent for perl's chop/chomp?
I see String.replace using a regex, but is there a more straightforward way to do this (very) common adjustment? (perl: chop and chomp delete the last character from a string in slightly different ways) thanks, John
Re: [flexcoders] Re: Feeding complex XMLdata to charts: Flex3
well it may be easier... but I liked the obvious page layout of the mx tags, separated from the AS code. No doubt I can still have what I want. My comment on the documentation is that as long as you are using very simple data, everything goes together smoothly, but as soon as I introduced real data from this big ugly XML file, I found myself off in the weeds. and thanks again, I am still working up to taking your code apart. John Amy wrote: I was actually surprised to find that creating charts in AS instead of MXML was actually _less_ confusing and quicker than MXML.
Re: [flexcoders] Feeding complex XMLdata to charts: Flex3
For total spanking newbies reading this: See Amy's code and also this simplified version http://livedocs.adobe.com/flex/3/html/help.html?content=charts_intro_7.html stuff I didn't get that tripped me up- 1) You don't have to use the mx:ColumnChart at all - you can do everything in AS instead. This is very confusing, because the call in AS that actually creates the chart is addChild as in // Attach chart and legend to the display list. p1.addChild(myChart); p1.addChild(legend1); My initial reaction is yuck but knowing nothing, its worth will likely be revealed to me later. 2) use of the child method on XML objects, I need to practice this and figure it out. 3) I was right, the bar charts just want an array of arrays for data, but I lacked the tools to create that from the XML. further comment welcome. John
Re: [flexcoders] Re: Feeding complex XMLdata to charts: Flex3
Hey I see what you are doing, including a call I didn't know about... thanks will try this afternoon, and probably have Qs. Have to write some release notes first. I knew I was having a forest and trees problem, but sometimes you just get stuck. John Amy wrote: You might find this useful http://flexdiary.blogspot.com/2008/08/charting-example.html HTH; Amy
[flexcoders] Feeding complex XMLdata to charts: Flex3
Good morning in PDT, and thanks for being here. Me: new to AS Flex, building a Linux-based dashboard, using Flexbuilder alpha for Linux in Eclipse ( this does not have all features compared to Windows and OSX I believe, and may be buggy) *Problem:* I've been given an XML schema for incoming data thats complex, and well, may not be optimum. :) When I follow the tutorials using simple data, data item etheth0/eth packets1234/packets bps3005/bps /item item etheth1/eth packets517/packets bps4335/bps /item ... /data I am able to get a dynamic bar chart that responds to changes in number of members of the data array of elements. But my real data is complex ( see below) and it appears to me that the dataFunc to chart series dataprovider connection, which understands simple arrays, gets confused with complex arrays. *What I get thats wrong:* Trace shows me getting results like peas data1 /peas peas data2 /peas or using a different notation, data1data2 when I expect an array of data1,data2 and the chart won't work at all. *What I want to know:* I want some guidance to help me avoid dead ends- Is my XML just flat not suitable? Am I wrong about the problem? Do I need to do some complicated restructuring of the data before I return it from the dataFunc, so I send a simple array like shown above? Thanks! John *Simplified Data:* save_instance namePC/name instance id1/id beetles_count1/beetles_count beetles array seed_nameeth3/seed_name instance0/instance apple_id4094/apple_id /array /beetles service_count1/service_count services array waiter_count4/waiter_count namehtml/name servers array lpeach0/lpeach namese1/name upeach0/upeach instance0/instance carrots_list array carrots_list1/carrots_list /array /carrots_list apple_id1/apple_id statistics statistics *peas/peas data1* * refresh0/refresh X label* *bugs/bugs data2* /statistics activeconns/activeconns inactiveconns/inactiveconns persistconns/persistconns /statistics pits10.0.1.42/pits pc_pits10.0.1.101/pc_pits status2/status weight1/weight /array /servers instance0/instance status2/status statistics peas/peas refresh2000/refresh bugs/bugs /statistics protocol0001/protocol scheduling0001/scheduling forwarding_method0001/forwarding_method /array ... /services control_seednameeth0/control_seedname fastpath num_stack0/num_stack num_key0/num_key num_hash0/num_hash /fastpath statistics peas000c/peas refresh2000/refresh bugs/bugs /statistics /instance ... /save_instance // *dataFunc:* private function dataFunc(series:Series, item:Object, fieldName:String):Object { if(fieldName == yValue series.id==peas){ return(item.services.array.servers.array.statistics.statistics.peas ) ;} else if(fieldName == yValue series.id==bugs){ return(item.services.array.servers.array.statistics.statistics.bugs) ;} else if(fieldName == xValue){ return(item.services.array.servers.array.name) ;} else{ display ( dataFunc returns NULL); return null; } } / *chart:* mx:ColumnChart id=chart dataProvider={xmlData} showDataTips=true width=50% height=50% mx:horizontalAxis mx:CategoryAxis id=h1 dataFunction=catFunc/ /mx:horizontalAxis mx:series mx:ColumnSeries id=peas displayName=Peas dataFunction=dataFunc