Jump to content
GreenSock

ashleebeggs

EaselPlugin not working b/c of caching

Go to solution Solved by Carl,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi I am trying to use your EaselPlugin, however no matter what I try I cannot tween filters b/c I get an error that the object needs to be cached. Specifically "Uncaught EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. [object HTMLCanvasElement]" in Chrome. I tried out your sample code in the docs, and I get the same error, even tried using EaselJS's sample code and adding a filter tween on mouse over, with the same error. I'm pretty sure I loaded all the correct scripts.

 

Can you help me figure out why it's not caching even when cache is there?!

See the Pen OPbNjz?editors=101 by ashleebeggs (@ashleebeggs) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Thank you for providing the demo.

 

I copied the code from the docs and added it to this pen: http://codepen.io/GreenSock/pen/XJNder?editors=001

 

Seems you were not loading the EaselPlugin and I think there were some other errors too but I didn't have time to hunt them down. 

Feel free to fork the demo I provided.

 

Happy Tweening!

  • Like 2
Link to comment
Share on other sites

Thanks for the response! One more question, can the EaselPlugin work on images too? Would I have to put an image into a canvas element? Thanks

Link to comment
Share on other sites

  • Solution

Thanks again for the demo.

 

Nothing wrong with your code.

The problem is that browsers can not read or write pixel data on images loaded from different domains. 

I took your code an made sure the html and image were both coming from the same domain.

 

Look here: http://greensock.com/temp/easel-bitmap/

 

Attached is a zip. You can run the files in FireFox locally, but note that webkit browsers will still give you problems

http://stackoverflow.com/questions/27707100/load-a-local-bitmap-over-file-in-easeljs

http://gskinner.com/blog/archives/2012/03/disable-local-security-errors-in-chrome.html

 

As long as  your files are running on a webserver and being loaded from the same domain, you should have no problem as shown in my link above.

 

 

easel-bitmap.zip

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×