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
Developer
Posts: 65
Registered: ‎11-15-2010
My Device: Not Specified
My Carrier: T-Mobile
Accepted Solution

setAreaOfInterest null object reference error

Not sure what's happening with my app, runs nicely on the desktop.  I sent it to my Playbook and am now getting errors.  I'm running OS Version 1.0.8.6067  Looks like something with the conversion to QNX from flash/Flex.  Anyone have any ideas (or work arounds)?

 

The stacktrace shows

 

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:Smiley FrustratedtageText/set text()
at StageTextPool$/acquireStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:3113]
at spark.components.supportClasses:Smiley FrustratedtyleableStageText/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:Smiley FrustratedtyleableStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:403]
at spark.skins.mobile.supportClasses:Smiley FrustratedtageTextSkinBase/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:Smiley FrustratedkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:692]
at spark.components.supportClasses:Smiley FrustratedkinnableComponent/validateSkinChange()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
at spark.components.supportClasses:Smiley FrustratedkinnableComponent/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/createChildren()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:855]
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:Smiley FrustratedkinnableContainer/set mxmlContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:657]
at spark.components:Smiley FrustratedkinnableContainer/createDeferredContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:1050]
at spark.components:Smiley FrustratedkinnableContainer/createContentIfNeeded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:1078]
at spark.components:Smiley FrustratedkinnableContainer/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 com.qapable.view::FridgeContentForm/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:Smiley FrustratedkinnableContainer/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/commitNavigatorAction()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\ViewNavigator.as:1932]
at spark.components::ViewNavigator/commitProperties()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\ViewNavigator.as:1301]
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]

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

Re: setAreaOfInterest null object reference error

Found the solution (via the comments of devgirl.org 's blog).  Turns out it's a known issue in Flash Builder 4.6 with the TextInput skin.  Quick and easy solution is to add

 

skinClass="spark.skins.mobile.TextInputSkin"

 

to the TextInput tag and everything works again (I saw him mention an issue with StageText and as you can see, that shows up in the stack trace I was getting).

 

Was also getting weirdness when exporting to Android (inputs vanishing and inputs showing up outside the textinput).  Hopefully this will fix that issue also.

BlackBerry Development Advisor
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: setAreaOfInterest null object reference error

Would you be able to send me a small sample of this error being thrown. I would like to guard against this error from being thrown in the future.

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

Re: setAreaOfInterest null object reference error

It was actually just a plain, ol' textinput that was causing the issue.  It wasn't always throwing it when it first showed.  I think it was usually when there was some kind of data in there.

 

This is the original textinput

 

<s:TextInput id="txtDescription" autoCapitalize="{ AutoCapitalize.SENTENCE }" height="43" width="200" />

 

I then changed this to

 

<s:TextInput id="txtDescription" skinClass="spark.skins.mobile.TextInputSkin" autoCapitalize="{ AutoCapitalize.SENTENCE }" height="43" width="200" />

 

Just adding the specific skin fixed the issue.  And it didn't seem to be related to the autoCapitalize as I had another TextInput that threw the error that did not have that attribute added.  I guess whatever Adobe did to modify the TextInput with the softKeyboard features caused some issue going from 4.5.1 to 4.6.

 

Let me know if you need any additional details.

Thanks.

BlackBerry Development Advisor
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: setAreaOfInterest null object reference error

Ok thanks.

 

I think in Flex 4.6 the TextInput is using StageText to input the text. StageText uses the native text input implementation of the platform.

 

On PlayBook it is essentially qnx.fuse.ui.text.EditableText, instead of TextField, which is used on the Desktop. But because StageText is implemented a little differently then just adding a child to the display list, errors like this may be thrown.

 

In your specific case it looks like the parent was null in EditableText. I am going to put a check in for that for this specific case so this error no longer happens.

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

Re: setAreaOfInterest null object reference error

Excellent! Thanks.
New Developer
Posts: 10
Registered: ‎02-12-2011
My Device: Tablet (simulator only)

Re: setAreaOfInterest null object reference error

[ Edited ]

Affects TextArea too...

 

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:Smiley FrustratedtageText/set text()

at spark.components.supportClasses:Smiley FrustratedtyleableStageText/set text()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:1143]

at spark.components.supportClasses:Smiley FrustratedkinnableTextBase/textDisplayAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:2315]

at spark.components.supportClasses:Smiley FrustratedkinnableTextBase/partAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:1751]

at spark.components::TextArea/partAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\TextArea.as:663]

 

And while applying the TextInput skin avoids the RTE, I'm left with 2 lines of truncated horizontal scrolling text instead of two nicely line-wrapped paragraphs. - so I have more to do to try work around this.

 

EDIT: doh! - of course I should have used spark.skins.mobile.TextAreaSkin

New Developer
Posts: 10
Registered: ‎02-12-2011
My Device: Tablet (simulator only)

Re: setAreaOfInterest null object reference error

I should add that the problem only arrises if we attempt to set the text property of the TextInput or TextArea before the viewActivate event - and this is the case internally within an s:ViewNavigatorApplication when pushing views.

 

@Is there a public reference to this bug so that we might track/contribute ?

New Developer
Posts: 10
Registered: ‎02-12-2011
My Device: Tablet (simulator only)

Re: setAreaOfInterest null object reference error

https://bugs.adobe.com/jira/browse/FB-33186

Of course flex bug-base being migrated to Apache, will update with new reference once it's there.
BlackBerry Development Advisor
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: setAreaOfInterest null object reference error

I don't have a public bug to reference, but can confirm that it will be fixed in the final release of Tablet OS 2.0.

This code is coming from the device and not the SDK itself.