google-code-export / jsinterface

Automatically exported from code.google.com/p/jsinterface
1 stars 0 forks source link

Flex 4.5.1 Issue #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I run the command "JSInterface.initialize(this);" in Flex 4.5.1, I get the 
following error:

----------------------------------------------------------------
TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
    at aw.external::JSInterface$/findCurrentRoot()[Z:\home\localhost\www\JSInterface\svn\source\full\aw\external\JSInterface.as:364]
    at aw.external::JSInterface$/coreInit()[Z:\home\localhost\www\JSInterface\svn\source\full\aw\external\JSInterface.as:343]
    at aw.external::JSInterface$/initialize()[Z:\home\localhost\www\JSInterface\svn\source\full\aw\external\JSInterface.as:324]
    at test/application1_creationCompleteHandler()[C:\Users\Blake Dearborn\Adobe Flash Builder 4.5\test\src\test.mxml:16]
    at test/___test_Application1_creationComplete()[C:\Users\Blake Dearborn\Adobe Flash Builder 4.5\test\src\test.mxml:4]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:13128]
    at mx.core::UIComponent/set initialized()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:1818]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:842]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]

Original issue reported on code.google.com by charles....@gmail.com on 25 Sep 2011 at 5:29

GoogleCodeExporter commented 9 years ago
Hi! Thank you for this report.
Please, share code example to reproduce error, this will help a lot.

Original comment by burd...@gmail.com on 26 Sep 2011 at 9:18

GoogleCodeExporter commented 9 years ago
Here is an example:
<?xml version="1.0" encoding="utf-8"?>
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    minWidth="955" 
    minHeight="600"
    creationComplete="application1_creationCompleteHandler(event)">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import aw.external.JSInterface;
            import mx.events.FlexEvent;

            protected function application1_creationCompleteHandler(event:FlexEvent):void
            {
                JSInterface.initialize(this);
            }

        ]]>
    </fx:Script>
</s:Application>

Original comment by charles....@gmail.com on 26 Sep 2011 at 4:01

Attachments:

GoogleCodeExporter commented 9 years ago
Hello,

I have been able to get JSInterface to function correctly by adjusting the 
examples provided.

Instead of using:
JSInterface.initialize(this);

The following can be used:
JSInterface.initialize(this.root);

This issue can be marked as resolved.

Original comment by charles....@gmail.com on 28 Dec 2011 at 4:20