Movie Clips/buttons  HELP!!

I have 4 movie clips on a stage that are supposed to act as
buttons(About, Resume, Work, Contact) When I roll over one movie I
want the movie to play and stay on the screen. When the user goes
to the next button and clicks and releases I want the previous
movie clip that was on stage to disappear. I have tried with
success with this code on the main stage but it only works for
rollovers. I want releases. Here is the code.....
b1. onRollOver = over;
b1. onRollOut = out;
b2. onRollOver = over;
b2. onRollOut = out;
b3. onRollOver = over;
b3. onRollOut = out;
b4. onRollOver = over;
b4. onRollOut = out;
b5. onRollOver = over;
b5. onRollOut = out;
function over() {
this. gotoAndPlay(2);
function out() {
this. gotoAndPlay(3);
Any help is appreciated!!

Assuming that frame 1 is the "hidden" state for the clips,
just change the code as follows:
// add a variable to the root timeline
var currentClip;
// add function
function click() {
this._root.currentClip.gotoAndPlay(1);
this._root.currentClip = this;
// add code to buttons
b1.onRelease = click;
b2.onRelease = click;
// and so on...
if frame one is not the hidden state, just change the first
line of the click() function:
this._root.currentClip._alpha = 0;
// then change the over() function
function over() {
this._alpha = 100;
this.gotoAndPlay(2);
Hope this helps,
Albee

Similar Messages

  • Movie clip button help

    Hello im trying to develop a small swf file that the user can
    control a video that gives the impression of rotation and
    transparency using arrow buttons. I have a 2 small movie clip files
    that are currently spread across the timeline exactly 200 frames.
    the videos are controlled by means of fast forward and rewind this
    gives the impression of rotation (backwards and forwrds) i have
    already got the fast forward and rewind function working i would
    like another set of arrows that control the transparency or alpha
    of the second movie clip so that when the user presses either an up
    or down arrow button the transparency goes up or down. Im very new
    to action script so any basic explanation help would be great. The
    code for the forward and rewind buttons is as follows (ignore the
    play function as this button is hidden off stage):
    stop();
    play_btn.onRelease = function (){
    play();
    pause_btn.onRelease=function(){
    stop();
    forward_btn.onPress=function (){
    _root.createEmptyMovieClip("controller_mc",1);
    controller_mc.onEnterFrame=function(){
    _root.gotoAndStop(_root._currentframe+3);
    if (_root._currentframe+3 > _root._totalframes){
    _root.gotoAndStop(_root._totalframes);
    forward_btn.onRelease=function (){
    controller_mc.removeMovieClip();
    forward_btn.onReleaseOutside=function (){
    controller_mc.removeMovieClip();
    rewind_btn.onPress=function (){
    _root.createEmptyMovieClip("controller_mc",1);
    controller_mc.onEnterFrame=function(){
    _root.gotoAndStop(_root._currentframe-3);
    if (_root._currentframe-3 < 1){
    _root.gotoAndStop(1);
    rewind_btn.onRelease=function (){
    controller_mc.removeMovieClip();
    rewind_btn.onReleaseOutside=function (){
    controller_mc.removeMovieClip();
    }

    //button is released and increases the Movie Clip's current
    alpha value by 10%
    increase_alpha_btn.onRelease=function(){
    if(MovieClip._alpha<100){
    MovieClip._alpha+=10;
    //button is released and decreases the Movie Clip's current
    alpha value by 10%
    decrease_alpha_btn.onRelease=function(){
    if(MovieClip._alpha>0){
    MovieClip._alpha-=10;

  • Just learning...help on movie clip buttons

    I've tried tons of tutorials and i cant seem to get my movie
    clip button to work when i put the mouse over the button.
    i have included a screen shot of my time line and code.
    Layer 10 frame 1 is where all the script is.
    "actions" layer has my "stop" codes in frames 1 and 20
    time
    line and code
    Thanks for your help.

    ok if i change "home" to "this" in my code, do i also have to
    change my instance name for my button layer from "home" to "this"
    as well?
    and how do I cast e.currentTarget as a movie clip?
    sorry this is only my 3rd day playing around with Flash.
    Thanks!

  • Hi, i am a bit of a newbie at AS & need some help applying it to a movie clip button

    I have created a movie clip button but am stuck with the actionscript. I have created the rollover and rollout for this movie clip button but i want it to do 2 things after this i want it to go and stop on the first frame of a movieclip which has my content on it called portfoliogallery_mc (which is also the same instance name for it) when you then click the button i want it to go and play frame 11 of that movie clip portfolio gallery_mc.
    Here is my current actionscript i HAVE Flash 8 on my comp that i am currently using.
    Please note my actions are on a layer called actions and not on the movieclip button itself.
    nxtimagetwo_mc (is the movie clip button/instance of mc)
    THE CODE I HAVE USED
    this.nxtimagetwo_mc.onRollOver = function() {
    nxtimagetwo_mc.gotoAndPlay("_over");
    this.nxtimagetwo_mc.onRollOut = function() {
    nxtimagetwo_mc.gotoAndPlay("_out");
    portfoliogallery_mc.gotoAndStop(1);
    portfoliogallery_mc.gotoAndPlay(11);
    currently it is playing to frame 11 not stopping at frame 1 and stops on frame 20 where i have a stop action. I also have a stop action on frame 1 of that movie clip.
    What I want it to do is first stop at frame 1 of that movie clip and when the button is clicked again to go and play frame 11 of that same movie clip.
    Basically what i want the mc button to do is 2 things automatically stop the mc for the first content and when button is clicked let the content fad out and play to where the next stop action is set to in the Movie Clip.
    Nothing to with the above www.rsquareme.co.uk is my current portfolio website if you would like to check it out it is not fully complete yet.

    it doens't make sense to execute:
    portfoliogallery_mc.gotoAndStop(1);
    portfoliogallery_mc.gotoAndPlay(11);
    only the 2nd line of code will be effected.
    i know you want to control 2 movieclips.  what are the instance names of the two movieclips and what do you want to occur in each of those movieclips.
    or, do you want to control 1 movieclip and have it play a certain sequence of frames followed by another sequence of frames?

  • Movie clip button navigation

    hey, i'm pretty new to flash and i'm attempting to create a
    site with different scenes representing different pages.
    i have four movie clip buttons. One of these buttons should
    link to the "about me" page, which so far only has another movie
    clip with pictures. from the main page i'd like a user to be able
    to click on the about me button/movieclip and the pictures should
    appear.
    i've been using the code:
    on(release){
    _root.gotoAndPlay("about_pictures")
    however whenever i run the preview, nothing happens when i
    click the button.
    main timeline includes :
    about me > pictures with a motion tween(pictures_about_mc)
    > the movie clip of pictures(pictures_mc).
    background
    buttons
    actions
    any help would be appreciated. thank you in advance.

    If you are genuinely using scenes, then your gotoAndPlay()
    call needs to include the scene name and the frame...
    gotoAndPlay("about_pictures", 1)
    and "about_pictures" needs to be the name you assigned to
    that scene in the scenes panel.
    Using scenes and the way you coded the button are both not
    clean ways to code--things end up being hidden from plain site.
    Instead of scenes, just use the one maintimeline. Instead of
    on(release, etc) use myBtn.onRelease = function (){...} in the
    actions layer.
    Makes life so much easier in the long run, especially a year
    from now when you're trying to change some code and can't find
    where you hid it.

  • Movie Clip Button - Action Script issues

    This is a two part question:
    1. I have my movie clip button, "mcAboutus" then inside my
    movie clip I have 5 layers: actions, labels, text, animated
    rollover("mcAboutusover"), animated rolloff("mcAboutusoff"). On the
    labels layer I have _up, _over, _off. On the _up is the text layer,
    on the _over is a movie clip of the animated
    rollover("mcAboutusover") which is 90 frames, and I want to loop as
    long as the mouse is over the text. And the _off has the
    "mcAboutusoff" movie clip.
    So I was able to have the rollover work, but when I roll off
    the rollover animation continues on until the end of the animation.
    I understand it has to do with the fact that it's a movie clip, but
    how do I point it to go into the movie clip and read the animation
    and that on the last frame of the animation I have a
    "gotoAndPlay(1);" to have the animation continue looping as long as
    it's in a rollover state?
    here is the code I have for the _root:
    this.mcAboutus.onRollOver = function() {
    mcAboutus.gotoAndPlay(_over);
    this.mcAboutus.onRollOut = function() {
    mcAboutus.gotoAndPlay(_off);
    The other problem I am having is that once the I have rolled
    over the animation once, the button dies and won't let me rollover
    it again?
    Aside from the "stop();" action in the mcAboutus movie clip
    symbol, I don't have any other actions, should I put items in the
    different movie clips I have set up?
    ALSO.... The reason that I have the main movie clip button,
    and two movie clips residing in the mcBtn is I wanted light rays to
    be glowing from the text, and I was having a hard time getting what
    I wanted from Flash, so I created in After Effects and exported two
    .SWF files. So those .SWF files are the _over and _off states in
    the mcBtn. I am having a very hard time controlling those Movie
    Clips within the main MC Button. Please, any help would be greatly
    appreciated.

    quote:
    Originally posted by:
    kglad
    mcAboutusover should be a movieclip that has your over
    animation and it should have a stop() on its last frame. it should
    be placed on your _over frame in mcAbousus' timeline. you should
    then use:
    Ok, so I have my main timeline, in it has my
    mcAboutus>> then inside that I have three labels. _up which
    has the static text then on frame 5 I have the _over which has the
    keyframe for the mcAboutusover, this animation is 90 frames, then I
    have on frame 10, the _off for the RollOut state, and I have a 10
    frame animation on that one. I still can't get it to continue on
    after the initial rollover, the button still dies down.
    I am going to redo everything in a presentation timeline,
    based on Total Training and see if that helps my problem out any,
    and will get back to you tomorrow with more info. Thanks

  • Cursor stops movie clip buttons

    I have animated movie clips as buttons. When the animation
    reaches the point where the cursor sits on the button it vanishes.
    Here is the script I have on the main time line:
    //news_mc is the instance name of my movie clip button
    news_mc.addEventListener(MouseEvent.CLICK, newsPage);
    news_mc.addEventListener(MouseEvent.MOUSE_OVER, newsRollOn);
    news_mc.addEventListener(MouseEvent.MOUSE_OUT, newsRollOff);
    news_mc.buttonMode = true;
    function newsRollOn(event:MouseEvent):void {
    news_mc.gotoAndPlay("in");
    function newsRollOff(event:MouseEvent):void {
    news_mc.gotoAndPlay("out");
    function newsPage(event:MouseEvent):void {
    gotoAndStop("news");
    I know there is something about
    news_mc.mask = ??? I'm not sure if I sure what part of the
    mask I use. I have a layer that has the button background (instance
    name - background) and then the 2 layers that form the animated
    mask - the mask layer contains a copy of the button background
    (instance name - background2) and then the animated later of the
    mask contains a gradient that slides over the button (instance name
    - masker).
    What is happening?

    ROLL_OVER and ROLL_OUT rather than mouse_over and _out did
    the trick!

  • 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);

  • 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 make a movie clip button into a url link?

    Hello,
    I'm kinda new to using Flash and am trying to edit a template for a friend of mine, the problem is I'm trying to add a url link to the buttons. I tried adding this action to the button
    on(release){
    getURL(http://www.yoururl.com.);
    I saved as swf & got this error msg in the compiler errors: Symbol=but1,layer 4, frame=1 Mouse events are only for button instances
    In the library I checked the properties of the button and its a movies clip, I'm not sure if it will make any difference if I change to button or graphic?
    I would like to upload the fla and swf files but this forum doesn't seem to allow me to attach files to messages.
    Does anyone know how to do this? Any help is greatly appreciated.
    http://jaedenyoo.com

    Unfortunately that doesn't seem to be the problem, I checked and
    in my flash file its typed correctly.

  • Movie Clip / Buttons

    I know this is probably something really easy to do I just
    for whatever reason cannot make this work. I am new to flash and am
    building an entire website. I used a template that I purchased and
    have been messing around with it and changing it. Problem is the
    buttons that are made are movie clips not actually buttons. I want
    to create a duplicate button, so I created a duplicate of the movie
    clip in the library. Problem is when I drag the movie clip into the
    movie and run the flash preview the new movie clips do not work
    like the other ones – meaning the other ones behave like they
    should – as a button (when I move my mouse over it the action
    works) but the new ones just appear as images. I know this must be
    a very easy fix and I must be doing something wrong. Any help would
    be greatly appreciated – (I might not have explained the
    problem accurately, so if more clarification is needed or an
    example needs to be uploaded let me know)
    Thanks a lot!!!

    Thanks that worked great, hope that wasn't too noob : (
    Well another problem as come up, I made another flash movie
    containing content in an xml file. When the swf is hosted and in
    the browser it works fine. However when i put that same swf in an
    html document and host it the xml never loads. Am i doing something
    wrong?
    Thanks in advance,
    ~Rob

  • I have a simple movie clip/ button question

    I have a simple movie clip on my scene 1 frame 1.  Inside that movie clip I have another movie clip, with a button on top that controls that mc.  Also have another movie clip with a button on top that I would like to take me back to scene 1, frame xyz.  I cannot remember how to do it.

    Well, I don't know the code to use, so I haven't tried anything unfortunately.  I havent typed code in the past couple of years, so I vaguely remember having to type in something pertaining to a _root or something like that ...here are a few screen shots, like I said, the button nested in the movie clip I need to take me back to the main page and goto a different frame.  I only have one scene, as2,
    on scene 1, the movie clip is the cube at bottom left.  inside the mc the button i need to take me back is bottom right-thanks!

  • How do I stop a Movie Clip (Button) from working once clicked?

    Ok,
    I'm using a movie clip as a button to show content on a page, effectively its like a new page of the website. Problem is, with the script im using for it, once the content is show, the button is still active and if clicked again, will re-load the content. I want a way to effectively disable the button whist the content is shown.
    Thanks.
    this.services_inner.buttonMode = true;
    this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
    this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
    function rollOver_services(evt:MouseEvent):void {
    this.services_inner.play();
    function onClick_services(event:MouseEvent):void {
    MovieClip(root).mov.backgrounds.colour.gotoAndPlay(2);

    Thanks, that does stop it, however, i now need it to work again if a different button is clicked... there are 4 buttons (movie clips) in total, so I assume I'd just need to add the event listener back again on click of the others?
    This is the "Services" Button, with the event listener removal.....
    this.services_inner.buttonMode = true;
    this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
    this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
    function rollOver_services(evt:MouseEvent):void {
    this.services_inner.play();
    function onClick_services(event:MouseEvent):void {
    MovieClip(root).mov.backgrounds.colour.gotoAndPlay(2);
    this.services_inner.removeEventListener(MouseEvent.CLICK, onClick_services);
    This is the "Contact" Button, which when clicked would need to "re-activate" the Services button.
    this.contact_inner.buttonMode = true;
    this.contact_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_contact);
    this.contact_inner.addEventListener(MouseEvent.CLICK, onClick_contact);
    function rollOver_contact(evt:MouseEvent):void {
    this.contact_inner.play();
    function onClick_contact(event:MouseEvent):void {
    MovieClip(root).mov.backgrounds.art.gotoAndPlay(2);
    this.services_inner.removeEventListener(MouseEvent.CLICK, onClick_contact);

  • Movie Clip Button Not Working

    I'm working on creating buttons right now as movie clips so when you roll over it they rise up. The third one "print" is jumping around like crazy and I can't figure out why. I've deleted and re-done it 3 times without luck. I've attached my file - if anyone can spot where I've made a mistake that would be great. Thanks!

    Got it - realized the text wasn't staying as static text and was a movie clip before the final frame. So if anyone else has this problem, create a new keyframe on the ending frame, and make THAT the movie clip.

  • Movie Clip Heiarchy Help!

    I have a timeline where each frame has a different movieclip.
    each of these movieclips have 5 specific frames inside them. I can
    jump between frames on the main timeline by doing this;
    this._parent.gotoAndStop(2); this brings me to the first
    frame of the movie clip.
    but if i want to do the same thing but go direcly to the 5th
    frame in said movieclip what do I do?

    klocascio,
    > I have a timeline where each frame has a different
    movieclip.
    > each of these movieclips have 5 specific frames inside
    them.
    I'm with ya so far.
    > I can jump between frames on the main timeline by doing
    this;
    >
    > this._parent.gotoAndStop(2); this brings me to the first
    frame
    > of the movie clip.
    That part confuses me. Where is that line of ActionScript?
    If the code
    appears in a keyframe of the main timeline itself -- and if
    you wanted to
    move the main timeline's playhead -- you could use this:
    this.gotoAndStop(frame number here);
    That fact that you're prefixing the MovieClip.gotoAndStop()
    method this
    this._parent means your code must be inside a keyframe of the
    first of your
    movie clips. But I'm not sure how gotoAndStop(2) would take
    you to the
    first frame. Second frame, yes.
    > but if i want to do the same thing but go direcly to the
    5th frame
    > in said movieclip what do I do?
    The frame you want to jump to is determined by the number
    you feed in as
    a parameter. gotoAndStop(5) takes you to frame 5. The
    question of *which*
    timeline should be jumped around depends on a) your object
    reference (e.g.
    this, or this._parent, or an instance name) and b) the
    location of the code
    making the reference.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

Maybe you are looking for