[flexcoders] Re: access mdb files with flex 3 reside in same directory
Flex can't natively connect directly to a database. There needs to be some sort of middle layer. (AIR apps can connect directly to SQLite, though.) For the Access DB I inherited, I ended up migrating the whole thing to MS SQL and then created web services. Then I use Flex's web service functionality to send/receive XML Soap messages. Works great. Technically, I could have created web services to hit up the Access DB, but for that much work, it was easier just to migrate to MS SQL and use the existing web service layer already in existence. --- In flexcoders@yahoogroups.com, xamkan xam...@... wrote: Is there any way having flex to access data within a .mdb file which reside in the same computer? Lets make it easier, having the .mdb file right next the the flex files. How can I design a flex program to open it and access the data within? I am just trying to make a very simple program, can access a .mdb file, and does not require remote connection. I searched for days and finally decided to make a post. This is a newbie with this tool and hopefully someone know how and can show shad some light on this with some example possibly. Thanks in advance!
[flexcoders] Re: From your own experience how long does it take to learn AS3?
Don't worry about having to refer back to the materials. I'm almost a year into programming with AS3 and even though I've got a BS in IT and can program in a few other languages, I still have to refer to AS3 materials quite regularly. I'm betting it's the same case for a lot of developers unless all they do is rehash out the same code and project types over and over. Like the other post says... work in small chunks. But also be sure to comment your code. You never know when you'll want to use that code again in the future. For example, this last application I built, I would just focus on each custom component until I had it dialed in. Each one had it's challenges and in the future, those things will be a lot easier now that I've got some examples to reference back to. Likewise, there were things I just breezed through because I just recycle code from other projects when those parts were serious challenges in the past. 4 Weeks in isn't enough time to master anything. --- In flexcoders@yahoogroups.com, ellistein52 ellistei...@... wrote: I have no background in programming , I am close to 54.I am following some AS3 Lynda.com Essential Training. I seem to understand the material but when I try to make a simple program on my own I am lost , I have to refer back to the lesson to be able to write a simple line of code on my own.Also I started learning the material 4 weeks ago so maybe it is too early for me to write my own code? I would appreciate your comments regarding this issue.
[flexcoders] Re: Best practices regarding XML to VO conversion
Here is how I convert XML from a SOAP web service into a VO. The VO Class: package vo { [Bindable] public class Product { public var ID:String; public var Category:String; public var Price:String; public var Name:String; public function Product(_ID:String,_Category:String,_Price:String,_Name:String) { this.ID=_ID; this.Category=_Category; this.Price=_Price; this.Name=_Name; } } } The web service result handler and namespace stripper: private function wsProductsResult(event:ResultEvent):void { var xmlResult:XMLList = event.result as XMLList; var xmlSource:String = xmlResult.toString(); //Strip namespace xmlSource = xmlSource.replace(/[^!?]?[^]+?/g, removeNamspaces); xmlResult = XMLList(xmlSource); //wrap XMLList in XMLListCollection var productsXmlc:XMLListCollection = new XMLListCollection(xmlResult.children()); var productsAC:ArrayCollection = new ArrayCollection(); //Cast xml element items into array of value objects for(var i:int=0;iproductsXmlc.length;i++) { var productTemp:Product = new Product( productsXmlc.getItemAt(i)..ID, productsXmlc.getItemAt(i)..Category, productsXmlc.getItemAt(i)..Price, productsXmlc.getItemAt(i)..Name); productsAC.addItem(productTemp); } //Bind ArrayCollection to Custom Component dgProducts.dg.dataProvider=productsAC; } public function removeNamspaces(...rest):String { rest[0] = rest[0].replace(/xmlns[^]+\[^]+\/g, ); var attrs:Array = rest[0].match(/\[^]*\/g); rest[0] = rest[0].replace(/\[^]*\/g, %attribute value%); rest[0] = rest[0].replace(/(\/?|\s)\w+\:/g, $1); while (rest[0].indexOf(%attribute value%) 0) { rest[0] = rest[0].replace(%attribute value%, attrs.shift()); } return rest[0]; } --- In flexcoders@yahoogroups.com, W.R. de Boer w...@... wrote: Hello, I am having a question what the best approach is to convert existing XML data to a object graph of value objects. I have spend quite some time to fix a memory leak in my existing parsing practice and I am curious how others solve this problem. My common approach is to create a class such as EventReader and EventItemReader class which is responsible for the parsing of the specific XML element and return the appropriate value object. But somehow this code is leaking like a mad dog (200kb per time) while the XML file is only 16kb. Now I have currently rewritten it so that just using simple strong typed objects. But I would love to find out what I am doing wrong in my current approach and how to solve it. Because it makes it easier to reuse the parsing code/logic. For example, normally, I use the approach of creating a public class with a few public variables like this: public class EventItemVO { public var eventDate: Date; public var eventName: String; public var location: String; } and then I am having code like this to parse it: try { var xml: XML = new XML( loaderContent ); var parser: EventItemXMLReader = new EventItemXMLReader( xml ); parser.parse(); } catch (e: Error) { trace(Error occured while parsing); } finally { parser = null; xml = null; } in the EventItemXMLReader-class I then return an instance of the EventItemVO-class Somehow this leaks and while I do the same stuff in the onComplete-handler of the Loader and do: array.push( {eventDate:date, eventName:name, location:location} ); The memory leak disappears. I would expect their is some reference kept alive but I am having a hard-time finding the reference which keeps it from garbage collecting it all. How do you parse XML and convert it in value objects? Yours, Weyert de Boer
[flexcoders] Re: [HELP] Little help with parsing datas
My approach would be to load all the rows and parse the // characters as a column, get a count of rows where that column is not empty, and then delete them. --- In flexcoders@yahoogroups.com, ~[TM3]~[Dev]At0ng[/Dev]~[/TM3]~ atong...@... wrote: I recently have this code from gotoandlearnforums to parse datas separated with commas from a text file but the problem is I dunno (I really had no idea how) how to exclude rows that begins with a double slashes (//), hope someone can help me with this. Parsing datas is ok but excluding rows is not private function init(e:Event):void { //load the data var loader:URLLoader = new URLLoader(new URLRequest(stuff.txt)); loader.addEventListener(Event.COMPLETE, parseData); } private function parseData(e:Event):void { var txt:String = e.target.data; var rows:Array = txt.split(\r\n);//split the string into rows var temp:Array = new Array(); for(var i:int = 0; irows.length; i++) {//you would include an if statement here to not include lines that begin with // var columns:Array = rows[i].split(,);//split each row into columns temp.push({id:columns[0],name:columns[1],position:columns[2]}); } ac = new ArrayCollection(temp)
[flexcoders] Re: How to parse xml with namespaces
Here's how I handle the messy SOAP and namespace returned from my web service application server: (I set the return format to e4x) private function webServiceResultHandler(event:ResultEvent):void { var xmlResult:XMLList = event.result as XMLList; var xmlSource:String = xmlResult.toString(); //Strip namespace xmlSource = xmlSource.replace(/[^!?]?[^]+?/g, removeNamspaces); xmlResult = XMLList(xmlSource); } public function removeNamspaces(...rest):String { rest[0] = rest[0].replace(/xmlns[^]+\[^]+\/g, ); var attrs:Array = rest[0].match(/\[^]*\/g); rest[0] = rest[0].replace(/\[^]*\/g, %attribute value%); rest[0] = rest[0].replace(/(\/?|\s)\w+\:/g, $1); while (rest[0].indexOf(%attribute value%) 0) { rest[0] = rest[0].replace(%attribute value%, attrs.shift()); } return rest[0]; } --- In flexcoders@yahoogroups.com, Vaibhav Seth vaibhav.s...@... wrote: Use regex and eliminate the namspaces from the root tag of the XML, check if it works. Root . . . /Root Thanks, Vaibhav Seth. EMAILING FOR THE GREATER GOOD Join me To: flexcoders@yahoogroups.com From: lukevanderfl...@... Date: Fri, 22 Jan 2010 03:04:05 + Subject: [flexcoders] How to parse xml with namespaces Hi. Here is a snippet of xml: It contains an element with a namespace (c:question) and several elements without a namespace. If I get the whole thing as an XML object, how do I go about accessing all the different fields. E.G. I need to access the c:question text or c:question subelements So: 1. c:question text: This is a wine question 2. c:question subelements: p.ul.li: Penfolds Grange - no effect or p: A bottle shop in a remote country pub sells five different bottled wines. The publican increases the price of a bottle of Jacob's Creek core range by 50 cents. 3. question attribute format: radio Ive tried setting a namespace for c and a default namespace but cannot consistently access elements and values from both namespaces. Id love your help.. Thanks. Kr. Luke. = ?xml version=\1.0\ encoding=\UTF-8\? c:question xmlns=\http://www.w3.org/1999/xhtml\; xmlns:c=\http://www.eddygordon.com/namespaces/course\;This is a wine question pA bottle shop in a remote country pub sells five different bottled wines. The publican increases the price of a bottle of Jacob's Creek core range by 50 cents. /p pAssuming that the prices of the other wines do not change, the Jacob's Creek price increase is likely to affect sales of the other products as follows: /p p ul liPenfolds Grange - no effect; /li liWyndham Estate Bin Range - the Wyndham Estate products are slightly more expensive but the price increase has narrowed the gap so a slight increase can be expected; /li liLindemans Bin Range - large increase in sales as this is a direct competitor; /li liRosemount Split Label Range - large increase in sales as this is a direct competitor /li /ul/ppBased on this information, which wines are in the same market as Jacob's Creek? /p question format=\radio\ name=\part1\ answer correct=\true\Lindemans Bin Range and Rosemount Split Label Range are definitely in the same market and Wyndham Estate may be. /answer answerPenfolds Grange is the only wine in the same market. /answer answerLindemans Bin Range and Rosemount Split Label Range are the only wines in the same market. /answer /questionp/ /c:question
[flexcoders] Re: Should I follow this recommendation when it comes to Flex learning curve?
Why can't you learn both at the same time? Flex by itself is all nice and dandy but the power comes from being able to create cross-browser, desk top deployable front-end to business processes and data. Techincally, the business logic can be built into Flex for a lot of stuff, but it's actually better to do that elsewhere like a middleware between the data and front end. Anywho... having skills to handle both modeling data on the server, processing it via the business logic layer, and then serving it up/to the flex front end is some strong Kung Fu. --- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote: I already know some html and CSS . Should I consider stopping learning Flex getting into PHP and coming back to Flex 3 again? The statement below is the recommendation of a friend programmer. I'm a little curious why you're jumping straight into advanced stuff and skipping the basics completely. Start with HTML and CSS. Those are literally the building blocks of the web. If you don't know them, it doesn't really matter if you understand OOP, because you'll never be able to format the output for the web. Then I'd move on to something like PHP... get a good solid grounding in basic programming logic used on the web. THEN jump into ActionScript/Flash programming and Flex. You're kind of starting at the wrong end of the progression
[flexcoders] Re: Adobe pulls Single CPU and 100-user licenses
It might be a good opportunity to loosely couple things and apply a more Service Oriented Architecture approach. Using SOA principles, changing out the business logic layer ie BlazeDS or LiveCycle wouldn't require a massive rewrite of the data or client layer. Just in how the data and presentation layers interact with whatever you implement in the business layer. Sort of like the whole MVC architecture applied enterprise wide. Not the easiest thing in the world to do, but it does come him handy and helps prevent massive re-design in all 3 enterprise application entities. Obviously that sounds nice on paper and doesn't change things after the fact, but it might be a good approach going forward. --- In flexcoders@yahoogroups.com, busitech m...@... wrote: I'm curious how many of your projects were deployed into production using the no-charge Single CPU (or the 100-user departmental) licenses of LCDS 2.x. Since the release of LCDS 3.0, neither of these licenses exist. This leaves our small business customers running in production using the Single CPU license with no upgrade path going forward, unless they can come up with the steep license fees for ES2. I doubt any of our customers will be able to afford it. Needless to say, this seriously impedes our ability to do business on the LCDS platform going forward in the SMB market we serve. It also leaves our hands tied with respect to the software we've already developed and deployed. BlazeDS is not an option - it would require a total rewrite of client and server, and mass annihilation of features. How are these changes affecting your business?
[flexcoders] Re: Adobe pulls Single CPU and 100-user licenses
It might be a good opportunity to loosely couple things and apply a more Service Oriented Architecture approach. Using SOA principles, changing out the business logic layer ie BlazeDS or LiveCycle wouldn't require a massive rewrite of the data or client layer. Just in how the data and presentation layers interact with whatever you implement in the business layer. Sort of like the whole MVC architecture applied enterprise wide. Not the easiest thing in the world to do, but it does come him handy and helps prevent massive re-design in all 3 enterprise application entities. Obviously that sounds nice on paper and doesn't change things after the fact, but it might be a good approach going forward. --- In flexcoders@yahoogroups.com, busitech m...@... wrote: I'm curious how many of your projects were deployed into production using the no-charge Single CPU (or the 100-user departmental) licenses of LCDS 2.x. Since the release of LCDS 3.0, neither of these licenses exist. This leaves our small business customers running in production using the Single CPU license with no upgrade path going forward, unless they can come up with the steep license fees for ES2. I doubt any of our customers will be able to afford it. Needless to say, this seriously impedes our ability to do business on the LCDS platform going forward in the SMB market we serve. It also leaves our hands tied with respect to the software we've already developed and deployed. BlazeDS is not an option - it would require a total rewrite of client and server, and mass annihilation of features. How are these changes affecting your business?
[flexcoders] Re: How long does it take to learn Flex and get a job?
One thing to consider is 1 year of experience or 1 month of experience repeated for 12 months. Big difference. What I mean is that learning the syntax and usage of Flex is one thing. Creating Flex apps to handle real world problems is another thing entirely. Most tutorials that have you building photo browsers don't go very far in terms of business needs such as dealing with databases, user authentication, version control, blah blah blah. Also, are you looking to specialize in a specific area? Websites vs. UI interfaces to large enterprise SOA deployments, etc. I suggest learning other programming basics to go along with your Flex learning. Java or C#.net would be good and both are pretty similar. JavaScript, XML, and (X)HTML are good skills to have as well. Another suggestion is to look through the help wanted ads in your area and see what skills people are looking for. Around here Flash developers with strong AS3 skills are in high demand. Most of the jobs requiring Flex I've seen require MVC skills and strong Java skills with Spring/Hibernate/etc. The other types of jobs requiring Flex usually also require strong AJAX/JavaScript/jQuery skills. Best of luck! --- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote: I am new to Flex and started learning Flex 3 months ago. I have no programming background. I wonder how long does it take to learn Flex and how long will take me before I can apply for an entry level position? I gave myself 1 year but I wonder if it is a realistic time frame? Thanks for your time. Fred.
[flexcoders] Re: the most popular way to be connected with sql server REFdn0085136210
WSAS Web Service Application Server. http://wso2.com/products/web-services-application-server/ One of the cool things you can do is create web services from multiple data sources which means you could basically query across different servers/databases/platforms. --- In flexcoders@yahoogroups.com, dennis den...@... wrote: Hello ppl. Which is the most popular way a Flex application to join an internet sql server (mysql or oracle)? Please give me some guidelines and places to read about. thanx dennis
[flexcoders] Handling Relational Data in a Form?
I've created a web service that returns a dataset from some relational tables. Tables 1 and 2 are the source tables. View 1 is the selected data that I send out as XML from a web service for the Flex UI. View 1 lists out all of the operations and then a bunch of query stuff, I populate the operation with an 'x' if that operation is needed for the job or populate with a date if that operation is completed. When an operation isn't needed it returns NULL as not every job needs every operation. table 1: Jobs jobnum clientname qnty - jobA Client A 1 jobB Client B5000 table 2: Operations ID jobnumOperation Completed 1 jobALaser 10-01-09 2 jobAInsert10-02-09 3 jobAInk jet 10-01-09 4 jobB4 Color Press 10-02-09 5 jobBLaser 10-02-09 6 jobBInsertx View 1: AllJobs jobnum clientname qnty Laser InkJet 4ColorPress Insert jobAClient A1 10-01-09 10-01-09 Null 10-02-09 jobBClient B 5000 10-02-09 NULL 10-02-09 x I have my Flex UI setup to receive the View output as XML and then populate an Advanced Data Grid. I've got a form section below that populates with the job data when a row is selected. The form section is for viewing or updating operation dates. (The form also shows some info returned in the xml that I don't show in the grid since I ran out of screen space in the grid.) For updates, I was going to setup a loop to cycle through the webservice update operation. However, where I'm stumped is passing the query info needed. The SQL statement is straight forward where the parameters needed are jobnum and something to identify the operation. And this is where I'm stumped. I need to get the operationID from the operation table and I'm thinking it's not a good idea to query that into the view. That it would be better to have a seperate query for the operations that I could then call via another webservice or webservice operation call. But how would I get that related that into the form? Or I guess I could get the operationID in the grid, but hide those columns. The other idea was change the View to only show the operationID's and then have another webservice to relate the operationID to the operation dates. But that mean needing to have my datagrid have 2 seperate datasources or someway to merge the data from two seperate services. Any insight is greatly appreciated.
[flexcoders] Re: Handling Relational Data in a Form?
AS3 really goes bonkers with array handling. If I'm not mistaken, it looks like how you access array data is completely dependent on how the array is populated? I finally got an array to populate from my form and then retrieved the array data in a trace(). It also looks like I can create multiple parallel arrays which might solve a lot of problems. Array population code: var array:Array= new Array(); array.push({operationCompleted:Press10Env.text, jobnum:jobnum.text, resource:10 Envelope Press}); array.push({operationCompleted:Press2clr.text, jobnum:jobnum.text, resource:2 Color Press}); array.push({operationCompleted:Press4clrEnv.text, jobnum:jobnum.text, resource:4 Color Envelope Press}); array.push({operationCompleted:Press4clr.text, jobnum:jobnum.text, resource:4 Color Press}); array.push({operationCompleted:Press9Env.text, jobnum:jobnum.text, resource:9 Envelope Press}); array.push({operationCompleted:FlowMasterMM.text, jobnum:jobnum.text, resource:Flow Master MM}); array.push({operationCompleted:InkJet.text, jobnum:jobnum.text, resource:InkJet}); array.push({operationCompleted:Inserting.text, jobnum:jobnum.text, resource:Inserting}); array.push({operationCompleted:LaserLetter.text, jobnum:jobnum.text, resource:Laser Letter}); array.push({operationCompleted:LaserRoom.text, jobnum:jobnum.text, resource:Laser Room}); //var operationsCollection:ArrayCollection = new ArrayCollection(shopOperations); var index:int; for( index = 0; index array.length; index++ ) { trace(array[index].jobnum+ +array[index].resource+ +array[index].operationCompleted); } --- In flexcoders@yahoogroups.com, jc_bad28 jc_ba...@... wrote: I've created a web service that returns a dataset from some relational tables. Tables 1 and 2 are the source tables. View 1 is the selected data that I send out as XML from a web service for the Flex UI. View 1 lists out all of the operations and then a bunch of query stuff, I populate the operation with an 'x' if that operation is needed for the job or populate with a date if that operation is completed. When an operation isn't needed it returns NULL as not every job needs every operation. table 1: Jobs jobnum clientname qnty - jobA Client A 1 jobB Client B5000 table 2: Operations ID jobnumOperation Completed 1 jobALaser 10-01-09 2 jobAInsert10-02-09 3 jobAInk jet 10-01-09 4 jobB4 Color Press 10-02-09 5 jobBLaser 10-02-09 6 jobBInsertx View 1: AllJobs jobnum clientname qnty Laser InkJet 4ColorPress Insert jobAClient A1 10-01-09 10-01-09 Null 10-02-09 jobBClient B 5000 10-02-09 NULL 10-02-09 x I have my Flex UI setup to receive the View output as XML and then populate an Advanced Data Grid. I've got a form section below that populates with the job data when a row is selected. The form section is for viewing or updating operation dates. (The form also shows some info returned in the xml that I don't show in the grid since I ran out of screen space in the grid.) For updates, I was going to setup a loop to cycle through the webservice update operation. However, where I'm stumped is passing the query info needed. The SQL statement is straight forward where the parameters needed are jobnum and something to identify the operation. And this is where I'm stumped. I need to get the operationID from the operation table and I'm thinking it's not a good idea to query that into the view. That it would be better to have a seperate query for the operations that I could then call via another webservice or webservice operation call. But how would I get that related that into the form? Or I guess I could get the operationID in the grid, but hide those columns. The other
[SPAM] Re: [flexcoders] Can't bind XMLListCollection to Datagrid
After googling for another couple of days and trying to find a namespace workaround.. which I never could get anything to work. Moreover, there's a chance the pre-fix could change depending on the server status (ie datas6 could be datas1 or datas2, etc.) I just took the route of stripping the namespace. Works great now. Code is below: private function resultHandler(event:ResultEvent):void { var xmlResult:XMLList = XMLList(event.result); var xmlSource:String = xmlResult.toString(); //Strip namespace xmlSource = xmlSource.replace(/[^!?]?[^]+?/g, removeNamspaces); xmlResult = XMLList(xmlSource); //wrap XMLList in XMLListCollection var schedData:XMLListCollection = new XMLListCollection(xmlResult.children()); //Update Grid gc.source = schedData; gc.refresh(); } public function removeNamspaces(...rest):String { rest[0] = rest[0].replace(/xmlns[^]+\[^]+\/g, ); var attrs:Array = rest[0].match(/\[^]*\/g); rest[0] = rest[0].replace(/\[^]*\/g, %attribute value%); rest[0] = rest[0].replace(/(\/?|\s)\w+\:/g, $1); while (rest[0].indexOf(%attribute value%) 0) { rest[0] = rest[0].replace(%attribute value%, attrs.shift()); } return rest[0]; } --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: You have a namespace issue. You might be able to use the namespace in the dataField, like this: dataField=datas6::Employee LastName, but I am not sure that will work. But I would declare a namespace and use that. I don't have any code handy, but search for namespace and you will find examples and more info. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Angelo Anolin Sent: Sunday, October 25, 2009 11:27 AM To: flexcoders@yahoogroups.com Subject: [SPAM] Re: [flexcoders] Can't bind XMLListCollection to Datagrid Could you try this one in your resultHandler private function resultHandler( event:ResultEven t):void { var xmlResult:XML = XML(event. result); var Employees:XMLListCollection = new XMLListCollection( xmlResult.table( )); trace(Employees) ; } _ From: jc_bad28 jc_ba...@... To: flexcoders@yahoogroups.com Sent: Sunday, 25 October, 2009 13:30:24 Subject: [flexcoders] Can't bind XMLListCollection to Datagrid I changed my webservice call to return e4x but I can't get the XMLListCollection to bind to the datagrid. Here is the pertinent AS code: [Bindable] private var Employees:XMLListCo llection; private function submit():void { EmployeeWS.GetAllEm ployees() ; } private function resultHandler( event:ResultEven t):void { var xmlResult:XMLList = new XMLList(event. result); var Employees:XMLListCo llection = new XMLListCollection( xmlResult. children( )); trace(Employees) ; } Here is how the trace returns the XMLListCollection data: datas6:Employee xmlns:datas6= DM xmlns:soapenv= http://schemas. http://schemas.xmlsoap.org/soap/envelope/ xmlsoap.org/ soap/envelope/ datas6:EmployeeID 3/datas6: EmployeeID datas6:EmployeeLas tNameBadham /datas6:Employee LastName datas6:EmployeeFir stNameJohn /datas6:Employee FirstName datas6:EmployeeMid dleNameC. /datas6: EmployeeMiddleNa me datas6:PositionTit leData Manager/datas6: PositionTitle /datas6:Employee datas6:Employee xmlns:datas6= DM xmlns:soapenv= http://schemas. http://schemas.xmlsoap.org/soap/envelope/ xmlsoap.org/ soap/envelope/ datas6:EmployeeID 4/datas6: EmployeeID datas6:EmployeeLas tNameBui /datas6:Employee LastName datas6:EmployeeFir stNameTai /datas6:Employee FirstName datas6:EmployeeMid dleNameTan /datas6:Employee MiddleName datas6:PositionTit leInserter Operator/datas6: PositionTitle /datas6:Employee Here is the datagrid code: mx:DataGrid id=myGrid dataProvider= {Employees} height=272 y=10 width=603
[flexcoders] Re: Question?? Best method for plotting a Moving Average
expect you or others have the answers but I need to get the Std Deviation caclulated from the Mean Value above and this is how to do that... http://en.wikipedia.org/wiki/Standard_Deviation I am not sure exactly the best way to proceed, but if anyone has a suggestions... I guess I would take the difference of each number in the series above form the mean, divide the sum of the numbers by the count (20) and take the square root. It's a brain teaser and I am working on it a piece at a time. If anyone has a shortcut I'd take it. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, jc_bad28 jc_bad28@ wrote: How are you receiving your price data to plot? Price feed? Static file? What you could do is create a function to loop through the array and perform the moving average calculation and add the result as an extra column in the array. Are you plotting the full historic price data set? If so, your MA will begin at the nth bar where n is your MA period setting. eg.. a 20 day MA won't start until the 20th day into the data set. If you're using a static dataset, you could do the calculation in Excel and then save the entire datset as XML and just bring that into flex and plot the MA from the existing values. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, cjsteury2 craigj@ wrote: Hi all, I am stumped. If I want to add an additional data series to a HLOC Chart that is a line series of a simple 20 day moving average for the closing price (Close) value in an array collection (Array_Tickers)... how would I perform that calculation in Flex? mx:lineSeries id=mavg dataprovider=Array_Tickers ySeries=Close / How would I calculate Close as {The SUM for the Value of Close for the previous 20 days / divided by 20}...
[flexcoders] Can't bind XMLListCollection to Datagrid
I changed my webservice call to return e4x but I can't get the XMLListCollection to bind to the datagrid. Here is the pertinent AS code: [Bindable] private var Employees:XMLListCollection; private function submit():void { EmployeeWS.GetAllEmployees(); } private function resultHandler(event:ResultEvent):void { var xmlResult:XMLList = new XMLList(event.result); var Employees:XMLListCollection = new XMLListCollection(xmlResult.children()); trace(Employees); } Here is how the trace returns the XMLListCollection data: datas6:Employee xmlns:datas6=DM xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; datas6:EmployeeID3/datas6:EmployeeID datas6:EmployeeLastNameBadham/datas6:EmployeeLastName datas6:EmployeeFirstNameJohn/datas6:EmployeeFirstName datas6:EmployeeMiddleNameC./datas6:EmployeeMiddleName datas6:PositionTitleData Manager/datas6:PositionTitle /datas6:Employee datas6:Employee xmlns:datas6=DM xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; datas6:EmployeeID4/datas6:EmployeeID datas6:EmployeeLastNameBui/datas6:EmployeeLastName datas6:EmployeeFirstNameTai/datas6:EmployeeFirstName datas6:EmployeeMiddleNameTan/datas6:EmployeeMiddleName datas6:PositionTitleInserter Operator/datas6:PositionTitle /datas6:Employee Here is the datagrid code: mx:DataGrid id=myGrid dataProvider={Employees} height=272 y=10 width=603 x=167 borderStyle=outset mx:columns mx:DataGridColumn headerText=Last Name dataField=EmployeeLastName/ mx:DataGridColumn headerText=First Name dataField=EmployeeFirstName/ mx:DataGridColumn headerText=Position dataField=PositionTitle/ /mx:columns /mx:DataGrid I've been spinning my wheels with this for 2 weeks now. It's probably something simple, but I can't figure it out after googling non-stop every damn day. Any help is greatly appreciated.
[flexcoders] Re: Question?? Best method for plotting a Moving Average
How are you receiving your price data to plot? Price feed? Static file? What you could do is create a function to loop through the array and perform the moving average calculation and add the result as an extra column in the array. Are you plotting the full historic price data set? If so, your MA will begin at the nth bar where n is your MA period setting. eg.. a 20 day MA won't start until the 20th day into the data set. If you're using a static dataset, you could do the calculation in Excel and then save the entire datset as XML and just bring that into flex and plot the MA from the existing values. --- In flexcoders@yahoogroups.com, cjsteury2 cra...@... wrote: Hi all, I am stumped. If I want to add an additional data series to a HLOC Chart that is a line series of a simple 20 day moving average for the closing price (Close) value in an array collection (Array_Tickers)... how would I perform that calculation in Flex? mx:lineSeries id=mavg dataprovider=Array_Tickers ySeries=Close / How would I calculate Close as {The SUM for the Value of Close for the previous 20 days / divided by 20}...
Re: [SPAM] [flexcoders] Web Service not returning all XML elements.
Thanks for the reply. After doing some searches, I see you've answered this question a few jillion times. :) --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: The default resultFormat, object causes Flex to try to convert the xml into a tree of dynamic objects. This is somewhat of a blackbox process and you have no control over it. It is also the worst of both worlds; Dynamic objects have performance issues, (as does xml) and searching/filtering that object tree is much harder than using e4x expressions. Best practice is to get your data as e4x, then process it yourself into an ArrayCollection of strongly typed value objects. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jc_bad28 Sent: Wednesday, October 14, 2009 3:01 PM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] Web Service not returning all XML elements. Hi, I've created a simple Web Service for retrieving 25 columns. The ws is setup to return the data as type object. When I go into debug mode and inspect the results only show about 1/2 of the columns are being returned. If I invoke the service from my java client, all of the expected columns are returned. Inspecting the returned XML in the java client doesn't show anything out of the ordinary. In Flex if I set the return type to e4x, all of the elements are returned. Just curious as to why Flex isn't returning all of the elements as objects. Below is the wsdl and a sample of the java invoked xml. - wsdl:definitions xmlns:wsdl=http://schemas. http://schemas.xmlsoap.org/wsdl/ xmlsoap.org/wsdl/ xmlns:ns1=http://ws.wso2. http://ws.wso2.org/dataservice org/dataservice xmlns:wsaw=http://www.w3. http://www.w3.org/2006/05/addressing/wsdl org/2006/05/addressing/wsdl xmlns:http=http://schemas. http://schemas.xmlsoap.org/wsdl/http/ xmlsoap.org/wsdl/http/ xmlns:ax21=S2 xmlns:xs=http://www.w3. http://www.w3.org/2001/XMLSchema org/2001/XMLSchema xmlns:soap=http://schemas. http://schemas.xmlsoap.org/wsdl/soap/ xmlsoap.org/wsdl/soap/ xmlns:mime=http://schemas. http://schemas.xmlsoap.org/wsdl/mime/ xmlsoap.org/wsdl/mime/ xmlns:soap12=http://schemas. http://schemas.xmlsoap.org/wsdl/soap12/ xmlsoap.org/wsdl/soap12/ targetNamespace=http://ws.wso2. http://ws.wso2.org/dataservice org/dataservice - wsdl:types - xs:schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=S2 - xs:element name=GetAllSched - xs:complexType xs:sequence / /xs:complexType /xs:element - xs:complexType name=Jobs - xs:sequence xs:element maxOccurs=unbounded minOccurs=0 name=Job nillable=true type=ax21:Job / /xs:sequence /xs:complexType xs:element name=Jobs type=ax21:Jobs / - xs:complexType name=Job - xs:sequence xs:element minOccurs=0 name=jobnum nillable=true type=xs:string / xs:element minOccurs=0 name=SpecialShipping nillable=true type=xs:string / xs:element minOccurs=0 name=OriginalMailDate nillable=true type=xs:string / xs:element minOccurs=0 name=maildate1 nillable=true type=xs:string / xs:element minOccurs=0 name=mailqty nillable=true type=xs:string / xs:element minOccurs=0 name=clientname nillable=true type=xs:string / xs:element minOccurs=0 name=ProductionComplete nillable=true type=xs:string / xs:element minOccurs=0 name=ShopNote nillable=true type=xs:string / xs:element minOccurs=0 name=creatdue nillable=true type=xs:string / xs:element minOccurs=0 name=creatdone nillable=true type=xs:string / xs:element minOccurs=0 name=ListDue nillable=true type=xs:string / xs:element minOccurs=0 name=ListDone nillable=true type=xs:string / xs:element minOccurs=0 name=Outsource nillable=true type=xs:string / xs:element minOccurs=0 name=ActualQty nillable=true type=xs:string / xs:element minOccurs=0 name=Press2clr nillable=true type=xs:string / xs:element minOccurs=0 name=Press4clr nillable=true type=xs:string / xs:element minOccurs=0 name=Press10Env nillable=true type=xs:string / xs:element minOccurs=0 name=Press9Env nillable=true type=xs:string / xs:element minOccurs=0 name=Press4clrEnv nillable=true type=xs:string / xs:element minOccurs=0 name=LaserRoom nillable=true type=xs:string / xs:element minOccurs=0 name=FlowMasterMM nillable=true type=xs:string / xs:element minOccurs=0 name=FlowMasterSTD nillable=true type=xs:string / xs:element minOccurs=0 name=Inserting nillable=true type=xs:string / xs:element minOccurs=0 name=InkJet nillable=true type=xs:string / xs:element minOccurs=0 name=LaserLetter nillable=true type=xs:string / /xs:sequence /xs:complexType /xs:schema /wsdl:types - wsdl:message name=GetAllSchedRequest wsdl:part name=parameters element=ax21:GetAllSched / /wsdl:message - wsdl:message name=GetAllSchedResponse wsdl:part name=parameters element=ax21:Jobs / /wsdl:message
[flexcoders] Web Service not returning all XML elements.
Hi, I've created a simple Web Service for retrieving 25 columns. The ws is setup to return the data as type object. When I go into debug mode and inspect the results only show about 1/2 of the columns are being returned. If I invoke the service from my java client, all of the expected columns are returned. Inspecting the returned XML in the java client doesn't show anything out of the ordinary. In Flex if I set the return type to e4x, all of the elements are returned. Just curious as to why Flex isn't returning all of the elements as objects. Below is the wsdl and a sample of the java invoked xml. - wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://ws.wso2.org/dataservice; xmlns:wsaw=http://www.w3.org/2006/05/addressing/wsdl; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:ax21=S2 xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:soap12=http://schemas.xmlsoap.org/wsdl/soap12/; targetNamespace=http://ws.wso2.org/dataservice; - wsdl:types - xs:schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=S2 - xs:element name=GetAllSched - xs:complexType xs:sequence / /xs:complexType /xs:element - xs:complexType name=Jobs - xs:sequence xs:element maxOccurs=unbounded minOccurs=0 name=Job nillable=true type=ax21:Job / /xs:sequence /xs:complexType xs:element name=Jobs type=ax21:Jobs / - xs:complexType name=Job - xs:sequence xs:element minOccurs=0 name=jobnum nillable=true type=xs:string / xs:element minOccurs=0 name=SpecialShipping nillable=true type=xs:string / xs:element minOccurs=0 name=OriginalMailDate nillable=true type=xs:string / xs:element minOccurs=0 name=maildate1 nillable=true type=xs:string / xs:element minOccurs=0 name=mailqty nillable=true type=xs:string / xs:element minOccurs=0 name=clientname nillable=true type=xs:string / xs:element minOccurs=0 name=ProductionComplete nillable=true type=xs:string / xs:element minOccurs=0 name=ShopNote nillable=true type=xs:string / xs:element minOccurs=0 name=creatdue nillable=true type=xs:string / xs:element minOccurs=0 name=creatdone nillable=true type=xs:string / xs:element minOccurs=0 name=ListDue nillable=true type=xs:string / xs:element minOccurs=0 name=ListDone nillable=true type=xs:string / xs:element minOccurs=0 name=Outsource nillable=true type=xs:string / xs:element minOccurs=0 name=ActualQty nillable=true type=xs:string / xs:element minOccurs=0 name=Press2clr nillable=true type=xs:string / xs:element minOccurs=0 name=Press4clr nillable=true type=xs:string / xs:element minOccurs=0 name=Press10Env nillable=true type=xs:string / xs:element minOccurs=0 name=Press9Env nillable=true type=xs:string / xs:element minOccurs=0 name=Press4clrEnv nillable=true type=xs:string / xs:element minOccurs=0 name=LaserRoom nillable=true type=xs:string / xs:element minOccurs=0 name=FlowMasterMM nillable=true type=xs:string / xs:element minOccurs=0 name=FlowMasterSTD nillable=true type=xs:string / xs:element minOccurs=0 name=Inserting nillable=true type=xs:string / xs:element minOccurs=0 name=InkJet nillable=true type=xs:string / xs:element minOccurs=0 name=LaserLetter nillable=true type=xs:string / /xs:sequence /xs:complexType /xs:schema /wsdl:types - wsdl:message name=GetAllSchedRequest wsdl:part name=parameters element=ax21:GetAllSched / /wsdl:message - wsdl:message name=GetAllSchedResponse wsdl:part name=parameters element=ax21:Jobs / /wsdl:message - wsdl:portType name=S2_MasterSchedPortType - wsdl:operation name=GetAllSched wsdl:input message=ns1:GetAllSchedRequest wsaw:Action=urn:GetAllSched / wsdl:output message=ns1:GetAllSchedResponse wsaw:Action=urn:GetAllSchedResponse / /wsdl:operation /wsdl:portType - wsdl:binding name=S2_MasterSchedSoap11Binding type=ns1:S2_MasterSchedPortType soap:binding transport=http://schemas.xmlsoap.org/soap/http; style=document / - wsdl:operation name=GetAllSched soap:operation soapAction=urn:GetAllSched style=document / - wsdl:input soap:body use=literal / /wsdl:input - wsdl:output soap:body use=literal / /wsdl:output /wsdl:operation /wsdl:binding - wsdl:binding name=S2_MasterSchedSoap12Binding type=ns1:S2_MasterSchedPortType soap12:binding transport=http://schemas.xmlsoap.org/soap/http; style=document / - wsdl:operation name=GetAllSched soap12:operation soapAction=urn:GetAllSched style=document / - wsdl:input soap12:body use=literal / /wsdl:input - wsdl:output soap12:body use=literal / /wsdl:output /wsdl:operation /wsdl:binding - wsdl:binding name=S2_MasterSchedHttpBinding type=ns1:S2_MasterSchedPortType http:binding verb=POST / - wsdl:operation name=GetAllSched http:operation location=GetAllSched / - wsdl:input mime:content type=text/xml part=GetAllSched /
[flexcoders] Re: Flex with .Net
WebOrb is pretty sweet. I did run into some problems where our backend data wasn't setup very well and I couldn't assign table relations in WebOrb. Workaround was using views and stored procedures. I'm currently playing around with WSO2's Web Service Application Server (http://wso2.com). It makes exposing data as web services very easy and very fast. It's a good alternative for those that don't want to use .net. It's also opensource and free which is a huge bonus as well. :) --- In flexcoders@yahoogroups.com, MicC chigwel...@... wrote: We have just switched from FlexSQL web service ($19.00) to WebOrb. FlexSQL works well but I think we threw too many users at it and it was having trouble wrapping our 4000 returned rows for OLAP cube in the xml format it uses. WebOrb is fast and efficient, and handles many users. We are calling our SQLServer2005 stored procedures with it. WebOrb comes with lots of good code examples also. There is a community version which is free, but the Enterprise edition costs. Mic. --- In flexcoders@yahoogroups.com, Jehanzeb Musani jehanzeb_bs@ wrote: The easiest thing would be to expose a web service written in .NET can invoke with Flex UI. Make sure you rely on the primitive types or design your protocol (objects encoded it in xml and pass as string to webservice). It's simple but will not be very efficient. The other approach you can resort to is using WebORB.NET. Regards, Jehanzeb From: Ramkumar nrk150@ To: nrk150@ Sent: Tue, October 6, 2009 12:34:08 PM Subject: [flexcoders] Flex with .Net Hi All, We have the application on .Net and we have to replace the asp pages with flex UI. I am little bit exposure only to flex(I am java developer) and dont have knowledge on .Net. Please provide me sample codes(like the data passing from UI to db) and materials for doing the application. from there i will try to manage my self. Thanks and Regards, N.Ramkumar