A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: movie clip in a button

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    137
    I have a movie clip I want to play wen ever they roll over it, How can I do this, I allready tried putting a movie clip inside a button, and it works, the only thing is that once the mouse is not over it the movieclip stops (off course), how can I make it keep playing.

  2. #2
    Junior Member
    Join Date
    Sep 2000
    Posts
    3
    Originally posted by furnart
    I have a movie clip I want to play wen ever they roll over it, How can I do this, I allready tried putting a movie clip inside a button, and it works, the only thing is that once the mouse is not over it the movieclip stops (off course), how can I make it keep playing.
    In the movie clip add a button that is the size of the whole movie clip. Make sure the button is on the top layer. For the buttons actions make it,
    on mouse event, rollover, play

    note: make the button alpha setting 0 so you can still see your movie clip benieth it.
    You can also make it stop on mouse event rollout. This way the movie will only play when it is rolledover and will start off at the same place it stoped.

    Hope this helps.

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    196
    Originally posted by furnart
    I have a movie clip I want to play wen ever they roll over it, How can I do this, I allready tried putting a movie clip inside a button, and it works, the only thing is that once the mouse is not over it the movieclip stops (off course), how can I make it keep playing.
    Hi furnart,

    If you simply want the user to trigger a movie clip to commence on mouse over then perhaps the simplest way is to use the TELL TARGET command and remove your cip from the button.
    If you are not familiar with the TELL TARGET then great! cause once you are familiar a big flash door opens.
    Here's how it goes,

    Create your movie clip with a blank 1st keyframe and put a stop action in it.(waiting for user action - mouseover)

    Then use your button to:
    tell target "whateveritis" goto and play 2

    Here's some code -

    on (rollOver) {
    tellTarget ("your movie clips instance name") {
    gotoAndPlay (2);
    }
    }

    *please note you need to give your movie clip an INSTANCE NAME - this is done by opening your INSTANCE dialogue box and entering a name - in order to target it.
    Cool cause you can have many of the same clip on the stage and operate them individually.

    * final note when your clip reaches it's last frame it will finally arive at keyframe 1 and stop again because of the stop action. So on your last frame add: GOTO AND PLAY 2
    for a continual loop.

    Hope I helped
    buy for now,

    Rob


  4. #4
    Senior Member
    Join Date
    Nov 2000
    Posts
    196
    Hi,
    final thought ,
    It's a good idea to get into creating invisible buttons

    Draw a rectangle, convert to button, edit in place , move the keyframe to the hit area leaving other states blank.

    Groovy you have a button that can now be reused used for every button element in your site.. Place it over a clip etc..
    Lower file size and shows up green to let you know where it is.

    Buy for now,
    rob

  5. #5
    Does anybody want fries or something. Just call me

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    353
    sure...i'll take some

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