I thought you were using HTTPService and not URLLoader until this morning when 
I looked more closely at your call stack.  I’m not digging through your code in 
detail.  I’m not sure if HTTPService wraps the URLLoader or subclasses or what. 
 But fundamentally, you should be able to override the right dispatchEvent call 
and send something else, or possibly be the first listener for an event and 
call stopImmediatePropagation and dispatch something else.

HTH,
-Alex


From: Serkan Taş <serkan....@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <users@royale.apache.org>
Date: Monday, February 25, 2019 at 11:19 AM
To: "users@royale.apache.org" <users@royale.apache.org>
Subject: Re: Work on Emulation

You are right Alex,

The dispatch is called in progressHsandler function in class URLLoader.

But I guess there is a misunderstanding.

From your mail I understood that I am going to override the function in 
HttpService class not in the URLLoader class.

To make it clear,  I am going to override the dispatch event function in 
URLLoader, right ?

Thanks,
Serkan
25.02.2019 20:26 tarihinde Alex Harui yazdı:

The call stack indicates that URLLoader's progressHandler calls dispatchEvent.  
I would step into that call.  If you have properly overridden URLLoader's 
dispatchEvent, then it should work.



HTH,

-Alex



On 2/25/19, 2:25 AM, 
"serkan....@likyateknoloji.com"<mailto:serkan....@likyateknoloji.com> 
<serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com> wrote:





    Do yoyu mean the method in URLoader class ?



    Alıntı Alex Harui <aha...@adobe.com><mailto:aha...@adobe.com>:



    > If you step into dispatchEvent, where does it go?

    >

    > From: Serkan Taş 
<serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com>

    > Reply-To: "users@royale.apache.org"<mailto:users@royale.apache.org> 
<users@royale.apache.org><mailto:users@royale.apache.org>

    > Date: Sunday, February 24, 2019 at 11:49 AM

    > To: "users@royale.apache.org"<mailto:users@royale.apache.org> 
<users@royale.apache.org><mailto:users@royale.apache.org>

    > Subject: Re: Work on Emulation

    >

    > Hi Alex,

    >

    > After overriding the method in HTTPService, I watched that it is not 
called.

    >

    > according to the code below,

    >

    > loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpResult);

    >

    > the method httpResult is called so the changes I made had no effect.

    >

    > Thanks,

    > Serkan

    > 14.02.2019 23:08 tarihinde Alex Harui yazdı:

    > I don’t think we have an example to reference.

    >

    > It should be something like:

    >

    > Override public function dispatchEvent(event:Event):Boolean

    > {

    >    If (event.type == “httpStatus”)

    >   {

    >     Var newEvent:HTTPStatusEvent = new HTTPStatusEvent(…)

    >     // assign other properties If needed

    >    Super.dispatchEvent(newEvent);

    >   }

    > }

    >

    > From: Serkan Taş

    > 
<serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com>

    > Reply-To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Date: Thursday, February 14, 2019 at 11:54 AM

    > To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Subject: Re: Work on Emulation

    >

    > Are there any similar implementation that you may advice me to check

    > as sample ?

    > 14.02.2019 22:36 tarihinde Alex Harui yazdı:

    > So the progressHandler in URLLoader is dispatching a ValueEvent, not

    > the HTTPStatusEvent you want.  The emulation HTTPService should

    > override what gets dispatched.  You could override dispatchEvent and

    > dispatch the right thing.

    >

    > HTH,

    > -Alex

    >

    > From: Serkan Taş

    > 
<serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com>

    > Reply-To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Date: Thursday, February 14, 2019 at 11:30 AM

    > To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Subject: Re: Work on Emulation

    >

    > Found it :

    > [cid:part1.364CE0CC.0B2C681F@likyateknoloji.com]

    > 14.02.2019 22:28 tarihinde Serkan Taş yazdı:

    > Alex,

    >

    > I am not sure that I know how to capture call stack in Firefox Dev 
Edition.

    >

    > Thanks,

    > Serkan

    > 14.02.2019 22:23 tarihinde Alex Harui yazdı:

    > In Royale in the browser, some events aren’t what you think they

    > are.  If you listen for a org.apache.royale.events.MouseEvent, the

    > browser dispatches a browser MouseEvent and Royale runs code to

    > catch that and convert it to org.apache.royale.events.MouseEvent.

    >

    > I suspect that the browser is sending its low-level event and Royale

    > code needs to be added to convert it to a Royale HTTPStatusEvent.

    > That’s why I suggested checking the call stack as it might be

    > possible to copy the MouseEventConverter patterns to do the

    > conversion.

    >

    > HTH,

    > -Alex

    >

    > From: Serkan Taş

    > 
<serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com>

    > Reply-To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Date: Thursday, February 14, 2019 at 11:14 AM

    > To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Subject: Re: Work on Emulation

    >

    > Hi Alex,

    > 13.02.2019 01:50 tarihinde Alex Harui yazdı:

    > Hi Serkan,

    >

    > In the emulation components, you may have to catch certain events

    > and redispatch them with the appropriate type.  In the event handler

    > that calls Alert, what is the type of the event parameter.  Is it an

    > HTTPStatusEvent or a browser event?

    > Here is the registration :

    >

    > loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpResult);

    >

    > It is registered as HTTPStatusEvent. And the handler has the signature :

    >

    > private function httpResult(event:HTTPStatusEvent):void

    >

    >

    >

    >

    >

    >

    > If it is an HTTPStatusEvent, then the emulation may be as simple as

    > adding a “status” getter that returns the event’s value property.

    >

    > As it is HTTPStatusEvent, than it will be enough to implement your

    > advice to the JS section of the code. But when I check the code,

    > there is getter for status :

    >

    > COMPILE::JS

    >     public class HTTPStatusEvent extends org.apache.royale.events.Event

    >     {

    >         /*  include "../core/Version.as"; */

    >         public static const HTTP_STATUS:String = "httpStatus";

    >         private var m_status:int;

    >

    >

    > 
//--------------------------------------------------------------------------

    >         //

    >         //  Class constants

    >         //

    >

    > 
//--------------------------------------------------------------------------

    >

    >

    >

    > 
//--------------------------------------------------------------------------

    >         //

    >         //  Constructor

    >         //

    >

    > 
//--------------------------------------------------------------------------

    >

    >         /**

    >          *  Constructor.

    >          *

    >          *  @param type The event type; indicates the action that

    > caused the event.

    >          *

    >          *  @param bubbles Specifies whether the event can bubble

    >          *  up the display list hierarchy.

    >          *

    >          *  @param cancelable Specifies whether the behavior

    >          *  associated with the event can be prevented.

    >          *

    >          *  @langversion 3.0

    >          *  @playerversion Flash 9

    >          *  @playerversion AIR 1.1

    >          *  @productversion Royale 0.9.3

    >          */

    >         public function HTTPStatusEvent(type:String, bubbles:Boolean = 
false,

    >                                         cancelable:Boolean = false,

    > status:int = 0)

    >         {

    >             super(type, bubbles, cancelable);

    >             m_status = status;

    >         }

    >

    >         public function get status() : int

    >         {

    >             return m_status;

    >         }

    >

    >     }

    >

    > But returns internal m_status, which is in my case is undefined.

    >

    > Thanks,

    > Serkan

    >

    >

    >

    >

    >

    > If it is a browser event, then look at the call stack to see who is

    > dispatching the event.  The code that dispatches the event might

    > need to create an HTTPStatusEvent, copy the browser event properties

    > into it, and then dispatch the HTTPStatusEvent.  If you are not

    > sure, post the call stack.

    >

    > HTH,

    > -Alex

    >

    > From: Serkan Taş

    > 
<serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com><mailto:serkan....@likyateknoloji.com>

    > Reply-To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Date: Tuesday, February 12, 2019 at 11:52 AM

    > To: 
"users@royale.apache.org"<mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > 
<users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org><mailto:users@royale.apache.org>

    > Subject: Re: Work on Emulation

    >

    > Hi Alex (only you are interested in emulation, right ?) :)))

    >

    > While debugging my code, I realized that there is a conflict between

    > in status and httpStatus values of the event HTTPStatusEvent, at

    > least in my mind.

    >

    > My old flex code, ported to royale, registers and event listener for

    > HTTPStatusEvent.HTTP_STATUS and handler httpResult as below (loader

    > is initialized somewhere) :

    >

    > loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpResult);

    >

    > After making http request, the handler returns as below on screen :

    >

    > [cid:part1.78AD6179.FDDC1C04@likyateknoloji.com]

    >

    > This is where it fires window :

    >

    > [cid:part2.FC1F7F03.0A76E9BA@likyateknoloji.com]

    > It is normally expected that the status holds real value, but here

    > it is not, httpStatus contains the value in "value" as below :

    >

    > [cid:part3.E6732EF2.3364FCC2@likyateknoloji.com]

    >

    > As the HTTPStatusEvent is emulated, I am not sure how to go to solve

    > the issue.

    >

    > Thanks,

    > Serkan





    --

    Serkan Taş

    Mobil : +90 532 250 07 71

    Likya Bilgi Teknolojileri

    ve İletişim Hiz. Ltd. Şti.

    
https://na01.safelinks.protection.outlook.com/?url=www.likyateknoloji.com&amp;data=02%7C01%7Caharui%40adobe.com%7C2d38384f8dd04ac3b47d08d69b0b9a20%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636866871467152908&amp;sdata=ub%2FTzqih%2BV94nZCXul3yM7K5kAWsFJh5wEAgV8Ifhis%3D&amp;reserved=0<https://na01.safelinks.protection.outlook.com/?url=www.likyateknoloji.com&data=02%7C01%7Caharui%40adobe.com%7Cfb70d570727744a8d5e308d69b561ee1%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636867191524216985&sdata=Ml8m03M5q8dynE9aSk7atllP0Gd4QStsUlUs9nxSTIE%3D&reserved=0>



    --------------------------------------

    Bu elektronik posta ve onunla iletilen bütün dosyalar gizlidir. Sadece

    yukarıda isimleri belirtilen kişiler arasında özel haberleşme amacını

    taşımaktadır. Size yanlışlıkla ulaşmışsa bu elektonik postanın

    içeriğini açıklamanız, kopyalamanız, yönlendirmeniz ve kullanmanız

    kesinlikle yasaktır. Lütfen mesajı geri gönderiniz ve sisteminizden

    siliniz. Likya Bilgi Teknolojileri ve İletişim Hiz. Ltd. Şti. bu

    mesajın içeriği ile ilgili olarak hiç bir hukuksal sorumluluğu kabul

    etmez.



    This electronic mail and any files transmitted with it are intended

    for the private use of  the persons named above. If you received this

    message in error, forwarding, copying or use of any of the information

    is strictly prohibited. Please immediately notify the sender and

    delete it from your system. Likya Bilgi Teknolojileri ve İletişim Hiz.

    Ltd. Şti. does not accept legal responsibility for the contents of

    this message.

    --------------------------------------








Reply via email to