Copy link to clipboard
Copied
I purchased a flash website template on template monsters.com and it was created in Flash CS5 however I own CS6. It has been working find and has been online for over a month now. Today I went to add some updates and republish and it gave me the compiler error 1046: Type was not found or was not a compile-time constant: Main.
Now my flash movie is not working. Not sure what is going on or how to fix this. I am not an experienced user of flash or actionscript 3.0
Help please!
Julie
Copy link to clipboard
Copied
The short answer is that whatever you changed caused the error. Is this template in AS2 or AS3? What change or changes did you make? Does the error message point to a specific frame or line of code?
Copy link to clipboard
Copied
I made a change to the xml file not the fla file. However I did download the file off my server and opened it in cs6. Would something have happened when it converted it from a cs5 file to cs6?
Copy link to clipboard
Copied
It looks like another error has come up. It said that I had actionscript 1.0 code in the file and the components were removed. It is asking me to covert all 1.0 code/components to 3.0. the compiler errors are related to the following code for "Main"
var program:Main = new Main(MovieClip(root));
addChild(program);
Copy link to clipboard
Copied
The code in your second reply is AS2. Main should be an object in the movie's Library. It will be a movieClip and it will be set to export for Actionscript and its export name will be Main. Its Library name will, most likely, be something different.
What does the xml file reference? Is it a list of external text or sound or image or video files that are imported at runtime?
Copy link to clipboard
Copied
I tried looking for the movieClip to export called Main and I can't find it. I did get an error that stated code would be lost because the Flash Pro I am using does not support actionscript 1.0 anymore. Do you think this is what happened?
Copy link to clipboard
Copied
Yes, but Flash CS6 should be able to work with Actionscript 1,2 and 3. If you are attempting to edit AS1 or 2, in Flash or Animate CC, then you will have a problem.
If you only need to edit the xml then you should be able to do that and use the new xml in your existing Flash file without editing the Flash file. Or do you need to change the Flash file as well as the xml file?
Copy link to clipboard
Copied
I did not change the flash file at all, just downloaded it from the server and it gave me the warning about the actionscript 1.0 code/components that were deleted when opening the file in CS6. The only thing I changed was the xml file to add text and replace the mp3 sound file with a new one.
Copy link to clipboard
Copied
there are/were no actionscript 1 components. components were introduced with macromedia flash 5, not cs6. they were called smart cliips, not components, back then and they could have been used in your fla.
also, one of the first problems you're likely to encounter is that template was created using case-insensitive code. ie, the template is so old the author could have (and probably did) write sloppy code like
var main = new Main(_root);
instead of
var main = new main(_root);
or vice-versa.
you should be able to search your library for Main using the library's search field
the search field is case-insensitve so searching for Main will also find main (and MAIN and the other 13 variants).
note:there may be no such object in your library. but, if that's the case, there will be (or should be) a file named Main.as (or main.as etc) in the class path of your fla. if that's been lost because you moved your fla from the directory where it was extracted (after downloading from monster.com), recheck that extract-directory or re-extract the files downloaded from monster. and even is you have an object in your library with a usable name, you may still need the class file (Main.as etc).
p.s. in my experience all flash templates are terrible. this is an excerpt from Flash Game Development: In a Social, Mobile and 3D World​ in a chapter about writing problematic code:
Spreading code across more than one frame of a timeline and especially in more than one timeline is a time-wasting mess and strongly discouraged. Anyone who has ever worked on a Flash file with significant bits of code spread over more than one timeline more than a few weeks after creating that code understands the incredible amount of time that can be wasted looking for pertinent code.
The worst offenders that I have seen (and I have seen hundreds of problematic Flash projects), in the highly competitive worst Flash coding derby, are templates sold by websites like http://www.entheosweb.com/. Do not be fooled into thinking you can get a head-start on a project by starting with a web template offered for sale. There may be some well-coded templates sold online but I have never seen one.
Copy link to clipboard
Copied
Do you have the .swf Flash file or just the .fla Flash file? If you have the .swf file then your should be able to edit the .xml and then just use it with the existing .swf.
I haven't used AS1 in many, many, years, so i don't remember much about AS1 components, or even if they existed at all. In any case there must be something in the code of the .fla that is incompatible with the CS6 version of Flash.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now