2D Toolkit Forum

2D Toolkit => Support => Topic started by: chadibanez on August 24, 2013, 11:25:51 pm

Title: tk2dAnimatedSprite is not a valid type
Post by: chadibanez on August 24, 2013, 11:25:51 pm
I keep getting the error message (The name 'tk2dSpriteAnimator' does not denote a valid type ('not found')) when trying to access the animation methods from a Javascript file.

I found the solution that was posted here:

http://forum.unity3d.com/threads/93287-2D-Toolkit-2D-in-Unity-made-simple-RELEASED/page16 (http://forum.unity3d.com/threads/93287-2D-Toolkit-2D-in-Unity-made-simple-RELEASED/page16)

but could not get this solution to work (file structure is different? Getting different "not found" errors).

I am instantiating the class at the top of my file:

Code: [Select]
// Link to the animated sprite
private var anim : tk2dSpriteAnimator;

// This script must be attached to the sprite to work.
anim = GetComponent(tk2dSpriteAnimator);

and attempting to access the "Play" method, but the reported error is preventing the code from compiling.

Any help would be greatly appreciated.

-CL

Title: Re: tk2dAnimatedSprite is not a valid type
Post by: unikronsoftware on August 25, 2013, 10:16:30 am
1. What version of 2D Toolkit are you running? tk2dSpriteAnimator is only available in 2.x. You can check the version number from the 2D Toolkit > About menu.

2. Have you run "Setup for JS"? http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,33.0.html
Title: Re: tk2dAnimatedSprite is not a valid type
Post by: chadibanez on August 26, 2013, 08:30:49 pm
I used the "Setup for JS" on version 2.1 and it works like a charm.  Thanks for the quick response and automating the js integration process!

-CL