Hello Guest

Author Topic: tk2dAnimatedSprite is not a valid type  (Read 4451 times)

chadibanez

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
tk2dAnimatedSprite is not a valid type
« 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

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


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dAnimatedSprite is not a valid type
« Reply #1 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

chadibanez

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: tk2dAnimatedSprite is not a valid type
« Reply #2 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