|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pause a flash movie on mouseover
Anyone suggest how i might pause a flash movie, in a webpage, when the use moves the mouse over the movie, then contiune when it moves off?
greatly appriciated alexc |
|
#2
|
|||
|
|||
|
Hi, this depends on how your movie is constructed. The easiest way in my opinion is to make a new movie clip with two frames. The second simply has gotoAndPlay(1); as its action and the first has something similar to:
if(paused) { _root.play(); _root.myMovie1.play(); _root.mymovie3.mysubmovie.play(); paused = false; } else { _root.stop(); _root.myMovie1.stop(); _root.mymovie3.mysubmovie.stop(); paused = true; } Then simply provide an initilisiation var to get it working either in the buttons onClipEvent(load) event or in root, to be called at startup: myPauserCode.paused = false; The pause/unpause button simply calls the same code as the above line except it sets things how they should be. You could just make the if/else statement a function however and call it from whereever you need it. You need to play with this to make it work with your movie. Using something like this can require extra testing to make sure each movie/submovie doesnt play when it shouldnt. i.e. the movies already stopped at the right place then the user clicks unpause and it forces the movie to play again. I solve that with lots of if statements etc. Hope this solution fits -Tann |
|
#3
|
|||
|
|||
|
My current movie is about 600 frames long.. does that bugger it up? or can i somehow paste that into a new movie, with just the 2 frames?
thanks |
|
#4
|
|||
|
|||
|
Hi, nope the length of the movie shouldn't be a factor here. Thats one of the beauties of this method. All you have to do is have a new layer that has the loop code movie in the first frame, then extend the frames to the end of the movie. I've used this method alot lately.
-Tann |
|
#5
|
|||
|
|||
|
Ah, does this method rquire a button? because my setup is just the flash as a title bar, which scrolls pictures, then i want it to stop when the mouse is over it
|
|
#6
|
|||
|
|||
|
Hi, just link it to whatever mechanism you use to detect the mouse over event. So no it doesnt require a button to work.
-Tann |
|
#7
|
|||
|
|||
|
ahh, any tips for that.. i'm quite good at setting up the pictures in flash, but i've never been great at the programming side
|
|
#8
|
|||
|
|||
|
Hi, sure. I'd stick with the button method, its proven to work. Make a button which simply has a hit area of 1x1 box (normally just the fill for me). Align it the same as the picture bar you have. i.e. if picture bar is aligned top left inside it self then do the same with the 1x1 box. Give the button an instance name of scrollerButton. Now in _roots frame 1 enter (in the AS panel):
onClipEvent(load) { _x = pictureBarMovie._x; _y = pictureBarMovie._y; _width = pictureBarMovie._width; _height = pictureBarMovie._height; } This should give you a button that on movie startup is the size of the picture bar although it will be "invisible"(ish). Basically you wont see a button but when you mouse over you now have something to target. Now select the button on the main stage and enter: on(release) { if(myPauserCode.paused) { myPauserCode.paused = false; } else { myPauserCode.paused = true; } } That should do it. You can place the button and the pauser code movie on the same layer if you want. -Tann |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Pause a flash movie on mouseover |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|