Flash :: Calling Geonames.org Service Multiple Times Adding Each Result To An ArrayCollection
Nov 14, 2011
I am using a service that returns JSON (geonames.org) and I'm putting the result in an array and dumping it to a datagrid. Now that works fine for one city like this [URL].. However, I want to call this service multiple times with different city names, so I created an XML list ad figured I would iterate over the city list and get the results.
My question is how do I do this such that 1) all the lists are combined into one arraycollection and 2) this seems like I will have to chain the calls and wait for results which may or may not come back, so I thought I would ask the group about the best practice, and or resources to read and examples to build from.
This code is for my login component. I want to get a special string for encrypting my password. This string is given by my authservice. But when i login i get a multiple times a alert with Done(line 69 in the pastebin code or line 4 in the code on the bottom of this question). But i want that it shows one single time. Does someone know what is wrong with this code?
protected function tryLogin():void { encryptStringResult.addEventListener('result', function(event:ResultEvent):void { var encryptString:String = event.result.toString();
I'm trying to set an array collection equal to a event.result that contains an array collection, but my array collection keeps coming up null. The event.result isn't empty because I can assign it as the dataprovider for a datagrid and that works (shows data correctly)[code]...
I've run into a bit of a snag regarding a project I'm working on. The code below sets up the mc holder which includes two dynamic text fields sFloor and sCompany these get their contents from an xml file. YAU is one of the additional mc's that I need added at runtime depending on the number shown in the sFloor field.
Code: var nameHolder:holder; var nameHolderX:Number = 145; var nameHolderY:Number = 267; var YAU:upArrow = new upArrow();
This is the code that add's the holder mc 25 times vertically down and populates the sFloor and sCompany text fields with what's in the XML file
Code: function loadText():void { var txtLoader:URLLoader = new URLLoader(); txtLoader.addEventListener(Event.COMPLETE, onLoaded); txtLoader.load(new URLRequest("XMLfile.xml")); removeEventListener(Event.COMPLETE, onLoaded); [Code] .....
it all works fine except that the "YAU" added mc is only added into the last instance on the list (which is the correct number) but I need it to add to any of them that meet the condition.
private var currentItem:uint; for(var i:uint = 0;i<10;i+){ addChild(arr[currentItem]);
[Code]....
So the problem is that the array only contains 6 items. So when it comes to the 6th item the currentItem resets and the next 4 items that are getting added are the 4 first from the array again. Now when i trace the items, the last 4 trace "null". how can i add items from the array multiple times without losing its properties etc?
I am passing array collection from flex to web service, and now that array collection want to use in asp.net web service.
suppose i have passed one array collection, and based on that array collection i want fetch value from database and want to generate report and returning path to flex.
In my Flex Application I am receiving Unicode result from back end ( web service) an displaying it in Flex Label component Eg. Response string = [u8868u7af9uff5eFulfillment
I am binding response to label component When I am displaying it in label its not showing me Japanese character .Storing this information in properties file works
I am trying to bind an ArrayCollection result coming in from the server to my DataGrid created dynamically in AS. The result data is not getting Displayed in the Grid. var dg:DataGrid = new DataGrid(); dg.width=650; dg.dataProvider=someArrayCollfromServer;
I am adding the dgColumn as runtime based on some data from a XML and it is the same as defined in below static format. But if I use the same code and create the DataGrid as a Flex Component as below, it works fine. <mx:DataGrid id="dg" width="100%" height="100%" dataProvider="{someArrayCollfromServer}"> <mx:columns> <mx:DataGridColumn dataField="Value" headerText="Value"/> <mx:DataGridColumn dataField="Code" headerText="Code" /> </mx:columns> </mx:DataGrid>
This works fine. Is there some functionality or implementation different as far as DataGrid is concerned in Flex and AS.
I am using Adobe Flash Builder 4 Premium. I have a mx:DataGrid and a s:TextInput, and I am trying to set up a search box that filters the DataGrid on each key press.his page shows a nearly perfect example of what I'm trying to do, except that I'm setting this up in a s:TitleWindow, which is brought up as a popup using the PopUpManager. The list I'm trying to filter can be very large. It is a list of usernames, fetched from a MySQL database via PHP. Since it can be so large, I want the list to be populated once in the main application and then referenced in the popup window so that it doesn't have to fetch all the usernames each time the user opens the popup.I have all of this working fine for the first time you bring up the popup, but if you close it and bring it up again, I get this runtime error:I also get this error if I attempt to set the filterFunction back to null just before closing the popup.See sample code below:
Main Application: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
In our flex/air application we are calling a web service over https.The web service is java based and has, at the moment, an untrusted certificate.When doing a POST to the service with some json, the payload on the server side is pretty garbled.A popup does occur asking whether you want to continue and even when I do and add the untrusted certificate into my keychain (on the mac), the data sent through always comes through mangled.I installed charles http proxy to see the actual traffic and it seems at times I'm getting a SSLHandshakeException back...I'm guessing this is causing the garbled data as ssl isn't being setup properly.
I am a .NET programmer working with a Flash designer on a project. The design is that they will create a flash UI (implemented with AS2) to present a questionnaire. After it is completed by an end user, the will send me (a .net web service of some form) the answers to the questionnaire, I will perform a calculation, and I will send a response back (the response will likely be a single integer, though it may be a touple of (integer score, string description).
Neither myself nor the designer is knowledgeable of Action Script. Does anyone have a snippet for such web service calls in AS2? Are there any soap libraries for AS2 that we could use, or should I expose a RESTful interface? Can it be as simple as having the designer concat the questionnaire answers into the query string of the service URL? What would be a typical data format for my response (xml, json, plain text)
Flex portlet is calling a webservice and I am intercepting the calls to check the session credentials using XFire AbstractHandler method implementation. But I am not getting the same httpsession value that is used for login in to the application. I have intercepted the calls using TCPmon also.
In one of our project we are using flex for front end, blazeds/java in the backend. Its an existing code where services are prewritten. I have to make calls to 3 services in the backend (basically 3 remote objects) and get their result and store the result in an object and show the data of this object in a view. Now in front end we are using Flex and Parsley Framework. I was thinking of the following approaches.
1) Making commands for each service call and storing the result in a shared object (model) and then displaying this model in the view. In this approach the problem is some services are needed in some other web pages, but they donot need the same model. How should i handle this scenario ? Should i make a asynchronous remote call and fetch the result and then again dispatch and event with the event object storing the result.
2) Making a service call , wait for the result then make another call and wait for the result and then make other call, not sure if this is the right way ?
What happens if I have a previously allocated variable (new), then I set such variable to null in order to mark it for GC but then a few seconds later I call new again on it (not knowing if it has been GCed), and the GC still has not cleaned the memory address containing the variable.Would the first (new) allocation be garbage collected
Adobe air runtime prevents more than one instance of an air application to be started at the same time. Is it safe to circumvent this restriction by arbitrarily changing the publisher ID? Does anyone know if Adobe plans to allow multiple concurrent instances in Air 2.0?
Assuming calling the same ColdFusion web service and all other factors are identical, is there a difference in performance/speed between using the following two tags?
I have a page that has a table with each row corresponding to an audio file. The last cell in each row embeds a simple flash audio player. The problem is that the flash file for the player is being downloaded for each row separately and as soon as rows go beyond 40-50 it crashes the browser.
I tried using different players (1pixelout, flash-mp3-player) and the problem is still there, so its not a player specific issue.
Is there any way to cache the player so that it is only downloaded once?
I'm dynamically loading JPG file using Loader class. Everything works except if I want to tile the image few more times using addChild(loader.content) it just doesn't work. It always removes previous instance and leaves only the last one. I've tried everything but with no luck. Here's my code:
var loaderContext:LoaderContext = new LoaderContext(true); var imageLoader:Loader = new Loader(); imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaderDone);
I am having issues with this method. It's supposed to loop through stage elements (news feed) and check if the item is checked/enabled. If they are, it should add them into an array ratingAC, which will keep track of the number of elements that are rated, and the rating total. The problem I am having is that only one item is added to the total even if multiple are selected.
Archive Vars...... [Bindable] public var newsDB:ArrayCollection = mx.core.Application.application.newsDB as ArrayCollection;
The following AS3 code is sometimes causing the audio to play multiple times, almost simultaneously like a crazy echo. It usually works ok with that URL but when I use a [URL]... it always freaks out. On rare occasions I think the issue has happened with local files even. I copied this code from somewhere else so I don't entirely understand it. Do you see a problem with this implementation or is Flash just crazy?
What I'm trying to do is quite simple. Load an image externally, then display it (addChild it) multiple times, in different places, without loading it again and again. (Granted, caching means the image won't be downloaded multiple times, but I'd like to avoid those annoying disk accesses as well.) I know that flash doesn't actually support this. A while ago I was trying this same thing, I dug around for hours, and there was no real solution.
I want to iterate over an ArrayCollection in Flex while there can be items added and removed.
Since i didn't find a way to use a "classic" Iterator like in Java, which would do the job. I tried the Cursor. But it doesn't really work the way i want it to be ;) So how do I do it nicely ?
var cursor:IViewCursor = workingStack.createCursor(); while (!cursor.afterLast) {
Below is my code and it is working. What I need to know is how to setup multiple passwords for one result. So look at the first four actions.. they go to the same page. I also want it to go if it is small caps verses large. How do I put all in one statement or do I have to do it this way. How do I put this in a text file if I have multiple passwords going to different pages. So as you see below if they put in password1,PASSWORD1,cash,CASH this all goes to page1.html If this put in password2,PASSWORD2 it goes to page2.html[code]...
I have a button which adds an Event.ENTER_FRAME listener. Once this listener has been added it's quite possible that the user might click the button several times more. Is the same Event.ENTER_FRAME listener triggered again when the button is clicked again? or does Actionscript ignore the command to create the listener again since the listener is already running?
I'm worried about memory leaks, and I'm worried that Actionscript might create multiple Event.ENTER_FRAME listeners with the same name, but it would suit me best if I could allow the user to click the button as many times as they want.
Adding / removing children (could be 10 times every few seconds)These children also have several animations associated with them
or
Adding all children once, and simply placing them out of stage view, and calling them back when needed to the stage (these will be still be running through their animation sequence while offstage, or they can be stopped) child.x -= 10000;
I have an ArrayCollection bound to a view, I use a filterFunction on this view to only display parts of the contents. Additionally I have another component where I want to display other parts of the ArrayCollection.
What I would like to do is wrap ArrayCollections around each other, meaning I could have one ArrayCollection containing the model data, and then two separate outer ones where I can set the filterFunction property (setting this in the model seems inappropriate in all cases). Is this possible somehow? If not, how else can this be solved, preferably without forcing model logic to end up in my view?