开发者

Flash stop(); doesnt seem to work after exporting movieclip as SWC

i have a Flash CS 5.5 fla with a basic timeline animation. at the very last frame i put a keyframe with the only code being

stop();

nevertheless this movieclip doesnt stop at the end but loops infinitely.

the movie is exported as an SWC which is then loaded into another flash movie. however this does not call any开发者_开发知识库 functions in the movie nor does it interact with it, other than embedding it.

i have already tested this with the debug version of flashplayer to see if there are any exceptions, but no errors occur.


How are you instantiating the MovieClip? If you are using the [Embed(src...)] method I think all of your scripts will be removed. Same with embedded SWFs. Add the SWC to the build path instead.

http://www.airtightinteractive.com/2009/06/better-flash-asset-loading-using-swcs/

package
{
    import flash.display.Sprite;

    import hud.HealthBar;

    public class TestSWCLibrary extends Sprite
    {
        public function TestSWCLibrary()
        {
            var health : HealthBar = new HealthBar();
            addChild(health);
        }
    }
}


The stop(); is correct;

my guess is that you have made some mistake, for example, do you have put the stop() on the MAIN timeline and not on a MovieClip?

The output windows shows any compilation errors?


Sounds like some script is causing havoc before the stop(); is reached. Flash Player has a tendency to silently fail on some code while keep playing a timeline as if nothing happened.

One way to debug this and to find out where on your timeline the error occurs is to add additional temporary stop(); command s to your timeline. By working backwards you should be able to pinpoint on which frame the Flash Player goes into "blind" mode.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜