[flexcoders] Re: MouseEvent.MOUSE_WHEEL fires twice in Firefox

2009-02-16 Thread hu22hugo
Just for reference, it's a known bug:
http://bugs.adobe.com/jira/browse/FP-347



[flexcoders] Re: How to cancel HTTPRequest?

2009-01-30 Thread hu22hugo
Once you sent a HTTP request, you cannot cancel it any more from the
client side. You could send a second request to the server to cancel
the previous request but that can lead to very unpleasant effects,
e.g. when a cancel request arrives before the original one. 

So either don't fire the original request or make the server robust
enough for all request.

Marc


--- In flexcoders@yahoogroups.com, "Dmitri Girski"  wrote:
>
> Hi everybody,
> 
> How can I cancel the http request? Is there a way to close the
> underlying socket?
> I've got a situation when first HTTP request is in progress
> (waiting/receiving the results), and I have to fetch the data again,
> as I know that the dataset I am expecting to get is already obsolete. 
> 
> I tried to do this:
> 
> requst.cancel();
> request.disconnect();
> request = new HTTPService() 
> 
> But looking at the server logs I can see that connection is still
> there and backend performs everything it has to and closes the
> connection only when all data is sent. (Apache is at the backend) 
> 
> Any comments or help is appreciated!
> 
> Thanks!
> 
> Cheers,
> Dmitri.
>




[flexcoders] Re: How to encode query parameters?

2009-01-30 Thread hu22hugo
You might look for the global ActionScript functions encodeURI() or
encodeURIComponent()?

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/package.html#encodeURI()

Marc


--- In flexcoders@yahoogroups.com, Greg Hess  wrote:
>
> Hi All,
> 
> Every service call to my server requires query params (POST and GET),
> even some POST requests will send query params. I have found that with
> HTTPService if I specify the Object with key value pairs in send(
> queryParams) it does not send the xml I set as the data property.
> 
> Some of my query params need encoding but I cant seem to find a
> urlencode(str) in Flex 3 SDK like in JavaScript.
> 
> Does anyone know how I can encode a string for a query param?
> 
> Any help much appreciated.
> 
> Greg
>




[flexcoders] Re: HTTP Request Error and long strings

2008-11-19 Thread hu22hugo
What's the error saying? Whatever, at least two suggestions:

1. The URL is not valid with an : in it. Encode it like
http://172.19.60.128:8080/ViewDuration%3AregisterBatchEvent/

2. Always use constants to avoid typing errors, e.g.
service.addEventListener(ResultEvent.RESULT, httpResult)

Marc

--- In flexcoders@yahoogroups.com, "claudfernan04" <[EMAIL PROTECTED]>
wrote:
>
> Hi,
> 
> I'm trying to send a nested array object using the method below but I 
> still seem to be getting an HTTP request error and I'm not sure why.
> 
> Any help would be greatly appreciated.
> 
> public function useHttpService(batchContainer:Object):void {
>  var container:String = JSON.encode(batchContainer);
>  var test:Object = new Object();
>test.data = container;
>service = new HTTPService();
>service.url 
> = "http://172.19.60.128:8080/ViewDuration:registerBatchEvent/";;
>logger.info("service.url: "+ service.url);
>service.method = "POST";
>service.useProxy = false;
>service.resultFormat = "text";
>service.addEventListener("result", httpResult);
>service.addEventListener("fault", httpFault);
>logger.info("batchContainer final: "+ batchContainer);
>logger.info("batchContainer encoded: "+ container);
>service.send(test); 
> }
> 
> Claud
> 
> --- In flexcoders@yahoogroups.com, "michael.ritchie" 
>  wrote:
> >
> > Tracy, 
> > 
> > Your last suggestion did the trick.  I was able to send my large
> > string using by sending the data in the body, not the url.  For the
> > list, here is the fix to my problem.
> > 
> > Tracy writes:
> >  
> > I believe that when the message body is empty, Flex always uses 
> GET. 
> > And when you put your data on the url, you are using the querystring
> > and not the body.
> > 
> > Instead. use the naked url, and in AS, do:
> > 
> > var oRequest:Object = new Object();
> > 
> > oRequest.data = { ...large JSON data sring ...}
> > 
> > JSONSaveCollection.send(oRequest);  // call to the HTTPService
> > 
> > ---
> > 
> > Thanks again Tracy... :D
> > 
> > Michael
> > 
> > --- In flexcoders@yahoogroups.com, "Tracy Spratt"  wrote:
> > >
> > > Change the method to "POST".  GET has a limit, but I have used 
> POST for
> > > quite large data streams.
> > > 
> > >  
> > > 
> > > Tracy
> > > 
> > >  
> > > 
> > > 
> > > 
> > > From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On
> > > Behalf Of michael.ritchie
> > > Sent: Thursday, January 25, 2007 3:39 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] HTTP Request Error and long strings
> > > 
> > >  
> > > 
> > > 
> > > There seems to be a size limit the value you set on the url 
> propery
> > > for a Flex HTTPService call, around 12000 characters (12KB?). 
> Could
> > > there be maxrequestlength setting in a config file for Flex 2 some
> > > place that we can adjust the limit?
> > > 
> > > When we send a JSON string on with the HTTP service that is over 
> 12000
> > > characters we receive the following error message:
> > > 
> > > Error: [RPC Fault faultString="HTTP request error"
> > > faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent
> > > type="ioError" bubbles=false cancelable=false eventPhase=2 
> text="Error
> > > #2032: Stream Error. URL: [...12716 character string...]
> > > 
> > > We tested this on both IE 7 and Firefox. I don't think this is a
> > > browser post limit as we have other non-Flex applications that 
> post
> > > that many characters. 
> > > 
> > > Michael Ritchie
> > > AOL Xdrive
> > >
> >
>




[flexcoders] Re: Flex: getting the current directory

2008-11-19 Thread hu22hugo
--- In flexcoders@yahoogroups.com, "renzeullo" <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
> 
> Quick question:
> Is there a way to get the current directory that a Flex application is
> currently running in? For example, if I'm running an app in
> C:\Documents and Settings\Administrator\Desktop\FlexApp\app.html, is
> there a way to retrieve "C:\Documents and
> Settings\Administrator\Desktop\FlexApp" ?
> 
> Thanks in advance.
> 
> Regards,
> Renz
>

You are probably looking for Application.loaderinfo.url? loaderinfo is
inherited from DisplayObject.

Marc




[flexcoders] Re: FileReference for file uploading, how to specify the folder to open?

2008-11-19 Thread hu22hugo
--- In flexcoders@yahoogroups.com, "Mat Mikul" <[EMAIL PROTECTED]> wrote:
>
> Hi!
> 
> I need to upload a file from flex. I know the path and the file name
> already, but haven't figured out a way to be able to upload in the
> background. This is likely due to some security restrictions posed by
> Adobe to ensure sites cannot upload files from the user's computer
> without their explicit permission. I can live with that for the
> moment, but then I don't want the FileReference dialog box to open
> always in My Documents. I'd rather it opened in the folder where the
> file is, and that I can specify the file name so that all the user (if
> they are ok with it) needs to do is to click Ok.
> 
> How can I specify default folder location?
>

It's not possible, see
http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html

Marc



[flexcoders] MouseEvent.MOUSE_WHEEL fires twice in Firefox

2008-11-18 Thread hu22hugo
The mouse_wheel event triggers always twice in Firefox. IE7 fires
correctly only one event. Find below a simple test case. Can anybody
confirm this behavior and maybe a workaround?

Thanks,
Marc

 



http://www.adobe.com/2006/mxml"; 
addedToStage="addedToStageHandler(event)">







Compiled with Flex 3.2 including HTML-wrapper. It also happens with
static swfobject wrapper.



[flexcoders] Re: Stepping through Flex SDK code while in Flex Builder debugger

2008-10-17 Thread hu22hugo
--- In flexcoders@yahoogroups.com, "lagos_tout" <[EMAIL PROTECTED]> wrote:
>
> Hi, all.
> 
> Is it possible to step through Flex SDK code using Flex Builder 3 
> debugger?  
> 
> I was able to set break points in only a couple of SDK 
> classes (eg AdvancedDataGrid).  I did this by adding
>  
> C:\Program Files\Adobe\Flex Builder 3 Plug-
> in\sdks\3.1.0\fbpro\projects\datavisualization\src
> 
> to the source lookup file list in the debug configuration panel in 
> Flex Builder.
> 
> But adding 
> 
> C:\Program Files\Adobe\Flex Builder 3 Plug-
> in\sdks\3.1.0\frameworks\projects\framework\src
> 
> doesn't have the same effect of letting me step through framework 
> code.

I had a similar issue with two particular projects using Flex
3.1.0.2???. All other projects were fine. It turned out that linking
the framework as runtime shared library was the culprit. Turning back
to merging the framework classes into the project.swf made me a happy man.
Marc, http://faindu.wordpress.com/



[flexcoders] Re: Dispatch event in itemClickHandler

2007-05-28 Thread hu22hugo
I doubt that this is the best solution. However, it seems to work.

private function itemClickHandler(e:MenuEvent) : void 
{
var event :  PageEvent = new PageEvent(PageVO.GET, [EMAIL PROTECTED])
this.callLater(eve, [event])
}
   private function eve(event: PageEvent): void
   {
event.dispatch()
}



[flexcoders] Dispatch event in itemClickHandler

2007-02-04 Thread hu22hugo
The code below works fine except for the fact that the menu of the
PopUpButton does not close. When I comment out the
CairngormEventDispatcher, the PopUpButton closes. So I assume that
there is something wrong with dispatching an event in a
handler??



http://www.adobe.com/2006/mxml"; width="400"
height="300">