This site is optimised for Firefox 2.0 or Internet Explorer 7.

1046: Type was not found or was not a compile-time constant:

rsebeck has no avatar
rsebeck
 
Post Count: 22
Joined: Sat Aug 05, 2006 5:48 pm
Location: Los ANgeles

1046: Type was not found or was not a compile-time constant:

Postby rsebeck on Tue Jan 22, 2008 2:55 pm

Sorry if this has already been addressed, but I douldn't find anything when I tried to search.

I am getting an "1046: Type was not found or was not a compile-time constant: TweenListObj.

User avatar
hamferus
Contributing Member
 
Post Count: 537
Joined: Thu Mar 30, 2006 8:37 pm
Location: Zagreb - Croatia
Flash Version: Adobe Flash CS4

Re: 1046: Type was not found or was not a compile-time constant:

Postby hamferus on Tue Jan 22, 2008 3:05 pm

You have to import TweenListObj class.

rsebeck has no avatar
rsebeck
 
Post Count: 22
Joined: Sat Aug 05, 2006 5:48 pm
Location: Los ANgeles

Re: 1046: Type was not found or was not a compile-time constant:

Postby rsebeck on Wed Jan 23, 2008 7:33 pm

Okay so I'm thinking something off with my Flash setup - perhaps my ActionScript 3 folders. I tried a different tutorial (DocumentClass) and I get his error:

1046: Type was not found or was not a compile-time constant: TimerEvent.

User avatar
hamferus
Contributing Member
 
Post Count: 537
Joined: Thu Mar 30, 2006 8:37 pm
Location: Zagreb - Croatia
Flash Version: Adobe Flash CS4

Re: 1046: Type was not found or was not a compile-time constant:

Postby hamferus on Wed Jan 23, 2008 11:32 pm

Did oyu import TimerEvent class inside document class? Can you post some code?

User avatar
restlessdesign
Moderator
 
Post Count: 2241
Joined: Mon Apr 10, 2006 12:04 am
Location: NYC
Flash Version: Adobe Flash CS3

Re: 1046: Type was not found or was not a compile-time constant:

Postby restlessdesign on Thu Jan 24, 2008 2:59 am

Any class you use you have to import.
Image

rsebeck has no avatar
rsebeck
 
Post Count: 22
Joined: Sat Aug 05, 2006 5:48 pm
Location: Los ANgeles

Re: 1046: Type was not found or was not a compile-time constant:

Postby rsebeck on Fri Jan 25, 2008 1:33 pm

It's not saying that it can't load the tweener class. The error is comming from the java script line. I am following the "Tweener" tutorial. My code is only this:


Code: Select all
import org.caurina.transitions.*;

Tweener.addTween(air, {x:340, y:300, time: 1});


and the error is:

Tweener.as, Line 1014 1046: Type was not found or was not a compile-time constant: TweenListObj.

rsebeck has no avatar
rsebeck
 
Post Count: 22
Joined: Sat Aug 05, 2006 5:48 pm
Location: Los ANgeles

Re: 1046: Type was not found or was not a compile-time constant:

Postby rsebeck on Fri Jan 25, 2008 1:55 pm

I found the solution. I was clicking the export for actionscript button on my movie clip's linkage properties. Does actionscript 3 not need this?

ThomasNorden has no avatar
ThomasNorden
 
Post Count: 7
Joined: Fri Feb 29, 2008 12:46 pm

Re: 1046: Type was not found or was not a compile-time constant:

Postby ThomasNorden on Fri Feb 29, 2008 1:04 pm

Hey there, I am fairly new to AS3 and this is my first post on this forum...

I just followed Lees tut on the tweener class, but I get the 1046 error. I have not checked any export for actionscript button as rsebeck first did, but I still get the error.

Code: Select all
import com.caurina.transitions.*;

Tweener.addTween(air, {x:400, y:300});


Any ideas ideas what might be wrong?

/Actionscrpiterwannabe

ThomasNorden has no avatar
ThomasNorden
 
Post Count: 7
Joined: Fri Feb 29, 2008 12:46 pm

Re: 1046: Type was not found or was not a compile-time constant:

Postby ThomasNorden on Fri Feb 29, 2008 1:30 pm

I found a solution to this odd problem

Instead of having my classpath poing to actionscript/ and then import com.caurina.transitions.*, I changed my classpath to actionscript/com and then only imported caurina.transitions.*

/Thomas

User avatar
hamferus
Contributing Member
 
Post Count: 537
Joined: Thu Mar 30, 2006 8:37 pm
Location: Zagreb - Croatia
Flash Version: Adobe Flash CS4

Re: 1046: Type was not found or was not a compile-time constant:

Postby hamferus on Fri Feb 29, 2008 1:54 pm

ThomasNorden wrote:I found a solution to this odd problem

Instead of having my classpath poing to actionscript/ and then import com.caurina.transitions.*, I changed my classpath to actionscript/com and then only imported caurina.transitions.*

/Thomas

You did not have to change actionscript classpath. You only needed to change import line.

you have
Code: Select all
import com.caurina.transitions.*

and it should be
Code: Select all
import caurina.transitions.*


And ofcourse caourina folder should be in actionscript/ folder not inside actionscript/com folder.

Lennart has no avatar
Lennart
 
Post Count: 1
Joined: Mon Mar 03, 2008 11:32 am

Re: 1046: Type was not found or was not a compile-time constant:

Postby Lennart on Mon Mar 03, 2008 11:49 am

Hi,

I think I found a explanation for your fix.

The Tweener class package name is:
Code: Select all
package caurina.transitions {

  ....

   public class Tweener {

      .....


Package names are references to the directory structure in which they exsist. Your folder structure should thus always match the package name (in this case caurina.transitions). So if you have set your general class folder at actionscript/ and you have put all tweener files in org.caurina.transitions you will generally get an error. The solution is to either change all package names, change your default folder or change the location of your tweener files. In other words you need to match folder structure with package name.

I'm just a noob all the way. So correct me if 'm wrong.

bye.

Obi Wan has no avatar
Obi Wan
 
Post Count: 18
Joined: Wed Feb 20, 2008 11:23 pm

Re: 1046: Type was not found or was not a compile-time constant:

Postby Obi Wan on Sun Apr 13, 2008 8:32 pm

Great that did it. I was having the same problem.

ThomasNorden wrote:I found a solution to this odd problem

Instead of having my classpath poing to actionscript/ and then import com.caurina.transitions.*, I changed my classpath to actionscript/com and then only imported caurina.transitions.*

/Thomas

Obi Wan has no avatar
Obi Wan
 
Post Count: 18
Joined: Wed Feb 20, 2008 11:23 pm

Re: 1046: Type was not found or was not a compile-time constant:

Postby Obi Wan on Sun Apr 13, 2008 8:39 pm

Thanks everyone by changing the path it did the trick.

import caurina.transitions.*;
Tweener.addTween (globalNav, { x:79, y:770, time:1});

ericcarl has no avatar
ericcarl
 
Post Count: 8
Joined: Fri May 02, 2008 3:53 am
Location: Los Angeles, CA

Re: 1046: Type was not found or was not a compile-time constant:

Postby ericcarl on Fri May 02, 2008 4:09 am

I am having this same problem, but none of the advice in this thread seems to be working for me. I am following this tutorial:

http://www.gotoandlearn.com/player.php?id=45

I don't understand it, everything seems like it should be perfect. This is my AS code:

Code: Select all
import caurina.transitions.*;

Tweener.addTween(air, {x:400, y:300});


The folder structure where my classes are stored is this (on a mac):

Applications > Adobe Flash CS3 > Configuration > ActionScript 3.0 > Classes > caurina > transitions > (.as file list)

In the Flash preferences, my AS3 class paths are listed as so:

.
$(AppConfig)/ActionScript 3.0/Classes

Yet when I run the movie, I get this:

1046: Type was not found or was not a compile-time constant


And I get it from 12 different lines in Tweener.as. What is going on?? Thanks for any help!

User avatar
nebutch
Site Admin
 
Post Count: 3395
Joined: Wed Apr 05, 2006 12:36 am
Location: Earth, Milky Way
Flash Version: Adobe Flash CS4

Re: 1046: Type was not found or was not a compile-time constant:

Postby nebutch on Fri May 02, 2008 6:05 pm

@ericcarl

As you have described everything, you should have no problems. You might want to try clearing your ASO cache (Control > Delete ASO Files) and then testing your movie.

If that doesn't do it, you should post all of your code (if there's more), and the entire error message. You could also try changing the location of the caurina files and adding a classpath to Flash (which is what most developers do anyway).

Also, if the errors are targeting the caurina files, then you might want to try re-downloading the files and replacing them in your classpath. (and make sure you have the latest stable or svn version)
Trust me, I know what I'm doing...

Image

Did this post help? If so, please consider a donation! Just click the "Donate" link at the top-right of this page.

Next

Return to Actionscript 3.0

Who is online

Users browsing this forum: Kirone and 4 guests