Spark Video Player null Object Error After Playback Error - apache-flex

I'm having a problem with the Spark VideoPlayer. If the player encounters a playback error (maybe due to it not being able to play the file) and I then try to set the source again I get a null object error. The error occurs here:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at spark.components::VideoDisplay/cleanUpSource()
E:\dev\4.y\frameworks\projects\spark\src\spark\components\VideoDisplay.as:1956]
which points to
videoPlayer.displayObject.visible = true;
where the displayObject is null.
I can't seem to find a way around this problem other than ditching the VideoPlayer component and creating my own.
I've seen a few post relating to this problem but I've not found a solution which work for me.

Related

Migrating Xamarin.forms app to Android 12 leads to Prism doesn't find the registered viewmodels

I have one Xamarin.Forms app with prism 8.1.96 that works great, but when I try to update the Android SDK to have Android 12 (SDK V31), I receive a blank screen and a message that says:
"An error occurred while resolving the page. This is most likely the result of invalid XAML or other type initialization exception."
Since nothing have been changing on XAML side, what can I do to fix this problem?
Without code it's impossible to say what the error is outright. The error message you're referencing can only come from the NavigationException. It's important to look at the inner exception. It likely has a ContainerResolutionException. If you get the Inner Exception and cast it to it's proper type you can call the GetErrors method which would let you get a list back of types/errors... typically the last type/error is the root cause of your issue.
var result = await navigationService.NavigateAsync("SomePath");
if(result.Exception is not null && result.Exception.InnerException is ContainerResolutionException cre)
{
var errors = cre.GetErrors();
var root = errors.Last();
System.Diagnostics.Debugger.Break();
}

Modeling best practices

I worked some days on models that should be used with aframe, built with blender, exported to .obj. All went mostly very well, so the experience so far was very positive.
Until an object started to throw exceptions after some small changes at a model that worked well so far. The stacktrace is
aframe.js:sourcemap:27095 Uncaught TypeError: Cannot set property 'value' of undefined
at initMaterial (aframe.js:sourcemap:27095)
at setProgram (aframe.js:sourcemap:27191)
at WebGLRenderer.renderBufferDirect (aframe.js:sourcemap:26139)
at renderObjects (aframe.js:sourcemap:26961)
at WebGLRenderer.render (aframe.js:sourcemap:26698)
at THREE.VREffect.render (aframe.js:sourcemap:79772)
at HTMLElement.value (aframe.js:sourcemap:74829)
at bound (aframe.js:sourcemap:78097)
56aframe.js:sourcemap:27732 Uncaught TypeError: Cannot set property 'needsUpdate' of undefined
at markUniformsLightsNeedsUpdate (aframe.js:sourcemap:27732)
at setProgram (aframe.js:sourcemap:27325)
at WebGLRenderer.renderBufferDirect (aframe.js:sourcemap:26139)
at renderObjects (aframe.js:sourcemap:26961)
at WebGLRenderer.render (aframe.js:sourcemap:26698)
at THREE.VREffect.render (aframe.js:sourcemap:79772)
at HTMLElement.value (aframe.js:sourcemap:74829)
at bound (aframe.js:sourcemap:78097)
I found the problematic object, so I just rebuild it, no big deal this time.
But: When such a problem pops up later in the process, it might not be so easy to just rebuild. So my question is if there are any general tips to prevent such breakage. For example what to watch out for or what blender features to stay away from.
It's easy to rebuild the model now, but might be much harder later in the production process. I'd like to prevent this in the future.
Exporting from blender to gltf failed for me with pretty simple objects already.

Flex Error #1009: Cannot access a property or method of a null object reference

I'm getting error while running a game I created with flex.
I know there has been some question about this, but my case is quite weird. I created a simple typing game that is running OK on my computer, but when I tried to deploy it online to facebook, I got those errors. I used code from the tutorial from adobe here http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt4.html to deploy my flex game to facebook
This is the error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at FacebookUserStatusWeb/init()
at FacebookUserStatusWeb/___FacebookUserStatusWeb_Application1_creationComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()
And here is snippet of the init() function:
protected var text1:String="Text to be typed"; //hard-coded temporarily
protected const TIMER_INTERVAL:int = 10;
protected var t:Timer = new Timer(TIMER_INTERVAL);
protected var topURL:String=ExternalInterface.call('top.location.toString');
protected function init():void
{
t.addEventListener(TimerEvent.TIMER, updateTimer);
ProblemText.text = new String(text1);
Facebook.init("<my app id>",loginHandler);
currentState = (topURL) ? "loggedout": "loggedoutonfacebook";
}
Some notes:
1.my app id is my facebook app id which I prefer not to show
2.ProblemText is a richtext which I placed the paragraph to be typed by the player.
3.I have deleted the method Application1_creationComplete() but it still appears at the error listing
And also I am curious about the errors other than the first two. What do they mean?
Ah, and if it is helpful, I can post some more of the code
First: You're only seeing one error. Everything you see below the #1009 error is your stack trace, not additional errors.
The stack trace basically tells you the series of things that happened prior to the error occurring, with the most recent at the top. This is useful because often things which happen prior to the actual error you see will contribute to said error.
Second: The null object reference is occurring because something in your init() function tried to access a property in an object that doesn't exist, or an object that doesn't exist. One (slightly messy but effective) way to debug this would be to drop some trace statements in the code to see how far it gets before barfing with the error -- the idea being to isolate the specific line that's causing the problem. Once you've done that, you need to work backwards to figure out why the object or property you're trying to use is null. It could be something simple, like a typo, or it could be more complex. You'll have to sleuth it out, one way or another =)
Good luck!
Finally got the bug. Just in case people have the same case with me, what exactly happened is at my computer I simulated the game with just one state, but when I'm deploying to facebook I have several states (loggedin,loggedout,etc). In the init() I tried to access ProblemText Label that is not present in the current state.

ASP.NET Error Object reference not set to an instance of an object

Object reference not set to an instance of an object
I am getting this error sometimes.
I have a page where I load questions and for some question system generate this error. Why do I get this error? Please help me.
It means that somewhere something dereferences a null reference. Crude example:
Foobar foo = null;
foo.DoSomething(); // this line will trigger a NullReferenceException
Here's what you can do:
compile in debug mode
run it until it crashes
examine the stack trace; it will tell you where the exception originates (unless you're doing stupid things like catching and rethrowing improperly). You may have to follow the chain of inner exceptions
if that doesn't provide sufficient information, step through your code with a debugger until right before the call that makes it crash. Examine any variables that might be null.
Once you have found the culprit, you need to find out why it is null and what to do about it. The solution can be one of:
fix incorrect program logic that causes something to be null that shouldn't be
check if something is null before dereferencing it
handle the exception at a point that makes sense, and translate it into something more meaningful (probably some sort of custom exception)
You got null reference and if it can't handle it will show that message.
It can caused by some case
The return value of a method is null
A local variable or member field is declared but not initialized
An object in a collection or array is null
An object is not created because of a condition
An object passed by reference to a method is set to null
I suggest you to track the null value using a debug mode
You get this error, whenever you are trying to make use of variable with Null value in it.

Very odd null object RTE on FocusManager

I am getting this error, randomly when I start my application (and it's sub applications). As you can see the stack trace is rather useless, although through the debugger I can see the parent of container (second in the stack) is an MXML class that has a repeater that repeats another component.
Therefore I guess the component with the problem is that repeated component, although I am unsure what I can change to stop this from happening. If anyone can give me some insight to the FocusManager or the getFocus() function it would be really handy.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.managers::FocusManager/getFocus()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\FocusManager.as:542]
at mx.core::Container/createOrDestroyScrollbars()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\Container.as:4571]
at mx.core::Container/createScrollbarsIfNeeded()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\Container.as:4402]
at mx.core::Container/createContentPaneAndScrollbarsIfNeeded()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\Container.as:4218]
at mx.core::Container/validateDisplayList()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\Container.as:2734]
at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\LayoutManager.as:677]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:8733]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:8673]
Thanks
Rob
It seems that the problem was related to removing a SWF from the stage whilst is was still loading.
http://tech.groups.yahoo.com/group/flexcoders/message/147691
The solution would be to only remove SWFs from the stage once they are fully loaded.

Resources