ceyesuma -4 Posting Pro

Could someone describe the elements of my class especially items associated with

//private var contentMC:SomeClass=null;

I would like to stop the animation when the player opens and I think I have the concepts confused.
How would I set the .fla up to do so.
Thanks
-Steve

Dani AI

Generated

Hi — short answer first: stop the MovieClip timeline you want to freeze (main timeline or a child clip) from your document class or from frame code. If you plan to use a class to control the FLA, export the symbol with an ActionScript class name or give the instance on stage an instance name, set the FLA's Document class, and call stop() on the appropriate MovieClip once the class is initialized.

A minimal document-class pattern you can adapt:

package {
    import flash.display.MovieClip;
    import flash.events.Event;

    public class Main extends MovieClip {
        private var contentClip:ContentSymbol;

        public function Main() {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            stop(); // stop the main timeline
            // if an instance named "content_mc" is on the stage:
            // content_mc.stop();
            // or if you create the symbol in code:
            // contentClip = new ContentSymbol();
            // addChild(contentClip);
            // contentClip.stop();
        }
    }
}

Notes: stop() only affects timeline playback. Tweens or code-driven animations must be stopped through their APIs or by removing their event listeners. If you use "Export in first frame" for library symbols and a preloader, handle that checkbox carefully. See the MovieClip reference for details: MovieClip class reference.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.