A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: need some help with movies and buttons....

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    16

    need some help with movies and buttons....

    I've been messing with this a while, but can't get it to work. Lets see if I can explain this...I have a web site made in flash, on the main page, I have 3 buttons. The button instances are placed in a movie along with a little animation animating the button on rollover.

    now, when I click on a button, I want it to fade-in a text box (if that is possible), or fade in a graphic made up of text onto the main page in the white area. Then when I click on another button, it will fade out whats currently on the main page, and fade in the text of whatever button is pressed.

    I'm a total Flash newbie, and don't know much about the action script part of flash, and I assume thats why I can't figure this out

    Any help would be appreciated...

    I might as well attach the file...

  2. #2
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    ahhh, the file is too big...

  3. #3
    Senior Member hum's Avatar
    Join Date
    Sep 2003
    Location
    CloudCuckooland
    Posts
    1,714
    Hi Mike....
    Check out this basic fla.it might help you....

    a dynamic text box ...(text)...is within a movieclip(...subMC).. which is tweened and this is inside another movieclip(MC)...
    there is a 'stop'action to prevent playing until button is pressed...
    the dynamic text is initialized in the keyframe on the main timeline along with the other actions.....

    variables are controlling the tweened frames and are set midway through the tween on the keyframe....

    All of above was then duplicated in the library ....dragged onto stage on a new layer....and the instance names and variables were changed....


  4. #4
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    Originally posted by hum
    Hi Mike....
    Check out this basic fla.it might help you....

    a dynamic text box ...(text)...is within a movieclip(...subMC).. which is tweened and this is inside another movieclip(MC)...
    there is a 'stop'action to prevent playing until button is pressed...
    the dynamic text is initialized in the keyframe on the main timeline along with the other actions.....

    variables are controlling the tweened frames and are set midway through the tween on the keyframe....

    All of above was then duplicated in the library ....dragged onto stage on a new layer....and the instance names and variables were changed....

    hmm, the flash you posted seems kinda quirky. It works if you click one button, and then click the other. But if you click one, and then click the same button again, it does wierd things.

    I don't really even need the fade, I just want text to pop up when I click on a button, then disappear and pop up different text when I press another button. I think I know how to do it if the button was located on the main stage, but they are in a movie. I could send you the file if it will help...

    Edit: here's an example of what I sort of want to do. I can't seem to open this tutorial though...
    http://www.flashkit.com/movies/Inter...9759/index.php

    Thanks btw
    Last edited by MikeTheVike; 12-06-2004 at 03:26 PM.

  5. #5
    Senior Member hum's Avatar
    Join Date
    Sep 2003
    Location
    CloudCuckooland
    Posts
    1,714
    aaaah...i see...

    check this then...it should help

  6. #6
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    Originally posted by hum
    aaaah...i see...

    check this then...it should help


    ok, Im actually understanding that I just need to figure out how to apply it to my mess of an animation!

    I have 3 layers, 1 for each movie containing the buttons. Now where do I put this code:

    mc.mytext = " ";
    btn1.onPress = function() {
    mc.mytext = "item 1";
    };
    btn2.onPress = function() {
    mc.mytext = "item 2";
    };
    btn3.onPress = function() {
    mc.mytext = "item 3";
    };


    do I have to stick it in all 3 keyframes on the main stage containing the button movies?

    sigh, this is so hard to explain, can i send you the file? and then you can advise me after seeing what I'm trying to put into words?


    Edit: ok, I uploaded my file, I just took out the background pic to reduce the file size so I can upload it. This file has the code you gave me placed where I think it goes, but of course, it doesn't work Hoepfully after looking at the file, you can see what is wrong. The problem area is on Scene3 frame 81. Thanks
    Last edited by MikeTheVike; 12-06-2004 at 05:33 PM.

  7. #7
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    my reduced-size file...
    Attached Files Attached Files

  8. #8
    Senior Member hum's Avatar
    Join Date
    Sep 2003
    Location
    CloudCuckooland
    Posts
    1,714
    Hi...

    here ya go....actions are on the last keyframe concerning the text....
    you had named your dynamic text box 'mc' by mistake and the buttons were contained in another movieclip so i gave these clips instance names...
    buttmc1
    buttmc2
    buttmc3
    then as you can see in the keyframe actions ....i have added these names to the paths...

  9. #9
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    Originally posted by hum
    Hi...

    here ya go....actions are on the last keyframe concerning the text....
    you had named your dynamic text box 'mc' by mistake and the buttons were contained in another movieclip so i gave these clips instance names...
    buttmc1
    buttmc2
    buttmc3
    then as you can see in the keyframe actions ....i have added these names to the paths...
    You are the man!! Geez, it looks so obvious when it's actually done. I'm a complete noob with Flash, so I still have a lot to learn about the action scripting. Thank you so much!!

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