Simple Button to Control Movie Clip

Hello,
I was relatively comfortable with AS 2.0, but am having a
hard time warming up to 3.0. I feel that this should be something
simple to find help online with, yet I'm finding it difficult to
get a simple answer.
I have a button that is inside a movie clip within another
movie clip:
mainMenu_mc > whoBtn_mc > whoButton
This button appears to work fine controlling a movie clip on
the same timeline. This is the code so far (on an Actions frame in
WhoBtn_mc):
whoButton.addEventListener(
MouseEvent.CLICK,
function(evt:MouseEvent):void {
whoGlow.gotoAndStop("click");
I have another movie clip on the main timeline that I would
like to control with this button:
blackFadeBottom_mc
What would the code look like for this?
Any help is appreciated - Thank you.

Thanks, I was able to place the code on the main timeline and
get a trace when I clicked on the movie clip instance itself. I
probably didn't explain what I was trying to do very well, so I
apologize.
What I need to do is to control this movie clip that is
physically placed on the main timeline (fadeBlackBottom) with the
button that is buried under two other movie clips
(mainMenu_mc>whoBtn_mc>whoBtn).
I would like the whoBtn to tell the fadeBlackBottom movie
clip to (what used to be)
_root.fadeBlackBottom.gotoAndPlay("play"); This will drop down a
box that will contain the content of my 'Who' link.
How can I accomplish this?
Thanks again,
Chuck

Similar Messages

  • Can't get Simple button to Load Movie Clip

    Hi I've looked around for the answer to my question on this
    forum
    but havent found it so here it goes. I am working on this
    company's
    Flash site that was built by an outside studio. I am using
    CS3.
    The url to the site is
    http://www.bubbakeg.com.
    (this link will take you to the main page click the shadow
    graphic
    on the left under Bubba and this will take you to the site I
    am speaking
    of. The site is basically 5 different pages or movie clip.
    What I am
    trying to do is basically change the "Spring Break" middle
    graphic
    (which is a Movie Clip) on the HOME page and add a simple
    button
    that will direct the user to a new page. When I replaced the
    graphic
    with a new Movie clip there was no problem but I have added
    a
    button to load a new page (movie clip) and nothing happens.
    This
    button is in the movie clip of the new graphic which is
    called up
    when the page loads. If i take this button and just put it
    on the
    Main Stage in Scene 1 by itself it works and loads the page
    (movie clip). It does not however when it is embeded in the
    Movie
    Clip. The Flash site is basically 5 different Movie Clips
    loaded into
    an "Empty Clip". This empty clip has a timeline with each of
    the
    clips labeled and with their respective sized placeholders.
    And
    when you click on either the links on the Nav bar or the
    graphic
    for each page it loads that movie clip on the main page. It
    seems
    like the button only wants to work on the main timeline. I
    have
    even replaced the code for the "Contact" button with the code
    for the new button and it worked (opening new page). Here is
    the
    code for the new button that does not work:
    on (release) {
    _root.contentHolder.myHeight = 307;
    _root.contentHolder.newLoc = 9;
    heightAnimation();
    I know the location and height from the above code are
    referring to the placement and sizing of each movie clip
    in the "Empty Clip". As i said before this heightAnimation
    and the resizing of the new clip works fine when the
    button resides in Scene 1 on the Main Timeline but not
    within the new movie clip (graphic Ive created.)
    I will upload the main chunk of the code that resides
    in Scene 1 on the first frame of the "Actions" layer.
    If anyone has any ideas I would appreciate it very much!
    Please let me know if I can provide anymore info.
    Thanks!
    Greg

    change:
    function newLayerBT_CLICK(MouseEvent):void{
    to:
    function newLayerBT_CLICK(e:MouseEvent):void{

  • Help with assignment- buttons that control movie clips

    I am pretty new to flash and my professor gave us an assignment with little help or tutorials.
    He wants us to create a SWF that features a house and it's front yard and two buttons.
    One button that says Sunrise, and one that says Sunset.
    When I push the sunrise button, the sun needs to rise above the house and stay there.  When I push the Sunset button, it needs to set- and then a ufo needs to land on the lawn.
    So i think I have a pretty good grasp on the assignment, but the actionscript is throwing me off.  How can I make buttons that will control the sun movie clip to rise- stay above the house, and then set?  The ufo is a whole new matter.   The sunset button should make the sun lower and then a ufo land on the lawn.
    Please help explain/link me to the proper tutorials.   One thing that i'm worried about is that the sun will rise- and then stay above the house even if i click the sunset button.
    Your help is greatly appreciated.

    Well i can think of a few ways to do this.
    Depending on what you have been taught so far you should be able to do this if you know how to make a button, a movie clip, and the basic script for the timeline. ie. play,stop, gotoandplay etc.
    I understand you have been set a task and you want the answer straight away. But i doubt he would have given you anything you couldn't handle. Also I learnt more from trial and error and searching the net than from most of my teachers at coll and uni, It's frustrating i know, but the buzz you get when you finally crack it is amazing. Stick in there!
    That being said i remember the panic I suffered and like to help so here's a thought:
    You could just have the 2 buttons play a basic movie clip. The sky could rotate one way to make the sun rise and add a "stop" in the actions to make it stay there, and to the left to sunset with both images together but not being shown all the time by using a mask. You could even add in the ufo to the clip but this would only work if you added an extra part to the movie so that when the ufo has landed it flys out again and then begins to rotate the sun and moon again. ( buttons would be dissabled during the play modes to avoid chaos) This is just a quick thought. I'm sure there are several ways of doing this depending on how fancy it needs to be.
    If your teacher really has given you no notes on buttons,movieclips and actionscript i would sujest Adobe TV. Nice videos that explain step by step. OR try downloading a tutorial file with buttons and movie clips and look at the coding they use in the file. Thats how i have learnt most of it since finishing Uni.
    Good Luck
    Cobie

  • Trying to connect buttons to a movie clip

    Hi all,
    I need step by step instruction on how to attech control buttons to a movie clip.
    I imported the .MOV clip (a 3D rotation) into the library, and I would like to be able to control where the rotation stops, by use of a slider or clicking a button. Can some one please tell me how to do this in an easy way if possible?
    Any help would be greatly appreciated so much.
    Many thanks,

    drag your movieclip to the stage and assign it an instance name, say movMC.  create your button and give it an instance name, say btn.  you can then use:
    btn.onRelease=function(){
    movMC.gotoAndStop(your frame label or number here);

  • Problems coding a button within a movie clip to navigate scenes

    Hello there! I've got another probably noobish question to ask about CS6.
    My goal is very similar to the one mentioned in this previously discussed forum question: http://forums.adobe.com/message/837995#837995 and also in this question http://forums.adobe.com/message/4172919#4172919
    I am attempting to make a button inside a movie clip in my first scene go when clicked to the first frame of my second scene. I named the button's instance menu_button_1 and I believe Scene 1 and Scene 2 are the names of the scenes. (If they should have special names or instance names, I did not see where to type them.) Because of the similarities, I attempted to follow the suggestions on those pages. However I probably did some small thing wrong, (Or heck, maybe a huge thing.) which I what I'd like help with to find.
    stop();
    myButton.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndStop(1, "Scene 1");
    This seemed to be what was suggested to enter. I attempted to modify it to work for me as well. This is what I typed for the button's action.
    menu_button_1.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndPlay(1, "Scene 2");
    (I removed the stop function because I have music looping in the movie clip that I want to play until the mouse is clicked.) (Also, I picked gotoandplay because I wanted scene 2 to start playing immediately when clicked rather than stopping.)
    I tried variations, including "2" instead of "scene 2" and whatnot. I also tried linking it to differnet places just to see if that would work. It seems like it could link if I only asked for a frame within the movie clip itself, but it couldn't go to any other frames in scene 1 or scene 2. When I attempt, this message is displayed in the output:
    ArgumentError: Error #2108: Scene 2 was not found.
        at flash.display::MovieClip/gotoAndPlay()
        at interactivestgermant_fla::menu_1/clickHandler()
    It seems it cannot find my Scene 2. (It also cannot seem to find Scene 1 when I prompt it to do that.) I'm afraid I'm not sure of what I've entered incorrectly, though I'd imagine it involves how I typed the scene navigation. Should it have an instance name or something? I'd very muchappreciate a push in the right direction. If you need any more info I'll be happy to provide it. Thanks for the help! I very much appreciate it.

    I bet you're absolutely right. However I am not sure how I am misnaming it, as to my ametuer eyes, it seems to be entered properly into the properties box? It does show up as "menu" written in white over the keyframes and also in the properties slot. I can include some images here to help out in correcting me.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-1-395704638   This image shows my movie clip. This seems to be the problem it's having, identifying "menu." Did I do that incorrectly? It looks to be in order.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-2-395704633 This is inside of the movie clip named menu. You can see I did the same to name the button menu_button_1.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-3-395704627   This shows the action I gave to menu_button_1 in which I attempt to have it naviagte to Scene 1 frame 493.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-4-395704623  This shows where I'd like the button to go to. (It is hard to tell if that's frame 493 or 492. I figured that it should be ok either way and if this frame is 492 then it's easily changed once I get the darn thing working in general) (Also, I named the layer "peanuts." I tired entering the name "peanuts" as well but it didn't seem to work either, so I figured "493" is easier since I know that you can go to a specific frame by doing gotoandplay("scene 1" , #) and I'm not sure if it requires any additional stuff to go to a name.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-5-395704687    These are the errors I get. I totally agree with you- It seems very much to be an issue of getting it to recognize the "menu." However I am unsure where I named something wrong. Is this enough info to help you perhaps point out where that is?

  • Button within a movie clip not working

    Hiya,
    I have a movie clip within my swf website that is basically
    an icon that you roll over to produce the menu. The movie clip has
    coding inside it to produce the rollover effect. This is as
    follows:
    stop();
    this.onEnterFrame = function(){
    if(rewind == true){
    prevFrame();
    this.onRollOver = function(){
    rewind = false;
    play();
    this.onRollOut = function(){
    rewind = true;
    Whilst this coding works fine for this movie clip, for some
    reason the buttons within the movie clip that appear as you
    rollover them will not work when pressed. I am trying to get them
    to navigate the main timeline, i.e. coding as follows:
    on (release) {
    _parent.gotoAndPlay("home")
    _parent should be correct, I've tried it without and with
    _parent._parent however still it has no effect. From what I can see
    everything should be working fine.
    Is there some reason why buttons will not work within this
    sort of roll over effect movie clip?
    Thanks for your help.

    you can't assign mouse handlers to a parent movieclip and
    expect a child movieclip to respond to mouse events: the parent
    will intercept those events.
    to remedy, either assign all your mouse handlers on the child
    generation movieclips or use a hitTest() for one of the
    generations.

  • How to control movie clips using mause scroller...?

    ....please look
    http://www.nagaoka-id.ac.jp/gallery/gallery.html
    ...how to control movie clips using mause scroller...?

    Hi Ldavinci, I have noticed your posts on that particular
    site before. Just chiming in here... don't be afraid of Flash Help
    menu. There's a wealth of information there and I've found it much
    faster than waiting for a response from the forum. Then if it still
    doesn't make sense, at least you have a basic idea of specifics to
    ask.
    If you search for mouse wheel, you'll see an example under
    the Actionscript 2.0 Language Reference on this topic. That said,
    here's the example:

  • Problems with button inside draggable movie clip

    I am building a click through presentation that has some small text in it. To maintain the design and allow for readability, I have added a zoom feature.
    Here is the structure of the movie,
    Stage - contains pages movie clip and forward/reverse click buttons for changing pages
         pages_mc - contains 24 frames, one page per frame and buttons
    There is a button at the _root level that uses a tweener to scale the pages_mc up to 170%. When this is clicked, it allows the pages to be dragged around the screen so you can look at different sections. When you click the button again, it returns the pages back to their original size stops drag.
    My problem is, on the pages, there are buttons with links to external sites. Once startDrag has been invoked, I cannot touch the buttons inside the movie clip. Is there a way to make these buttons work?
    I need the finished quickly so any assistance is welcome.
    Code below
    magUp_btn.onRelease = function() {
    this._visible = false;
    TweenLite.to(pages_mc, .25, {_x:-250, _y:-193, _xscale:170, _yscale:170});
    TweenLite.to(magUp_mc, .75, {_alpha:0});
    TweenLite.to(magDown_mc, .75, {_alpha:25});
    magDown_btn._visible = true;
    pages_mc.onPress = function(){
    this.startDrag();
    pages_mc.onRelease = function(){
    this.stopDrag();
    pages_mc.onReleaseOutside = function(){
    this.stopDrag();
    pages_mc.useHandCursor = false;
    TweenLite.to(instr_mc, 1, {_alpha:100});
    magDown_btn.onRelease = function() {
    TweenLite.to(pages_mc, .25, {_x:0, _y:0, _xscale:100, _yscale:100});
    TweenLite.to(magUp_mc, .75, {_alpha:25});
    TweenLite.to(magDown_mc, .75, {_alpha:0});
    this._visible = false;
    magUp_btn._visible = true;
    pages_mc.onPress = function(){
    this.stopDrag();
    TweenLite.to(instr_mc, 1, {_alpha:0});
    I don't know how to turn drag off when I zoom out without using the onPress command, but I know that this is probably what is getting in the way of the button working?
    Thanks!

    One option is to make the background of the pages be the draggable parts rather than the movieclips that contain the pages and buttons.  That way, the buttons could be atop the background and not have their access blocked.
    Instead of coding the pages_mc, you would essentially have the background coded for the drag...
    pages_mc.bkgnd.onPress = function(){
        startDrag(this._parent);

  • Controlling movie clip play order

    Good Day,
    I have a web site that opens with two movie clips. One (A)
    folds open some navigation menus, the other (B) opens some
    rectangles that hold content. I want "A" to play out then, once it
    is played, I want "B' to start. It sounds simple but I cannot get
    the right code. I need something I can use for other applications
    in other pages. I have this code so far; (naigation_mc = "A"
    page01_mc = "B")
    if (navigation_mc.play=true) {
    page01_mc.gotoAndStop("start");
    } else {
    page01_mc.gotoAndPlay("start");
    Perhaps there needs to be more code to controll this?

    The most likely cause for you problem lies in the scope of
    "this" in your case.
    While traitional flash5 style buttons would have the imeline
    in which they reside (e. g. the main timeline) as scope and a
    comand like
    on (release){
    stop();
    wouls stop he playhead of the main timeline.
    Where as the more modern form of attaching code to a button
    and the explicit use of
    this handles buttons like movieClips so that a command like:
    myButton.onRelease = function(){
    this.stop();
    will try to stop the buttons (= movieclips) own timeline.
    I hope that helps
    [This fact isn't stated clearly in the docs, but I at least
    asked Macromedia (back then) to add it at least to the live
    docs.]

  • Button inside a movie clip

    Ok, i'm new at action script so i have a problem
    I have a sound inside a movie clip (sound_MC) in the main
    timeline, and i have another movie clip with a button inside, and I
    need that button to control that sound movie clip
    on (release) {
    gotoAndStop("off_radio"); // this goes to another frame in
    the movieclip with the button (works fine)
    on (release) {
    _root.gotoAndPlay("stop_loop"); // this goes to another
    frame of the sound MC (doesn't work)
    // i have this in the stop button
    on (release) {
    gotoAndStop("on_radio");
    on (release) {
    _root.gotoAndPlay("start_loop");
    // and this for the play button
    whats the code for that ?
    what should i do?

    i solve the problem !! :-D
    but now i hold like to now how i make a fade out sound
    command when i enter a frame and a fade in when i enter in another
    frame
    here are the examples:
    http://tubo_centeno.web.simplesnet.pt/problem/problem.html
    http://tubo_centeno.web.simplesnet.pt/problem/problem.fla
    can anyone help me?

  • Button w/in movie clip not working

    I know this question has been raised before and it usually
    just boils down to using the frame #'s and labels. But, even with
    that it is not working.
    I have a map of the US and when each state is rolled over I
    would like a menu to appear - this menu is a list with several
    options and all of the options are buttons. I have it set up so
    that each state is its own MovieClip and each has an invisible
    button over it for the hit area and the menu to appear. (i didn't
    want it to be simply when it rolls over the state movie clip
    because the hit would be square, covering other states and causing
    a mess of pop up menus)
    Anyway, the menu pops up fine, but the buttons within do not
    work. Any ideas of what I'm doing wrong? Thanks Much!!!!
    wi_mc.stop(); // wi_mc is the state movie clip
    wi_btn.onRollOver = function(){ //wi_btn is the invisible
    button
    wi_mc.gotoAndStop(15); //frame 15 is where my menu resides
    wi_btn.useHandCursor = false;
    wi_mc.onRollOut = function(){
    wi_mc.gotoAndStop(1);

    Alright, I've made adjustments to how I've got it all set up.
    I've made the menu it's own swf file, (seeing as how I'm going to
    have 48 of them in total I figured it was less messy to have each
    as their own file). Anyways... here's the current problem and I'm
    hoping someone has a good explaination for why this would be
    happening...
    on my main file I have 2 invisible buttons - 1 is calling the
    movie to load when rolled over and the other is calling the movie
    to unload when a roll-out occurs. RollOver works great - fully
    functional menu shows up. Roll out, however, is having some issues.
    The invisible button is in the same location of the menu, same size
    etc. so that when the user rolls away from this the menu should
    "unload".
    For some reason it's acting as if the hit area for the roll
    out is off. I did a trace to find out where it's saying the rollout
    areas are and the first is actually when I roll onto it, then only
    again when i roll out from the left side of the graphic. I've tried
    deleting the button and creating a new one but the same thing is
    happening.
    Any ideas for a very confused person trying to complete this
    simple task of unloading a swf via rollout? MUCH appreciated!!!!
    this.createEmptyMovieClip("ExternalSWFHolder",
    this.getNextHighestDepth());
    var SWFLoader:MovieClipLoader = new MovieClipLoader();
    wi_btn.onRollOver = function(){
    SWFLoader.loadClip("wi_menu.swf", ExternalSWFHolder);
    wi_rollout.onRollOut = function (){
    SWFLoader.unloadClip(ExternalSWFHolder);

  • Overlapping buttons within a movie clip

    I am using Flash CS3. Within a movie clip, I have a button
    symbol on one
    layer and an invisible button, which covers the whole canvas,
    on another
    layer. Regardless of top-down order, the big invisible button
    works and the
    button symbol (simple text rollover with link) will not work.
    If I put the
    button on the main timeline it works fine.
    What's the solution or what is a good way to have canvas
    coverage, plus
    individual links?
    Thanks for the help.

    See, I thought of that. It only works on the main timeline,
    not within the
    movie clips.
    If you look at
    http://www.graceweb.us/flash/precepts_090310.swf
    and mouse
    over the right-hand rectangle you'll see the top "blog" link
    is on the main
    timeline, the second blog link is two MCs deep, and the
    bottom two links are
    in the same clip as the invisible button.
    The actual FLA is at
    http://www.graceweb.us/flash/precepts_090310.fla
    Thanks again for the help
    "NedWebs" <[email protected]> wrote in
    message
    news:gpqvok$d45$[email protected]..
    > Place all of you individual links/buttons on a layer
    above the stage one

  • Buttons in a movie clip don't go to frame Labels

    Hello, I have 1 button inbeded in a movie clip named mcintroclp that is on frame 1 of my main timeline, Frame 2 is labeled port_btn on the main timeline. In the timeline of the movie clip mcintroclp I've put the code:
    stop();
    function buttonClick(event:MouseEvent):void
    gotoAndPlay(event.target.name);
    port_btn.addEventListener(MouseEvent.CLICK,buttonClick);
    The problem is that when the port_btn is pressed the playhead starts from the beginning of the main timeline not at frame 2 with the label port_btn. does anyone know what I am doing wrong, Thanks
    SQ

    what timeline contains your code?  (that's the same timeline that contains those two buttons, correct?):
    The timeline that contains the code is the movie clip named mcintroClip I've put the code on an actions layer on the last frame of the MC timeline. Which is the same timeline that contains the two buttons.
    what timeline contains mcintroClip?
    mcintroClip is on the first frame of the main timeline (whaich has a label home but I dont think that matters)
    what timeline contains intro_mc?
    intro_mc is the instance name for the movie clip mcintroClip on the main timeline. I tried to put that in the code because I don't relly know what I'm doing.
    what timeline has labels that match your button names?
    The main timeline contains the labels that match the button names, at this point frame 2 is labels port_btn
    The only othe code I have is stop(); on frame 1 and 2 of the main timeline.
    Thanks much for all your help on this.

  • AS3 air project.. nested button in a movie clip .. trying to use a class script

    I have been tring to have a button in a nested movie clip move the timeline along using a class script attached to the nested movie. I can get the buttons to work on the main timeline with another similar class script, but when I have a button within a nested movie and attach similar code to the movie, it doesn't seem to want to work. This is the class code attached to the nested clip.... I guess can an active listener be called if the button isn't yet being visible yet, and should this be done on the Main class script page for the main timeline? Any help would be great!! Thanks
    package  {
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class Animation extends MovieClip {
            public function Animation() {
                gotoAndStop(1);
                negBackground_btn.addEventListener(MouseEvent.MOUSE_UP, buttonPressedNegBackground);
            private function buttonPressedNegBackground(e:MouseEvent):void {
                negBackground_btn.visible = false;
                gotoAndStop("negChar");

    Hi,
    Your question is bit confusing, try to explain it. According to what I unsrestand you should use the particular movieClip name with the code to make it happen properly.
    Like :
    (movieClip_Instance).gotoAndStop("negChar");

  • Moving the play head in the main timeline from a button in a movie clip

    I have a movie clip that loads and when it is done playing it has a close button that unloads the movie clip... I want to add code to this button that moves the play head to frame 20 of my main timline using actionScript 3.0

    Tried that but dose not work think its because I am loading the movie this way...
    Play button "playFinal"
    function lastQuestion(event:MouseEvent):void{
         var Info:final1 = new(final1);
         this.stage.addChild(Info);
         Info.x=511
         Info.y=340; }
    So I tried using the Name "Info"
    //example......    MovieClip(Info.root).gotoAndStop(20);
    And I tried the name of the clip in the library "final1"
    //example......    MovieClip(final1.root).gotoAndStop(20);
    Is it because im loading it with actions script instead of having it on the timeline?

Maybe you are looking for

  • How do I get my contacts back on my PC?

    How do I get my contacts back on my PC? It seems that iCloud has taken them off of my PC.

  • Generating events after jaxb unmarshling

    Hye, I have a an application that uses a request-response model. I have generated code for my schema. I thought this would free me from the hassle of SAX parsing where I have to write the whole parser. But in SAX atleast I know and specify, that at e

  • Sql login failed

    Hi everybody. I installed database 10g release 2 with enterprise manager on windows server 2003 machine. But when I tried to login to the database throughout internet explorer using the following command:- http://localhost:5560/isqlplus , but it is f

  • TS1372 I have an error code 1406 when trying to restore my ipod classic.

    I just had my ipod classic's battery replaced. I purchased this device in 2006 and the battery died in 2012 (approximately 11 months ago). What else can I do?

  • "Please insert media for next copy" (auto)

    This should be a simple request. If I want to make 10 copies of a disc I would rather not have to wait for the disc to spin up and then hit "next" I would like to just put the disc in and the rest be automated. Thanks so much! I couldn't be happier w