Runtime Error with Skyboy's JSON class [Solved]

9 posts

Flag Post

I’m getting the following runtime error when using Skyboy’s JSON class:

ReferenceError: Error #1069: Property clear not found on flash.utils.ByteArray and there is no default value.
	at skyboy.serialization::JSON/decode()
	at skyboy.serialization::JSON$/decode()
	at ScenarioScreen/onJSONLoaderComplete()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete()

Strangely, this error does not occur when testing my game in Flash Professional, but it does occur when I run the SWF file in Internet Explorer. I could get it to run without error if I comment out the line that says strArr.clear(); but I’d then lose the opportunity to immediately dispose of unneeded data. Is there a way to retain the call to clear the ByteArray without running into errors?

 
Flag Post

how about ba = [];

 
Flag Post

What is your flash player version in IE? I’m going to take a guess and say FP 9

 
Flag Post

Originally posted by qwerber:

how about ba = [];

… ByteArray, not Array.


Originally posted by UnknownGuardian:

What is your flash player version in IE? I’m going to take a guess and say FP 9

it shouldn’t even run then, and shouldn’t compile for 9 (i use Vectors)

i can’t offer and help for the issue because i can’t think of any situation where that error is even possible =\
a workaround might be to do this:

if (!("clear" in new flash.utils.ByteArray)) flash.utils.ByteArray.prototype.clear = function():void {
this.length = 0;
this.position = 0;
}
 
Flag Post

Ah, good point. I was looking at the docs and it shows ByteArray implementation in FP9, and then clear() in FP10. Weird.

 
Flag Post
Originally posted by UnknownGuardian:

What is your flash player version in IE? I’m going to take a guess and say FP 9

It turns out that I’m actually running version 10 on IE, which is strange because I have version 11.5 running on Firefox and Chrome. Shouldn’t Flash Player have been updated on all my browsers at the same time? Anyhow, I was able to run my SWF file on my other two browsers without error. Thanks for all the help, guys.

 
Flag Post
Originally posted by Elyzius:
Originally posted by UnknownGuardian:

What is your flash player version in IE? I’m going to take a guess and say FP 9

It turns out that I’m actually running version 10 on IE, which is strange because I have version 11.5 running on Firefox and Chrome. Shouldn’t Flash Player have been updated on all my browsers at the same time? Anyhow, I was able to run my SWF file on my other two browsers without error. Thanks for all the help, guys.

Microsoft like fucking with things.
(i.e. oddly no. If any version differs, it’ll always be the one installed for IE and it will always be a lower version. Don’t ask me why, but that’s always the case).

 
Flag Post
Originally posted by Elyzius:

It turns out that I’m actually running version 10 on IE, which is strange because I have version 11.5 running on Firefox and Chrome. Shouldn’t Flash Player have been updated on all my browsers at the same time? Anyhow, I was able to run my SWF file on my other two browsers without error. Thanks for all the help, guys.

No, every browser has to update its Flash player by its own, be it IE or Chrome. It’s just Chrome autoupdates, FF manually updates, IE was plainly forgotten and does not report outdated plugins at all.

Originally posted by Draco18s:

Microsoft like fucking with things.
(i.e. oddly no. If any version differs, it’ll always be the one installed for IE and it will always be a lower version. Don’t ask me why, but that’s always the case).

I can tell you. FF checks for updates, Opera IIRC too, Chrome automatically updates (by default, likely this can be changed), IE does neither. Also IE lacks use if another browser is installed in the system, so “update flash” event likely does not trigger in the user’s brain for longer.

 
Flag Post
Originally posted by Elyzius:
Originally posted by UnknownGuardian:

What is your flash player version in IE? I’m going to take a guess and say FP 9

It turns out that I’m actually running snip IE,.

Theres your problem