Recieving Error #1009

pourma

  • Posts: 2
Hello,

I started to continue development on my game this morning and found out that I couldn't test it, so I published it and when I tried to run it I ran into this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at stencyl.api.data::Assets$/toXML()[/home/stencyl/stencyl.net/jenkins/jobs/StencylWorks-Dist/workspace/plaf/flash/flixel/org/FlxPreloader.as:331]

Please help me as I do not have the slightest idea on where I went wrong

Innes

  • *
  • Posts: 1961
Most commonly, this error means that you are trying to do something to an actor that no longer exists.

For example, if you have a behavior or event that kills the actor, and then a moment later, if you try to move, or obtain a value from that actor (or kill it again), the 1009 error will occur.

One way to avoid the error is to enclose the action that is attempting to access the actor in a [if actor exists] block.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

pourma

  • Posts: 2
I can't find an instance were what you said applies, My actors can't die at the moment

rob1221

  • *
  • Posts: 9446
Are you using a library that may affect the preloader or trying to embed the Stencyl SWF?  Any AS3 code at all?

YuriG

  • Posts: 8
Facing the same problem and I can not solve.
I give you a picture of what I try to do.


And this is the error log


When i remove the 2ndActor from Kill, everything play normal.

« Last Edit: December 04, 2013, 05:09:33 pm by YuriG »

Photon

  • Posts: 2697
The problem is this: since the kill code is being set in the background to wait (the Do After X Seconds), the rest of the collision handler processes and finishes. As such, it "forgets" what 2nd actor was and therefore shoots an error about it being "null".

A better idea would be this: make some sort of delayed death behavior that you attach to your "2nd actor", and then have the collision code trigger it. That way, the 2nd actor handles the delay and the killing of itself.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

irock

  • *
  • Posts: 2881
Also, collectables that just fade out look bad, so don't do that.

Innes

  • *
  • Posts: 1961
Also, collectables that just fade out look bad, so don't do that.

For someone with only four posts, I don't think it's a bad thing to try! Everyone has to start somewhere!

Once that's working, they can move on to other things like exploding particles, etc.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

irock

  • *
  • Posts: 2881
No, I mean it would look better even if they were to just instantly disappear. Simple fades look awful in this context.

I'll just stop giving advice. Thanks Innes!

Innes

  • *
  • Posts: 1961
No, I mean it would look better even if they were to just instantly disappear. Simple fades look awful in this context.

I'll just stop giving advice. Thanks Innes!


Ah! I see what you mean. Still, there's no harm in trying things out, if only to learn that they don't look great!
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

irock

  • *
  • Posts: 2881
There's no harm in trying things out, but some people still go with the fade even after trying it, so there's a legitimate reason to advise against it too. :)

YuriG

  • Posts: 8
Also, collectables that just fade out look bad, so don't do that.

Thanks. It is not necessary. But because I'm new, it is good to ask and try anything. So far I removed it, because I could not solve it. Thanks Innes and Photon

« Last Edit: December 05, 2013, 05:46:15 pm by YuriG »

Photon

  • Posts: 2697
Also, collectables that just fade out look bad, so don't do that.

Thanks. It is not necessary. But because I'm new, it is good to ask and try anything. So far I removed it, because I could not solve it. Thanks Innes and Photon
If you just want something clean and easy, just kill it right away while the data is still remembered.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

irock

  • *
  • Posts: 2881
Don't give up! For reference, this is what I did in one of my games. You'd have something like this attached to your collectible.


YuriG

  • Posts: 8
Yes Irock. When I connect this behavior in collectibles, works fine. But if I connect a behavior to the main character eg "when actor hit collectible" crashes.