3

I've been working with a fairly simple animation, powered by Adobe Edge Animate, on my site for a while now. I didn't change anything to do with it for the longest time, but something's obviously happened, because now when i run the animation, i get

Uncaught TypeError: Object [object Object] has no method 'stringify' edge.2.0.0.min.js

from Chromes Console Log. I have no idea what this means, but it has something to do with the json. I'm not sure if my image is being loaded, but there's no reason it shouldn't be, since i never changed the path of it. Can somebody tell me what "Object [object Object]" is supposed to refer to?

Thanks!

P.S My animation setup is just the stage, with about 17 copies of an .svg that i use as a sprite sheet, plus some text. Every single object has animations that includes opacity, top, left, and height.

EDIT: Here's what i get when i do a console.log(JSON); ScreenShot of Console.log(JSON)

In case you can't read it:

Native.initialize
$replaceChars: function (a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16);
$specialChars: Object
decode: function (string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;
encode: function (b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]";
__proto__: Object

Update: I think i may have figured it out. In the preloader, i'm calling the dependent files with the full path, so i don't think they get called. But when i fix the path, i get that really annoying

Uncaught SyntaxError: Unexpected token < 

These files get interpreted as text/html, so now those dependent .js files are full of my html. (I'm using Sinatra, with a layout file). Here's Chromes message:

Resource interpreted as Script but transferred with MIME type text/html: "http://127.0.0.1/bird_Animations_edgeActions.js". 

This is how the preloader calls those files:

{load:"/bird_Animations_edge.js"},{load:"/bird_Animations_edgeActions.js"}. 

Now my question is: How do i get these files to be transferred as scripts?

Edit: Because i confused myself with that, the way Edge Animate works is that it gives you three .js files. One is focused on general stuff, making the object, creating the animations. The second is focused on actions, I.E clicking on an element. The third loads the previous two files, and every other files necessary for the whole page to work, plus some other stuff that i don't know. The third file is then called in the head tag of the page you want the animation to run, with a div in the body of that same page.

Cameron Meyer
  • 65
  • 1
  • 9
  • Are you sure you are including the relevant library? – Patsy Issa Aug 12 '13 at 13:09
  • It d mean that is a object but not string - "Object [object Object]" is just the way Objects are consol log – Alex Garulli Aug 12 '13 at 13:12
  • probably there s something to update - some library as mentioned? did it use to work before? – Alex Garulli Aug 12 '13 at 13:14
  • Object [object Object] could be the global var JSON. I remember JSON had such a method – tobspr Aug 12 '13 at 13:14
  • u d search if there s any update concern this file edge.2.0.0.min.js - it dn't be the JSON per se – Alex Garulli Aug 12 '13 at 13:16
  • Thanks for the fast replies! I can't check that i have the object, because it seems the object only gets made in the HTML after the stringify call. I have the JQuery Libraries off of google code, which i think is all i need. I haven't changed any names or paths for my images, only changes i've made to them is compression. – Cameron Meyer Aug 12 '13 at 13:16
  • you may find a **good explanation** on this here [link](http://stackoverflow.com/questions/8022288/why-are-my-objects-showing-up-as-object-object?lq=1) – Cody Aug 12 '13 at 13:20
  • Normally you use `JSON.stringify(someObject)` to convert an object into a valid JSON-String. Either someone has overwritten the global JSON variable or added the method to another object. Could you do an `alert(JSON)` or a `console.log(JSON)`? Could be interesting for the solution. – Fabio Poloni Aug 12 '13 at 13:21
  • 3
    @CodyDmd You just didn't answer the question, congratulations. – Fabio Poloni Aug 12 '13 at 13:22
  • 3
    I just have to know: How did you generate that screenshot? It looks like it was shot with a phone camera, printed, scanned on a flatbed, and upscaled in Photoshop. – Aaron Miller Aug 12 '13 at 14:30
  • show us the javascript includes please – TecHunter Aug 12 '13 at 14:37
  • I would also suggest to activate break on exception with chrome (hit the break button until it turns purple/fushia ). – TecHunter Aug 12 '13 at 14:54
  • @AaronMiller I used Snipping Tool,but did use Photoshop. Mad Skills with photo capturing, i know. – Cameron Meyer Aug 12 '13 at 15:06

2 Answers2

1

After so many edits, and awesome comments, i figured it out. I was using the wrong path in the preloader, which is why stringify failed, it wasn't finding any object whatsoever. Then, with the interpreted but transferred as error, it was because in my HKEY_CLASSES_ROOT\.js (regedit) the content type was set to text/html. Setting it to application/javascript fully fixed my problem. Thanks a ton for everyones help!

Cameron Meyer
  • 65
  • 1
  • 9
  • you should have just updated your original post. The big "ANNNNNNNNND" at the start of this post is a painful eyesore. – Charles D Pantoga Aug 12 '13 at 15:43
  • 2
    Sorry bout that. And i didn't want to add to my original post because this is the *hopefully* concise explanation and answer to my question(s). I'll accept this question as the answer when i'm allowed to. :/ – Cameron Meyer Aug 12 '13 at 15:50
0

I had a similar problem. The root of this error can be from a bug in Mootools. Mootools before version 1.3.2 will override JSON object. You have to use a newer version of Mootools to solve the JSON.parse and JSON.stringify problem.