-
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.
-
Senior Member
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. -
-
Adam Bell
dzign@datatv.com
--
Over 90% of all websites
suck......
Join the minority.
-
Senior Member
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. -
-
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.
-
Senior Member
- The right of the People to create Flash movies shall not be infringed. -
-
trace("AKA: Biro Barna");
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. |
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|