A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: script to change htm b/ground color?

  1. #1

    script to change htm b/ground color?

    Hello All!

    Q. Can I call a serverside script ( perhaps using getURL ) to change the background color of the .htm file that has my swf embedded into it?

    I'm just like that fly walking through the barrel of honey - stuck!

    A. ---------------?!?

    Would appreciate a little pointer here,

    Cheers,

    Scott

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    It could be done with javascript

    in between the <head> and </head> tags of the page add this function

    <script>
    function changeBG(col) {
    document.bgColor=col;
    }
    </script>

    then in flash you could use something like

    getURL("javascript:changeBG('red');");
    or
    getURL("javascript:changeBG('#ff0000');");

  3. #3
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175
    Hi !

    And why not to say just:

    getURL("javascript:document.bgColor='#ff0000'; void(0);");

    without editing HTML page ? :)
    Good luck !
    Ilya. [email protected]
    Flash sources page

    [swf width="285" height="50" background="#FFDB5A"]http://polar-lights.com/biker/polar.swf[/swf]

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