joshtynjala commented on pull request #1041:
URL: https://github.com/apache/royale-asjs/pull/1041#issuecomment-814393934


   In `addViewport()`, I replaced this code:
   
   ```as3
   if (chost != null && chost != _viewport.contentView) {
        chost.addElement(_viewport.contentView);
   }
   ```
   
   with this code instead, and that seems to resolve the error:
   
   ```as3
   if (chost != null && chost != _viewport.contentView) {
        if(chost is ILayoutParent) {
                var cview:ILayoutView = 
ILayoutParent(chost).getLayoutHost().contentView;
                if(cview != _viewport.contentView) {
                        chost.addElement(_viewport.contentView);
                }
        }
        else {
                chost.addElement(_viewport.contentView);
        }
   }
   ```
   
   However, progressing further in the Mustella tests gives us another error:
   
   ```
   Error #1034: Type Coercion failed: cannot convert 
flash.events::MouseEvent@1908aad6e1f1 to org.apache.royale.events.MouseEvent.
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at 
DispatchMouseClickEvent/dispatchMouseEvent()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/DispatchMouseClickEvent.as:190]
        at 
DispatchMouseClickEvent/doStep()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/DispatchMouseClickEvent.as:79]
        at 
TestStep/execute()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/TestStep.as:75]
        at 
DispatchMouseClickEvent/execute()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/DispatchMouseClickEvent.as:0]
        at 
TestCase/runSteps()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/TestCase.as:443]
        at 
TestCase/runBody()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/TestCase.as:318]
        at 
TestCase/runSetup()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/TestCase.as:296]
        at 
TestCase/runTest()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/TestCase.as:264]
        at 
UnitTester/runTests()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/UnitTester.as:2113]
        at 
UnitTester/runMoreTests()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/UnitTester.as:2159]
        at 
UnitTester$/enterFrameHandler()[/Users/joshtynjala/Development/apache/royale-asjs/mustella/src/main/royale/UnitTester.as:1253]
   ```
   
   As I understand it, Royale is supposed to convert `flash.events.MouseEvent` 
to `org.apache.royale.events.MouseEvent` automatically. It appears that this 
pull request breaks that functionality in some situations.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to