Html page in body

I can send mail with simple text in the body.
But when i am sending html contents in the body i got blank content in the email body.
This is my code.
MimeMessage m = new MimeMessage(session);
if(From != null | To != null)
Address from = new InternetAddress(From);
m.setFrom(from);
Address [] to = InternetAddress.parse(To);
m.setRecipients(Message.RecipientType.TO,to);
if(Cc != null)
Address [] cc = InternetAddress.parse(Cc);
m.setRecipients(Message.RecipientType.CC, cc);
m.setSubject(Subject);
m.setSentDate(new java.util.Date());
mbp1.setText(Contents);
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
m.setContent(mp);
Transport transport = session.getTransport("smtp");
transport.connect(getSmtpHost(), "xxxxxxxxxxxxxxxxxxx", "xxxxxxxt");
m.saveChanges();
transport.sendMessage(m, m.getAllRecipients());
transport.close();
else
throw new NullPointerException("IST Send Mail Exception : From or To can not be null..");
}

I have solved it my self.

Similar Messages

  • How to place a html page into body part of mail?

    Hi,
    I want to place a html page into body part of any mail.How can i do this?
    Thanks...

    just set ur message type to text/html and put ur whole html string into the body will do...

  • Please help to send an email with html page in body

    I need an html page on the body of an email to send an email blast to our customers.

    HTML Emails can be a bit tricky. You can design them in Dreamweaver, but you really shouldn't send mass email through your personal email account (or your company account). That could get you blacklisted by corporate spam filters and make your email addresses pretty much useless.
    For mass email campaigns (over a few hundred email addresses) I use http://www.icontact.com.
    You can build the email right through their site (without DW) or you can import your html from DW to their service.
    Some things to keep in mind with HTML email...
    1. Use absolute links to images and files on a server you control
    2. Use a limited amount of inline css (no external or embedded css)
    3. Use table based layouts, css support is spotty at best with email clients
    4. The <head> will be stripped from a number of email clients, don't rely on anything between the <head> tags making it to your recipients
    5. Don't use an image-only email. HTML text is very important to keep it from being labeled spam, make the images secondary to the message, many email clients will not download images without the user's say-so
    6. Include an opt-out link so people can get off your list
    There are more things to watch out for, but those are the big ones. Here is some more good info: http://alt-web.com/Articles/HTML-Emails.shtml

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • Error while invoking BPEL Process through HTML Page

    Hi ,
    I have created a HTML Page to invoke BPEL synchronous process .
    HTML Page contains :
    <html>
    <head>
    <title>Untitled Document</title>
    <h1>Add Macro Task Input Form </h1>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="cyan" text="#000000">
    <form name="form1" method="get" action="/httpbinding/default/AddMacroSync/process">
    EmployeeId :
    <input type="text" name="EmployeeId" ><br>
    <br>
    TaskName :
    <input type="text" name="MacroTaskName" >
    <button
    id="identifier"
    class="dialog"
    label="OK"
    accesskey="t"/>
    <br>
    </form>
    </body>
    </html>
    I am able to invoke my BPEL Process named as " AddMacroSync" .
    It also creating instance for this BPEL Process .
    But when I go BPEL Console and check my instance , it is always faulted .
    I am providing two inputs : Employee Id and Taskname through HTML Page .
    These inputs got assigned to their respective output variables .
    But when I click on audit link ..it shows error while invoking the Process .
    It Show error :
    when invoking endpointAddress 'http://152.69.248.232:8990/AddMacroTask-AddMacroTask-context-root/AddMacroTaskWebService', [java.lang.NumberFormatException]
    But this end point address is working when I put this address in URL .
    Please someone help me how to solve this problem .
    Thanks
    Prashant Dwivedi
    Message was edited by:
    Prashant Dwivedi

    Hi Clemens ,
    I changed My HTML ...Now it looks like as :
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="application/x-www-form-urlencoded; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <form name="form1" method="post" action="/httpbinding/default/AddMacroSync">
    <input type="hidden" name="msg_part" value="payload">
    <input type="hidden" name="namespace" value="http://xmlns.oracle.com/AddMacroSync">
    EmployeeId:
    <input type="text" name="EmployeeId">
    TaskName :
    <input type="text" name="TaskName">
    <input type="submit" name="Submit" value="Submit">
    </form>
    </body>
    </html>
    After this when I try to incoke my BPEL Process through this HTML :
    I am gettign following error :
    500 Internal Server Error
    java.lang.IllegalStateException: IOException: Premature end of POST data
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.EvermindHttpServletRequest.getParameter(EvermindHttpServletRequest.java:2452)
         at com.collaxa.cube.ws.http.HttpBindingServlet.checkSecurity(HttpBindingServlet.java:281)
         at com.collaxa.cube.ws.http.HttpBindingServlet.doPost(HttpBindingServlet.java:85)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)

  • "Page Path" in HTML Page Skin

    Hey Guys,
    I was wondering if anyone knows how I could include the behavior that the "Page Path" Item provides, but I would like to do it in an HTML Pageskin. Seems like this would be fairly common for those people using page skins.
    Thanks
    -sean

    Hi,
    I insist : it is not possible with HTML to insert Page breaks. BUT, Tammie is right! You can use CSS (Cascade Style Sheet) to insert page breaks thanks to few lines of code in your HTML page.
    Follow this link to have a look at a very simple piece of code to illustrate this :
    http://www.codeave.com/css/code.asp?u_log=4016
    Here it the code if you don't have access to this URL :
    <html>
    <head>
    <title>CodeAve.com/CSS - Page Break</title>
    <body bgcolor="#FFFFFF">
    <center>
    Page 1
    <br style="page-break-before:always;">
    Page 2
    <br style="page-break-after:always;">
    Page 3
    <p>
    Use print preview on your browser to see how<br>
    this page would print out to three pages
    </center>
    </body>
    </html>
    Hope it helps.
    Don't forget to close the post if solved (so that search in the forum is easier), and reward points (so that SDN members are happy !) 

  • How to develope a par file with a static html pages in NWDS

    Hi to all,
    what is the procedure to put static html pages as iviews by using programming.
    In my project hierarchy where should i keep the html file, and what component should be generated? to generate a par file.
    using that par i'll generate a iview and i will link to my page.
    but i need a procedure to generate a portal component of this type.
    if any body is having the procedure of this, or any online help documentation link u have please forward to me.
    Thanks & Regards,
    sireesha.

    Hi,
    Check whether KM is installed in your server. If yes then you can view it under Content Administration>> KM content(like the Portal Content).
    In that you can see the Root folder>>documents>>Public Documents. If you wish you can create your own folder or can  just upload the file inside that folder.
    1. to create a folder go to Folder >> new folder...
    2. to upload the file click Folder>>New>>upload.. then you can browse to the local system and from there you can upload file.
    The path that you have to give in the Iview shloud be like
    \documents\Public Documents\<your foldername>\filename.
    Hope this Helps
    gEorgE

  • How do I add to the HTML page containing an fla?

    Hi,
    My site has Flash Video that plays back in a Flash movie
    file.
    I want to put html text on the html page containing the Flash
    movie so that if a viewer doesn't have Flash, they can see a plain
    text link that sends them to a page with a Windows Media Player.
    When I attempt to add text to the html page containing the
    Flash movie, the text doesn't appear and my page changes background
    color.
    Where in the source code should I be adding my html text?
    Please indicate the insertion point below.
    Source code below or visit
    http://www.ocatillopictures.com/OcatilloFrames/Animation.html
    Thanks
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Janos-FlashPlayer</title>
    <script language="javascript">AC_FL_RunContent =
    0;</script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    </head>
    <body bgcolor="#100068">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    <p align="center"><font face="Wingdings 3" size="16"
    color="#80dbf9" letterSpacing="0.000000" kerning="1"><a
    href="
    http://www.ocatillopictures.com/FinalPages/Animation.html#Janos
    Video Anchor" target =
    "_self"><b>t</b></a><font
    face="Arial"><a href="
    http://www.ocatillopictures.com/FinalPages/Animation.html#Janos
    Video Anchor" target = "_self"><b>Return to
    Menu</b></a></font></font></p>
    <p align="center"><font face="Arial" size="16"
    color="#80dbf9" letterSpacing="0.000000" kerning="1"><a
    href="
    http://www.ocatillopictures.com/movie-pg/Janos-movie.html"
    target = "_self"><b>View Windows
    Media</b></a><font face="Wingdings 3"><a
    href="
    http://www.ocatillopictures.com/movie-pg/Janos-movie.html"
    target = "_self"><b>u</b></a><font
    face="Arial"><b>
    </b></font></font></font></p>
    -->
    <!-- saved from url=(0013)about:internet -->
    <script language="javascript">
    if (AC_FL_RunContent == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
    'width', '700',
    'height', '500',
    'src', 'Janos-FlashPlayer',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Janos-FlashPlayer',
    'bgcolor', '#100068',
    'name', 'Janos-FlashPlayer',
    'menu', 'true',
    'allowFullScreen', 'false',
    'allowScriptAccess','sameDomain',
    'movie', 'Janos-FlashPlayer',
    'salign', ''
    ); //end AC code
    </script>
    <noscript>
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="700" height="500" id="Janos-FlashPlayer" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="Janos-FlashPlayer.swf"
    /><param name="quality" value="high" /><param
    name="bgcolor" value="#100068" /> <embed
    src="Janos-FlashPlayer.swf" quality="high" bgcolor="#100068"
    width="700" height="500" name="Janos-FlashPlayer" align="middle"
    allowScriptAccess="sameDomain" allowFullScreen="false"
    type="application/x-shockwave-flash" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    />
    </object>
    </noscript>
    </body>
    </html>

    You have the text commented out. Remove the "<!--" before
    your text and the "-->" after the text and it will show.

  • How to embed a Video stored in KM repository on html page

    Hi All,
    I have a requirement to embed a video stored in KM repository on html page.
    My html page and related file referred in html code below (highlighted) are stored at following path in KM “root>documents>test” with the same name as mentioned in code.
    Code which I got from net for embedding an .flv file on html is mentioned below but how should I modify it to take files stored in KM.
    <html>
    <head>
    <title>Flash Test</title>
    </head>
    <body>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="Jacksonville" name="movie" width="425" height="305" align="center" id="movie">
                               <param name="allowScriptAccess" value="sameDomain" >
                               <param name="movie" value="<b>player.swf</b>?file=<b>Radvan_001MEDWHI.flv</b>" >
                               <param name="menu" value="false" >
                               <param name="quality" value="high" >
                               <param name="scale" value="noborder" >
                               <param name="salign" value="lt" >
                               <param name="wmode" value="transparent" >
                               <param name="bgcolor" value="#000000" >
                               <embed src="<b>player.swf</b>" menu="false" quality="high" scale="noborder" salign="lt" wmode="transparent" bgcolor="#000000" width="425" height="305" swliveconnect=true id="movie" name="movie" align="left" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="<b>install_flash_player_active_x.msi</b>" >
                             </object>
    </body>
    </html>
    Please guide me for the same.
    Regards,
    Madhvika

    Hi,
    I have stored all the files referred in code ( player.swf, install_flash_player_active_x.msi and Radvan_001MEDWHI.flv ) at root>documents >test folder in KM repository
    <u><i>Julian</i></u>
    My requirement is to know, what path i should give for the files highlighted with bold in my code as they are stored in KM .
    <i><u>
    Praveen</u></i>
    Can you please tell me how should I modify these lines in code (name of video file is Radvan_001MEDWHI.flv)
    <param name="movie" value="player.swf?file=Radvan_001MEDWHI.flv" >
    embed src="player.swf"
    pluginspage="install_flash_player_active_x.msi" >
    Regards,
    Madhvika

  • Referencing a "locally installed" Java applet from a server-based HTML page

    How does one reference a "locally installed" Java applet from a server-based HTML page (i.e. via the applet, object, or embed tags)? I have seen references in documentation that this is possible, but I have not seen any examples. I have tried a few things, but nothing seems to be working.
    Some background...
    I'm working on a web site that aggregates Internet video. For many users, I would like the site to work "without" requiring Java to be installed (or any prompts, etc.). This version of the site allows users to stream videos directly over the Internet and does not require any sort of access to the local system.
    However, in addition, I have a download manager that can be installed on the local system. Currently, it's a Windows-based "service" that is always running in the background, downloading files, etc. (with plans to later support other OSes).
    My dilemma is trying to communicate between my web site running in the local browser (executing JavaScript code) and the download manager. I call this component the "gateway". I need the gateway to be able to do the following:
    1) Pass user credentials from the web browser UI to the download manager (so it can communicate with my servers).
    2) Check the status of downloaded videos
    3) Launch a local media player (such as Windows Media, QuickTime, etc.) (or perhaps tell the download manager to launch the media player).
    Under Windows XP, I have an ActiveX control that can do these things. It communicates with the download manager via reading/writing to a shared XML configuration file.
    Unfortunately, under Vista and IE7 Protected Mode, ActiveX controls have become very restricted and my gateway no longer works. As such, I am looking at using Java for the gateway (also giving me the additional benefits of supporting additional browsers and OSes).
    From my understanding, I believe I can created a "face-less" Java applet, whose methods can be called from JavaScript. Ideally, I'm thinking I could install the applet onto the local system at the same time the download manager is installed. This would give the applet the security permissions it needs to communicate with the download manager.
    Thanks for any help and suggestions!

    Hi,
    Put the .jar file and the .class file in the path mentioned in one of the aliases in the plsql.conf file like /images or create
    a seperate directory and create an alias like /applets "path" in the plsql.conf file.
    <html>
    <body>
    <applet code=com.chartapplet.chart.BarChartApplet
    codebase=/applets/
    archive=/applets/chart.jar width=300 height=200>
    <param name=background value="white">
    </body>
    </html>
    Hope this helps.
    Thanks,
    Sharmila

  • How to change the file name of pdf file in html page?

    Hi,
    Actually my requirement is to upload 50 PDF files containing javascript in each file into flex page with the help of one html page.
    i did the the javascript part by using batch processing.
    now i want to call those pdf files one after another without changing the file name in html page
    the code written in html page is
    <html>
        <body>
            <object id="PDFObj"
                    data="http:\\localhost\pdf\20090807 - Batch 630.pdf"
                    type="application/pdf"
                    width="100%"
                    height="100%">
            </object>
            </body>
    </html>
    So every time i have to change that file name to acess another file.
    Is there is any other way to sort this problem????
    Plz anyone help me to sort out this problem with some code or some example.

    I once had a similar task for creating a webpage that I only use on my computer--a webpage that accesses PDF's and SWF's font previews from a list of fonts as "a href's".  What you must do is utilize the power of the command line, whether on a Mac on a PC or on Linux, Linux being the most powerful (although Mac IS Unix).  You must utilize variables, variable replacement, and then a command to print out the results of a "for" or "while" loop to a text file which will be your HTML file with each individual link automatically built into the HTML code.  You will have a list of 50 links.  If you are simply looking for a GOOGLE type functionality where you click on "Next" and "Previous" you will have to dig deeper into variable replacement--this I don't know how to do yet but there are books for command-line shell interpreters.  One shell interpreter is called "bash" (born-again shell) and there is a book on the market which gives a detailed example of how to replace variables in a shell script.  Again, I don't know how it works.  I will try to learn this at a later time when I am more seasoned with the basics of shell scripting.

  • How to get the source code of an HTML page in Text file Through java?

    How to get the source code of an HTML page in Text file Through java?
    I am coding an application.one module of that application is given below:
    The first part of the application is to connect our application to the existing HTML form.
    This module would make a connection with the HTML page. The HTML page contains the coding for the Form with various elements. The form may be a simple form with one or two fields or a complex one like the form for registering for a new Bank Account or new email account.
    The module will first connect through the HTML page and will fetch the HTML code into a Text File so that the code can be further processed.
    Could any body provide coding hint for that

    You're welcome. How about awarding them duke stars?
    edit: cheers!

  • Replace HTML page with an applet

    Hello to everybody!
    I created a servlet who can manage file upload from an HTML page.
    Now I want to replace that HTML page with an applet.
    I know that I need to use multipart/form-data , but I have no experience with applet.
    HTML page code is:
    <html>
    <head><title>Upload</title></head>
    <body>
    <FORM ACTION="http://localhost:8080/examples/servlets/servlet/UploadTest" ENCTYPE="multipart/form-data" METHOD=POST>
    What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
    Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
    <INPUT TYPE=SUBMIT>
    </FORM>
    </body>
    </html>
    Any help for "translating" this html page into an applet?
    Applet will send, like html page, a string and a file.
    Thanks in advance, Liuk

    If you use something like Apache Http Client you dont have to do any low level implementations.
    Also if you are the one who is writing both servlet and applet you dot have to stick to standerd formats. you can develop your own format and write both servlet and applet to handle it. that kind of thing can be done easily even with URLConnection. But if you plan to send large files then URLConnection may not be the right option becouse I have seen many complaining that URLConnection gives OutOfMemoryErrors when uploading large amounts of data.

  • How do I - change the background colour of the output HTML page

    Captivate 5
    I am publishing my project to html, but wish to change the background colour of the html page to match the projects colour scheme.
    I can find no option in Captivate to do this, and it is always output as white = <body   bgcolor="#f5f4f1">
    I change the colours used within captivate and change the html colour of the borders, or the captivate project background, but this does not effect the html page when published.
    Is this possible?
    At present I am having to manual amend the html to the colour of my choice.

    Hi there
    Can you post a screen grab of what you are seeing? The instructions Orange_Sean provided should have done the trick for you. Even though you aren't using Borders, it still should have changed the HTML background color. Unless we have unearthed a bug or something.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • Strange behaviour when embedding HTML page in Air

    Hi,
    I'm trying to embedd a HTML page to a Air application.
    The HTML page has a simple Flex application (TestFlex4Project.mxml) with a button that changes one HTML element on the web page (TestFlex4Project.html) using ExternalInterface. If I run the Flex application using the HTML page it works just fine and when I click the button the HTML ellement is changed and the mouseover- and onclick events works. If I embedd the HTML page in an Air application the mouseover- and onclick events does not work any more. Why?
    If I use Aternative 1 in the HTML code (instead of using Aternative 2 in the HTML code where I'm editing the innerHTML property) the mouseover- and onclick events works when the HTML page is embeded in Air. Why?
    Even more strange is that if I remove the line [<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />] from the HTML page the Flex application dose not show at all when embedded in Air. Why?
    You can try the online sample here and the files here.
    The application looks like this:
    And if you click the button and click the upper most text you will recieve a message like this:
    But not when I use innerHTML and embedd the HTML page in Air. Can anyone please help me with this issue. Is it a bug or what am I doing wrong? I need to change some HTML elements using innerHTML.
    Thanks!!
    The code for TestFlex4Project.mxml is like this
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
    width="100%"
    height="100%">
    <fx:Script>
      <![CDATA[
       function buttonClickHandler(event:Event):void{
       ExternalInterface.call(" function(){SetHTML();}")
      ]]>
    </fx:Script>
    <s:HGroup verticalAlign="middle">
      <s:Button label="Edit HTML Element" click="buttonClickHandler(event)"/> 
    </s:HGroup>
    </s:Application>
    The code for TestFlex4Project.html is like this
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8"/>
    <title>Test Flex 4 Project</title>
    <meta name="description" content="" />
    <script src="js/swfobject.js"></script>
    <script>
      var flashvars = {
      var params = {
       menu: "false",
       scale: "noScale",
       allowFullscreen: "true",
       allowScriptAccess: "always",
       bgcolor: "",
       wmode: "direct" // can cause issues with FP settings & webcam
      var attributes = {
       id:"TestFlex4Project"
      swfobject.embedSWF(
       "TestFlex4Project.swf",
       "altContent", "100%", "100%", "10.0.0",
       "expressInstall.swf",
       flashvars, params, attributes);
       function Message(){
       alert("Message!")
    function SetHTML(){
       //Start Alternative 1
       NewHTML.innerHTML = "Dynamically changed text"
       NewHTML.style.cursor = "pointer"
       NewHTML.style.color = "#ff0000"
       NewHTML.onclick = function(){
        Message();
       NewHTML.onmouseover = function(){
        this.style.fontWeight = 700;
       //End Alternative 1
       //Start Alternative 2
       var HTMLStr='<p style="cursor:pointer; fontWeight:300; color:#ff0000" onClick = "Message()" onMouseOver = "this.style.fontWeight=700">Dynamically changed text</p>'
       NewHTML.outerHTML=HTMLStr
       //End Alternative 2
    </script>
    <style>
      html, body { height:100%; overflow:hidden; }
      body { margin:0; }
    </style>
    </head>
    <body id="Body">
    <p id="NewHTML">This text will change when you click the button!</p>
    <p style="cursor:pointer; fontWeight:'300'; color:#ff0000" onClick = "Message()" onmouseover = "this.style.fontWeight='700'">Default text</p>
    <div id="altContent">
      <p><a href="http://www.adobe.com/go/getflashplayer">
       <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
       </a>
      </p>
    </div>
    </body>
    </html>
    The code for the Airapplication is like this
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
    width="800"
    height="566">
    <mx:HTML id="HTMLObject" location="TestFlex4Project.html" width="100%" height="100%"/>
    </s:WindowedApplication>

    Hi,
    I'm trying to embedd a HTML page to a Air application.
    The HTML page has a simple Flex application (TestFlex4Project.mxml) with a button that changes one HTML element on the web page (TestFlex4Project.html) using ExternalInterface. If I run the Flex application using the HTML page it works just fine and when I click the button the HTML ellement is changed and the mouseover- and onclick events works. If I embedd the HTML page in an Air application the mouseover- and onclick events does not work any more. Why?
    If I use Aternative 1 in the HTML code (instead of using Aternative 2 in the HTML code where I'm editing the innerHTML property) the mouseover- and onclick events works when the HTML page is embeded in Air. Why?
    Even more strange is that if I remove the line [<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />] from the HTML page the Flex application dose not show at all when embedded in Air. Why?
    You can try the online sample here and the files here.
    The application looks like this:
    And if you click the button and click the upper most text you will recieve a message like this:
    But not when I use innerHTML and embedd the HTML page in Air. Can anyone please help me with this issue. Is it a bug or what am I doing wrong? I need to change some HTML elements using innerHTML.
    Thanks!!
    The code for TestFlex4Project.mxml is like this
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
    width="100%"
    height="100%">
    <fx:Script>
      <![CDATA[
       function buttonClickHandler(event:Event):void{
       ExternalInterface.call(" function(){SetHTML();}")
      ]]>
    </fx:Script>
    <s:HGroup verticalAlign="middle">
      <s:Button label="Edit HTML Element" click="buttonClickHandler(event)"/> 
    </s:HGroup>
    </s:Application>
    The code for TestFlex4Project.html is like this
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8"/>
    <title>Test Flex 4 Project</title>
    <meta name="description" content="" />
    <script src="js/swfobject.js"></script>
    <script>
      var flashvars = {
      var params = {
       menu: "false",
       scale: "noScale",
       allowFullscreen: "true",
       allowScriptAccess: "always",
       bgcolor: "",
       wmode: "direct" // can cause issues with FP settings & webcam
      var attributes = {
       id:"TestFlex4Project"
      swfobject.embedSWF(
       "TestFlex4Project.swf",
       "altContent", "100%", "100%", "10.0.0",
       "expressInstall.swf",
       flashvars, params, attributes);
       function Message(){
       alert("Message!")
    function SetHTML(){
       //Start Alternative 1
       NewHTML.innerHTML = "Dynamically changed text"
       NewHTML.style.cursor = "pointer"
       NewHTML.style.color = "#ff0000"
       NewHTML.onclick = function(){
        Message();
       NewHTML.onmouseover = function(){
        this.style.fontWeight = 700;
       //End Alternative 1
       //Start Alternative 2
       var HTMLStr='<p style="cursor:pointer; fontWeight:300; color:#ff0000" onClick = "Message()" onMouseOver = "this.style.fontWeight=700">Dynamically changed text</p>'
       NewHTML.outerHTML=HTMLStr
       //End Alternative 2
    </script>
    <style>
      html, body { height:100%; overflow:hidden; }
      body { margin:0; }
    </style>
    </head>
    <body id="Body">
    <p id="NewHTML">This text will change when you click the button!</p>
    <p style="cursor:pointer; fontWeight:'300'; color:#ff0000" onClick = "Message()" onmouseover = "this.style.fontWeight='700'">Default text</p>
    <div id="altContent">
      <p><a href="http://www.adobe.com/go/getflashplayer">
       <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
       </a>
      </p>
    </div>
    </body>
    </html>
    The code for the Airapplication is like this
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
    width="800"
    height="566">
    <mx:HTML id="HTMLObject" location="TestFlex4Project.html" width="100%" height="100%"/>
    </s:WindowedApplication>

Maybe you are looking for

  • Ergent problem with the jsp file access in tomcat. HELP...

    I use tomcat as my server, I have one JSP file located in : webapps\abc\war\WEB-INF\jsp\index.jsp You see my project name is abc, I want to access the index.jsp file, I define another jsp file in the path: webapps\abc callled outside.jsp. I want to u

  • Changes made in Itunes not in Music Library

    Hi: I have spent countless hours fixing track names, adding artwork and all the other fun stuff. None of these changes are reflected in the music library and I can't figure out how to fix that situation. I've scrolled through the forum and can't fina

  • Home Sharing No Working

    I'm having a bit of a battle with my iTunes Library. Right now I can't see my music on my MacPro on my Laptop even though when I go to "Advanced" pulldown I have an option to "Turn off Home Sharing ([email protected])". Does anyone know how to get th

  • Mysql python snow leopard, won't compile

    I am trying to crack open python for web development. step one ... get some db connectivity going. MySQL, Postgres (i don't really care) i have both installed and working within another php project. when trying to build and install the MySQL driver (

  • After installing lms 3.2 Deamon manager couldnt start

    Hi All I'm installing LMS 3.2  trial version on Windows 2008. I could not start CiscoWorks Deamon Manager services. (I'm getting the error 1053: The service did not response to the start or control request in a timely fashion) I s this due to the tri