Flex :: Override Result Event (HTTPService)?
May 27, 2011
I have a global settings class, and i want to switch a var (to 1) in this class, when i call the send function and switch this var (to 0), when the result event dispatched.
I created a class, extends HTTPService..i can override the send function (override public function send(parameters:Object=null):AsyncToken), but how can i override the function, which call when the result arrived?
View 1 Replies
Similar Posts:
Dec 8, 2011
In my AIR application, I try to dispatch a custom event from a class to main window.This class is use to call httpservice. My goal is to send a custom window when the httpservice result is send.[code]...
View 1 Replies
Mar 10, 2010
I have an HTTPRequest in mxml that has an mx:request defined inside it. I use the info in the mxml request 99% of the time (I thought it was 100% until I found this bug). So I need to send the HTTPRequest with one of the items in the request different. I tried using the send() method and sending my own object, much like you would if no request was defined in the mxml, but it doesn't seem to override it.
Any ideas how I can accomplish this without re-writing every call to send this httpRequest?
View 1 Replies
Mar 3, 2010
XML is cool in flex, but I have an annoying problem to solve, caused by what I can imagine is a feature. You see, when you have just one tag of something, it creates an object which is not an array. But when finds more than one, it puts it on an array structure.[code]I could check the format of resObj.specifictag (to check if it is has an array) and then duplicate the code (for each case). But -even if it's calling a function- I don't think it is an elegant solution.Well, I hope someone has a good idea on this matter. (I know from experience that SO has much more C++ experts than flex, but well...)The perfect thing would be that HTTPrequest handled every tag in a consistent way (using always arrays... though I'm guessing that that would also have its drawbacks).
View 3 Replies
Aug 15, 2010
I always have a question about override custom event. I am not sure why or what do to inside override function. I searched google but didn't get too many feedbacks. EDIT: My projects seem work fine even though I use my custom event without override. Anyone could explain it?
View 2 Replies
Nov 12, 2009
I have a question about HTTPService and the data it returns.
Well lets consider this XML:
<PhotoGalleryData>
<Photo>
<id>1</id>
[Code]....
View 2 Replies
Jun 15, 2010
I feel like this should be simple, however everywhere I look online someone does something different. I am doing a small charting application to track download statistics, and want to put the data into a pie chart.
<s:HTTPService id="service"
url="admin/stats/totalstats.php"
fault="service_faultHandler(event)"
result="service_resultHandler(event)" />
[Code].....
how I am transferring the data to the chart to make sure I am not doing something wrong there either.
<mx:PieChart id="pieChart">
<mx:PieSeries nameField="year"
field="count"
[Code]......
View 1 Replies
Jan 28, 2010
I have an HTTPService that executes the dataLoaded(e:ResultEvent):void function whenever it gets a result from a send() call. OK so If I call HTTPService.send() and then call HTTPService.send() again before the previous one receives a result, I end up repeatedly running dataLoaded() which is undesirable What I want is if HTTPService.send() gets called before a previous call to it returns a result. I want to cancel the first call, and only process the result from the last call to HTTPService.send()
View 4 Replies
Oct 11, 2011
My xml data [URL]. I need to load this xml data through httpservice and in the handle result function I need to access the individual data like complaints.complaint.title using for loop function. I had tried this I couldn't get the result as I need
<s:HTTPService id="Complaints" url="[URL]" result="Complaints_resultHandler(event)" fault="Complaints_faultHandler(event)" >
</s:HTTPService> <fx:Script> <![CDATA[
protected function Complaints_resultHandler(event:ResultEvent):void {
[Code] .....
I need to get the data like title, complainturl, latitude, longtitude etc.
View 10 Replies
Jan 25, 2010
I have two datagrids and I want to override the behavior of the tab-key event, so that it goes to the next datagrid, when the cursor reaches the end of the first datagrid columns.
View 2 Replies
Mar 16, 2011
I am trying to figure out how to override the default paste logic in a Flex 4 DataGrid ItemRenderer. Does anyone know how to do this?I am trying to capture the event when a user hits Ctrl-V while a cell in the DataGrid has focus and override the logic there.
View 1 Replies
Nov 20, 2010
I'm trying to feed data from SQL database to FLEX, using php script in the middle. I see the data in body of message in the Network Monitor and in "Variable" window during debug, but i cant retrieve them to XML.
Below (event.message.toString())
(mx.messaging.messages::AcknowledgeMessage)#0
body = "<?xml version="1.0" encoding="UTF-8"?>
<articles>
<node><id>2</id>
[Code]....
View 4 Replies
Sep 1, 2010
I have a HTTPService:
<mx:HTTPService id="scoreService" url="http://" method="POST" result="onResult(event)">
<s:request xmlns="">
<name>{..}</name><score>{...}</score>
</s:request></mx:HTTPService>
And a script for (event):
private function onResult(e:ResultEvent):void {
if (e.result.status == true) {
currentState='...';
} else {
Alert.show("...", "...");
}}
The problem is that none of the event possibilities fires after I POST data to my php.
View 1 Replies
Mar 14, 2011
I have a small question. I am probably misunderstanding something, but when I do :
[Code]....
View 1 Replies
May 1, 2010
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();
[code].....
View 1 Replies
Jun 23, 2009
I have two functions in an ActionScript class, they are:
private function loaderCompleteHandler(event:Event):void
{
_loader = Loader(event.target.loader);
selectedBitmap = Bitmap(_loader.content);
[Code].....
Is it possible to send the selectedBitmap variable back to the byteArrayToBitmap function after the event completed?
View 1 Replies
Apr 2, 2011
I get the webservice(spring WebService) response properly ,but the event.result object is null.I can see the SOAP response body in the event.message.body variable.
## Soap Response ##
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/><SOAP-ENV:Body><getUserUserTasksResponse xmlns="http://ws.burr.com/BurWS/9_0">
<foundTasks>
[code]...
View 1 Replies
Sep 23, 2009
I've doing a bit of "training" at working with Flex and Remote Data from XML files.This is my HTTPService
<mx:HTTPService id="loginData" url="com-handler/basic.xml" showBusyCursor="true">
</mx:HTTPService>
I have a button and when its clicked its call a function, that calls loginData.send and does a little IF condition, that IF condition relies on the data returned by loginData.The condition doesn't work because its called right next to the loginData.send, and .send method still didn't returned the values from the XML file. But if you click it a second time a second after the first click the IF condition works.So to deal with i wanted to do a eventListener so that when loginData.send returned the data from the XML it fires up the IF condition. But i don't know how to do it.
View 1 Replies
Aug 27, 2010
I have created a custom even class which is pretty basic. But when calling an event and then relaying that event to another class I have encountered the "cannot transform thisEvent into thisOtherEvent" error. I realize this is because I needed to override the Clone function in my custom event like so:
[Code]...
View 5 Replies
Jan 17, 2011
Is it possible to override the default focus event on the in-built TextField class? So for example when a textfield gains focus a custom event is triggered rather than the default one? I know we can use the onSetFocus event, however we have over 1200 swfs that use TextFields so want to do it on a global scope rather than having to modify each individual swf. that on an Android tablet selecting a TextField brings up the android keyboard that not only shrinks the flash content, but defaults to the alpha keyboard when all we want is numeric (it's a Maths app).
View 1 Replies
Jan 17, 2011
Is it possible to override the default focus event on the in-built TextField class? So for example when a textfield gains focus a custom event is triggered rather than the default one? I know we can use the onSetFocus event, however we have over 1200 swfs that use TextFields so want to do it on a global scope rather than having to modify each individual swf.
The idea is that on an Android tablet selecting a TextField brings up the android keyboard that not only shrinks the flash content, but defaults to the alpha keyboard when all we want is numeric (it's a Maths app).
View 1 Replies
Jun 20, 2009
I have seen this done and not done on different occations... why do we need to override clone() and toString() in custom events?
View 1 Replies
Jul 9, 2009
I've a Services class...which handles the HTTPService requests and responses and faults. Now I want to dispatch a new event whenever I send request to the server...so that I can take custom actions like showing some popup window or disabling certain components.
Here is my services class:
PHP Code:
package business{
import mx.controls.Alert;
import mx.managers.CursorManager;
import mx.rpc.AsyncToken;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
[Code] .....
The method doRequest calls the HTTPServices send method...so in this method, I want to dispatch a new event and handle it in the main application...
View 1 Replies
May 27, 2009
i am trying to do a simple blackboard on mouse down, start drawing on mouse move, if drawing, draw line on mouse up, stop drawing i set the listeners on a simple clip with a rectangle. if i dont fill the rectangle, the mouse events wont fall into the rectangle, but if i fill the rectangle, it will paint behind the rectangle, so anyway i wont see any succesfull results. what i did was create another sprite and paint within it; something like
[Code]...
View 3 Replies
May 23, 2011
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]...
View 3 Replies
Jan 11, 2012
I have an as3 class that I use for communicating with my Zend_AMF endpoint:
[Code]...
All of this works fine, but it takes a lot of work to use it. I always expect a Response object when calling send() on my request. Ideally I would like to be able to call request.send() and have it return a Response object directly and not having to deal with a listener: var result:Response = request.send(); Is this possible? If so, how can I go about doing this?
View 1 Replies
Aug 20, 2010
I am currently developing a dynamic LineChart in FLEX 4.I am implementing a Tree control next to my LineChart, which will filter the LineChart dataprovider and lineseries. The tree control has several branches and ultimately 5 children (leaf nodes) at the bottom of the last branch.I need the leaf node/children to be displayed as checkboxes inside the tree control.As I understand,this will require overrides in the TreeItemRenderer class.This is where I am a little confused on how to implement that.Currently I can distinguish between leaf and branches using this code, in my main MXML component.I added this because it may be helpful to some beginning FLEXdevelopers, such as myself, who cannot easily find this functionality documented well:
private function treeClick(e:ListEvent):void {
_selectedItem = Tree(e.currentTarget).selectedItem;
if(mainTree.dataDescriptor.isBranch(_selectedItem)) {[code].....
I am looking at the TreeItemRenderer override class from the following example here: In the example, they override the "createChildden" super function to add checkboxes to the tree control.My question is, can I override the createChildren function directly in my MXML component, and not have to use an entire class file to override this functionality? Must I re-invent the wheel to do this?Also, how can I distinguish that my treeItem is a leaf node and not a parent, in the override function? I only want to add checkboxes to the leaf nodes, how can I differentiate? The following example adds checkboxes to all branches and leaf nodes, but I want to add checkboxes only to leaf node/children. How would you approach that?
override protected function createChildren( ): void
{
super.createChildren( );[code]............
Here is my tree tag:
<mx:Tree id="mainTree" dataProvider="{treeData}" itemRenderer="TreeCheckBoxItemRenderer" labelField="@label" showRoot="false" width="100%" height="100%" itemClick="treeClick(event)" />
View 1 Replies
Jul 31, 2010
I have a Flex 3.2 application for which I am developing a custom style. Basically the first stylesheet gets applied first, and then my custom stylesheet. I am wondering how I can completely empty a value set in the first stylesheet with a value set in the second. The value has to be blank because if the horizontal-center value is set then any other positioning values are ignored.
Example
CSS1.css
.myButton {
[code].....
View 1 Replies
Jul 5, 2010
I have a Flex client making RESTful calls to a webservice using HTTPService. The server is returning JSON responses, which we would like to compress. Can Flex using HTTPService handle gzip-encoded responses? If so, what steps are required to make it work (e.g., which headers to set, how to decompress, etc.)? If not, can you suggest a simple alternative?
View 1 Replies
Nov 14, 2011
How can i call a CGI script in flex 3? Also how can i retrieve the result of exection of that cgi script?
For example, lets say my CGI script(hello.cgi) just display "hello world". How can i call this script from flex 3 and then retrieve the result, i.e. hello world , so that it can be displayed on my flex application.
View 1 Replies