新手到flash,actionscript编译错误

时间:2023-02-13 15:27:58

I'm adding a small .swf object (XSPF Web Music Player) to a site I'm working on. I need to add two lines of code to make external javascript calls, so, I guess I need to re-compile to actionscript (please forgive me, I'm extremely new to flash). I'm using MTASC to compile at the command line. I'm getting errors at the start of the file, pretty much at the first thing not-commented. The .as file is posted here http://pastebin.com/f3c4a4a03 and it produces an error(characters 0-4 : parse error Unexpected stop ) at stop. As I'm new to flash, is there anything you guys see in there which would make it break at stop()? or any other pointers at all?

我正在向我正在处理的网站添加一个小的.swf对象(XSPF Web音乐播放器)。我需要添加两行代码来进行外部javascript调用,所以,我想我需要重新编译为actionscript(请原谅我,我是非常新的flash)。我正在使用MTASC在命令行进行编译。我在文件开头遇到错误,几乎没有评论过。 .as文件发布在http://pastebin.com/f3c4a4a03,它会在停止时产生错误(字符0-4:解析错误意外停止)。因为我是flash的新手,你们在那里看到的任何东西都会让它在stop()中突破吗?或任何其他指针?

2 个解决方案

#1


The fla file is what you need to open and compile in the flash environment (IDE) to get that code compile successfully . The code was originally written for Actionscript 2 but Actionscript 3.0 has a different structure than that. The solution, if you can grab an Adobe flash IDE to compile the file . that will solve the problem

fla文件是您在Flash环境(IDE)中打开和编译所需的文件,以便成功编译代码。该代码最初是为Actionscript 2编写的,但Actionscript 3.0的结构与此不同。解决方案,如果您可以获取Adobe Flash IDE来编译该文件。这将解决问题

#2


Just went through the file and it is very clear that you have some syntax error in the code. Is there any reason why you are using MTASC? . You can actually complie this in Flash 9 , using a nice IDE called FlashDevelop (windows only).

刚刚浏览了文件,很明显你的代码中有一些语法错误。您使用MTASC有什么理由吗? 。实际上你可以在Flash 9中使用一个名为FlashDevelop的精简IDE(仅限Windows)来编译它。

Are you sure you copied the file correctly? . the stop(); function on works on objects called MovieClips in flash , and that file does not extend the object, so thats why you are getting that error message.

您确定要正确复制文件吗? 。停止();函数on对Flash中名为MovieClip的对象进行处理,并且该文件不会扩展该对象,因此这就是您收到该错误消息的原因。

#1


The fla file is what you need to open and compile in the flash environment (IDE) to get that code compile successfully . The code was originally written for Actionscript 2 but Actionscript 3.0 has a different structure than that. The solution, if you can grab an Adobe flash IDE to compile the file . that will solve the problem

fla文件是您在Flash环境(IDE)中打开和编译所需的文件,以便成功编译代码。该代码最初是为Actionscript 2编写的,但Actionscript 3.0的结构与此不同。解决方案,如果您可以获取Adobe Flash IDE来编译该文件。这将解决问题

#2


Just went through the file and it is very clear that you have some syntax error in the code. Is there any reason why you are using MTASC? . You can actually complie this in Flash 9 , using a nice IDE called FlashDevelop (windows only).

刚刚浏览了文件,很明显你的代码中有一些语法错误。您使用MTASC有什么理由吗? 。实际上你可以在Flash 9中使用一个名为FlashDevelop的精简IDE(仅限Windows)来编译它。

Are you sure you copied the file correctly? . the stop(); function on works on objects called MovieClips in flash , and that file does not extend the object, so thats why you are getting that error message.

您确定要正确复制文件吗? 。停止();函数on对Flash中名为MovieClip的对象进行处理,并且该文件不会扩展该对象,因此这就是您收到该错误消息的原因。