Professional Web Applications Themes

Completing a button movie - Macromedia Flash Sitedesign

I have attached a movie to a button on the Down keyframe. I want the movie to run to completion even if the user lifts the mouse button part way through. Is this possible, and if so how do I do it? Thanks...

  1. #1

    Default Completing a button movie

    I have attached a movie to a button on the Down keyframe. I want the
    movie to run to completion even if the user lifts the mouse button
    part way through. Is this possible, and if so how do I do it?

    Thanks
    DGClarke Guest

  2. #2

    Default Re: Completing a button movie

    The problem here is that as soon as the user lifts the button, the
    button changes state and no longer plays the required MC. What you can
    do however, is take the MC OUT of the button and place it on the
    stage. Give the MC an instance name [eg "mc_01"] and assign to the
    button an action like:

    on (release) {
    tellTarget("mc_01") {
    play();
    }
    }

    Hope this helps

    Keep on Flashing,
    tictac

    [email]davidlinksw.co.uk[/email] (DGClarke) wrote in message news:<df32ab94.0402171123.61c4d171posting.google. com>...
    > I have attached a movie to a button on the Down keyframe. I want the
    > movie to run to completion even if the user lifts the mouse button
    > part way through. Is this possible, and if so how do I do it?
    >
    > Thanks
    tictac Guest

  3. #3

    Default Re: Completing a button movie

    tictac

    This is exactly what I was looking for. I had started to read the
    Actionscript manual, and was thinking about taking the MC out of the
    button. However, if I just put the clip on the stage, why won't the
    player simply play it anyway without waiting for the key release, the
    same way it does for other timeline elements?

    Thanks for your help! I appreciate it.

    Dave


    [email]tictactartarus.uwa.edu.au[/email] (tictac) wrote in message news:<a9ad7bb3.0402171713.37a493fcposting.google. com>...
    > The problem here is that as soon as the user lifts the button, the
    > button changes state and no longer plays the required MC. What you can
    > do however, is take the MC OUT of the button and place it on the
    > stage. Give the MC an instance name [eg "mc_01"] and assign to the
    > button an action like:
    >
    > on (release) {
    > tellTarget("mc_01") {
    > play();
    > }
    > }
    >
    > Hope this helps
    >
    > Keep on Flashing,
    > tictac
    >
    > [email]davidlinksw.co.uk[/email] (DGClarke) wrote in message news:<df32ab94.0402171123.61c4d171posting.google. com>...
    > > I have attached a movie to a button on the Down keyframe. I want the
    > > movie to run to completion even if the user lifts the mouse button
    > > part way through. Is this possible, and if so how do I do it?
    > >
    > > Thanks
    DGClarke Guest

  4. #4

    Default Re: Completing a button movie

    I have been thinking about this and I believe I see what you mean. You
    place the MC onto the stage, but don't assign it to any frames on the
    timeline. That way, it just sits there disconnected waiting to be
    woken up by the button release, but isn't picked up while the scene's
    timeline (which contains the button) runs normally. Is that right?

    Dave


    [email]tictactartarus.uwa.edu.au[/email] (tictac) wrote in message news:<a9ad7bb3.0402171713.37a493fcposting.google. com>...
    > The problem here is that as soon as the user lifts the button, the
    > button changes state and no longer plays the required MC. What you can
    > do however, is take the MC OUT of the button and place it on the
    > stage. Give the MC an instance name [eg "mc_01"] and assign to the
    > button an action like:
    >
    > on (release) {
    > tellTarget("mc_01") {
    > play();
    > }
    > }
    >
    > Hope this helps
    >
    > Keep on Flashing,
    > tictac
    >
    > [email]davidlinksw.co.uk[/email] (DGClarke) wrote in message news:<df32ab94.0402171123.61c4d171posting.google. com>...
    > > I have attached a movie to a button on the Down keyframe. I want the
    > > movie to run to completion even if the user lifts the mouse button
    > > part way through. Is this possible, and if so how do I do it?
    > >
    > > Thanks
    DGClarke Guest

  5. #5

    Default Re: Completing a button movie

    because you will put a stop() in the first frame of the MC
    :o)

    "DGClarke" <davidlinksw.co.uk> a écrit dans le message de
    news:df32ab94.0402180237.f02f2e6posting.google.co m...
    > tictac
    >
    > This is exactly what I was looking for. I had started to read the
    > Actionscript manual, and was thinking about taking the MC out of the
    > button. However, if I just put the clip on the stage, why won't the
    > player simply play it anyway without waiting for the key release, the
    > same way it does for other timeline elements?
    >
    > Thanks for your help! I appreciate it.
    >
    > Dave
    >
    >
    > [email]tictactartarus.uwa.edu.au[/email] (tictac) wrote in message
    news:<a9ad7bb3.0402171713.37a493fcposting.google. com>...
    > > The problem here is that as soon as the user lifts the button, the
    > > button changes state and no longer plays the required MC. What you can
    > > do however, is take the MC OUT of the button and place it on the
    > > stage. Give the MC an instance name [eg "mc_01"] and assign to the
    > > button an action like:
    > >
    > > on (release) {
    > > tellTarget("mc_01") {
    > > play();
    > > }
    > > }
    > >
    > > Hope this helps
    > >
    > > Keep on Flashing,
    > > tictac
    > >
    > > [email]davidlinksw.co.uk[/email] (DGClarke) wrote in message
    news:<df32ab94.0402171123.61c4d171posting.google. com>...
    > > > I have attached a movie to a button on the Down keyframe. I want the
    > > > movie to run to completion even if the user lifts the mouse button
    > > > part way through. Is this possible, and if so how do I do it?
    > > >
    > > > Thanks

    Alex Mercier Guest

  6. #6

    Default Re: Completing a button movie

    You have to place your movie on the stage if you want
    to activate and play with it and you cant put a movie on the stage without
    puting it on a frame.
    if you dont want do see your MC before you
    relase the mouse button, leave the first frame of your MC empty,
    and put a stop() in that first frame.
    You can make, for exemple, your animation between frame 5 and 10 inside the
    MC with
    a gotoandstop(1); on frame 10.

    now on the button (if your movie is on the root) :

    on(release){
    _root.yourmoviename.gotoandplay(5);
    }


    "DGClarke" <davidlinksw.co.uk> a écrit dans le message de
    news:df32ab94.0402180306.4b6776d4posting.google.c om...
    > I have been thinking about this and I believe I see what you mean. You
    > place the MC onto the stage, but don't assign it to any frames on the
    > timeline. That way, it just sits there disconnected waiting to be
    > woken up by the button release, but isn't picked up while the scene's
    > timeline (which contains the button) runs normally. Is that right?
    >
    > Dave
    >
    >
    > [email]tictactartarus.uwa.edu.au[/email] (tictac) wrote in message
    news:<a9ad7bb3.0402171713.37a493fcposting.google. com>...
    > > The problem here is that as soon as the user lifts the button, the
    > > button changes state and no longer plays the required MC. What you can
    > > do however, is take the MC OUT of the button and place it on the
    > > stage. Give the MC an instance name [eg "mc_01"] and assign to the
    > > button an action like:
    > >
    > > on (release) {
    > > tellTarget("mc_01") {
    > > play();
    > > }
    > > }
    > >
    > > Hope this helps
    > >
    > > Keep on Flashing,
    > > tictac
    > >
    > > [email]davidlinksw.co.uk[/email] (DGClarke) wrote in message
    news:<df32ab94.0402171123.61c4d171posting.google. com>...
    > > > I have attached a movie to a button on the Down keyframe. I want the
    > > > movie to run to completion even if the user lifts the mouse button
    > > > part way through. Is this possible, and if so how do I do it?
    > > >
    > > > Thanks

    Alex Mercier Guest

  7. #7

    Default Re: Completing a button movie

    Thanks for this Alex. I understand exactly what you're saying.

    In fact I have decided to do exactly what you said, and place the
    clips on the stage but outside the viewable area. If a clip performed
    an initial run, it wouldn't matter (it would be invisible). Your
    suggestion of a stop in frame 1 will prevent this though.

    However, that's not the reason I'm doing it this way. I have decided
    to randomly select one of 3 compatible clips (lightning strikes) to
    play when one of the 6 appropriate buttons is pressed. The intention
    is to move the selected clip into place above the pressed button using
    the _x and _y properties and then use your gotoandplay to run the
    clip.

    This means I will be able to service all 6 buttons with only 3 movie
    clips.

    I have tried this on my local PC and it works a charm.

    If you want to check on my progess on the net, look at
    [url]www.theordinarys.com/html/home.html[/url]. This is still showing fixed clips
    at the moment, and has only 3 buttons but it'll show you what I'm
    trying to achieve. Turn on the sound too!

    One other question; as these are navigation buttons, I'll want to use
    getURL to load the next page when they're pressed, but not until the
    MC has finished playing. How can I hold off the next step until the MC
    has completed?

    Thanks for your great advice.

    Dave

    "Alex Mercier" <androgenyusnetscape.net> wrote in message news:<HwPYb.8941$d34.1071579news20.bellglobal.com >...
    > You have to place your movie on the stage if you want
    > to activate and play with it and you cant put a movie on the stage without
    > puting it on a frame.
    > if you dont want do see your MC before you
    > relase the mouse button, leave the first frame of your MC empty,
    > and put a stop() in that first frame.
    > You can make, for exemple, your animation between frame 5 and 10 inside the
    > MC with
    > a gotoandstop(1); on frame 10.
    >
    > now on the button (if your movie is on the root) :
    >
    > on(release){
    > _root.yourmoviename.gotoandplay(5);
    > }
    >
    DGClarke Guest

  8. #8

    Default Re: Completing a button movie

    Hello, nice effects with the cloud and thunder
    and everything :) no rain?

    for the getURL, you can put it directly
    inside the MC on is last frame.



    "DGClarke" <davidlinksw.co.uk> a écrit dans le message de
    news:df32ab94.0402190219.18a58a6bposting.google.c om...
    > Thanks for this Alex. I understand exactly what you're saying.
    >
    > In fact I have decided to do exactly what you said, and place the
    > clips on the stage but outside the viewable area. If a clip performed
    > an initial run, it wouldn't matter (it would be invisible). Your
    > suggestion of a stop in frame 1 will prevent this though.
    >
    > However, that's not the reason I'm doing it this way. I have decided
    > to randomly select one of 3 compatible clips (lightning strikes) to
    > play when one of the 6 appropriate buttons is pressed. The intention
    > is to move the selected clip into place above the pressed button using
    > the _x and _y properties and then use your gotoandplay to run the
    > clip.
    >
    > This means I will be able to service all 6 buttons with only 3 movie
    > clips.
    >
    > I have tried this on my local PC and it works a charm.
    >
    > If you want to check on my progess on the net, look at
    > [url]www.theordinarys.com/html/home.html[/url]. This is still showing fixed clips
    > at the moment, and has only 3 buttons but it'll show you what I'm
    > trying to achieve. Turn on the sound too!
    >
    > One other question; as these are navigation buttons, I'll want to use
    > getURL to load the next page when they're pressed, but not until the
    > MC has finished playing. How can I hold off the next step until the MC
    > has completed?
    >
    > Thanks for your great advice.
    >
    > Dave



    >
    > "Alex Mercier" <androgenyusnetscape.net> wrote in message
    news:<HwPYb.8941$d34.1071579news20.bellglobal.com >...
    > > You have to place your movie on the stage if you want
    > > to activate and play with it and you cant put a movie on the stage
    without
    > > puting it on a frame.
    > > if you dont want do see your MC before you
    > > relase the mouse button, leave the first frame of your MC empty,
    > > and put a stop() in that first frame.
    > > You can make, for exemple, your animation between frame 5 and 10 inside
    the
    > > MC with
    > > a gotoandstop(1); on frame 10.
    > >
    > > now on the button (if your movie is on the root) :
    > >
    > > on(release){
    > > _root.yourmoviename.gotoandplay(5);
    > > }
    > >

    Alex Mercier Guest

  9. #9

    Default Re: Completing a button movie

    Alex

    Thanks for your kind comments. I have put up the version with the
    variable flashes and it runs each flash to the end. Check it out if
    you're interested.

    I can't simply put the getURL in the last frame of the clip as I'm
    using the same clips for all buttons and the URL I'd go to is
    different for each. I've tried testing the position of the playhead in
    the clip using _currentframe, but all I succeeded in doing was locking
    up the clip. I need a new idea.

    Cheers

    Dave

    "Alex Mercier" <androgenyusnetscape.net> wrote in message news:<RB3Zb.11840$d34.1294100news20.bellglobal.co m>...
    > Hello, nice effects with the cloud and thunder
    > and everything :) no rain?
    >
    > for the getURL, you can put it directly
    > inside the MC on is last frame.
    >
    >
    >
    DGClarke Guest

  10. #10

    Default Re: Completing a button movie

    oh.
    then you can use variables, for exemple :
    on button 1 :

    on (press) {
    _root.myvariable = 1;
    }

    same thing with the 2 other button but with different variables.
    and on the last frame inside your Mc :

    if (_root.myvariable == 1){

    getURL('1234.htm')

    }else if (_root.myvariable ==2 ){ .....and so on.


    and for your movie, nice job.
    it look realy good and the atmosphere is cool :)

    goodbye



    "DGClarke" <davidlinksw.co.uk> a écrit dans le message de
    news:df32ab94.0402191230.646c8b0eposting.google.c om...
    > Alex
    >
    > Thanks for your kind comments. I have put up the version with the
    > variable flashes and it runs each flash to the end. Check it out if
    > you're interested.
    >
    > I can't simply put the getURL in the last frame of the clip as I'm
    > using the same clips for all buttons and the URL I'd go to is
    > different for each. I've tried testing the position of the playhead in
    > the clip using _currentframe, but all I succeeded in doing was locking
    > up the clip. I need a new idea.
    >
    > Cheers
    >
    > Dave
    >
    > "Alex Mercier" <androgenyusnetscape.net> wrote in message
    news:<RB3Zb.11840$d34.1294100news20.bellglobal.co m>...
    > > Hello, nice effects with the cloud and thunder
    > > and everything :) no rain?
    > >
    > > for the getURL, you can put it directly
    > > inside the MC on is last frame.
    > >
    > >
    > >

    Alex Mercier Guest

  11. #11

    Default Re: Completing a button movie

    Nice one! In fact I solved this myself using smart clips, adding the
    URL to the clip as an attribute, but I think your solution is easier,
    so I'll take your advice and use simple variables. Surely I can just
    put the URL in the variable though, rather than 1,2,3 etc. like this:

    on (press) {
    _root.myvariable = "1234.html";
    }

    and on the last frame inside the Mc :
    getURL(_root.myvariable)

    Thanks for all your help, you've been a star!

    Dave


    "Alex Mercier" <androgenyusnetscape.net> wrote in message news:<8i9Zb.13784$d34.1349699news20.bellglobal.co m>...
    > oh.
    > then you can use variables, for exemple :
    > on button 1 :
    >
    > on (press) {
    > _root.myvariable = 1;
    > }
    >
    > same thing with the 2 other button but with different variables.
    > and on the last frame inside your Mc :
    >
    > if (_root.myvariable == 1){
    >
    > getURL('1234.htm')
    >
    > }else if (_root.myvariable ==2 ){ .....and so on.
    >
    >
    > and for your movie, nice job.
    > it look realy good and the atmosphere is cool :)
    >
    > goodbye
    DGClarke Guest

  12. #12

    Default Re: Completing a button movie

    ok no problem, that was a pleasure.
    and good luck for the rest of your site.

    Alex


    "DGClarke" <davidlinksw.co.uk> a écrit dans le message de
    news:df32ab94.0402200107.3ce58206posting.google.c om...
    > Nice one! In fact I solved this myself using smart clips, adding the
    > URL to the clip as an attribute, but I think your solution is easier,
    > so I'll take your advice and use simple variables. Surely I can just
    > put the URL in the variable though, rather than 1,2,3 etc. like this:
    >
    > on (press) {
    > _root.myvariable = "1234.html";
    > }
    >
    > and on the last frame inside the Mc :
    > getURL(_root.myvariable)
    >
    > Thanks for all your help, you've been a star!
    >
    > Dave
    >
    >
    > "Alex Mercier" <androgenyusnetscape.net> wrote in message
    news:<8i9Zb.13784$d34.1349699news20.bellglobal.co m>...
    > > oh.
    > > then you can use variables, for exemple :
    > > on button 1 :
    > >
    > > on (press) {
    > > _root.myvariable = 1;
    > > }
    > >
    > > same thing with the 2 other button but with different variables.
    > > and on the last frame inside your Mc :
    > >
    > > if (_root.myvariable == 1){
    > >
    > > getURL('1234.htm')
    > >
    > > }else if (_root.myvariable ==2 ){ .....and so on.
    > >
    > >
    > > and for your movie, nice job.
    > > it look realy good and the atmosphere is cool :)
    > >
    > > goodbye

    Alex Mercier Guest

Similar Threads

  1. 2 movie events for 1 button
    By MattManchester in forum Macromedia Flash Actionscript
    Replies: 5
    Last Post: February 11th, 02:19 PM
  2. 2 Movie Actions for Same Button
    By MattManchester in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 11th, 12:43 PM
  3. button to enable movie
    By George Hatsi in forum Macromedia Flash
    Replies: 0
    Last Post: October 1st, 12:10 AM
  4. Movie Clip Button
    By Thundercat webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 2
    Last Post: September 18th, 06:54 AM
  5. Can a button start a movie?
    By amclean123 webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 5
    Last Post: August 5th, 04:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139