Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 21st, 2003, 05:41 PM
alexchatwin alexchatwin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 alexchatwin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old November 22nd, 2003, 06:51 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
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

Reply With Quote
  #3  
Old November 22nd, 2003, 07:01 AM
alexchatwin alexchatwin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 alexchatwin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old November 22nd, 2003, 07:32 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
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

Reply With Quote
  #5  
Old November 22nd, 2003, 08:14 AM
alexchatwin alexchatwin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 alexchatwin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old November 22nd, 2003, 08:30 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
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

Reply With Quote
  #7  
Old November 22nd, 2003, 08:35 AM
alexchatwin alexchatwin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 alexchatwin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #8  
Old November 22nd, 2003, 11:57 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Pause a flash movie on mouseover


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT