开发者

Why would an swf break when changing its export version from Flash 6 to 7?

开发者 https://www.devze.com 2023-01-26 02:59 出处:网络
I need to make a small modification to an existing Flash library (Fusion Charts Free) written in AS1 with Flash 6 as its publish version.My change uses ExternalInterface, which requires Flash 8, so I

I need to make a small modification to an existing Flash library (Fusion Charts Free) written in AS1 with Flash 6 as its publish version. My change uses ExternalInterface, which requires Flash 8, so I opened Publish Settings and changed the version to 8. No other changes were made.

Now the swf loads, but encounters some error part-way through its operation. If I change the publish version back to 6, it works again. Changing it to 7 breaks it. My questions:

  1. Is there a complete list of changes between Flash 6 and 7 that affect existing AS1 code?

  2. Is there any way to get real debugging output from an swf, to determine what has happened? It's frustrating that there doesn't seem to be any sort of log or console whatsoever. I've seen a few solutions that involve using ExternalInterface to log to Firebug or such, but obviously that isn't useful to me, given that my whole problem centers around exporti开发者_如何学运维ng to Flash 8.


the externalInterface is probably not the reason for errors.. i tested myself to ensure.. (with flash8 + AS1).

1) maybe you accidentally selected AS2 instead.. 2) the error is while compiling? or during it's running? 3) the error happens when you run it from the application? or as standalone? (when it's standalone the ExternalInterface might raise an exception because there's no "external interface". 4) what's the error? 5) try to put "try" block on the ExternalInterface part if the error is not while compiling.. 6) if the error is while its running, then you have a debugger.. just press Ctrl+Shift+Enter


Having completed this project, I'll share my experience. Virtually all incompatibilities fell into three categories, described in this very useful article:

  1. Flash 7 variables names are case-sensitive, so xPos and xpos are now separate variables and can't be used interchangeably. You would never do this anyway, if you were writing good code, but if you're trying to port some third-party code, as I was, this is the #1 problem to look out for.

  2. Undefined variable values have changed. In Flash 6, numbers were initialized to zero and strings were empty. In Flash 7, a number is NaN and a string is undefined.

  3. String boolean equivalents are different. In Flash 6, empty strings, or strings other than "1" evaluate to false. In Flash 7, a string with any contents evaluates to true; only empty strings evaluate to false.

0

精彩评论

暂无评论...
验证码 换一张
取 消