PDA

View Full Version : onclipevent problem


srlem
11-26-2002, 09:03 AM
Hi guys!
i'm in a bit of trouble and help would be much appreciated.

1.The thing is i have a movie clip on a main timeline and the movie clip has its own timeline. What i wan't to do is when the mouse is over the clip that the clip starts playing the second frame in its own timeline

2. my second problem is. that on the main timeline i have stop() at the end. i intended to stop the animation from repeating but this stop also stops the animation of the movieclip. what should i do that the mc plays and that there is no animation on the main timeline.

for the mouse over thing i thought it had to be smth like this on the mc

onClipEvent (mouseUp) {
gotoAndPlay(Symbol 5,1);
}

please help! asap

vosgien
11-26-2002, 10:15 AM
Hi,
On your mc the code should be something like this:

onClipEvent(mouseUp){
if(this.hitTest(_root._xmouse, _root._yMouse,true){
this.play();
}
}

The stop action on your main timeLine shouldn't affect the timeLine of the mc

Hope that helps

Vosgien

srlem
11-26-2002, 02:30 PM
hmm..i replaced with "box" which is the name of the instance..but still doesn't work.

i've attached the fla so you can see what i'm talking about

regards

srlem
11-26-2002, 02:37 PM
hey!

the code you provided was ok but it didn't work in test scene.
It worked when i published it. And also one bracket was missing.
so this is the exact code.

Ok now this works, but i thought mouse up was actually mouse over. Is there any way to create rollover behavior on a MC??

onClipEvent(mouseUp){
if(this.hitTest(_root._xmouse, _root._ymouse,true)){
this.play();
}
}


srle

vosgien
11-26-2002, 02:44 PM
Hi,
Yeah, the double bracket at the end is a recurring typo of mine - sorry about that, yes you can create mouse over with :

onClipEvent(mouseMove){

you have to put the hitTest in otherwise it will fire everytime the mouseMoves - funny that - do I need to look at this file or is everything OK now

Vosgien

srlem
11-26-2002, 03:00 PM
it's ok if i click on it..but now with this mouse move thing...
do i have to assign some _y andf _x coordinates so it will now when it has to start playing the mc. like you said i don't want it to play every time i move the mouse...

thanx for helping me!:)

srlem
11-26-2002, 03:09 PM
the effect works fine if i roll over the mc and i also managed to do that the rollover behavior stops when the mouse is out. Here's what i did.

onClipEvent (mouseMove){
if(this.hitTest(_root._xmouse, _root._ymouse,true)){
this.gotoAndPlay(2);
} else {
this.gotoAndStop(1)
}
}

the mc is built so that it's static in the first frame and in the second frame it starts tweening.. So that's why gotoAndPlay(2) and gotoAndStop(1)..

srlem
11-26-2002, 03:14 PM
ok i know i'm like one of those vacum cleaner salesmen who you can't get rid off:)

but now i want to achieve when i click the mc i want activate the timeline and for example go to frame 2 on the main timeline...

this is what i had in mind..

onClipEvent (mouseDown) {
this.gotoAndStop(2)
}

but...doesn't work:(
hmmmmm....what to do???

srlem
11-26-2002, 03:17 PM
ok i figured that one also it's like this:

onClipEvent (mouseDown) {
if(this.hitTest(_root._xmouse, _root._ymouse,true)){
_root.gotoAndStop(2);
}

}

i forgot the hit test...