SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Updating SWF (without a page load)

    Hey.

    Let's say I have a video page and I have a bunch of links that link to other videos (if the user doesn't have Javascript enabled). Using JS, I want to enhance my page and change the video automatically without going to another page. All my videos are the same size, by the way (there is no interface like Youtube, it's just like a screen and the video starts playing automatically).

    I'm wondering how I can update the video? Would I need to only modify the swf value, or completely rewrite it because the old swf is still playing? If anyone has done this before and would like to share, I'd appreciate it.

  2. #2
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I imagine you could do something like this:

    Code:
    <div id="ad">
      <!-- INSERT SWF CODE HERE -->
    </div>
    And simply refresh the contents of #ad with javascript:

    Code:
    document.getElementById( 'ad' ).innerHTML = '<!-- INSERT NEW SWF CODE HERE -->';


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
  •