A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Roll overs and movies

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Greetings All,

    This is probably a newbie question to most of you, but it is proving an interesting problem to me Also the post is kind of long, but I wanted to explain clearly what I'm doing :-) Lol

    Basically I have a setup that I imagine is common in flash. I have images that I have imported that I want to give roll over actions to, and I want those actions to be motion tweens So let me tell you what I've done, and then it would be awesome if more experienced flash developers could suggest a better way

    Step 1: I made each image a movie symbol. So for example I have cone, cube and and sphere.

    Step 2: Then I created a second movie symbol called name _animate, eg cone_animate, cube_animate and sphere_animate. Each of these movies has 20 frames, 10 frames for each of the motion tween's. I then have stop actions at frames 1, 10 and 20. The two motion animations are simply the shape moving closer to the "centre" and back again.

    Step 3: I copied my _animate movies into the main flash page (calling them "shape_obj") and create a transparent button over each of my movies. Then I have the following action script:

    on (rollOver, rollOut) {
    tellTarget ("cube_obj") {
    play ();

    So when I roll over the movie will play the first animation (moving into the centre) and the on roll out the second animation (moving back to original position).

    Only problem here is I found that if I move the mouse too fast the movie gets stuck half way. So I added this to the script:

    // Stop all other movies
    on (rollOut) {
    tellTarget ("sphere_obj") { gotoAndStop (1); }
    tellTarget ("cone_obj") { gotoAndStop (1); }

    And this works okay, however it is still possible to get collisions which doesn't look professional and these collision's last until you rollout of another button :-(( I also tried putting the movies inside the button, but this doesn't work.

    So I am left with a movie which works okay, but if users get excited and move around the mouse too fast the end up seeing shape's collide, at least for a little while :'-(

    I was hoping that somebody had come up against this problem and could suggest a better approach. I would love to hear about this, thanks heaps!


  2. #2
    Join Date
    Jan 2002
    Leicester, UK
    the set up that you have used is great, making the separate movies and then making the buttons to target them.

    I have found the most effective way to get the buttons to function well is:

    on (rollOver) {
    _root.cube_obj.gotoAndPlay (2);

    on (rollOut) {
    _root.cube_obj.gotoAndPlay (11);

    then take the stop script out of frame 20 so the movie just goes back and stops at 1.

    let me know how you get on.

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