AS3 Error: 1046: Type was not found or was not a compile-time constant
File under Adobe Flash 9 / Action Script 3 (AS3) Errors
Error Message: 1046: Type was not found or was not a compile-time constant: caseStudyLink.
The Problem: I was getting this error message when trying to tween a MovieClip on the stage. Flash was telling me that the error message was coming from one of my package files – in this case, it was a custom class that I was using to extend the parent MovieClip. It is notable that this class had no direct mention of the object I was trying to tween.
Everything was running smoothly until I added an instance name to the existing MovieClip.
The Cause: I can’t say for sure why, but for some reason Flash was unable to find the object I was referring to, even though it was indeed in the Library and had the proper class name filled in.
The Solution: I duplicated the offending MovieClip in the Library, then used the “swap” button in the properties pane to swap the parent object in every keyframe that the instance was being used. Presto – problem went away.
Go figure.


October 27th, 2008 at 7:45 am
I had the same problem and it was driving me nuts! it’s a very wierd bug, but your solution works… problem solved! tks
November 28th, 2008 at 5:41 am
I had the same problem for only ONE out of 6 clips in my library, and it happened to be one for which I had mistakenly given a Linkage name identical to the instance name. So Flash was looking for a class that did not exist… I duplicated it but let flash decide the linkage name(flash does create its own class for linked objects, unless you specify one) And then I swapped as you did, and indeed the error (one of the 100s we now get in as3 which makes prior 5 minute tasks last a whole weekend) was gone.
October 15th, 2009 at 10:13 pm
Oh god I swear i just wanna punch Adobe square in the face!
(Fucking Ass holes)
bless you for this answer Eddie!
February 19th, 2010 at 10:58 pm
Thanks!
April 16th, 2010 at 9:04 am
Thank you, it helped me. :)
April 21st, 2010 at 10:51 pm
Thanks for posting that solution. I ended up changing instance name after exporting and the prob went away. But your post got me thinking in that direction.
May 1st, 2010 at 11:22 pm
Thanks so much. I’m regretting so much that I ever thought to use Flash for my class project. I hope Steve Jobs kills it :P
May 31st, 2010 at 5:41 pm
Man, I had the same problem and it bothered me to no end.
Thanks a lot!
Also, mine seemed to start working if I just leave the instance name blank.
September 3rd, 2010 at 11:03 am
This didn’t work for me! ive been having the problem that no matter the code (i ended up copy and pasting a simple code) it would give me that error. so when i saw this i thought it was going to work but i tried it and it didn’t work! and my instance names and everything are right. anything you can do to help?
September 27th, 2010 at 3:13 am
Thanks a lot!!!
September 29th, 2010 at 10:59 am
I was getting the error when I tried to publish it in CS5. I solved the problem by going back to CS3.
October 4th, 2010 at 2:18 pm
Wow I was starting to get all frustrated here and then I found your post and my problem is solved now. THANK YOU!!!
(I hate these stupid bugs and glitches between versions)
>=(
My favorite version will always be Flash 9 when the actionscript was flawless and servant, before this chaos began.
October 5th, 2010 at 5:06 am
hey man,very big thanks,ur solution worked as well ;)
November 25th, 2010 at 7:07 am
The instance name and Linkage name should not be same, it’s working now and the problem is resolved. Thanks a lot, whoever post the idea.:-)
February 14th, 2011 at 8:09 pm
I had this problem. I wonder if it was because I converted some symbols to movieclips? anyone else do that?
May 24th, 2011 at 8:16 pm
I had same problem and I fixed it the way you say. Thanks!!!
Then I compared the file that I had and the new duplicated file. The deference is: first file has AS linkage in its property.
Instead of duplication go to the properties for your object in the library (caseStudyLink in your example) and uncheck “Access for Actionscript”.
September 19th, 2011 at 5:15 am
I had the exactly same problem and fixed it like this:
I was using TLF TextFields in the same FLA, which seemed to cause the problem. I just converted TLF TextFields to Classic Text and there we go, issue’s workaround.
It also helps to just rename the affected instances of the MovieClips on stage. In my previous try to get this bug fixed without having to duplicate and swap, I added an underscore as prefix for the instance names so the linkage identifier/class name was not the instance name on stage.
Two solutions where you dont have to do the nasty duplicate/swap procedure.
Cheers,
Jan
November 2nd, 2011 at 5:29 am
Hi, I discovered I had the instance name named the same as the name of the movieclip in the “export for actionscript” box in the MC properties. The convert to symbol prompter automatically removes the appendix MC.
So the simpler solution to this problem is to go into the movieclip properties and change the export for actionscript name to something that is not a duplicate.