A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Help with the SWFObject!

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    9

    Help with the SWFObject!

    Hi there,

    Please, can someone help me, how to use the SWFObject for my HTML page that contains 2 flash objects and one media player object .wmv. The standard procedure below work just fine for one flash object, but when i try to use it for multiple objects in one web page, it doesn't work! May be i am missing something or it is just a more complicated code! Please, help! Thanks in advance!

    <script type="text/javascript" src="swfobject.js"></script> /in the head of the html page/ and:

    <div id="flashcontent">
    This text is replaced by the Flash movie.
    </div>
    <script type="text/javascript">
    var so = new SWFObject("movie.swf", "mymovie", "500", "100", "6", "#003399");
    so.addVariable("variable", "varvalue");
    so.write("flashcontent");
    </script>

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    You don't share all the code, so it's harder to tell, but:
    Make sure you use two different ids.
    Code:
    <script type="text/javascript" src="swfobject.js"></script> /in the head of the html page/ and:
    
    <div id="flashcontent">
    This text is replaced by the Flash movie.
    </div>
    <script type="text/javascript">
    var so = new SWFObject("movie.swf", "mymovie", "500", "100", "6", "#003399");
    so.addVariable("variable", "varvalue");
    so.write("flashcontent");
    </script>
    
    <div id="moreflashcontent">
    This text is replaced by the Flash movie.
    </div>
    <script type="text/javascript">
    var so = new SWFObject("movie2.swf", "mymovie2", "500", "100", "6", "#003399");
    so.write("moreflashcontent");
    </script>

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    9
    Thanks, that's a big help, the code itself doesn't differ much from the one shown, because i didn't know what kind of code to use for the second movie on the page!

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Posts
    9
    I can't use though the same code for the wmv movie. Do you have any clues? Thanks for the help!

    <object id="MediaPlayer" width="344" height="280" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject">
    <param name="FileName" value="
    http://xxx.wmv">
    <param name="autostart" value="1">
    <param name="showcontrols" value="1">
    <embed type="application/x-mplayer2"
    src="xxx.wmv"
    width="344"
    height="280"
    autostart="1"
    showcontrols="1"> </embed></object>

  5. #5
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Read this.

  6. #6
    Junior Member
    Join Date
    Oct 2005
    Posts
    9
    Thanks, very useful article, big help nunomira

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center