Change HTML background color with AS3

Hi all,
I'm looking or a way to change my HTML background color trough Flash.
The problem is it's not working any ideas? here is the code i'm using
HTML HEAD
<script language="JavaScript">
function changeBgColor(newBgColor)
if (window.document && window.document.bgColor)
        document.bgColor = newBgColor;
</script>
Flash document
import flash.external.*;
var jsCall:String;
this.addEventListener(Event.ENTER_FRAME, bgChange)
function bgChange(e:Event):void{
    jsCall = String(ExternalInterface.call("changeBgColor", "#FF0000"));
best regards!!!

Change your AS3 function code to be more like...
function bgChange(e:Event):void{
    var result:Object = ExternalInterface.call("changeBgColor", "#FF0000");
and I suggest you do not use...
this.addEventListener(Event.ENTER_FRAME, bgChange)
as that will continuously trigger the function call at the frame rate of the Flash file.  If the intention is to only trigger it once, then just use...
bgChange();

Similar Messages

  • Change Browser Background Color with Image Fill

    I inserted a picture using 'Image Fill' and 'Original Size' under Browser Background in the Page Layout tab and the browser background, I assume, defaults to white.
    I need the browser background to be a standard black color with an Image Fill. I searched around the iWeb preferences and tabs but found no option...
    Many thanks in advance!
    Alex

    The only way to get a black browser background is to set it to black. If you tile the photo there will be not browser background or make the image large enough so that it would take a very large browser window to exceed the photo's size. Or create a very large canvas with the photo in it at its original size and the rest of the area black.
    OT

  • Change applet background color with a button

    Does anyone know how to change the background of an applet by clicking a button within the applet? Thanks.

    Add an ActionListener to the button which calls the setBackground method.

  • How to change the background color only for one HTML-Portlet?

    Hi all,
    I have created a HTML-Portlet in my root-page. The root page have a style: Main-Style.
    I want to change the background-color only for this one HTML-Portlet:
    <html>
    <header><title>Test</title></header>
    <body bgcolor="#999999">
    Test
    </body>
    </html>
    But this does not work...
    When I use the CSS, then it will change the background-color for the root-page too.
    Thans
    Leonid Pavlov

    could you try this
    <table bgcolor="#999999">
    <tr>
    <td>
    test
    </td>
    </tr>
    </table>
    I don't think you need <html><header><title>Test</title></header>
    <body></body></html> for your HTML-Portlet.

  • How do I change to background color in the open tabs; currently grey with black text, hard to read.

    In FF 4.0 can I change the background color of the open tabs. Currently it is grey with black type. A lighter background would be easier to read.
    Thanks, TJH

    Download this addon: https://addons.mozilla.org/en-us/firefox/addon/stratiform/ It allows you change the color of the tabs, plus many other options.

  • Change the background color on the textbox with setToolTipText method

    Hi there,
    Is there anyway to change the little help text background color
    with the setTipToolText() method ???
    Thanks a million
    Christian

    use the javax.swing.UIManager and set the appropriate properties:
    ToolTip.backgroundInactive
    ToolTip.borderInactive
    ToolTip.foregroundInactive
    ToolTip.border
    ToolTip.foreground
    ToolTip.font
    ToolTip.hideAccelerator
    ToolTip.background <- this is probably the one you want

  • How do I change the Background Color of a Shape in iWeb?

    I am adding a comment bubble from the Shape menu for one of my photos. Everytime I try to change the background color of the bubble I end up changing the entire background color of the Web Page.
    How do I only change the background color of the shape?
    G5   Mac OS X (10.4.4)  

    Hi Kyn,
    Perhaps you (or anyone else!) can help me with this too: is it possible to change the color of the border styles that you choose for the thumbnails on a photo page? There is no "fill" option in the Graphic pane of the inspector when I select one of them. I love some of the styles but would like to be able to match the color better to my pages. See here for an example:
    http://web.mac.com/mousie/iWeb/Site/Recount.html
    The twirly border is a little too orange for my taste.
    Thanks in advance.

  • Can i change the background color of a file from white?

    i want to change file backgrounds from bright white, to a more soothing color.

    Each program is different and do not always have controls to change the background colors.
    For jpg files view this:
    https://www.youtube.com/watch?v=u5-WmuLFHys
    or this for jpeg
    http://www.wikihow.com/Change-an-Image-Background-in-MS-Paint-(Green-Screen)
    or this for pdf
    http://sodapdf.com/blog/sodapdf-tutorials/how-to-edit-a-pdf-file/pages/how-to-add-or-replace-a-backg...
    or of a folder
    http://www.sevenforums.com/customization/336693-how-change-background-color-folders-windows-7-a.html
    Anything else, I can't help you.
    Please mark my post as SOLVED if it has resolved your problem. It helps others with similar situations.

  • Anyone using Simple Viewer?  How do I change the background color?

    To match my website better, I would like to change the background color to white. Any ideas... Hopefully automatically?

    Hello TandA4,
    You need to open up the folder you created. Locate the file called "index.html" and open it with text edit. Find the following three pieces of text:
    background-color: #181818;
    <param name="BGCOLOR" value="#181818" />
    scale="noscale" bgcolor="#181818" type="application/
    In each case change the "181818" (or what other numbers or digits are there) with six F's. It should look like: background-color: #FFFFFF.
    Kind Regards,
    --Eric
    Ash Films
    <edited by host>

  • Change the background color in a report cell - td bgcolor

    Hi.
    I have a report in which I would like to change the background color of a table cell based on some values in the underlying query
    If Column A > Column B and Column C > 10, I want to color the background green. In my cgi , this was easy, but in apex, even if I write the query to output html, won't everything already be wrapped in the <td></td> tags? Is there any way around this?
    Thanks

    Mike ,
    With the above solution you can conditionally fill the report cell with a particular color and not the entire row set. If you want to highlight entire row, you have to do something different. Take a look at this jQuery function
    Step 1 . Download jquery http://code.jquery.com/jquery-1.4.2.min.js
    Step 2. Upload it to apex image folder using shared component.
    Step 3. In the page header put the following code
    <script src="#WORKSPACE_IMAGES#jquery-1.4.js" type="text/javascript" ></script>
    <script type="text/javascript">
    $(document).ready(function(){
         if ($('.apexir_WORKSHEET_DATA').length > 0) {
              function HighLightRows(){
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GRAY)").siblings().addClass('greentd');
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GRAY)").addClass('greentd');
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GREEN)").siblings().addClass('graytd');
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GREEN)").addClass('graytd');
         // This time out is required since after the report is refreshed via AJAX,
                                  setTimeout(function(){HighLightRows();},1000);
         }//if
    HighLightRows();
    </script>
    <style type="text/css">
    .apexir_WORKSHEET_DATA td.greentd
    background-color: green !important;
    .apexir_WORKSHEET_DATA td.graytd
    background-color: gray !important;
    </style>
    Step 4. Change the SQL Query to
    SELECT
         SALE_DATE
         ,PRODUCT_NAME
         ,PRODUCT_ID
         , CASE WHEN SALE_DATE > ADD_MONTHS(SYSDATE,-2) THEN
                     '<COLOR_GREEN>&#38;nbsp;</COLOR_GREEN>'
              ELSE
                      '<COLOR_GRAY>&#38;nbsp;</COLOR_GRAY>'
         PRODUCT_NAME_COLOR
    FROM SALES;
    Step 5. Make this new column PRODUCT_NAME_COLOR visible and in the column heading u can just put &#38;nbsp;.
    As long as this column will be available for display you will see the conditional highlighting.Thanks,
    Manish

  • Change different background color in row grid

    Hi,
        i want to change different  background color in row grid..ex.two different colors should continue in all row grid..pls guide me ..
    Regards,
    Senthil.

    Hi Senthil,
    If I understand you correctly, you wish to show a grid with alternating colours down the rows.
    You have a few options:
    1) Apply a stylesheet nd display it as HTML.  But this solution lacks the advantages of the iGrid
    2) Return a field with alternating 1's and 0's in the query and use this field in the Colour-Context mapping
    3) Use JavaScript to loop through each row and set alternating background cell colour for all columns
    Hope this helps.
    Cheers,
    Jai.

  • I am new to this I am trying to do something very simple.  I need to change the background color to

    I need to change the background color of a photo to white and then shrink the head of a photo for a passport and make the picture output a 2x2.
    Can someone help.  Thx

    Here are the requirements for US passport. Scroll down for the passport tool to make the picture utilizing one on your disk.
    http://travel.state.gov/passport/pptphotoreq/pptphotoreq_5333.html
    If you decide to make it in Elements and print it, you should have a resolution of 240-300 px/in for a good output.  I suggest that you print the 2 photos on good quality paper, probably both on 4x6 stock, and trim with scissors to specification.
    Open your picture and go to Image>resize>picture size, and check the resolution. If it is less than 240 px/in, enter 240 in the field and see if the dimensions remain adequate. If not, you may have to resize.
    Use one of the selection tool, e.g. lasso tool, or selection brush tool, to select head and shoulders
    Go to Edit>copy to put the selection on the clipboard
    Open a new, blank file (File>new>blank file) 2.25 x2.25", resolution the same value as your picture, background white
    Go to Edit>paste. The picture will be on its own layer
    Access the move tool to position it, and to resize with the corner handles of the bounding box, if necessary
    Please report back with your progress.

  • How to change the background color of a single row

    Hi OTN,
    I am using JDeveloper 11.1.1.2 with ADF faces in view layer.My issue is How to change the background color of a single row in af:table ?.

    How to highlight ADF table row based on column value?
    Found by searching

  • How can I change fullscreen background color, so that it is the same when viewing on mac and iPad? I want this to be able to use MathType in widget text.

    How can I change fullscreen background color, so that it is the same when viewing on mac and iPad? I want this to be able to use MathType in widget text.
    As an example, html widget has white background on iPad, and black on mac. The same goes for interactive widget.
    The MathType text inserted is inserted as a image, and will have the same color when in fullscreen as when not. So I need the textcolor to be the same in both views. Anyone know how to fix this?

    We're still not communicating. This is why I wanted an example .iba.
    Here's a re-creation of my own, going off what you described. You said "all html widgets and all gallery widgets" have this problem. So I inserted a blank HTML widget and a blank Gallery widget, and typed into both. Inserted a MathType equation into both. I don't see any difference when I preview it on my Mac compared to the preview on the iPad. I want to help, but I can't help if I can't duplicate the issue.
    I've attached the screen shots and the .iba file [link to .iba file].
    Feel free to email me directly at bobm at dessci dot com. If you're uncomfortable giving some information here, tell me anything you want in email. I work for the "MathType company", Design Science.

  • How to change the background color of a sequence?

    I'm using Premiere Pro CS5 on Win7 x64.  I've imported a JPEG that's a different size than my 1920 x 1080 frame.  The background of this JPEG is white, but the background of the sequence is black (by default), so the borders of the JPEG make it stand out.  I want the JPEG to blend into the sequence background by making the sequence background white.  How can I change the sequence background color?  Thanks.

    Jim and Ann are correct. I can see where someone used to After Effects might ask that question though because in AE you can change the background color of the composition. Same with Photoshop.
    However, I think it would confuse things if changing the background color were to be allowed in Premiere Pro. Black tells me something. I suppose white could tell me the same thing, but at this time it is not possible in Premiere Pro.

Maybe you are looking for