Same button on single frame to display/hide movie clip?

Hi, can a button on a single frame be coded to both display a movie clip on its first click and, after a second click, hide the movie clip?  Thanks

Yes, assuming you make the movieclip invisible to start with, in the event handler function just use...
mc_name.visible = !mc_name.visible;

Similar Messages

  • Mouse over HTML link causes single frame to display at top of page Netscape only

    Having a wierd problem. When you run the mouse over HTML
    links on the page a single frame of the flash movie apears at the
    top center of the page. It only happens in netscape in firefox
    mode. IE, Opera, and Firefox do not have the problem.
    Problem site
    Thanks in Advance,
    Vorsch

    The problem goes away if i modify my .css file by removing
    the
    border: 1px solid #999999;
    line from the "a:hover" style.
    I ran my css file thru the validator at w3c and its fine. The
    Page also validates as xhtml transitional.
    and just a note the same file version is on my public server
    and my testing server.
    Has anyone ever seen this before?? I have several sites with
    a:hover effects and flass media and have never run across this
    before.

  • Going Back to the main frame, from inside a movie clip time line.

    In flash CS5 I want to go back to the main time line, from inside a movie clip button, so when i click the the movie clip it goes to another frame on the main time line..
    Can anyone help me?
    Thanks
    Daniel Derrick

    your can use _root to reference the main timeline from anywhere though that can lead to problems if your swf is loaded by another swf.  because of that eventuality, it would be better to use a relative path back to the main timeline.
    so, from a movieclip's timeline (when the movieclip is on the main timeline), you can use _parent to reference the main timeline.
    but even better would be to use no code on that movieclip's timeline and keep all your code on one timeline (the main one).

  • How do I make all buttons on stage unclickable, while a certain movie clip is visible?

    Hi,
    I have a button on stage which opens a popup (movie clip is popup + several other buttons). The movie clip and the buttons on it take up most of the stage.
    The problem is that the buttons which are on the stage, and are behind the movie clip, remain clickable (you can click through the movie clip!). How may I disable this?
    Basically, I need to make it that you cannot click through the movie clip.
    Thanks in advance!
    PS I am using CS5 and AS2.

    One way would be to make the movieclip clickable.  That would make it block the other objects behind it...
         mc.onRelease = function(){ }
         mc.useHandCursor = false; // to hide the hand cursor
    Another way would be to disable the buttons while the movieclip is present...
         btn.enabled = false;
    Another way would be to build conditional code into the button clicking code to not work if the movieclip is visible.
         btn.onRelease = function(){
              if(!mc._visible){
                    // okay to do stuff

  • 3 same buttons & 3 different frames, but each frame must have it's own actionscript?

    Here is my issue. I have 3 frames and 3 buttons. Each button takes you to their respected frame. However, I noticed that I cannot have 1 key frame of actionsript read the same on those 3 frames. Why? because if I jump from frame 1 to frame 2 or 3, then I cannot jump back. Instead, each frame has to have it's own actionscript. The only thing that would change is the method name. I find it tedious. Is that how  it is? This almost felt seem like it would be less tedious but even for 3 frames, I have to change each method name as I build more frames to navigate to. Check my example below:
    Old Actionscript (1 keyframe for 3 frames did not work to jump back any frame)
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame1);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame2);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame3);
    function handlerFrame1(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame2(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame3(event:MouseEvent):void {
    gotoAndStop("frame3");
    New Actionscript (3 keyframes and this works):
    Frame 1
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame1);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame2);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame3);
    function handlerFrame1(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame2(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame3(event:MouseEvent):void {
    gotoAndStop("frame3");
    Frame 2
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame4);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame5);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame6);
    function handlerFrame4(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame5(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame6(event:MouseEvent):void {
    gotoAndStop("frame3");
    Frame 3
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame7);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame8);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame9);
    function handlerFrame7(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame8(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame9(event:MouseEvent):void {
    gotoAndStop("frame3");

    You should not need to have code in all three frames.  The first bit of code you show should suffice under normal circumstances.  If you have the code on a layer that has only one keyframe and the buttons on a layer that only has one keyframe, then the buttons will remain working.  It is only when you create new instances (keyframes) of the buttons that you need to assign new event listeners for them, but even then the same event handler functions can be shared for all of them as long as that actions layer extends the length needed for all the buttons.

  • Hide Movie Clip

    i have 50 movic clip (box 10px by 10px) in my flash with the
    instance name is "test_mc" (all 50 MC same name of instance)
    then i write this code
    this.createEmptyMovieClip("test_mc", 0);
    test_mc._visible = false; // try to hide the movie clip
    but when i publish the file only single (1) MC is hide, why
    is happan
    here is i want to hide all my 50 movieclip at a time
    can anybody modify tish code or give me new code for tha

    give each instance an incrementing name
    for(i=1; i<=50; i++){
    this.createEmptyMovieClip("test_mc"+i,
    this.getNextHighestDepth());
    this["test_mc"+i]._visible = false;

  • How can I display a Movie clip from library on stage in AS3?

    Hi,
    I have a movie clip in my library and I would like to display it on the stage using AS3.
    do I have to define it as a variable?Do  I need to use this code:  addchild(movieclip);
    can I use the 'x' and 'y' to position it?
    What would the code look like?
    Ben.

    Great! it works  well ! thanks
    But I have another question, if I wanted to used the same movie clip but postion it at different x and y positions when a different btn is selected how could I do that?
    Would I have to make a copy of the movie clip and give it a different name?
    or is there an better way around it?
    Ben.

  • Button no longer works when inside a Movie Clip?

    Again I turn to the almighty Adobe forums for help...
    So basically, I've had this problem for over a day now, and I've posted on Experts-Exchange.com... to no avail really.
    So here we go:
    I have a button in a Flash project I've made. It's used to jump to another place on the root timeline, labelled "Why". It used to work perfectly.
    I have now placed the button inside a movie clip (it has to be in an animated sequence), but now it no longer works. It appears to work fine, the rollover state works and all. But when clicked it does nothing.
    The code I use to work the buttons goes on the main timeline, the code for this button is:
    mc_anim_backdrops_menu.btn_subsection1.onRelease = function() {
    gotoAndStop("Why");
    _global.swfloaded = "";
    Why does it no longer work? and what can I do to fix it?
    The question is posted here over at Experts Exchange - http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Act ionScript/Q_24888850.html
    what we've tried there is tracing the problem. The code seems to be pointing to the right place, but none of the actual function works.. as you'll be able to see if you open up the attached file (and change it's extension from .txt to .fla to get it working)
    So would someone be able to open it up, have a look and tell me what's wrong? Because I'm stumped. And frustrated.

    My guess is that you have a scope problem. By putting the button inside a movieclip you have made the buttons scope the same as that clip.
    So if you add a trace inside the release event handler, what do you get?
    trace("My current scope is: "+this);
    I'm guessing it is "_level0.mc_anim_backdrops_menu," right?
    So since you are using the global function of gotoAndPlay() it is looking for that label in the current timeline and not finding it.
    You should probably use the MovieClip method and specifiy which timeline it should look in.
    _root.gotoAndPlay("Why");
    _level0.gotoAndPlay("Why")
    _parent.gotoAndPlay("Why");
    both would probably work. I would never use the first two, other than to make sure that there wasn't something else going on...

  • HitArea hide movie clip

    Im trying to hide a clip on when one clips collide with
    another using hit Tes and also hitArea, both of them doesnt
    work....
    I write the following code:
    onClipEvent (enterFrame) {
    if (_root.guardia, hitTest(_root.quienes)) {
    hide == true;
    } else {
    hide == false;
    Is something there i mess?
    best,
    IN

    ok im understanding
    "guardia" is the instance name of the mc also is a layer on
    scene 1
    "quienes" is the instance name of the mc that is inside a
    mouse over buttom that is on scene 1
    the action (the code) is inside frame 1 that is in other
    layer on scene 1
    I try these as you said:
    onClipEvent (enterFrame) {
    if (_root.guardia.hitTest(_root.quienes)) {
    guardia.hide =true;
    } else {
    guardia.hide =false;
    but still doesnt work
    in

  • Hide movie clip of external swf

    Hi there.
    I have my main.swf and in the second frame i load an external swf called first.swf with this method:
    [AS]var loader:MovieClipLoader = new MovieClipLoader();
    this.createEmptyMovieClip("myGalleryContainerproducts",5);
    myGalleryContainerproducts._lockroot=true;
    loader.loadClip("first.swf",myGalleryContainerproducts);
    myGalleryContainerproducts._y =86;
    myGalleryContainerproducts._x =50;
    [/AS]
    In first.swf i have two movie clips with instance names ena and dyo
    I want in main.swf in the third frame to hide these movie clips of first.swf  (only the movie clips not the whole .swf) or to move them (change x and y values) so they practically hide.
    Any solutions?
    Thank you in advance

    You will need to wait until the file is loaded to be able to interact with it, so if that might be an issue timing-wise then look into using the addListener method of the MovieClipLoader class.  If the movie is loaded you should be able to access the movieclips within it using the movieclip name you assigned (mygalleryContainerproducts) to target them.

  • Auto hide (movie clip) task bar

    How do I make a auto hide task bar (which is a movie clip)?
    auto hide bar similar to windows task bar, when move mouse to
    bottom of screen, the task bar come up, else task bar auto hide.
    http://www.oniva.com/upload/1356/hide.jpg
    I try to set code in movie clip (task bar) but don't work
    well
    =====================
    on (rollOver)
    _root.top._x = 400;
    _root.top._y = 220;
    on (rollOut){
    _root.top._x = 400;
    _root.top._y = 150;
    }

    just found here is the trick
    ==========
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    function tweenY(mc, newLoc) {
    var myTween = new Tween(mc, "_y", Strong.easeOut, mc._y,
    newLoc, 0.5, true);
    var mouseListener = new Object();
    mouseListener.onMouseMove = function() {
    if (_ymouse > 394) {
    tweenY(taskBar, 360);
    } else if (_ymouse < 360 &&
    !taskBar.hitTest(_xmouse, _ymouse, true)) {
    tweenY(taskBar, 400);
    Mouse.addListener(mouseListener);

  • How do I export a single frame from a QT movie?

    WHY in the world does this seem sooooo difficult to do?

    Select the frame you want by using the scrubbing bar.
    Hold down the command key and then click the c key (copy).
    Switch to the Preview app and choose "New From Clipboard" and save the image.

  • How do I convert 5 frames into a nested movie clip?

    I have animated a buttefly flapping it's wings, now I want to make it fly using 'motion tweens'. what do I do?

    To convert the frames into a movieclip, create a movieclip symbol, copy the frames, and paste them into the timeline of the movieclip.
    To create motion tweens, you need to have the same symbol at both ends of the tween, so if these 5 frames contain the same symbol, just in different orientations, then you just need to add the motion tween to each keyframe except the last.

  • Movieclip display different movie clip

    I have 2 movieclips in different places in my movie called
    movieclipA and movieclipB. Is there a way to tell movieclipB to
    display what's in movieclipA

    MovieclipA contains dynamic text fields, MovieclipB contains
    Input text fields. When the user enters text into the textfields in
    movieclipB the text appears in movieclipA. I need to show another
    instance of movieclipA at another place in my movie. The problem is
    the tex that is input into the textfields in movieclipB only shows
    up in one instance of movieclipA. I need it to show in both
    instances.

  • Controlling frame rates of loaded movie clips

    Is it possible to control the playback rate of movie clips
    that are loaded with a Loader() call?

    …that which we call a rose by any other name would
    smell as sweet.
    With AS3 it seems that we shouldn't get as hung up on names
    as we have been in the past. From my brief experiments, I don't
    think it is that the loader is dynamically creating a movie, but
    that the timeline of the external clip is an instance of MovieClip.
    And it is "time-line" placed by definition. When I trace the
    this.name from my external movie it traces "root1" by itself, but
    when loaded into something else it gets that "instance" name.
    You can name your loader and just access its content property
    (cast as a MovieClip).

Maybe you are looking for

  • "No Signal" on Samsung HDTV

    I am trying to connect my Samsung LN52B750 HDTV to my Macbook Air. I have monoprice's mini-DVI to HDMI cable. "SAMSUNG" appears as a display choice on the Mac, with different resolutions and mirroring options, but nothing I have done has been able to

  • Macbook pro as [MacBook Pro Blank Screen ] with voided Warranty ?

    I have the same issue as told in this post. MacBook Pro Blank Screen (Built - in & External) However, I have manually replace my HDD to another. Since my HDD die before and want a bigger one. And I think my warranty have voided. So does it include in

  • A verticle red line suddenly has appeared on my monitor

    I was lookiing at a video on Youtube and tried to upload it. It didn't. But, suddenly now I have a verticle red line on my monitor which i cannot get rid of. Anyone out there have an idea what could be wrong? thanks.

  • XML Publisher V/S Report builder

    Hi, Could someone please tell me what are the features that are available in the XML Publisher but not in oracle report or vice-versa, Please provide some link or document for this. Thanks, Pragati

  • RAW Images from Canon Digital Rebel XT

    Does (or will) iPhoto 5 support the RAW files from the Canon Digital Rebel XT?