Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Style sheet switchin restarts my swfs

  1. #1
    Join Date
    Mar 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Style sheet switchin restarts my swfs

    I'm using the style sheet switcher at http://www.dynamicdrive.com/dynamici...etswitcher.htm

    The prob is whenever I switch style sheets it restarts my flash movies, and theres an animation with sound that would be annoying to hear every time someone switches. Please advise.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Have the animation start with its sound off. Um, is there any reason why the swfs reload? I'm thinking that unless they are a part of your style, they should not. Is the whole page reloading? I don't think that it should.

    However, I notice that on the demo page here at Dynamic Drive that they have chosen not to have any of the flash banner ads that almost all demo pages have. This may indicate an incompatibility with flash for this script.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    huh...now that I think about it I have external javascript files with the flash movies:

    Code:
    function Runcow()
    {
       document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="413" height="236">\n');
       document.write('<param name="movie" value="cowabunga.swf" />\n');
       document.write('<param name="quality" value="high" />\n');
       document.write('<param name="wmode" value="transparent" />\n');
       document.write('<embed src="cowabunga.swf" width="413" height="236" wmode="transparent"></embed>\n');
       document.write('</object>\n');
    }
    I did this to get rid of the box that would highlight swf's when you mouse over them at first. Would this be making them restart?

  4. #4
    Join Date
    Mar 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I put the swfs in normally without using js and they still replay...I guess the style sheet switcher just reloads the page...

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I just did a test using a swf that plays a flv file. It didn't restart the swf when the styles were changed. I did use pretty simple styles though. However, I am thinking that there is something else beside the style switcher that is causing this. It might even be something in the code of the swf files. Also, swf files can have sound and motion without flv files so, maybe that sort of swf is more prone to this problem.

    Could you provide a link to a demo of the problem?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Mar 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah sure. thanks for your help. http://weargoodness.com/index5.htm

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Right away I noticed that this is not a problem in IE 7 or Opera 9.01, it was a problem in FF 1.5.0.10. After some fairly extensive testing I discovered that even if I used FF's native style switcher from its view menu, the problem still occurred. However, since (at least in your demo) you are only changing the background image, I discovered that by only doing that, it didn't cause the problem in FF. Example commands:

    Code:
    document.body.style.backgroundImage='none'
    Code:
    document.body.style.backgroundImage='url(http://weargoodness.com/bg1.jpg)'
    Code:
    document.body.style.backgroundImage='url(http://weargoodness.com/bg2.jpg)'
    Bottom line, this appears to be a bug in FF as regards alternate style and flash.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Mar 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So youre saying I dont even need the style sheet switcher script? I'm not sure how to implement these commands but I'll try to find some time and play with it...thanks for your help man

  9. #9
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Hmm..
    doesn't Firefox require singular quotes around the url() selector?
    Code:
    document.body.style.backgroundImage="url('http://weargoodness.com/bg1.jpg')"
    - Mike

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by rysotope View Post
    So youre saying I dont even need the style sheet switcher script? I'm not sure how to implement these commands but I'll try to find some time and play with it...thanks for your help man
    Well, you could do something as simple as:

    Code:
    <a href="#" onclick="document.body.style.backgroundImage='url(http://weargoodness.com/bg1.jpg)';return false;">Floral</a>
    I'll try to work up something using an array for you if your demo is still online.

    Quote Originally Posted by mburt View Post
    Hmm..
    doesn't Firefox require singular quotes around the url() selector?
    Code:
    document.body.style.backgroundImage="url('http://weargoodness.com/bg1.jpg')"
    Not required, won't hurt and is a good habit. But, gets a little complicated if it is something like an onclick event.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •