Working with an Movie Clip as a button.

I am creating a button with a 20 frame disolve into a page upon entry.  I want the button to play a 20 frame disolve back to it's original state when the user rolls out.  I want the movie clip to play from frame 21 to the end of the mc and then become inactive.  I can get the button to disolve out but the user will not be able to use it after that first roll over.  I was thinking of trying to add a time delay from when the first action of the rollout occurs to when the disolve is complete.  How do I include a 20 frame delay in the roll out sequence?
Here is my code so far:
//Index Button
mc_buttons.mc_index.onRollOver = function ()
    this.active = 1;
mc_buttons.mc_index.onRollOut = function ()
    this.gotoAndPlay (21);
//This is were I might include the time delay.  Any suggestions?
    this.active = 0;
mc_buttons.mc_index.onEnterFrame = function ()
    if (this.active == 1 && this._currentframe == 1)
            this.gotoAndPlay (2);
        }else if (this.active == 1){
        }else{
        this.gotoAndStop (1);
mc_buttons.mc_index.onPress = function ()
    getURL ('#');

The clip has a stop action at frame 1.  On rollover I want it to play at frame 2 until it hits the next stop action command at frame 20.  On roll out I want the clip to play at frame 21 and continue to the last frame (40) then loop back to frame one and stop.
So that the user can go back to the button after the first time I want the link to become inactive.  The frame rate is 32 fps so I only need a one second delay from the this.gotoAndPlay (21) command to the point where the link is de-activated, this.active = 0;, so that it can be activated again, this.active = 1;.
I found a line of code on another forum, setInterval(nextThing, 1000);, but it didn't work.
Any Thoughts?
Thanks

Similar Messages

  • Loading Movie Clip from a button

    Hi,
    How do I load a movie clip from a button? So far on my button
    (b1), I have this AS: and I want the button to load the movie clip
    "char1." My button already has some AS:
    b2.onRollOver = function() {
    _root.captionFN(true, "Hi!", this);
    this.onRollOut = function() {
    captionFN(false);
    How would I go about adding more script to load a movie clip
    to my button b2?
    Thanks

    Hey - Unfortunately I'm going to be in meetings for most of
    the day, so
    it'll take me a while before I can go through this in any
    detail. One thing
    that struck me though is that your two functions (captionFN
    and
    hoverCaption) are in the main1_mc not on the main timeline.
    Then the
    buttons are calling _root.captionFN(); which refers to the
    main timeline.
    I would expect that they should be calling
    _root.main1_mc.captionFN(),
    because that is the path to where the function is. Does that
    make any
    sense?
    One thing that I do when I'm writing code is to always keep
    all functions on
    the main timeline. That way you are sure that they are being
    registered
    (i.e. if you call a function before the playhead reaches
    where that function
    is written, the function won't work. If the function is in
    the first frame
    of the main timeline, you know that the playhead has reached
    it). What you
    might want to do is to move all your functions to the very
    first frame of
    your movie. Then you can call them with the path:
    _root.myFunction() and
    you are sure that they will be found.
    Maybe give that a try and let me know if it helps. In the
    meantime, I'll
    try to go through your code, but like I said, today's a bit
    of a gong show
    for me.
    Sorry - I don't mean to just sluff you off or anything.
    Cheers,
    Brock
    "respondplease" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi Brock,
    >
    > Thanks again, your sample file really helps but I'm
    still having problems.
    > What it boils down to is that my buttons don't fully
    function properly. It
    > works correctly sometimes, but not consistently enough.
    So if I fast
    > forward
    > too much or rewind and then FF, the buttons aren't
    either isn't clickable
    > or
    > the hover text and caption box doesn't show up, etc.
    This usually happens
    > when
    > I press FF too many times or too fast. But regardless of
    how many times I
    > press
    > FF I would like my buttons to work
    >
    > Your sample file is very useful but unlike mine I have
    perhaps too many
    > MC's
    > w/in MC's, etc. I will try to clarify my setup in hopes
    of finding a
    > (better)
    > solution to my problems. My main timeline has my "prev",
    "next", and
    > "pause"
    > buttons which also has the actionscript for my NEXT
    BUTTON, PREV BUTTONS.
    > And
    > now I've added your SHOW BUTTONs function as well. I've
    minorly modified
    > your
    > showButtons function adding a couple of more lines and
    actually deleting
    > the
    > _root because I found that it doesn't work sometimes.
    Anyhoo, here it my
    > entire
    > code in one frame on my main timeline:
    >
    > // ===== NEXT BUTTON ===== \\
    > next.onPress = function() {
    > _root.screen.showButtons();
    > _root.createEmptyMovieClip("controller_mc", 1);
    > controller_mc.onEnterFrame = function() {
    > _root.screen.gotoAndPlay(_root.screen._currentframe+10);
    > if
    (_root.screen._currentframe+10>_root.screen._totalframes) {
    > _root.screen.gotoAndStop(_root.screen._totalframes);
    > }
    > };
    > };
    > next.onRelease = function() {
    > controller_mc.removeMovieClip();
    > _root.screen.showButtons();
    > };
    > next.onReleaseOutside = function() {
    > controller_mc.removeMovieClip();
    > _root.screen.showButtons();
    > };
    >
    > // ===== REWIND BUTTON ===== \\
    > prev.onPress = function() {
    > _root.createEmptyMovieClip("controller_mc", 1);
    > controller_mc.onEnterFrame = function() {
    > _root.screen.gotoAndStop(_root.screen._currentframe-10);
    > if (_root.screen._currentframe-10<1) {
    > _root.gotoAndStop("screen");
    > }
    > };
    > };
    > prev.onRelease = function() {
    > controller_mc.removeMovieClip();
    > };
    > prev.onReleaseOutside = function() {
    > controller_mc.removeMovieClip();
    > };
    > // ===== SHOW BUTTONS ===== \\
    > function showButtons() {
    > for (i=1; i<=6; i++) {
    > _root["b"+i]._visible = true;
    > _root["char"+i].removeMovieClip();
    > chars._visible = true;
    > cap.desc._visible = true;
    > cap._visible = true;
    > }
    > }
    > Still from my main timeline, my main1_mc is called from
    the frame labeled
    > "screen." My main1_mc has the b1 - b6 buttons which has
    the HOVER CAPTIONS
    > and
    > HIDE BUTTONS FUNCTION coding. And each button calls each
    movie clip ie.
    > char1_mc, char2_mc, etc. Here's all my code on one frame
    (in my main1_mc):
    > // ===== HOVER CAPTIONS =====
    > b1.onRollOver = function() {
    > _root.captionFN(true, "pick me!", this);
    > //display the function (true) or to hide the function
    (false)
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char1_mc", "char1",
    _root.getNextHighestDepth(),
    > {_x:595,
    > _y:345}); //this attaches movie to the _root timeline,
    and renames it to
    > "char1".
    >
    > _root.char1.swapDepths(_root.cursor_mc);
    > //swaps the depth that the cursor is on and the new
    movieClip is on. So
    > the
    > cursor will stay on top.
    > };
    > };
    > b2.onRollOver = function() {
    > _root.captionFN(true, "Hi!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char2_mc", "char2",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b3.onRollOver = function() {
    > _root.captionFN(true, "Get Jac'd Up!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char3_mc", "char3",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b4.onRollOver = function() {
    > _root.captionFN(true, "Boo!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char4_mc", "char4",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b5.onRollOver = function() {
    > _root.captionFN(true, "I'll be your guide", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char5_mc", "char5",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b6.onRollOver = function() {
    > _root.captionFN(true, "Welcome!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char6_mc", "char6",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > _root.captionFN = function(showCaption, captionText,
    bName) {
    > if (showCaption) {
    > createEmptyMovieClip("hoverCaption",
    this.getNextHighestDepth());
    > cap.desc.text = captionText;
    > // cap._width = 7*cap.desc.text.length;
    > cap._alpha = 75;
    > if ((bName._width+bName._x+cap._width)>Stage.width) {
    > xo = -2-cap._width;
    > yo = -17;
    > } else {
    > xo = 2;
    > yo = -17;
    > }
    > hoverCaption.onEnterFrame = function() {
    > cap._x = _xmouse+xo;
    > cap._y = _ymouse+yo;
    > cap._visible = true;
    > };
    > } else {
    > delete hoverCaption.onEnterFrame;
    > cap._visible = false;
    > }
    > };
    > // ===== END OF HOVER CAPTION ===== \\
    >
    > // ===== HIDE BUTTONS FUNCTION ===== \\
    > function hideButtons() {
    > for (i=1; i<=6; i++) {
    > this["b"+i]._visible = false;
    > }
    > chars._visible = false;
    > cap.desc._visible = false;
    > }
    > Sorry for copying and pasting all my code - I know it
    must be annoying,
    > but I
    > can't seem to find what's wrong. Again, ANY help would
    be greatly
    > appreciated.
    > Thanks for your patience. Your talent is very much
    appreciated and I'm
    > very
    > grateful for all your help.
    >
    > Kindest regards
    >

  • Working with converted .mov files in Premiere Elements 2

    I recently got a digital camera that records .mov clips with H.264 technology. I use it for back up when Im having problems with my regular camcorder. Of course I can work with these .mov files in QuickTime Pro with no problem. But in order to work with them in Premiere Elements 2, it appears I have to export it into the .avi format first. After exporting in QuickTime Pro, when I bring the new .avi file up into Premiere Elements, the color quality is retained, but much of the resolution is lost. Its very pixelated. I understand that .avi and .mov work differently in the way information is stored avi in chunks and mov in streams, but Im wondering if there is a way I can work around this. The reason why I got QuickTime Pro initially was to be able to convert my finished .avi videos made in Premiere Elements 2 into MPEG-4 files using the H.264 codec for better quality. And Im doing that all the time now with no problem. So I am wondering if when I reconvert the .mov clip thats been converted into .avi back into mpeg-4, will the resolution be restored? That is part of my question. The other part is regarding the initial conversion process. Are there settings in QuickTime Pro for converting .mov to .avi with as little loss in resolution as possible? The manual doesnt address this issue specifically. Any ideas or suggestions? OS is Windows XP Media Center edition, computer Sony Vaio dual processor. Thanks, Judy

    Hi again Steve. I'm so embarrassed. After my initial reply to your message I went to the Adobe site to see if they even made Premiere for Mac and learned they don't. I also read a review in Wired that says Premiere 6 is just as good if not better than iMovie which they say has actually been downgraded. I'm using Premiere 2, so I thought I might consider upgrading. Then I watched "Steve's Story" and realized it was you. (Your daughter is a cutie! Adobe must love you.) So my question is this: Would my problem be solved by simply upgrading to Premiere 4? If I do that, would it be compatible with regard to catalog integration with Photoshop Elements 4 or would I have to upgrade to Elements 6? If I upgraded the whole package would my current Photoshop Elements 4 catalog transfer with all tags intact? This is vital for me to know because I rely on them heavily. I realize that I would be skipping a version in the upgrade. Is that possible? Does that matter? Please read my reply to Bill because it explains why I want to use those particular .mov files. Another question for you. I use your excellent book a lot. If I upgrade will it become useless? Finally, since you're the expert, let me tell you what I'm really aiming for and get your advice. I need to start composing my own musical soundtracks to my videos. I want to do it as I'm viewing the timeline. Therefore, I know I need to invest in a midi-capable keyboard or controller and software. The problem is that there are few controllers compatible with Windows XP Media Center Edition. I am told I would need to disable the XP Media Center registry keys for anything to work which wouldn't matter because I don't use Media Center features anyway (like TV hookup, media player, etc.). But messing with the registry sounds a little complex and dangerous to me. There's got to be an easier way. Do you have any advice or recommendations? Can you point me to any helpful resources? Now you see why I want a Mac? Everyone says all this kind of stuff would be so much easier with a Mac. Problem is I have a limited budget and would like to make the most with what I have. I hope I haven't overtaxed you with my questions. Thanks for your patience! Judy

  • HT5105 How can you do picture in picture when you are working with a Multicam clip?

    How can you do picture in picture when you are working with a Multicam clip?

    Im doing a drumming music video and with the multi cam clip all the angles are nicely sync'd top the audio.
    Problem is if i want to have 3 angles on top of the main shot, im gonna have to re-sync them all to get them to line up manually. If i could use the multi cam clip they will already be aligned
    Thanks for trying to help appreciate, hoping someone has some multiclip knowledge and will be able to tell me if yay or nay.

  • IPod touch 5 is charged. Won't turn on. Plugged into computer with two different cords. They both work with my iPad. My home button is also jammed. Please help!

    I used my iPod yesterday, and it was charged. I put it on the floor, and took it into my room before I went to bed. I wanted to check what I missed while I wasn't using it, but it was "off". I put it on the charger, and it should've been charged up by morning. It still didn't turn on. I tried plugging it into my iMac, but nothing happens when I plugo in my iPod, but works with my iPad. My home button is also jammed, and I've tried to get it To work again, but I've had no luck.
    Is there something I can do to turn my iPod on again?

    Try:                                               
    - iOS: Not responding or does not turn on           
    Ignore the reset and when it says place the iPod in recovery mode
    Place the iPod in recovery mode using one of these programs:
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    or
    http://joshuabailey1997.wordpress.com/2010/09/02/recboot-v1-3/
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    and                                          
    RecBoot tip
    RecBoot may have problems on 64X windows, then try:       
    Tenorshare ReiBoot – Enter & Exit iPhone, iPad, iPod Recovery Mode with a Single Click
    For MAC or PC       
    The Firmware Umbrella - TinyUmbrella
    Installs blootware on PC too
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable              
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • HT3290 Will my Sony Handycam DCR-SR68 work with I-Movie

    Will My Sony Handycam DCR-SR68 work with I-movie for downloading video? I was able to get the photos I had on it to download onto I-Photo, But I want the video to download also, so I can edit them and burn to a DVD. Please Help, this is driving me nuts!!!

    According to the iMovie Supported Cameras List, your camera should work with iMovie 11.
    http://help.apple.com/imovie/cameras/en/index.html?lang=en_US
    You would need to connect the camera via USB, and the camera would need to be plugged in to AC power (not batteries only). Then use FILE/IMPORT FROM CAMERA. The camera probably needs to be put in Playback mode, but some cameras need to be in PC Attach mode. Check your manual.

  • Buttons with nested movies clips...

    Hi guys
    I'm a flash newb. Have just read some tutorials on creating
    flash buttons that contain nested movie clips for the different
    states. So I went and made 5 of them for my site, all seems great
    the rollover effects are just as planned, and I thought I could add
    URL link to them in Dreamweaver but thats not working out. Been
    googling my *** off to add URL via actionscript (of which I
    understand VERY little) , found some code (add the following to key
    frame :on(release) {
    getURL('
    http://www.generic.com',
    '_parent');
    Major problem is, when I try to add AS to the frame/button,
    I'm getting told I 'current selection cannot have actions applied
    to it' If I persist and add the script anyway, funnily enough it
    doesn't work.
    I did an experimental button, consisting of diff coloured
    boxes, and AS will apply to that no problem.
    I'm tearing my hair out, as I already posted the flash links
    on my site and have had to add a note for visitors to use static
    links in the interim.
    I would love to post the .fla file but I don't see an option
    anywhere here to do so.
    If some wise soul can help my dumb *** out of this bind it
    would be greatly appreciated.

    You were using AS2 code, which will not work in AS3. That
    particular code is placed on an object, which AS3 does not allow
    for, which is why it wouldn't let you... all code in AS3 goes into
    timeline frames.
    For mouse interctive objects (buttons, movieclips, etc) you
    assign event listeners to the object. Let's say your button has an
    instance name of "btn", here's a variety of the possible event
    listeners avaiable, and I've assigned them to the button....
    btn.addEventListener(MouseEvent.CLICK, clickHandler);
    btn.addEventListener(MouseEvent.DOUBLE_CLICK,
    doubleClickHandler);
    btn.addEventListener(MouseEvent.MOUSE_DOWN,
    mouseDownHandler);
    btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
    btn.addEventListener(MouseEvent.MOUSE_OVER,
    mouseOverHandler);
    btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    btn.addEventListener(MouseEvent.MOUSE_WHEEL,
    mouseWheelHandler);
    All of those "...Handler" things at the end are the names of
    functions you create to take action when the listener hears
    something it's assigned for... you can name them anything you want,
    and here's and example of how the function might look for the CLICK
    event...
    function clickHandler(event:MouseEvent):void {
    trace("clickHandler");
    Again, you can name the function anything you want, and the
    code within the function can be whatever you need done when the
    button is clicked... just be sure to include the argument
    "event:MouseEvent" because the listeners throws an argument to the
    function and the function needs to expect it. The "event" part of
    that is a variable name, so you can name it whatever you like, such
    as "e", which is commonly done. The MouseEvent defines the class,
    and should be exactly what it is.... a MouseEvent, caps and
    all.

  • Movie Clip Button not working within an Movie Clip

    Hi,
    I'm trying to create a movie clip on my my main timeline that has a movie clip button within it that pops up a box in the middle of the site that contains text and links. On Frame 1 I have the Up state, frame 2 the roll over state, and frame 3 my Down State (where Box appears).
    on (rollOut) {
        this.gotoAndStop("1");
    on (rollOver) {
        this.gotoAndStop("2");
    on (release) {
        this.gotoAndStop("3");
    I have stop(); on each of the 3 keyframes
    The problem is that on the main time line, the button is clickable but doesnt do anything
    Any suggestions, what am i missing?
    Cheers

    Ok, i have this assigned to a movieclip, is this wrong? Especially for MovieClip Buttons. Anyway, just tried this and it works!
    on (rollOut) {
        this._parent.gotoAndPlay(1);
    on (rollOver) {
        this._parent.gotoAndPlay(2);
    on (release) {
        this._parent.gotoAndPlay(3);

  • 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.

  • Multiple movie clips within a button

    I'm having trouble with working a movie clip played one after another within a button. Can anybody help? or is there a simpler way of getting multiple movie clips to play?
    for my project, when you hover over the button and vines grow out. currently, i have one working in a button but i can't seem to get other vines to work.

    use a movieclip (or sprite) button.  you can then control the child movieclips with actionscript.

  • Newbie:  Help with Interactive Movie Clips

    I'm just starting off with Indesign and am already running into an issue on a seemingly simple issue.  I'm trying to create an interactive document that I will play movie clips when exported to pdf.  Ok so far so good.  I've inserted one movie and started to play around.
    1st issue - The only option I can get to actually play the movie when clicked is when the pdf export option for compatibility is set to 'Acrobat 5 (PDF 1.4)'
                     How come no newer options work?  Using Acrobat reader 9 by the way and tried to toggle options such as 'embedding' the movie.
                     No luck with playing on any setting except 'Acrobat 5 (PDF 1.4)'
    2nd Issue - Inside the movie options dialog box for this clip, there is an option for a poster that I can 'choose movie frame' as poster.  The dialog box       comes up and is completely empth with no video controls or anything.  What the deal with this.
    I'm just starting out and I know I'm not totally incompetant but I'm not very pleased with what I'm seeing right now.
    Any help or suggestions would be very much appreciated.
    Thanks,
    Don

    Here is some help for starter.
    For embedding, do that in InDesign. I think you know the movie will only play in the PDF.
    If you export to PDF 1.3/1.4•Non-RGB movie or sound posters aren’t visible in the exported PDF document.
    •SWF and MPEG movies aren’t playable in the exported PDF document.
    •Clipping paths applied to movie or sound posters don’t appear in the exported PDF document. Posters are resized to match the movie page item.
    •Movies cannot be embedded.•Sounds cannot be linked.
    If you export to PDF 1.5 or laterQuickTime is specified as the preferred player when exporting to PDF. To change the preferred player, you must edit the rendition in Acrobat 6.0 or later.
    If you export to any PDF version•Non-rectangular media frames don’t appear in the exported PDF document.
    •Hyperlinks applied to movies, sounds, or buttons are not active in the exported PDF document. However, you can add those hyperlinks using Acrobat Professional.
    •Rotated or sheared movies and posters may not appear correctly in the exported PDF document.
    •Any masking applied to movie frames or posters is not supported.

  • Tooltips not working inside Embedded Movie Clip but works on main stage

    Hey,
    I  have a movie clip that is a navigation window and I am trying to have some tooltip hover over the buttons inside the navigation window.
    If I create a button on the main stage it hovers and works fine but if I create the same clip inside the embedded navigation window the tooltip does not show up.  I do not have any error messages but it is not there that I can see.
    Any ideas?
    Thanks!

    Even you place your mc within another clip for example NavWindowMC:
    Write the code in the maintimeline as
    import fl.transitions.easing.*;
    import fl.transitions.*;
    NavWindowMC.mc.addEventListener("mouseOver", mouseRollOver);
    NavWindowMC.mc.addEventListener("mouseOut", mouseRollOut);
    NavWindowMC.mc.addEventListener("mouseMove", mouseMove1);
    var tooltip:Tooltip = new Tooltip();
    tooltip.txt.text = "Design";
    tooltip.x = stage.mouseX;
    tooltip.y = stage.mouseY - NavWindowMC.mc.height;
    function mouseRollOver(e:MouseEvent):void {
        addChild(tooltip);
        var myTween:Tween = new Tween(tooltip, "alpha", Regular.easeIn, 0, 1, 0.5, true);
    function mouseRollOut(e:MouseEvent):void {
        removeChild(tooltip);
    function mouseMove1(e:MouseEvent):void {
        tooltip.x = stage.mouseX;
        tooltip.y = stage.mouseY - NavWindowMC.mc.height;

  • Playing Movie clip backward using buttons?

    Im trying to create a series of images that scroll acoss the page left and right using arrows at either side of the stage. The arrows use mouse over events to play a movie clip of the images foward and backward.
    There are a few issues I am having. I have a mouse over and mouse out events in place to start and stop the clip on to different buttons. However when playing the clip backward with my current script the mouse out doesnt do anything so the clip just keeps playing backward to the beggining. Once this has happened neither button then does anything.
    Another issue is once the clip has played foward once in total and I mouse over the same arrow button again it flicks back to the begginging of the clip.
    Here is my current scrpit:
    panel.stop();
    leftarrow_btn.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_7);
    leftarrow_btn.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_4);
    function fl_MouseOverHandler_7(event:MouseEvent):void
              panel.play();
    function fl_MouseOutHandler_4(event:MouseEvent):void
              panel.stop();
    rightarrow_btn.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_9);
    rightarrow_btn.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_7);
    function fl_MouseOverHandler_9(event:MouseEvent):void
       panel.addEventListener(Event.ENTER_FRAME, everyFrame);
    function everyFrame(event:Event):void
              panel.prevFrame();
    function fl_MouseOutHandler_7(event:MouseEvent):void
              panel.stop();
    Please Help!!
    Patrick

    use:
    panel.stop();
    leftarrow_btn.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_7);
    leftarrow_btn.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_4);
    function fl_MouseOverHandler_7(event:MouseEvent):void
              panel.play();
    function fl_MouseOutHandler_4(event:MouseEvent):void
              panel.stop();
    rightarrow_btn.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_9);
    rightarrow_btn.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_7);
    function fl_MouseOverHandler_9(event:MouseEvent):void
       panel.addEventListener(Event.ENTER_FRAME, everyFrame);
    function everyFrame(event:Event):void
              panel.prevFrame();
    function fl_MouseOutHandler_7(event:MouseEvent):void
    panel.removeEventListener(Event.ENTER_FRAME,everyFrame);

  • Playlists don't work with separate audio clips

    I have a timeline with 8 different clips and chapter playlists set up to play each clip individually and to play them in pairs.  This works fine.
    But when I add audio to the timeline it goes wrong. I have 8 different audio clips that match up with the video clips.  If I view the timeline itself, everything is OK.  If I view the first clip's playlist (with the first audio clip) it also works OK.  But if I view any of the other playlists, the DVD (and previewer) return me back to the menu as soon as the audio track starts (this is the end action). If I delete any of the audio tracks, the playlists for those videos work fine again.
    I also see similar behaviour on another timeline where a second audio clip starts midway: the chapter immediately before the new audio track is skipped in a playlist and the DVD plays the subsequent chapter (there are many chapters on that timeline).
    The only solution I've come up with is to burn a DVD with no audio, rip the video, line up the audio tracks I want to use with the video, export them all in one big file and then add that single clip into Encore.  It's not really something I want to do, to be honest.
    Is there any explanation for this strange behaviour, or is it another bug?
    Thanks for any help or pointers towards sorting this out.

    I'm with Neil on the 8 separate Timelines. There are pitfalls to grouping multiple Clips onto one Timeline, and even an Audio Unit's difference in Duration can cause issues.
    If you do go with the discrete Timelines workflow, you'll just do Playlists, and not Chapter Playlists instead.
    Good luck,
    Hunt

  • How to use classes with the Movie Clips

    Hi guys!I have a movie clip called teacher.It's assigned to a class called teacher.It has a location(room).I have multiple rooms and so i want the teacher to be only visible in the room it's at.I have  two buttons for each room.The problem is the teacher doesn't disappear when it's in the playroom.
    package  {
              import flash.display.MovieClip;
              public class teacher extends MovieClip {
                        var room:String;
                        room="classroom";
                        this.croom=croom;
                        public function teacher() {
                                  var teacher:teacher=new teacher();
                        if(teacher.room!==croom){
                                  teacher.visible=false;
                        if (teacher.room==croom){
                                  teacher.visible=true;
    clroom.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
              croom = "classroom";
              classroom.visible = true;
              playroom.visible = false;
    btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
              croom = "playroom";
              classroom.visible = false;
              playroom.visible = true;

    Where is all of the code you just showed?
    Only a portion of it is a class file's code, and of that class file's code, only a portion of it is valid.  The paret where you have the conditional checking the treacher's roon is not incorporated proerly... it needs to be inside some function of the class. 

Maybe you are looking for

  • AfterEffects CC crashes on Startup

    Yesterday AE was working mostly fine; every hour or so it would crash. I'd start it up and it would work for another hour. This morning it was working fine for 5 minutes; I imported a .mov file and added it to the timeline and crash. Now it opens the

  • Should I put my computer in sleep mode instead of just closing the lid?

    I want to ensure that I am not increasing the liklihood of malfunction my simply closing the lid.

  • Deletion Flag setting Error message for production order

    "Unprocessed future change recs for orders prevent del. flag/completion" I tried to used COFC and CO1P but didn't work out? How to fix this issue i am trying to set deletion flags for certain production orders? If i even found errors in final confirm

  • PowerView cannot connect to SSAS Database

    This will be latest problem with Power View that I will probably get no help with but you never know... SharePoint 2013 SQL Server 2012 SP1 I have reporting services and power view set up in SharePoint. I can create a data connection in SharePoint an

  • Sync does not work with psd layer files

    My sync with cloud does not work. I also can not downoad or upload PSD files with Layers Message was edited by: KlausJoseph