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");
   function getParameterByName(name) {
        var match = RegExp('[?&]' + name + '=([^&]*)')
        return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); 
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 = "function getAppName(){ return navigator.appName; }" );
var agentName:String = "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)'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);
    var urlRequestIE:URLRequest = new URLRequest(pageurl+qs);
  var urlRequest:URLRequest = new URLRequest(pageurl+"?xml="+qxml);
Is there a better way of doing this?

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:
var nav1:String=""; navigate1(e:MouseEvent):void {
navigateToURL(new URLRequest(nav1),"_self");
var nav2:String=""; navigate2(e:MouseEvent):void {
navigateToURL(new URLRequest(nav2),"_self");
var nav3:String=""; navigate3(e:MouseEvent):void {
navigateToURL(new URLRequest(nav3),"_self");
var nav4:String=""; navigate4(e:MouseEvent):void {
navigateToURL(new URLRequest(nav4),"_self");
var nav5:String=""; navigate5(e:MouseEvent):void {
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
    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:

  • 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:
    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

    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:

  • 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">
                  <fileset dir="${build.classes.dir}"/>

    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

    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?

  • 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 :
    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:
    <title>Envio de XML</title>
    <form action=http://remoteaddress:8080/Proyecto/xmlsend method=POST>
    <BR>Numero Movil
    <input type=text name=numero>
    <input type=text name=operadora>
    <input type=text name=mensaje>
    <input type=submit value=Aceptar><input type=reset value=Limpiar>
    And here it's my servlet code to process and convert it to XML:
    public class xmlsender extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    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>");
    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

    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)

    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,

    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.
    travis (at)

  • How to send HTML page via an email

    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
    It is usefull only when u r using some Application servers like WebLogic, WebSpeher, or JBoss

  • 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...

    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.

Maybe you are looking for

  • Type of listener needed for buttons ? please help

    hi does anyone know what type of event or listener one should include for buttons in a web page which has been downloaded into a JEditorPane. i have been able to get a web page onto my JEditorPane and can even follow most of the hyper links by implem

  • FCP 7 Finished Project Seq from 60fps to 23.98 fps

    Thank you in advance. I've been editing for a company which had transcoding issues with source footage recently, and long story short I had to re-encode all of the footage to the proper settings before editing, which is: 23.98 fps / Frame size: 960 x

  • Query works interactively, but not as a View? ORA-03113: end-of-file on communication

    Hi, I have created a db, using object stuff and now am doing a few queries. I created this query and it makes perfect sense, runns fine interactively and returns the correct records .. But if I put this query into a separate queries.sql file and try

  • Reading String input?

    So the other day I thought I might go ahead and try to make a few simple programs to see if anything I have learned is soaking in. I did a few math ones, which were easy enough, but then I tried to do a password program. It was easy enough to write,

  • Categorization Schema

    Does anyone know if there is a program that currently exists or can be written to upload categorization levels and data into the CRM system automatically? Also, do anyone know if there is a restriction to the amount of levels and/or values that are d