Sending XML to an HTML page in AS3

I'm working on an a Flex 3 application to generate XML to use in Fusion Charts Free.
So that the user can preview the chart, I'm currently sending the XML to an HTML page with runs the chart SWF using navigateToURL with the XML appended to the query string. The HTML page captures the query string with Javascript and supplies the XML to the chart.
<script type="text/javascript">
   var xmlstring = getParameterByName('xml');
   var chart = new FusionCharts("FCF_Column2D.swf", "ChartId", "900", "600");
   chart.setDataXML(xmlstring);   
   chart.render("chartdiv");
   function getParameterByName(name) {
        var match = RegExp('[?&]' + name + '=([^&]*)')
                     .exec(window.location.search);
        return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); 
</script>
This works fine in Firefox but I have problems with IE - the maxium URL length limits the amount of data, and IE9 removes the query string if in protected mode, and also requires it to be URL encoded. I try to get round this with the actionscript below.
var pageurl:String = chartpage + ".html";
var appName:String = ExternalInterface.call( "function getAppName(){ return navigator.appName; }" );
var agentName:String = ExternalInterface.call( "function getAppName(){ return navigator.userAgent; }" );
var qs:String = qxml;
// IE cannot cope with more than 2083 chars in URL
// IE9 requires escaping and needs to be not in protected mode
if (appName == "Microsoft Internet Explorer")
   if (agentName.indexOf("MSIE 9") > -1)
    qs = encodeURI("?xml="+qxml);
    if (qs.length > 2000)
    Alert.show('Data is more than 2000 bytes, too much to pass to Internet Explorer on the query string. Choose less data or use a different browser.', 'Fusion Chart Generator', mx.controls.Alert.OK);
   else
    var urlRequestIE:URLRequest = new URLRequest(pageurl+qs);
    navigateToURL(urlRequestIE,"_blank");
else
  var urlRequest:URLRequest = new URLRequest(pageurl+"?xml="+qxml);
  navigateToURL(urlRequest,"_blank");
Is there a better way of doing this?
Thanks
Richard

It appears that I am still doing something wrong. I've attached the flash, but here is the code based on my understanding of how to update it:
import flash.net.URLRequest;
import flash.net.navigateToURL;
dvds.addEventListener(MouseEvent.CLICK,navigate1);
var nav1:String="http://bikepaparazzi.com"; navigate1(e:MouseEvent):void {
function
navigateToURL(new URLRequest(nav1),"_self");
proconvention.addEventListener(MouseEvent.CLICK,navigate2);
var nav2:String="http://proconvention.com"; navigate2(e:MouseEvent):void {
function
navigateToURL(new URLRequest(nav2),"_self");
advertise.addEventListener(MouseEvent.CLICK,navigate3);
var nav3:String="http://bikepaparazzi.com"; navigate3(e:MouseEvent):void {
function
navigateToURL(new URLRequest(nav3),"_self");
tee.addEventListener(MouseEvent.CLICK,navigate4);
var nav4:String="http://bikepaparazzi.com"; navigate4(e:MouseEvent):void {
function
navigateToURL(new URLRequest(nav4),"_self");
proconvention.addEventListener(MouseEvent.CLICK,navigate5);
var nav5:String="http://bikepaparazzi.com"; navigate5(e:MouseEvent):void {
function
navigateToURL(new URLRequest(nav5),"_self");

Similar Messages

  • 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

  • Link button to local html page using AS3

    I am using AS3 and having trouble linking a button to a local html page

    Okay, I tried both of the codes and it is still now working.
    navigateToURL(new URLRequest("file:///fishcom/Home.html"));
    I get a Windows dialog box that states that the path can not be found.
    navigateToURL(new URLRequest("./fishcom/Home.html"));
    This goes to http://./fishcom/Home.html  but not my page.
    The Flash file and the HTML page are in the fishcom folder on my desktop. Very frustrating because this was so easy in AS2. 

  • Trying to link a html page in AS3

    I made a flash site with a button I want to link to a html page I made. But I don't know what I'm doing. I tried this:
    _root.cele1.on(release);{
    getURL("celebrities.html");
    where cele1 is the button name, but that don't work.  I know what I need to do to navigateToURL but I want to link a HTML page I created.
    Any help would be great. Thanks.

    THis is likely a literal case of helping yourself... See your other posting and leave out the part where you try to size the window...
    I'm trying to make the window size smaller in flash actionscript 3.0

  • Sending content in an html page via email as body

    Hi
    I am really in need of a prompt help for sending a web page which contains some html content as an email body.
    I really have no clue about this.
    I have tried searching in google but could not find any thing in java.
    I have everything ready for sending an email, i.e. to, from and subject.
    The only thing i need is the content from an html.
    I can set the content type as text/html.
    I need some help on content Id and content.
    Any quick help is really appreciated.
    Thank you.

    I have tried searching in google but could not find
    any thing in java.You actually didn't. Go take a look:
    http://java.sun.com/developer/EJTechTips/2004/tt0426.html#1

  • How-to show XML code into HTML page???

    I have not formatted String,
    String str = <target name=\"-post-compile\"><obfuscate><filesetdir=\"${build.classes.dir}\"/ > </obfuscate></target>;
    how I can show this String on Web page in the this format?
    <target name="-post-compile">
            <obfuscate>
                  <fileset dir="${build.classes.dir}"/>
            </obfuscate>
    </target>Thanks.

    You would need to escape all of the characters. ie < should become &lt; and > should be &gt etc etc; You would probably also have to put in the tabs/<br> tags in appropriate places.
    The JSTL c:out tag which automatically escapes characters for you, but how you want it laid out is completely up to you to program.

  • Converting XML document to HTMl using xsl

    Hi,
    I'm trying to convert an xml document into html page using xsl. But when I try to open the page in the browser nothing comes up.
    I'm not sure if I am using the PrintWriter correctly.
    StreamResult result = new StreamResult(new PrintWriter(new (File"text.html")));
    Please help.

    Oops! I wrote the parenthesis wrong in the previous mail
    This is the correct one I use in my program.
    StreamResult result = new StreamResult(new PrintWriter(new File("text.html")));
    Please help. Its urgent

  • Post response back to html page

    How to send response back to html page which sent request to my jsp page.
    please reply me b'coz I have sent two problems already,but there is no response for any of them.
    Please reply as soon as possible.
    --Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Yes I know all these implicit objects,but all these are in JSP.
    I want reply from JSP in HTML means at client side.
    See my steps:
    1.creating HTML page.
    2.creating form in that html page
    3.Then Accessing Database(some data which is required at client side for further processing like mapping in Google map) through JSP
    So here how do I get data from JSP page.
    help me with code if u can?
    thanks

  • Send XML through JSP pages

    Hi friends
    I was wondering if it's possible to send XML data when a form button is pressed. Suppose we have in the client machine a browser displaying a HTML Form with one text inputtype and one button to send this information to the JSP Server. If the inputtype's name is 'user' it's easy to retrieve this information in the JSP component, just a request.getParameter("user") would work fine. But I want to send the text of the inputtype through XML. Something like :
    <data>
    <user>
    smith
    </user>
    </data>
    How could I tell the browser to send the information through XML ? Is it possible ? And how could I retrieve this XML data in the JSP component ?
    Thanks a lot

    What I have done is working with 'bare hands', I'll paste my simple code here:
    This is my HTML page for colleting the info:
    <html>
    <head>
    <title>Envio de XML</title>
    </head>
    <body>
    <form action=http://remoteaddress:8080/Proyecto/xmlsend method=POST>
    <BR>
    <BR>Numero Movil
    <input type=text name=numero>
    <p>
    <BR>Operadora
    <input type=text name=operadora>
    <p>
    <BR>Mensaje
    <input type=text name=mensaje>
    <p>
    <input type=submit value=Aceptar><input type=reset value=Limpiar>
    </form>
    </body>
    </html>
    And here it's my servlet code to process and convert it to XML:
    import java.io.*;
    public class xmlsender extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/xml");
    String cadenanumero = req.getParameter("numero");
    String cadenaoperadora = req.getParameter("operadora");
    String cadenabody = req.getParameter("mensaje");
    salida.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    salida.println("<mensaje id=\"000001\" tipo=\"SMS\" fecha=\"2004-04-26T10:54:33\">");
    salida.println("<numero>" + cadenanumero + "</numero>");
    salida.println("<operadora>" + cadenaoperadora + "</operadora>");
    salida.println("<body>" + cadenabody + "</body>");
    salida.println("</mensaje>");
    Don't know if this is what you want, but maybe it can at least illustrate you, I hope so.

  • How to send html page in outlook wihtout gibberish

    i have html page that i tried to send in outlook with send web page by email
    the problem is it add the following thing before the html:
    ן»¿
    the questions are:
    from where does it come from? and how to fixed it so it does not show?

    thank you for the answer but saving it as ansi or unicode make things worse and in that encoding
    it is not possible to see the page
    the page is mainly photos some text and links
    is there any other
    possibility that cause this or it is only encoding of the page? 

  • How link from html page to a specific frame in flash cs5 as3

    Hi!
    I'm kinda new around here. I am interested in knowing how to link from a specific html page to a specific frame in flash cs5 as3.
    I have a website that I originally began to design in flash but later started developing new pages for it in html. The flash part of it has several pages on different frames and I have created links from the flash part to the other html pages, but, I can only link the html pages back to the main flash home page, and not the other pages in the flash part of the website.
    I have read that in cs3 it was possible using the flashvars skip variable, but I don't know how to do it. I have not yet seen any working examples and I could not find any instructions / tutorials online for cs5.
    Can someone help here?

    add a query string, to the swf's embedding html, with variable/value indicating the frame you want to display in your swf.  add a javascript function to return the query string (or entire url), call the javascript function from flash using the externalinterface class.  and finally add code to your swf to parse the returned url or query string, parse it and then direct your timeline to the appropriate frame.

  • Problem sending a HTML page

    How can i send a HTML by email??
    When i am sending a HTML he shows the code in the mail instead of showing the HTML page??
    Anyone knows how can i solve tyhis??

    are you setting the content type to text/html? there are plenty of examples out there (and in here). run a search.

  • How to send inline HTML page in mail(not as attachment)

    Hi,
    I am using JavaMail to send details to users using text mail. Its working successfully. But now i have to send the details on mails that will contain HTML page (not as attachment but as inline HTML page containing text) and details in it. Plz help me. Its urgent.
    Thanks in advance,
    Devom

    Set the contentType to "text/html" and send away.
    (If you need both text and html you will need to make a multi-part message), this is covered in the FAQ.
    http://java.sun.com/products/javamail/FAQ.html
    travis (at) overwrittenstack.com

  • How to send HTML page via an email

    Hi..
    I wanna send HTML page with images via an email, it should not go as an attachment.
    Is there any Tool or Software available to send HTML Pages via email.
    i just wanna send my advertisement as a HTML page via email
    So plz. help me out

    Java Message Service (JMS) For more info u can visite http://java.sun.com/products/jms/tutorial/
    It is usefull only when u r using some Application servers like WebLogic, WebSpeher, or JBoss
    Bye

  • How to send browser display HTML page as HTML Email using JSF

    Hi all
    i need to send a whole jsf rendered page as a html page.... . say theres a page which hav few links , images etc & theres a send email button at the end of the page. once the user clicks on the button the whole page shld appear in another window which hav from,to, subject line + the html body of tht earlier page & once he clicks the send button it should send to the sender & the receiver should see the email a s a html email.where u can click on the links,images showin etc...
    Thanks
    Saman

    Subhash,
    Here is one approach..
    1. Make the report page as PUBLIC ( no Authentication required)
    2. Create procedure which will pull the page content and send it to pre-defined e-mail address
    2.1 Use utl_http.request to pull the page content
    2.2 Store the page content in some PL/SQL variable and pass it as 'p_body_html' parameter to APEX_MAIL.SEND procedure.
    3. Schedule the above procedure to run on daily using DBMS_JOB API.
    I have not implemented it and its just a thought.
    Regards,
    Hari

Maybe you are looking for

  • Multiple languages autocorrect issues

    On my iPhone, I added multiple languages and on the keyboard appears the 'globe' to choose one before writing an email. That way, autocorrect adjusts to that language. I added languages to my MacBook Air Air as well, but autocorrect sticks with Engli

  • Error when launching .exe

    I devloped an application that connect to internet and parse some html and xml files to provide a search using search engines. it compiles and works well in JBuilder 2005. but when i make the .exe it works in the beginning after that it crash. i have

  • How to tap non node area in a JTree

    how can I trap area of a JTree which does not constitute the node rows???

  • HT201250 time machine halts after 28.7 MB

    time machine is connected to external hard drive. back up starts but after 28.7 MB seems to go dead. nothing happens no more.

  • Policy Based Routing - set ip next-hop

    All, I am trying to change the next hop for selective traffic to route via a WAN optimiser rather than follow the default route. I am trying to achieve this on a 4506 with IOS 12.2(20)EW. I have configured an ACL intended to capture traffic from my d