Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Contributor
Posts: 7
Registered: ‎12-03-2011
My Device: Playbook
My Carrier: None

Re: setAreaOfInterest null object reference error

Hi,

 

Thanks for solution. I have just now the problem and now myapp work.

 

In simulator, with 2.0.0.4867, the problem not appear. Strange...

Developer
Posts: 65
Registered: ‎11-15-2010
My Device: Not Specified
My Carrier: T-Mobile

Re: setAreaOfInterest null object reference error

As an FYI (I haven't tried on the 2.0 platform yet), but there is another weird error with the CalloutButton that is related to this skin.

I have a TextInput in a CalloutButton component. I have set the mobile skinClass for the TextInput to prevent the weird setAreaOfInterest error. However, on closeDropDown(), all buttons and calloutbuttons lose their ability to show button presses (e.g. mousedown, mouseup, etc.). They still respond to the actual press (i.e. adding eventlisteners for mouseclick still works), but it just does not visibly show it. The calloutbuttons do not show the callout/pop up display though, which is how I noticed it happening on the playbook.
Developer
Posts: 65
Registered: ‎11-15-2010
My Device: Not Specified
My Carrier: T-Mobile

Re: setAreaOfInterest null object reference error

It also seems to be related to the "paste" into the textinput. If I type into the field, it seems to be ok, but once I paste text into the field (without doing anything else), the mouse display issues appear.
Developer
Posts: 455
Registered: ‎03-04-2011
My Device: Paper cup

Re: setAreaOfInterest null object reference error

[ Edited ]

Seems it's related simply to contents being in the field, not specifically pasted or set programmatically.

 

The same error is happening, also in qnx.stagetext.ui.text::EditableText/setAreaOfInterest(), under the following very simple circumstance:

 

1. A Views application created with 3 views,

2. Each view just has a couple of TextInput fields and a single TextArea output field,

3. It works fine if nothing is entered in the fields,

4. If something is typed into a field, it crashes with error #1009 when trying to change views.

 

This occurs even if there is no binding or function call, just the plain view with a few fields in it.

 

If you type something in but erase all fields before changing views, it does not crash.

 

The error:

[SWF] Main.swf - 3,377,940 bytes after decompression
[SWF] QNXStageText - 261,481 bytes after decompression
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at qnx.stagetext.ui.text::EditableText/setAreaOfInterest()[/home/builder/hudson/workspace/Trunk-SWF_StageText/src/stagetext/src/qnx/stagetext/ui/text/EditableText.as:756]
at qnx.stagetext.ui.text::EditableText/insertText()[/home/builder/hudson/workspace/Trunk-SWF_StageText/src/stagetext/src/qnx/stagetext/ui/text/EditableText.as:972]
at qnx.stagetext.ui.text::EditableText/set text()[/home/builder/hudson/workspace/Trunk-SWF_StageText/src/stagetext/src/qnx/stagetext/ui/text/EditableText.as:300]
at flash.text::StageText/set text()
at StageTextPool$/acquireStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:3113]
at spark.components.supportClasses::StyleableStageText/http://www.adobe.com/2006/flex/mx/internal::getStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:2415]
at spark.components.supportClasses::StyleableStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:403]
at spark.skins.mobile.supportClasses::StageTextSkinBase/createChildren()[E:\dev\4.y\frameworks\projects\mobiletheme\src\spark\skins\mobile\supportClasses\StageTextSkinBase.as:185]
at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7634]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
at mx.core::UIComponent/addChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7176]
at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:692]
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:406]
at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7634]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
at mx.core::UIComponent/addChildAt()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7199]
at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:2037]
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1628]
at spark.components::Group/setMXMLContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:633]
at spark.components::Group/set mxmlContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:573]
at spark.components::SkinnableContainer/set mxmlContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:657]
at spark.components::SkinnableContainer/createDeferredContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:1050]
at spark.components::SkinnableContainer/createContentIfNeeded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:1078]
at spark.components::SkinnableContainer/createChildren()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:885]
at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7634]
at spark.components::View/initialize()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\View.as:999]
at views::TurnView/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
at mx.core::UIComponent/addChildAt()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7199]
at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:2037]
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1628]
at spark.components::Group/addElementAt()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1387]
at spark.components::Group/addElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1345]
at spark.components::SkinnableContainer/addElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:761]
at spark.components::ViewNavigator/createViewInstance()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\ViewNavigator.as:2018]
at spark.components::ViewNavigator/http://www.adobe.com/2006/flex/mx/internal::createTopView()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\ViewNavigator.as:1981]
at spark.components::ViewNavigator/http://www.adobe.com/2006/flex/mx/internal::setActive()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\ViewNavigator.as:424]
at spark.components::TabbedViewNavigator/commitProperties()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\TabbedViewNavigator.as:741]
at mx.core::UIComponent/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8219]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:813]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]

 

The source code:

 

Main.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160">
<s:ViewNavigator label="Accel" width="100%" height="100%" firstView="views.AccelView"/>
<s:ViewNavigator label="Turn" width="100%" height="100%" firstView="views.TurnView"/>
<s:ViewNavigator label="Spin" width="100%" height="100%" firstView="views.SpinView"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TabbedViewNavigatorApplication>

 

One of the views:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Turn">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label id="TurnL1" x="95" y="41" width="178" height="18" text="Curve Radius"/>
<s:Label id="TurnL2" x="129" y="180" width="60" text="Speed"/>
<s:TextInput skinClass="spark.skins.mobile.TextInputSkin" id="TurnRadius" x="245" y="41" width="125" height="50" enabled="true" restrict="0-9." />
<s:TextInput skinClass="spark.skins.mobile.TextInputSkin" id="TurnSpeed" x="245" y="178" width="103" height="50" enabled="true" restrict="0-9." />
<s:Label id="TurnL3" x="121" y="314" width="102" height="20" text="Force (G)"/>
<s:TextArea id="TurnForce" x="245" y="314" width="103" height="50" editable="false" enabled="true"/>
<s:VGroup x="371" y="146" width="99" height="158">
<s:RadioButton id="TurnSpeedUnitMPH" label="mph" groupName="TurnSpeedUnitGrp" selected="true"/>
<s:RadioButton id="TurnSpeedUnitFtsec" label="ft/sec" groupName="TurnSpeedUnitGrp"
selected="false"/>
<s:RadioButton id="TurnSpeedUnitKPH" label="kph" groupName="TurnSpeedUnitGrp"
selected="false"/>
<s:RadioButton id="TurnSpeedUnitMsec" label="m/sec" groupName="TurnSpeedUnitGrp"
selected="false"/>
</s:VGroup>
<s:VGroup x="398" y="41" width="77" height="81">
<s:RadioButton id="TurnRadiusUnitFt" label="ft" groupName="TurnRadiusUnitGrp" selected="true"/>
<s:RadioButton id="TurnRadiusUnitM" label="m" groupName="TurnRadiusUnitGrp" selected="false"/>
</s:VGroup>
</s:View>

 

Developer
Posts: 65
Registered: ‎11-15-2010
My Device: Not Specified
My Carrier: T-Mobile

Re: setAreaOfInterest null object reference error

Sorry, I guess I wasn't clear in my post, the result I was seeing (the lack of button UI) was after I added the skinClass. The error you're posting is related to *not* using the skinClass, correct? Once you add the skinClass, that error you're seeing should go away.
Developer
Posts: 455
Registered: ‎03-04-2011
My Device: Paper cup

Re: setAreaOfInterest null object reference error

Ah, forgot to mention... tried that, it didn't work in this case.

 

Added the skinClass per your example to all instances of TextInput; same error occurred.

 

Developer
Posts: 65
Registered: ‎11-15-2010
My Device: Not Specified
My Carrier: T-Mobile

Re: setAreaOfInterest null object reference error

You have to add it to the "TextArea" one as well (but use the TextArea vs. the TextInput skinClass
Developer
Posts: 455
Registered: ‎03-04-2011
My Device: Paper cup

Re: setAreaOfInterest null object reference error

[ Edited ]

Worked.

Thank you. Pls send the address where you want the beer sent.

 

Developer
Posts: 65
Registered: ‎11-15-2010
My Device: Not Specified
My Carrier: T-Mobile

Re: setAreaOfInterest null object reference error

Smiley Very Happy
Developer
Posts: 455
Registered: ‎03-04-2011
My Device: Paper cup

Re: setAreaOfInterest null object reference error

How many more things like this are there in Flash and Tablet OS development?

 

This was my first attempt to write something for PlayBook or in Flash, so I chose the simplest thing imaginable... an app that has a few tabbed views with just a few fields per view.  All it has to do is make one simple calculation per tab from data entered in two fields and display the result in the 3rd field.

 

... and it was already a major problem that took days to find a solution to.

 

Doesn't make a great first impression.  Is this how it's going to be?  Having to learn a whole new mess of hacks to get simple things done?  What would happen if I tried to write a "real" app, it would be a nightmare of problems?

 

Would rather know up-front what I'm getting into.

 

Thx