A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Why is my MC repeating itself over and over on MOUSEOVER event?

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    373

    Why is my MC repeating itself over and over on MOUSEOVER event?

    I've got a mouse over event on a MC that when you roll your mouse over the clip, it starts playing til it reaches the end. Problem? It's constantly repeating itself and in some cases it's just replaying the first frame over and over. Very strange. All I want it to do is play the clip til it reaches the final frame of the clip and then stop. That's it. Here's my code:

    roll_mc.addEventListener (MouseEvent.MOUSE_OVER, over1);
    roll_mc.addEventListener (MouseEvent.MOUSE_OUT, out1);

    function over1 (e:MouseEvent):void
    {
    e.currentTarget.play();
    }
    function out1 (e:MouseEvent):void
    {
    e.currentTarget.gotoAndStop("1");
    }
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Is "1" frame 1 or is it the name of the frame?
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    Frame Number
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Either you write a real frame name or write this as a number without quotation. I recommend to give it a real framename like "frame1".
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    I did that after that previous post you made (gave it a label of 'start') but it didn't change a thing. Same problem.
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Can you post the fla.
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    Hmm... Did you define a hit area for your movie clip ? Because if you didn't and you animation suddenly changes size then you could end up having the mouse outside the hit area of the movie clip after the first frame which will cause it to go to out1 and once that's done, the size is back to normal causing the movie clip to fire the over1 function again but again the hit area will be gone and you'll fire out1 right after the first frame and so on...

    Create an invisible movie clip that is the max width and height of the animation, give it an instance name and assign it as a hitArea: e.target.hitArea = yourInvisible_mc;

    Once that's done, then you won't have to worry about the animation changing it's shape and having your mouse accidentally out of the hit area...

    Good luck.



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  8. #8
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    Actually, I figured it out. Seems my MC has an animation (basically a split wipe) that uses two mc's to perform the animation. I changed them to straight up graphics and when I did, the problem was gone. Still not sure why that would occur but that's the end result nonetheless. Thanks to all. So the mc never changes size but does have a wipe going on.
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

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