Connecting Tech Pros Worldwide Help | Site Map

How to play a flash movie continuously while the user browses my page?

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,736
#1: Aug 23 '08
Hi.

So I have this flash movie that plays a Mp3 file using the MediaPlayback component, which is all working wonderfully.
If the user presses a play button, the song starts to play, and I would like it to continue to do so while he is browsing around my page.

The only thing I can think of at the moment that would make this possible would be to use frames, and I'm trying to do that now, but I would rather not be stuck with that. They cause all sorts of collateral damage that I could do without.

Any suggestions would be greatly appreciated.

Thanks,
Atli Þór.
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#2: Oct 28 '08

re: How to play a flash movie continuously while the user browses my page?


I know this post was quite a while ago, but if you still need help, I'd recommend using the Sound.onSoundComplete event handler. If you are still working on that project, or need further assistance please let me know, and I will help you.

joedeene
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,736
#3: Oct 29 '08

re: How to play a flash movie continuously while the user browses my page?


Hi joedeene.

Thanks for the suggestion, but I can't really see how this event would help.

The problem is; when a client enters my page, the flash movie is loaded and the sound starts to play. If the client then decides to navigate away from that page to another section of my page, the flash movie is re-loaded and starts playing from the beginning again.

The best solution I managed to come up with was using JavaScript.
I basically created a variable containing the current position of the player within flash, which I had the JavaScript read every 250ms and save in a cookie.
Then, whenever the client entered a page, I would check that cookie and start playing from the saved position.

This is obviously a little defective, because even tho the sound would start playing from the same position, there was always a couple of seconds cap while the page loaded.

I have actually abandoned this function of the web for now. I plan to re-create the web to operate entirely client-side, using AJAX to load required data from the server, which pretty much takes care of this problem.

But thanks for the help tho.
Come to think of it... that even handler you mentioned might solve another problem I have been working on.
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#4: Oct 29 '08

re: How to play a flash movie continuously while the user browses my page?


Ohh...Ya, if you client navigates to another page it will have to reload and re-download the flash file for viewing and start again basically from frame one, I'm wondering if there is also a handler, in flash, when you leave the page you're currently browsing, then you could use something like local Shared Objects to save the position. Also, when you said 'page' I thought you meant like one specific Web Page and not like more than one or a whole website. But sorry I couldn't help...

joedeene
Newbie
 
Join Date: Oct 2008
Location: Earth
Posts: 29
#5: Nov 2 '08

re: How to play a flash movie continuously while the user browses my page?


You could use Html frames, but that would be the very last resort.
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,736
#6: Nov 2 '08

re: How to play a flash movie continuously while the user browses my page?


Quote:

Originally Posted by joedeene

[...] then you could use something like local Shared Objects to save the position. [...]

Ahh thanks for that. This could be used to replace my previous attempt where I used JavaScript. I didn't know Flash could handle cookies.

Quote:

Originally Posted by Fabez

You could use Html frames, but that would be the very last resort.

Yea, that was what I originally thought to. But like I said in my first post, I would much rather not have to fall back on that.

In any case. My new AJAX version of my web will fix all of this :)

Thanks.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#7: Feb 17 '09

re: How to play a flash movie continuously while the user browses my page?


You could, of course, have one of those nasty pop ups that some sites use.. but you're better than that. Go AJAX.
Reply