PDA

View Full Version : roll out?


kaatje
02-16-2004, 06:51 PM
hi there,
i have 4 buttons on my page, that each start
playing a movie clip onRollOver...this works great
, anyhow , if you roll your mouse out of the button ,
the movie stops and gets his first state back.
how can i make it so that onRollOut the movie keeps playing?

and is this the right way to do it?i read several
times a mc can act as a button too , and that that
is a better way to do this.
is it so , and how do i make my mc like a button than??

hope someone can give me a hint..
thx!

Mr.Moo
02-16-2004, 10:27 PM
do u have a rollOut statment? what does it say? try removing it

kaatje
02-17-2004, 03:22 AM
hi mr moo
as i said , i'm pretty new to this , so i'm a real newby....
not much action script....(yet!)
i just have buttons and in the over frame i have put my movie....
am i going completely wrong??

GothicMink
02-17-2004, 09:38 AM
Hello,

I'm not sure this is the best way to do this, but that's an idea.

You have your movieclip on the root, inside it, on a seperate layer, you put an invisible button. You may want to scale the button so it matches your movie's dimensions.
Name your movieclip instance "themovie", then put this code in your button's actions:


//start the movie
on(rollOver)
{
_root.themovie.play();
}


//to reinitialise the movie
on(release)
{
_root.themovie.gotoAndStop(1);
}



The movie won't stop playing when you roll the mouse out.

kaatje
02-17-2004, 10:47 AM
ok , just got home ...
will try it out ,
i'll post back if it works like that, thanks a lot already!!!:)

kaatje
02-17-2004, 05:23 PM
hmm , i've been playing around with the code u gave me..
as i said before , i'm really new to this , so sorry if im a little slow at understanding...
i have done as u said , but now the button is not doing what it has to do...the rollOver isnt there anymore if i put it in the actions..
maybe i've put the actions wrong(i have attached them to the button) do i still have to put the movie in the overstate of the button also??

AngelEyesShadow
02-17-2004, 08:48 PM
Here's smth. I've done, that does what u want.

kaatje
02-18-2004, 02:32 AM
thx , let u know how if i get it now...

GothicMink
02-18-2004, 04:27 AM
Yo,

Thanks AngelEyesShadow for posting an actual example. I think It's simple enough for kaatje to understand.

In the example i've describe, you'd have the same kind of solution, exept i've put the button inside the movieclip. But the code for the button is exactly the same.

Just as a note for Kaatje:
In my example, you would have a movieclip which contains your animation. Inside this movieclip, you also include your button. This button would only contain a "hit" area (just a shape in its "hit" frame, nothing in other frames) and this button would contain the code i posted before.
This only avoids having two objects on your root. that's the only differece with AngelEyesShadow's example.

kaatje
02-18-2004, 09:54 AM
:) :) :)
YES!!
it works great!!!
u are right GothicMink ,i should have been able to get it right with the code u posted....it's not that it was for nothing, i do understand now what i'm doing(little different than just copy an example..) with the example from AngelEyesShadow it really was easy!!
thx a lot , you made me happy!!
now i can go on..!!
hope i won't need to bother u again too soon!
grtz,kaatje