You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by chris_d_k <ck...@christiankiefer.de> on 2015/11/13 17:36:58 UTC

NPE in ButtonSkin

Hi,

I have added a Standard Button (spark, no skin, ...)

in one of my component and get the following error. If I add the Button with
an time-offset (setTimout(addMyButton, 20)) it is working. Any ideas why?

[Fault] exception, information=TypeError: Error #1009: Cannot access a
property or method of a null object reference.
at
spark.skins::ActionScriptSkinBase/setElementSize()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/spark/src/spark/skins/ActionScriptSkinBase.as:600]
at
spark.skins.mobile::ButtonSkin/http://www.adobe.com/2006/flex/mx/internal::layoutBorder()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as:390]
at
spark.skins.mobile::ButtonSkin/layoutContents()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as:364]
at
spark.skins::ActionScriptSkinBase/updateDisplayList()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/spark/src/spark/skins/ActionScriptSkinBase.as:293]
at
mx.core::UIComponent/validateDisplayList()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/framework/src/mx/core/UIComponent.as:9531]
at
mx.managers::LayoutManager/validateDisplayList()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/framework/src/mx/managers/LayoutManager.as:744]
at
mx.managers::LayoutManager/doPhasedInstantiation()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/framework/src/mx/managers/LayoutManager.as:809]
at
mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188]

kind regards

Christian



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/NPE-in-ButtonSkin-tp11481.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: NPE in ButtonSkin

Posted by OmPrakash Muppirala <bi...@gmail.com>.
That looks like a mobile skin.  Is this a mobile app?

Thanks,
Om

On Sat, Nov 14, 2015 at 3:40 PM, jude <fl...@gmail.com> wrote:

> Try changing the skin to a spark skin. It looks like it's using an action
> script skin. I don't remember ever seeing that class before.
>
> The reason is that some skins support some styles and other skins do not.
> So if the skin expects a style to be there and it's not it will throw an
> error. But that doesn't explain why it works 20ms later.
>
> Even if you are using default skins they still may have styles defined.
> Look for defaults.css in the flex sdk and you'll see each component
> defining the skin and a few styles.
>
> If you have a style sheet named defaults.css check that it is in your
> project it may be not conflicting with the library defaults.
>
> On Friday, November 13, 2015, chris_d_k <ck...@christiankiefer.de> wrote:
>
> > Sorry, "not changed" any default skins, css, ...
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-flex-users.2333346.n4.nabble.com/NPE-in-ButtonSkin-tp11481p11486.html
> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> >
>

Re: NPE in ButtonSkin

Posted by jude <fl...@gmail.com>.
Try changing the skin to a spark skin. It looks like it's using an action
script skin. I don't remember ever seeing that class before.

The reason is that some skins support some styles and other skins do not.
So if the skin expects a style to be there and it's not it will throw an
error. But that doesn't explain why it works 20ms later.

Even if you are using default skins they still may have styles defined.
Look for defaults.css in the flex sdk and you'll see each component
defining the skin and a few styles.

If you have a style sheet named defaults.css check that it is in your
project it may be not conflicting with the library defaults.

On Friday, November 13, 2015, chris_d_k <ck...@christiankiefer.de> wrote:

> Sorry, "not changed" any default skins, css, ...
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/NPE-in-ButtonSkin-tp11481p11486.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: NPE in ButtonSkin

Posted by chris_d_k <ck...@christiankiefer.de>.
Sorry, "not changed" any default skins, css, ...



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/NPE-in-ButtonSkin-tp11481p11486.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: NPE in ButtonSkin

Posted by Alex Harui <ah...@adobe.com>.

On 11/13/15, 11:12 AM, "chris_d_k" <ck...@christiankiefer.de> wrote:

>Hi Alex,
>
>the strange thing is that this is a project for developing a part of a
>bigger project and in this state this whole project is NOT using any skin,
>style, ...

I’m not sure what it means to be not using any skin.  There are default
skins for most things.

-Alex


Re: NPE in ButtonSkin

Posted by chris_d_k <ck...@christiankiefer.de>.
Hi Alex,

the strange thing is that this is a project for developing a part of a
bigger project and in this state this whole project is NOT using any skin,
style, ...



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/NPE-in-ButtonSkin-tp11481p11484.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: NPE in ButtonSkin

Posted by Alex Harui <ah...@adobe.com>.

On 11/13/15, 8:36 AM, "chris_d_k" <ck...@christiankiefer.de> wrote:

>Hi,
>
>I have added a Standard Button (spark, no skin, ...)
>
>in one of my component and get the following error. If I add the Button
>with
>an time-offset (setTimout(addMyButton, 20)) it is working. Any ideas why?

Hard to say for sure, but one possibility is that some styles are being
loaded or defined and aren’t ready in time.  setTimeout might delay just
enough for other code to run and setup those styles.

-Alex