www.webdeveloper.com
Results 1 to 4 of 4

Thread: flash keeps playing after i leave web page

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    18

    flash keeps playing after i leave web page

    I have run into a sticky problem in IE7.

    A visitor can click on one of four links on an HTML page. Each takes them to a correlating anchor position within a movie that is located on another page.

    When they click on the link, they are taken to that page and the movie begins playing at that location. So far, so good.

    Some visitors hit IE's browser back button to return to the orig page. There, they click on one of the other anchors and are once again taken to the page with Flash. This time, however, the audio from the first anchor they clicked continues to play below the new audio they selected.

    Apparently, the original link doesn't stop playing. Is there a way to stop a movie from playing as someone uses the browser's navigation to leave that page? Is there another solution?

    I'm a novice at AS3, and really need the help.

    Thanks. The links page is here (just click on a photo to begin the movie. The most problematic link is the first one, "Larry")

    http://www.themarksonconnection.com/...d=63&Itemid=55

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Well without seeing the code you are using it’s pretty hard to tell you how to fix it, but here are a couple suggestions on basic rules to fix the problem. And please don’t show me the code… try to fix it yourself from these suggestions.
    First directly download the .swf file you are using here:
    http://www.themarksonconnection.com/video.swf
    click all the buttons… everything works fine .. but, did you notice, when the file first load it auto plays starting with Dr. Larry. So in the Web page, regardless of which Dr. you click, it will always play Dr. Larry (from the cache), besides the other Dr. you may have clicked on. Test that for yourself. Then do this, play the Dr. Larry video and back arrow to the home page. While there, delete all the files from the Temp Internet cache (in IE Tools/Internet Options/Browsing History/Settings/View Files) .. then delete them all. Close everything out and you’re back to your Web page. Now choose any Dr. and NO Problem.
    Since I ain’t ah’ very good at PHP, I’m not exactly sure how you are navigating to the various sections of the .swf, but however you are going it, you will need to stop the current video from playing before any nav changes are made.
    So if you are using a PHP array, one way around this would be to load a non-existent element. To stop one video from playing (as in an array), call for an element which does not exist in the array. So if you have 4 videos in your array, on click, have your function call for the 6th element in the array. You now have stopped video 1 and the 6th file does not exist, so nothing happens. Then immediately call for the correct element. At the very least, you will need to stopAllSounds(); (Google for more info).
    To illustrate, here is a AS2 button which took viewers to another page… but the music would keep playing.. until I added the code to load a fake url in the array
    Code:
    home_btn.onRelease = function() {		
    	getURL("http://www.uncledoodad.com/index.htm");
    	jukebox.loadSound(urls[100],false);
    }
    When jukebox did a loadSound, it stops the current and tries to load [100]. Since there is no 100 in the array, it stops playing while getting the other URL.
    Sorry that this doesn’t solve the issue but it should help you understand the problem better.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com

  3. #3
    Join Date
    Aug 2009
    Posts
    18
    Thanks for the input. When I go from the html page (a page in Joomla) to the html/joomla page that holds the flash movie, I use a simple hyperlink with the page url plus "#" and then the label of the flash frame I want to jump to. No PHP.

    From what you're showing me, I can code into AS3 so that it stops the audio when I call a non-existent label. But here's the rub. These users are either linking back to the original Joomla page using the web page's nav bar OR they are linking back using the back button in IE. So is there a code in flash like in javascript that calls a function when the current page unloads? For instance, onUnload stop movie OR onUnload play non-existent audio?

  4. #4
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    I don't know about that. But the idea is to stop all video (or sounds) as the first step in starting the next video. So the main .swf should not auto play in the first frame but either call a non existent element or stopAllSounds.
    So whichever Dr. you choose, all prior choices are negated (as you described with the .js).
    EfV

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles