SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Movie starts playing before webpage is loaded...

    Hi guys!

    I have created a tiny flash movie (my first ). Right now it starts playing before the webpage loads.

    How can I make it wait for the webpage to load and render and start playing when everything else is in place?

  2. #2
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's called a preloader job....Try the articles section of SP for help with this.

  3. #3
    SitePoint Enthusiast kansas411's Avatar
    Join Date
    Apr 2003
    Location
    Wichita, KS
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put a stop in the first frame so that it doesn't play automatically and then have a start button in it. Or make it really long by putting a whole bunch of blank frames in front of the actual content so that the page has time to load.

    Don't know what else to suggest at this point without knowing the movie or the page.

  4. #4
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kansas411
    Or make it really long by putting a whole bunch of blank frames in front of the actual content so that the page has time to load.
    don't do this, not scientific enough, how many frames would you put there? you would never know, becuase it would vary on the connection of the viewer. Use a preloader, that's why you have them.

  5. #5
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But doesn't a preloader preload the flash movie and play it when it has loaded 100%?

    That isn't the problem. The movie loads faster than the web page. I don't want it to start playing until the whole page has loaded.

  6. #6
    SitePoint Enthusiast kansas411's Avatar
    Join Date
    Apr 2003
    Location
    Wichita, KS
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Golgotha
    don't do this, not scientific enough, how many frames would you put there? you would never know, becuase it would vary on the connection of the viewer. Use a preloader, that's why you have them.
    It may not be scientific, but it would work. Preloaders only stop the movie from playing before it is all loaded if it is a big movie.

  7. #7
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah, my bad, didn't understand the problem.

    you could:
    use JavaScript to run a function when page is loaded that would then launch actionscript in Flash to play movie.
    Last edited by Golgotha; May 5, 2003 at 08:45.

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Golgotha your second idea is much more ideal for this situation. Basically put a stop in the first frame of the movie, then use a javascript onLoad handler in the body tag of your page which runs a function which calls the movie to start playing. Kinda like

    Code:
    <HTML>
    <HEAD>
    <meta http-equiv=Content-Type content="text/html;  charset=ISO-8859-1">
    <TITLE>food</TITLE>
    <script language="Javascript">
     function myLoader() {
      var b = (navigator.appName.indexOf ("Microsoft") !=-1) ? window.food : document.food;
      b.Play();
     }
    </script>
    </HEAD>
    <BODY bgcolor="#FFFFFF" onLoad="myLoader();">
    <!-- URL's used in the movie-->
    <!-- text used in the movie-->
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
     codebase="http://download.macromedia.com/pub/s...ersion=6,0,0,0"
     WIDTH="550" HEIGHT="400" id="food" ALIGN="">
     <PARAM NAME=movie VALUE="food.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="food.swf" quality=high bgcolor=#FFFFFF  WIDTH="550" HEIGHT="400" NAME="food" ALIGN=""
     TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
    </OBJECT>
    </BODY>
    </HTML>

  9. #9
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much freddy! I'll test that script tonight!

  10. #10
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what about this freddy?
    not sure I understand your code?

    add AS on frame 1
    stop();
    frame 2 give it the name map and script play();
    Code:
    <HTML>
    <HEAD>
    <meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
    <TITLE>food</TITLE>
    <script language="Javascript">
    function myLoader() {
    window.food.TCallLabel("/","map" );}
    </script>
    </HEAD>
    <BODY bgcolor="#FFFFFF" onLoad="myLoader();">
    <!-- URL's used in the movie-->
    <!-- text used in the movie-->
    <OBJECT classid="clsid[img]images/smilies/biggrin.gif[/img]27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/s...ersion=6,0,0,0"
    WIDTH="550" HEIGHT="400" id="food" ALIGN="">
    <PARAM NAME=movie VALUE="food.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="food.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="food" ALIGN=""
    TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
    </OBJECT>
    </BODY>
    </HTML>

  11. #11
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same things, but not needed, as Play(); will just move the playhead to the next frame and continue playing until the next stop, basically

  12. #12
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I feel like an idiot but I really suck at Java Script... I can't get it to work.

    Here's my code:
    Code:
     
    <HTML> 
    <HEAD> 
    <meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> 
    <TITLE>whatever</TITLE> 
    <script language="Javascript">
    <!--
     function myLoader() {  
       var b = (navigator.appName.indexOf ("Microsoft" ) !=-1) ? window.flashmovie : document.flashmovie;
      b.Play();
     }
    //-->
    </script>
    </HEAD> 
    <BODY bgcolor="#FFFFFF" onLoad="myLoader();"> 
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s...rsion=6,0,29,0" width="425" height="71">
    				<param name="movie" value="images/flash/flashanimation.swf" />
    				<param name="quality" value="high" /><param name="LOOP" value="false"><param name="PLAY" value="false">
    				<embed src="images/flash/flashanimation.swf" width="425" height="71" name="flashmovie" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" play="false"></embed></object>
    </BODY>
    </HTML> 

  13. #13
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Weird, I wonder whats going on inside the actual flash movie. Here I attached the sample that I used to show you.
    Attached Files Attached Files

  14. #14
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Argh! I forgot to add id="nameofflashmovie" in the <object> tag! Now it works perfectly (I think). Thanks for posting the .zip freddy!

  15. #15
    SitePoint Addict piku's Avatar
    Join Date
    Oct 2003
    Location
    Alameda, CA
    Posts
    239
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the thread, i found it useful. however, i was wondering... what do i need to add to the JS to make it work along w/ NS/Opera as well IE?

    thanks in advance.

    edit: i forgot to mention, i have a preloader scene as well called "preload"... and the main scene is "main". i added "window" to ".document" so it now reads "window.document.movName" (as stated in macromedia's site).

  16. #16
    SitePoint Addict piku's Avatar
    Join Date
    Oct 2003
    Location
    Alameda, CA
    Posts
    239
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^ttt


Bookmarks

Posting Permissions

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