Question

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.

Était-ce utile?

La solution

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!

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top