Main timeline/separate movie clip timeline

I am trying to understand this by using example:
I have rectangle that i want to move from one corner of the stage to another. I will create tween for it. This will  last 48 sec(stage is set as 24fps)
Now when this animation is done (main time line) I would want this rectangle to stay at that corner and I would want separate animation (inside my movie clip for this object) to start changing colors but not moving at all.
What is the frame that i should start this separate animation that should be independant of main timeline?
Thanks

I played with it last night and I think I got it now.  I wanted to understand amnimation within animation(i think they call it nesting as well). I implemented this file as a rectangle going over image and rectangle contains some text that has its own animation.
I really appreciate your help. I think I am ok now with multiple animation but I have now another question about mask which I will ask in separate thread. Hopefully you can give me some suggestions.

Similar Messages

  • Sound from separate movie clips over laps.

    I have 4 buttons that each lead to 4 different frames with a gotoAndStop() command. Each of those frames has a movie clip on it. But for some reason the sound that I have triple checked plays from more than one movie clip. It's weird because the sound is only in the movie clips.
    Here are some pictures.
    http://rapidshare.com/files/382828989/2.png.html
    http://rapidshare.com/files/382829165/1.png.html

    And here is the project file its self.
    http://rapidshare.com/files/382874382/Project.fla.html

  • Navigate on Main Timeline using Custom .as

    OK, I'm back, and I have another issue that's bogging me down.
    The project I am working on has individual frames, each of which holds separate movie clips.  Within those movieclips are buttons which allow the user to navigate to the next frame in the main timeline.  The button objects are different in each frame, so these aren't objects that I can just put on the main timeline (some are nested within several objects)
    I want to be able to use a line like:
    myButton.addEventListener(MouseEvent.CLICK, rootnextframe);
    and not have to always then follow that up with the function declaration. I've tried just declaring the function on the main timeline, but when the script within the objects call the function, it doesn't see it.
    I have created an actionscript file that reads:
    package {
        public function rootnextframe():void {
            MovieClip(root).nextFrame();
    but I get the errors:
    Call to a possible undefined method MovieClip.
    Access of undefined property root.
    So, clearly, I'm going about this all wrong.  I feel like it's a waste to have a function that has only one line, but I can't think of any other ways to do what I'm trying to get it to do.  Anyone have any ideas?

    I have to run but here's another approach that you can take:
    In the code (probably an event listener) where you determine what frame you're on ( 3 or 6 ), dispatch a new custom bubbling event, and then listen for that event in the main timeline.
    Pseudo code:
    function nextFramePopup(event:Event)
         if (currentFrame == 3)
              //doStuff
              dispatchEvent(new Event("advanceFrame", true));
         else
              //doOtherStuff
              //popUpWindow()
    and in main timeline on frame 1
    addEventListener("advanceFrame", handleAdvanceFrame);
    function handleAdvanceFrame(event:Event):void
         //do your next frame thing here
    ts

  • Selecting a frame in a movie clip

    Hi,
    A little help is required.
    I have a movie clip, that i need to display on all frames on
    the main timeline. I have animated the movie clip on its own
    timeline. However I don't want the movie clip to play intially when
    i load the movie. I only want it to play when a button is selected.
    Can anyone please help me to get the movie clip to only play once a
    button is clicked.
    Thanks

    I have all my movies etc working so that each button plays a
    separate movie clip.
    Within each movie I have start and stops mid way through the
    movie.
    What i want to happen is, when a button is clicked once, i
    want it to play frame 2-10 then when it is clicked again I want it
    to play 11-20. How do I make it recognise its a second click. I was
    thinking of using the boolean feature, but i'm not sure how this
    would be used.
    Can anyone help point me in the right direction?

  • How do I stop a movie clip from looping

    I am using Action Script 3 and the 'stop()' function is not working to stop my movie clips from looping continuously.
    I have added the 'stop()' function to the last frame on the timeline of each movie clip.
    I originally built the .fla file in Flash CS6 using Action Script 2 where it was working with no problems (I have since upgraded and don't have access to CS6 anymore).
    I have all the separate movie clips positioned on Frame 1 of my main stage with the following script to start them playing:
    Cigarette_Reveal.play();
    KickTheHabit.play();
    BallMove.play();
    BallFlip.play();
    Offer.play();
    I want each of these movie clips to stop playing after one animation sequence is complete.
    Please help!

    Turn on strict mode in your publish settings. This will allow you to see the compiler errors that are preventing the actionscript in your fla from compiling correctly.

  • Tinting part of an animated movie clip

    Hello - I have a need to tint part of an animated movie clip. For example, I might have a movie clip that consists of 2 layers, 1 layer that is tinted, and one layer that is not tinted. The animation needs to be done by an artist - it is not an algorithmic animation.
    One way to do this is to make each layer a separate movie clip. Then I can apply a tint using the colorTransform property in ActionScript 3 on the 2nd movie clip. This works correctly but has several issues:
    It makes it extremely difficult for the artist who creates the original animation. They can't scroll through the timeline and see what the final result looks like (like they could before the layers were converted to movie clips).
    In order to drive the animation, you have to call gotoAndPlay on each sub-movie clip, instead of just once at the root level. This can cause mistakes if one movie clip's animation is slightly different than the other's.
    I've played around with a ton of ways to do this, but nothing seems to work - either the tint ends up getting lost as the movie clip plays, or the tint sticks but the animation on the movie clip disappears.
    Some examples of the types of things that would make this possible would be being able to assign a Tint setting from the the Flash IDE to an actionscript variable that I could change dynamically, being able to apply tints to layers instead of movie clips, etc. As far as I can tell, none of this is accessible in actionscript.
    Does anyone have suggestions on how I can solve this problem, either through actionscript or by changing how the original Flash .fla is set up? To reiterate - making it so the artist can easily create the animation and maintain it is a top priority.
    Thanks!

    it doesn't matter what kind of loop you use as long as it
    checks frequently enough to catch the termination condition, not
    too frequently so it wastes computing resources and terminates when
    no longer needed.

  • Grouping/ungrouping movie clips

    Hello, I am trying to figure out how to bring in a group of 4
    separate movie clips and have them behave as a single clip, and
    then allow the viewer to "ungroup" the clips so that their
    properties will be accessible individually. I can do the first
    part, it's the second part that is giving me fits. Initially, I
    want the viewer to be able to move things around on the stage. I've
    entered the attached script in frame one of my timeline.
    The script loads 4 clips, arranges them in a square, and
    allows the viewer to drag all 4 around the stage as if they were
    one clip. Clicking the release_mc instance disables the startDrag
    action, but I don't know how to add a startDrag to the other clips
    that is enabled with the same user action.

    you have to use a hitTest() for the child movieclips of
    bigBox. all mouse events will be interecepted by the parent.

  • Sync movie clips loaded by swfloader

    hi guys,
    i have 5 separate movie clips (swf) represent 5 flower petals,
    each of them is showing up from center,
    i load them in flex app by 5 separate mx:SWFLoader tags.
    the problem is they should sync with each other to open up the flower,
    but due to being loaded from network, they don't start at the same time.
    please help me, how to sync these flower petals?

    according to http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/SWFLoader.h tml
    it doesn't seem like SWFLoader has a method called "rewind()" or "gotoAndPlay(...)"?

  • Detecting Rotation Amount to Control Movie Clips

    I created a movie clip consisting of a bar and a knob.  When you click and drag the knob, the bar rotates through 360 degrees.  I want to be able to detect the degree of rotation and use that metric to control other movie clips.  The code to make the drag/rotate object work is...
    handle.knob.onPress = function(){
    handle.onMouseMove = function(){
      var angle = Math.atan2(this._parent._ymouse-this._y,this._parent._xmouse-this._x);
      this._rotation = angle*180/Math.PI;
      this.knob._rotation = -this._rotation;
      trace(angle);
      trace(angle*180/Math.PI);
    handle.onMouseUp = function(){
    if (this.onMouseMove) delete this.onMouseMove;
    I can trace the angle in radians and degrees but I don't know how to extract either value as a variable that can be used in a function to control a separate movie clip.

    assign a variable to have the value of the _rotation or angle in your onMouseMove function.   and use that variable's value wherever you like.

  • Reverse Movie Clip

    I am a beginner in flash right now and have one quick
    question. I have just made a movie clip of a 2D character walking
    to the right. Now I would like to take this character and make him
    walk to the left (saving this as a separate movie clip). Instead of
    starting all over and having to go through all the key frames I was
    wondering if there is a faster way of reversing him. In other words
    I'd like him to flip over (i know there is a way to flip him
    easily) and then walk the other way. Almost as if I reversed the
    entire movie clip except instead of walking backwards he was
    walking frontwards to the left.
    Edit: Also if anybody knows any sites that have help for
    beginners. Like a tutorial that brings you through the program
    slowly.

    I am a beginner in flash right now and have one quick
    question. I have just made a movie clip of a 2D character walking
    to the right. Now I would like to take this character and make him
    walk to the left (saving this as a separate movie clip). Instead of
    starting all over and having to go through all the key frames I was
    wondering if there is a faster way of reversing him. In other words
    I'd like him to flip over (i know there is a way to flip him
    easily) and then walk the other way. Almost as if I reversed the
    entire movie clip except instead of walking backwards he was
    walking frontwards to the left.
    Edit: Also if anybody knows any sites that have help for
    beginners. Like a tutorial that brings you through the program
    slowly.

  • Targeting movie clips

    Hello everyone,
    I've worked on some code with a little help from some people
    here and I've gotten everything to work. The problem I am having
    right now is getting my cross fading images to sit inside separate
    movie clips that are on my home .swf. The code I have so far is as
    follows:
    var showTime:Number = 5000 // milliseconds the picture shows
    at 100% alpha.
    mc_Mon1 = createEmptyMovieClip("img1_mc", 0);
    loadMovie("images/home/image01.jpg", img1_mc); // load
    picture from the file directory that your .swf is in.
    mc_Mon1 = createEmptyMovieClip("img2_mc",
    getNextHighestDepth());
    loadMovie("images/home/image02.jpg", img2_mc);// load picture
    from the file directory that your .swf is in.
    img2_mc._alpha = 0; // hide 2nd picture
    var duration:Number = 30; // milliseconds per alpha change
    (framerate).
    var count:Number = 0;
    var alphaPhase:Number = 1;
    var alphaCount:Number = 0;
    function picSwap():Void {
    count++;
    if(count >= (showTime/duration)) {
    alphaCount += alphaPhase;
    img1_mc._alpha = 100-alphaCount;
    img2_mc._alpha = alphaCount;
    trace("img1 alpha: " + img1_mc._alpha);
    trace("img2 alpha: " + img2_mc._alpha);
    if(alphaCount >= 100 || alphaCount <= 0) {
    count = 0;
    alphaPhase *= -1;
    var intervalId:Number = setInterval(picSwap, duration);
    // End of script.
    I am trying to make img1_mc and img2_mc sit inside mc_Mon1.
    So I am thinking that I would need mc_Mon1 to
    "createEmptyMovieClip" named "img1_mc and img2_mc. I thought thats
    what I did with the code but so far my cross fading images just sit
    up on the top left of the screen. Does anyone have any idea how to
    set the target movie clip to load the other movie clips?
    Thanks,
    Kyle

    hi,
    you should make few changes in your code for it to work,
    starting with this:
    instead of - "mc_Mon1 = createEmptyMovieClip("img1_mc", 0);"
    and the
    following line, try - mc_Mon1.createEmptyMovieClip("img1_mc",
    mc_Mon1.getNextHighestDepth());
    mc_Mon1.img1_mc.loadMovie("images/home/image01.jpg");
    and then -
    mc_Mon1.createEmptyMovieClip("img2_mc",
    mc_Mon1.getNextHighestDepth());
    mc_Mon1.img2_mc.loadMovie("images/home/image02.jpg");
    mc_Mon1.img2_mc._alpha = 0;
    and then in picSwap function, it should be -
    mc_Mon1.img1_mc._alpha = 100-alphaCount;
    mc_Mon1.img2_mc._alpha = alphaCount;
    that should do it i think.
    just so you'd learn, in your original code, 'mc_Mon1'
    actually is variable
    reffering to 'img1_mc' (which, if i'm not mistaken, is
    created in _level0),
    but then 2 lines later you overwrite the refference to
    'img1_mc' with a
    refference to 'img2_mc' (which is also created in _level0).
    one more thing which i didn't check - when you declare you
    'intervalId',
    don't u need to use 'showTime' instead of 'duration'?
    good luck,
    eRez
    "kypsul" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hello everyone,
    >
    > I've worked on some code with a little help from some
    people here and I've
    > gotten everything to work. The problem I am having right
    now is getting my
    > cross fading images to sit inside separate movie clips
    that are on my home
    > .swf. The code I have so far is as follows:
    >
    > var showTime:Number = 5000 // milliseconds the picture
    shows at 100%
    > alpha.
    > mc_Mon1 = createEmptyMovieClip("img1_mc", 0);
    > loadMovie("images/home/image01.jpg", img1_mc); // load
    picture from the
    > file
    > directory that your .swf is in.
    >
    > mc_Mon1 = createEmptyMovieClip("img2_mc",
    getNextHighestDepth());
    > loadMovie("images/home/image02.jpg", img2_mc);// load
    picture from the
    > file
    > directory that your .swf is in.
    >
    > img2_mc._alpha = 0; // hide 2nd picture
    >
    > var duration:Number = 30; // milliseconds per alpha
    change (framerate).
    > var count:Number = 0;
    > var alphaPhase:Number = 1;
    > var alphaCount:Number = 0;
    >
    > function picSwap():Void {
    > count++;
    > if(count >= (showTime/duration)) {
    > alphaCount += alphaPhase;
    > img1_mc._alpha = 100-alphaCount;
    > img2_mc._alpha = alphaCount;
    > trace("img1 alpha: " + img1_mc._alpha);
    > trace("img2 alpha: " + img2_mc._alpha);
    > if(alphaCount >= 100 || alphaCount <= 0) {
    > count = 0;
    > alphaPhase *= -1;
    > }
    > }
    > }
    > var intervalId:Number = setInterval(picSwap, duration);
    > // End of script.
    >
    > I am trying to make img1_mc and img2_mc sit inside
    mc_Mon1. So I am
    > thinking
    > that I would need mc_Mon1 to "createEmptyMovieClip"
    named "img1_mc and
    > img2_mc.
    > I thought thats what I did with the code but so far my
    cross fading images
    > just
    > sit up on the top left of the screen. Does anyone have
    any idea how to set
    > the
    > target movie clip to load the other movie clips?
    >
    > Thanks,
    >
    > Kyle
    >
    >

  • How do I recerence Movie Clips on the Main Timeline from inside a class?

    Hey everyone, this might be a stupid question but I thought
    I'd ask cause it's making me nuts. I'm all of 2 days into AS3
    (coming from not using Flash at all in YEARS) so feel free to
    consider me ignorant. I do have plenty of application development
    experience in other areas though.
    I can't seem to create a class that can reference an instance
    of a movie clip on my main timeline. I'd post code of what I've
    tried but I've gone through so many desperate edits & wild
    guesses that it was just garbled junk before I deleted it all.
    Basically here's how I figured Flash could work, though maybe
    it doesn't work this way at all.
    I'm assuming that with AS 3 being so big on being a true
    object oriented environment, I wouldn't need to mix my code and
    interface together. Preferably I'd be using the Flash authoring
    tools just to design my interface. Create a button... place it
    somewhere... give it an instance name. Roughly the equivilant of
    Apple's InterfaceBuilder for those of you that might be familiar
    with Cocoa development. I can see maybe having to put a few lines
    of ActionScript onto frame 1 (though really I'm hoping Flash would
    have a better method of kicking off the application at this point
    that using code tied to frames) to load my classes & such, but
    after that I'd like all of my code to be held in external class
    files.
    So maybe I've got:
    Interface.fla - My interface
    Button_1
    Button_2
    TextField_1
    Main.as - My main controller class using to handle all of my
    applications behavior
    SomeClass.as - Some helper Class
    SomeOtherClass.as - Some helper Class
    Main.as would have instructions in its initialization method
    to go ahead & attach events to buttons & initialize
    anything else that needs to happen when the application starts.
    From there on it would all be objects communicating back &
    forth. Button_1 would get clicked with would fire
    Main.someMethod(). Main.someMethod() would then do it's thing and
    set the value of TextField_1. All very clean & code is very
    separated from interface.
    Unfortunately I can't for the life of me figure out how AS3
    classes reference each other like that. There doesn't seem to be
    any kind of a global 'root' or '_root' I can use to locate any
    movie clips on the stage. I've searched the help & the web for
    any kind of simple tutorial but to no avail. My job has tasked me
    with building a flash app for a project but I'd really rather not
    have a tone of ActionScript just shoved into frame 1. That just
    seems... ugh! (::shudder::)
    Can someone maybe point me in the right direction here? I'm
    really willing to do my homework but I can't seem to locate the
    info I need to get started. Also, is there an ActionScript IRC
    channel or something maybe?
    Thanks,
    Cliff

    I worked with the problem last night and the solution I
    started coming to involved creating my own custom document class
    based off which extends MovieClip. My thought is that way I have
    access to the initialization routine of the timeline itself and
    that all of the elements on the main timeline should be
    "properties" of my custom class.
    Is this correct? Is there a down side to doing this & if
    so what is it & why?
    Also, just for my reference, the last time I did anything
    with ActionScript I think I was using '_root' to target the main
    timeline. WHat are the global variable names in AS 3? Is it just
    'root' & 'stage' or 'Root' & 'Stage' or what?

  • In actionscript 3.0 how do i make a nested movie clip button go to a frame on the main timeline

    I am making a website based in flash actionscript 3.0 i have a button nested in its own movie clip, because I have the button expanding to be able to read it i have figured out the only way to do this is by creating it as a movie clipa nd inside the movie clip creating it as a button
    I added an event listener to the blog button by saying,
    blog.addEventListener(MouseEvent.ROLL_OVER,gotoblog);
    function gotoblog(evtobj:MouseEvent){
         gotoAndStop(2)
    this part of the code works it goes to the 2nd frame of the timeline it is in and stops wich is a blown up version of the origanal symbol
    i added on frame 2 a second command
    blog.addEventListener(MouseEvent.CLICK.gotoblogpage);
    function gotoblogpage(evtobj:MouseEvent){
    gotoAndStop("blogframe")
    trace("the blog button was clicked")
    i have named the symbol blog and have name the frame of where the blog page is going to be "blogframe" this line of code at the bottom is where i run into trouble the output window in Flash is saying "The blog button was clicked" just like i want it to. no errors are accouring why than is the playhead not going to frame "blogframe"? if the button is working when i click it the code is right i belive the problem here is it does not want the playhead to go to the frame i want it to. So i gues my question is, how can i make a button withing a movie clip interact with the main timeline?

    I have a similar problem if could please help me i'd really apreciate it!!
    So i have a looping animation of some thumbnails, the hierarchy goes like this
    Scene1(main timeline) -> imgBar(MC)->imgBarB(MC within the imgBar MC)
    My buttons symbols are in the last MC "imgBarB" where i have this code:
    ss1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
      function OneButtonClicked(event:MouseEvent):void{
      MovieClip(root).gotoAndStop("ssbox1");
    I want to control the Btns in my "imgBarB" MC to play a labeled frame(named "ssbox1") on another MC on the main timeline,this other MC goes like this:
    Scene1(main timeline)->ssbox_mc(MC where my labeled frame is)

  • How to add button inside move clip and call it from main timeline?

    Hi,
    On the main timeline I  have a movie clip called clock_mc and playBtn
    playBtn is  placed in the center of clock_mc
    When you press playBtn clock_mc starts playing
    playBtn.addEventListener(MouseEvent.CLICK, playClock);
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    This is working fine for me.
    But I want to add replayBtn to the last frame of clock_mc and set up the function on main Timeline.
    Another words when the clock_mc rich last frame you see replayBtn.
    code example:
    replayBtn.addEventListener(MouseEvent.CLICK, playClock);
        if (event.target == replayBtn)
            clock_mc.play();
            replayBtn.visible = false;
            trace ("replay button was clicked");
    I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false;
    And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work
    Even when I put the button physically to the last frame of clock_mc it will not work either.
    Please help

    I've solved the problem:-)
    I've set replayBtn.visible = false; on first frame of clock_mc
    and  replayBtn.visible = true; at the last frame
    and than as you sugested I'v add:
    clock_mc.replayBtn.addEventListener(MouseEvent.CLICK, replayClock);
    function replayClock(event:MouseEvent):void
            clock_mc.play();
            trace ("replay button was clicked");
    I couldn't see replayBtn at the firs stage because I have clockTween assosiated with clock:
    clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
    and I had replyBtn in the wrong place so when clock_mc was coming up on the stage replayBtn was on the left side of the stage :/
    Now I have to solve only one thing.
    Maybe you would have any suggestions please.
    I've set up stop(); in a first frame of clock_mc
    that when you see clock_mc sliding in it has to wait for playBtn to be clicked
    because I have two tween:
            clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
            playTween = new Tween(playBtn, "x", Regular.easeOut, -720,514, .5, true);
            playBtn.visible = true;
    so when you click on playBtn:
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    everythink is working fine except when I clik on replayBtn it play for I sec because there is stop(); on the first frame of clock_mc

  • Attempt to move main timeline from inside a movie clip breaks menu buttons.

    I am attempting to have the main timeline move from a stopped position over a movie clip to frame 1, where my start menu is.
    The code I'm using does move the timeline but in doing so it somehow breaks the 4 buttons I have in frame 1.
    My code in the movie clip:
    stop()
    function replayMovie(event:MouseEvent):void
    MovieClip(parent).gotoAndStop(1);
    Menu.addEventListener(MouseEvent.CLICK, replayMovie);
    My code in frame 1 of the main timeline:
    stop();
    function bo(event:MouseEvent):void
    gotoAndPlay(21)
    SoundMixer.stopAll()
    espesp.addEventListener(MouseEvent.CLICK, bo);
    function ho(event:MouseEvent):void
    gotoAndPlay(31)
    SoundMixer.stopAll()
    espeng.addEventListener(MouseEvent.CLICK, ho);
    function yo(event:MouseEvent):void
    gotoAndPlay(41)
    SoundMixer.stopAll()
    engesp.addEventListener(MouseEvent.CLICK, yo);
    function go(event:MouseEvent):void
    gotoAndPlay(51)
    SoundMixer.stopAll()
    engeng.addEventListener(MouseEvent.CLICK, go);
    The error output when I use my Menu button at the end of the movie clip.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at SSubjunctiveProjNewgrounds_fla::MainTimeline/frame1()
    at flash.display::MovieClip/gotoAndStop()
    at SSubjunctiveProjNewgrounds_fla::Esp_5/replayMovie()
    Any help would be greatly appreciated.

    For the sake of space, I'll leave out all the package declarations and class declarations and just talk about the functions.
    First, the Game class, it has two functions.  The first one is the constructor function and it launches at the beginning of the game:  First the Game function:
    public function Game():void
    //Game code goes here
    }//Game
    We want to listen for someone to click the mouse on the MenuPage, so lets create a new MenuPage and add a listener to the button contiained within it.
    public function Game():void
    menuPage = new MenuPage;
    menuPage.startButton.addEventListener(MouseEvent.CLICK, startGame);
    addChild(menuPage);
    }//Game
    You will notice that before I declared a variable var menuPage:MenuPage, but that's all I did was declare it.  I didn't really make a new instance of it, I just set aside space for it.  In the first line within the Game function, I'm actually turning that variable into a new instance of a MenuPage.
    We don't have a picture of this imaginary menuPage instance, but lets' assume that in our MenuPage MovieClip in the library, we created a SimpleButton called startButton.  Here, I'm adding an EventListener that patiently waits for someone to click that button.  Once we receive that event, Flash is told to call the startGame function.
    As you get better at this, you'll get into custom events, and the eventListener for the button will exist in the MenuPage class file, or even in another class file that you create just for the button.  Something like StartButton.as  But for now, we can do it as above.
    Now the startGame function:
              public function startGame(evt:MouseEvent):void
    //Remove the start Page
    //Add the zombie
    //Add the gun
    }//startGame
    And we'll replace those comments with real code.  It follows along with what we just did above.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    And we also want to clean up some by removing the menuPage, and throwing out the eventListener.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    menuPage.startButton.removeEventListener(MouseEvent.Click,startGame);
    removeChild(menuPage);
    }//startGame
    Now our Game class is complete.
    The Zombie Class
    public function zombieWalk(evt:Event):void
    this.addEventListener(Event.ENTER_FRAME,zombieWalk);
    this.x = this.x + 10;
    }//zombieWalk
    Notice we've added a function to the Zombie Class.
    The first function adds an EventListener to the zombie.  We can use the word this and actionScript knows we're talking about the zombie that the class is written for.  This listener fires off every frame.  If our FLA file is set to 12fps, then 12 times every second it will call on the zombieWalk function.
    The zombie walk function moves the zombie 10 pixels to the right every time the function is called.
    On a more advanced level, you'll want to add animation in the MovieClip to move the zombie legs.  You'll also want to use Timer events to space out how often the funtion fires and not ENTER_FRAME events.  And you'll want to use a static constant to establish how far the zombie moves.  We have it now set to 10 pixels, but that can get irritating if we want to change that value later.  But again, baby steps.
    And finally, the Gun class
    public function Gun():void
    this.addEventListener(MouseEvent.CLICK, fireGun);
    }//function
    public function fireGun(evt:MouseEvent):void
    this.gotoAndPlay(2);
    }//fireGun
    First we add an EventListener for when someone clicks on the gun.  Once this happens, the listener calls on the fireGun function.
    The fireGun function takes advantage of the frames within the Gun MovieClip.  Say we have three frames in the Gun MovieClip.  The first is just a picture of the gun.  The second is the gun with a flash coming out of the nozzle.  And the third is the gun at rest again.  The line this.gotoAndPlay(2) sends the gun to the second frame with the flash graphic.
    For this to work, each frame in the Gun MovieClip has to have some stop and play commands.
    But.. you said no code on our timeline!! Liar!
    I know.  This is the exception.  You will need basic stop() commands and gotoAndPlay commands to loop animations.  Any MovieClip that has more than one frame will need something to control it.
    So our Gun MovieCLip has the following:
    Frame 1: stop();
    Frame 2: no actionScript... and I mean nothing, not even the words, "no actionScript"
    Frame 3: gotoAndStop(1);
    This will loop the gun to the beginning and wait for the next time the user clicks the gun.
    Advanced features of the Gun class might include a Bullet.as sub-class that creates a bullet MovieClip to fly across the screen.  Sound to play when the shooting takes place.  Object collision detection to see if the bullet hits the target.  And a means by which a custom event will tell the Game.as class that a zombie has been hit and it should be removed from the stage.
    As you go down the rabbit hole of ActionScript 3, you will find yourself at a point where it's just a matter of getting the syntax right for all the built in functions and classes.  Arrays, Loaders, casting variable types.. all that stuff will come.
    I hope this has been helfpul.  It's been on my to-do list for a long time.  When I first started out, no one could provide me with basic answers for how all these classes and whatnot worked.  After teaching myself AS3 for 2 years and reading a gabillion books, I think I've gotten to a point where I'm pretty comfortable with it all.

Maybe you are looking for

  • Query on app.activeDocument.exportFile

    (Apologies if this is an Illustrator scripting question rather than a CEP specific extension one) From Adobe Illustrator CC2014 HTML5 extension I am using app.activeDocument.exportFile to export the activeDocument to SVG. I have that working great bu

  • Copy Chart and Legend Together

    Hi, Just tinkering with Numbers. Can anyone advise how to copy a chart and its legend to a new app? I am copying a chart in numbers but when I paste it into Mail the chart-legend is not pasted. I have tried using Cmd to select both objects but no joy

  • Files for Website upload

    How do I format a logo to upload into a website. I have jpg files.

  • ITunes could not sync contacts because the synch server failed to synch....

    I have a laptop running Windows 7 (professional edition) 64 bit using Outlook 2010 and I get this same daggone message every time I try to synch contacts, calender, or notes (all Outlook 2010)...."iTunes could not synch contacts to the iPhone because

  • Zone Alarm 6 and iTunes Sharing

    Can anyone advise how to get iTunes music sharing to work with an XP SP2 machine running Zone alarm 6? iTunes sharing is working with 6 computers on the network, 2 Macs and 4 XP SP2 machines that do NOT use Zone Alarm, but the two machines running ZA