A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: movie clip as a button and graphic as a button

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    198

    movie clip as a button and graphic as a button

    what is the "rule of thumb" for creating a button that has a movie clip. I often get confused to what order to do things...(ie..do I create the movie clip first, the button first)?? I'd like sound on different stages (over and down). Does that go into the button or actionscripting?...see how confusing it is???

    Also if I wanted to pull a .jpg image into flash and have it drop down a menu..what is the rule of thumb to do that? (i.e. do I create the drop down menu first). I get so confused what order to do things...please help.

    Many Thanks,
    Andrea
    fitchic77@yahoo.com

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Posts
    198
    Please help anyone!!

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Posts
    198
    can someone at least refer a book or an online tutorial for me...gets so confusing with buttons inside of tweens inside of movie clips...etc.

    Thanks

  4. #4
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041
    hiya fitchic77,

    long time no help.

    My rule of thumb is that I primarily use buttons to capture user interaction only. That is, my button objects are buttons with only the HIT state defined, usually a rectangle. I name it btn_gtz, both for the library and when it is on the stage.

    I then create a movieclip object that has 3 (or 4) frames.

    Layer 1 is an action layer with stop actions on each frame and labeled, "UP" "OVER" "DOWN" and sometimes "OUT". The "OUT" frame is used only if I have an animation that plays upon moving off of the button.

    Layer 2 is where the button, "btn_gtz", lives. This layer is usually locked down and invisible via the eyeball and lock to the left of the timeline.

    Layer 3 is where the individual state graphics, or animations reside.

    There are a couple of ways of using buttons like this, one way is to drag a copy of it onto the stage and then right-click duplicate it. Now you can edit the interior as you will.

    I end up a lot of times only wanting to use ever one of these clips to save space, so I end up putting a lot of onClipEvent(load) parameters into my "button-clip". This is useful to me for navigation buttons especially, as I can leave the core functionality of the button alone and duplicate this one "button-clip" in any number of ways. Really gives me a lot of flexibility in terms of making (the almost incessant) changes our clients request.

    Okay so now we have this button clip, to make the button clip function properly, select the "btn_gtz" and hit f9 (to open the action window). Very basic here:

    Code:
    on (rollOver) {
    	gotoAndStop("OVER");
    }
    on (rollOut) {
    	gotoAndStop("OUT");
    }
    on (press) {
    	gotoAndStop("DOWN");
    }
    on (release){
    	gotoAndStop("UP");
    }
    Now on(rollOut) can have 2 options, depending on how the button is designed. rollOut can either be gotoAndStop("OUT") if I have a movieclip that needs to animate on(rollOut). (the last frame of this "out" animation would have a _parent.gotoAndStop("UP"); action on it) If, however, I do not have that animation then on(rollOut){gotoAndStop("UP");} works just fine.

    As to adding sound, which I rarely do, I add via actionscripting and add the code to the on(someEvent) parts of the button code.

    Feel free to ask any questions about what I've put forth here. Im gonna try to make you a .fla here in a little bit to show you what I mean. I was going to try to have it done with this post, but a meeting just sprung up out of nowhere, grr. So I must be off.

    Maybe this can get your gears spinning, anyhow, good luck to yaz!

    P.S.
    I'm not sure what your actual intent here is... "Also if I wanted to pull a .jpg image into flash and have it drop down a menu..what is the rule of thumb to do that? " So if you can clarify and I have some more time later maybe I can help ya with that too.
    Antibody
    "Our deepest fear is not that we are inadequate.
    Our deepest fear is that we are powerful beyond measure." - N. Mandela

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    198
    Many Thanks Antibody!! I'm just trying to figure out when using a graphic from photoshop how to go about coding for a drop menu that is a movie clip.

    Thanks so much for your help...you are the bestest!!!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center