Highlighted

HTML5 canvas not working on PHP files

Explorer ,
Apr 14, 2019

Copy link to clipboard

Copied

I have a problem when I change an animate canvas file from html to php so it doesn't start up. In the Chrome browser, I get this message in the console:
Failed to load resource: the server responded with a status of 404 (Not Found)
Uncaught ReferenceError: AdobeAn is not defined
at init (index.php:33)
at onload (index.php:105)
Failed to load resource: the server responded with a status of 404 (Not Found)

Inside the init function I get this marked with red text was comp = AdobeAn.getComposition ("89ED7AB5C946D849B35B1594202278DE")

With Microsoft's Edge browser, I get this message in the console: SCRIPT5009: SCRIPT5009: 'AdobeAn' is not defined index.php (33,2)

What is it due to? I want the canvas in the php file.

Now it works. I had the Swedish letter ö in the name of the .js file where the animation is located. Now it's solved.

Views

708

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

HTML5 canvas not working on PHP files

Explorer ,
Apr 14, 2019

Copy link to clipboard

Copied

I have a problem when I change an animate canvas file from html to php so it doesn't start up. In the Chrome browser, I get this message in the console:
Failed to load resource: the server responded with a status of 404 (Not Found)
Uncaught ReferenceError: AdobeAn is not defined
at init (index.php:33)
at onload (index.php:105)
Failed to load resource: the server responded with a status of 404 (Not Found)

Inside the init function I get this marked with red text was comp = AdobeAn.getComposition ("89ED7AB5C946D849B35B1594202278DE")

With Microsoft's Edge browser, I get this message in the console: SCRIPT5009: SCRIPT5009: 'AdobeAn' is not defined index.php (33,2)

What is it due to? I want the canvas in the php file.

Now it works. I had the Swedish letter ö in the name of the .js file where the animation is located. Now it's solved.

Views

709

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 14, 2019 0
Adobe Community Professional ,
Apr 14, 2019

Copy link to clipboard

Copied

It shouldn't have anything to do with PHP.

Are you sure all the CreateJS and specific Animate project JS is being included? No 404s in the developer tools Network panel?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2019 0
Explorer ,
Apr 14, 2019

Copy link to clipboard

Copied

Yes it is included <script src = "https://code.createjs.com/createjs-2015.11.26.min.js"> </script> in index.php when I use plain html so it works but not on PHP files. I wonder why it doesn't work. What does 404 mean?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2019 0
Advocate ,
Apr 15, 2019

Copy link to clipboard

Copied

peor  wrote

I wonder why it doesn't work. What does 404 mean?

404 Not Found
The requested resource could not be found but may be available in the future.
(List of HTTP status codes)
It means, that something couldn't be found on the server. I guess it's the index.js file linked in index.php. (depending what you did in Animate's Publish Settings the js-file might be named differently). Let's say it's index.js = it will be linked in index.php like this (line 02):

<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>

<script src="index.js"></script>

If this can't be found then AdobeAn is in no way defined and the process runs into more trouble in around line 33 with:

var comp=AdobeAn.getComposition("89ED7AB5C946D849B35B1594202278DE");

There you've got this Error:

Uncaught ReferenceError: AdobeAn is not defined

at init (index.php:33)

This error:

at onload (index.php:105)
Failed to load resource: the server responded with a status of 404 (Not Found)

is related to this line (02) in your index.php:

</head>

<body onload="init();" style="margin:0px;">

In the init() function the malaise with var comp=AdobeAn.getComposition(..); is going wrong.

Check if links and filenames are okay throughout, correct them if necessary and the problem should disappear. I don't think it has anything to do with your renaming your main document to *.php.

-Klaus

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2019 0
Explorer ,
Apr 15, 2019

Copy link to clipboard

Copied

Now it works. I had the Swedish letter ö in the name of the .js file where the animation is located. Now it's solved.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2019 1