HTMLLoader loadString

I have a socket connection that I am sending a pdf file down to an Air Application.
If I use HTMLLoader.load then  it opens the pdf perfectly.
When  I user HTMLLoader.loadString it just gives me the makeup data of the file ie %pdf-1.3 etc.
I can save the file and then use load to open it, but it seems to me there must be a way to get the loadString to work, it has all the info.
I can't find any relevant info on the web.
Hope someone can help.
Cheers

Add the following code before you call loadString():
            htmlLoader.placeLoadStringContentInApplicationSandbox = true;
By default, content added via loadString() is not in the application security sandbox (and it cannot load images from the application directory). By setting this property to true, loadString() content is placed in the application security sandbox.
For more information, see the property's description in the language reference:
http://help.adobe.com/en_US/AIR/1.5/jslr/flash/html/HTMLLoader.html#placeLoadStringContent InApplicationSandbox

Similar Messages

  • New Window, HTMLLoader.loadString image problem

    Hello,
    I woudl like to load an image into a new window which I create, the image is accessable via the main application e.g. app:/images/notificationbg.png After creating the new window, the text and everything appears fine, but the image fails to load, I have tried not making it a background image and used <img src="images/notificationbg.png"> just to test it but still no luck.
    ////////////////////// Create Window /////////////////////
    var options = new air.NativeWindowInitOptions();
                options.transparent = false;
                //transparent windows must have the systemChrome set to none
                options.systemChrome = air.NativeWindowSystemChrome.NONE;
                options.type = air.NativeWindowType.LIGHTWEIGHT;
                this.htmlLoader = air.HTMLLoader.createRootWindow(
                        false, //hidden
                        options,
                        false, //no scrollbars
                        bounds
    ////////////////////// Load the Image /////////////////////
    this.htmlLoader.loadString("<html>" +
    "<head><style type=\"text/css\">#notify { background: url('images/notificationbg.png') no-repeat; }</style></head>" +
    "<body><div id=\"notify\" style=\"width: 200px; height: 62px; padding-top: 34px; padding-left: 45px;\">"+this.template+"</div></body>"+                       "</html>");
    Any help would be much appreciated!
    Thanks,
    Andrew

    Add the following code before you call loadString():
                htmlLoader.placeLoadStringContentInApplicationSandbox = true;
    By default, content added via loadString() is not in the application security sandbox (and it cannot load images from the application directory). By setting this property to true, loadString() content is placed in the application security sandbox.
    For more information, see the property's description in the language reference:
    http://help.adobe.com/en_US/AIR/1.5/jslr/flash/html/HTMLLoader.html#placeLoadStringContent InApplicationSandbox

  • HTMLLoader.window

    I'm trying to call a Javascript function via
    HTMLLoader.window within the event listener for htmlDOMInitialize
    and it says the function does not exist. What am I not
    understanding?
    import flash.html.*;
    var htmlLoader = HTMLLoader.createRootWindow();
    htmlLoader.loadString("<html><script
    language='Javascript'>function
    testFunc(){alert('test')}</script><body><p>Hello
    World</p></body></html>");
    htmlLoader.addEventListener("htmlDOMInitialize",htmlDOMInitialize);
    function htmlDOMInitialize(evt){
    trace(evt.target.window); // [object DOMWindow]
    evt.target.window.testFunc(); // TypeError: Error #1006:
    testFunc is not a function
    }

    The HTMLDOMInitialize event is dispatched before any objects
    have been created in the new HTML window or DOM. This gives you an
    opportunity to create and initialize variables that objects in the
    new window will use. However, since said objects haven't been
    created yet, you can't access them at the time this event is
    dispatched.

  • Loading local images into HTML component

    I need to intermix text and images for a project I'm working
    on, and using htmlText seems the best way to do it. However, I
    can't get it to work when the images are loaded from the local file
    system.
    It seems to work fine with remote images:
    <mx:HTML x="480" y="191" width="256" height="315">
    <mx:htmlText>
    <![CDATA[
    <p>Image: <img src='
    http://knight.fb.hive7.com/res/img/ico/x32/coin.gif'
    ></p>
    ]]>
    </mx:htmlText>
    </mx:HTML>
    But not with local images:
    <mx:HTML x="480" y="191" width="256" height="315">
    <mx:htmlText>
    <![CDATA[
    <p>Image: <img src='../assets/coin.gif'
    ></p>
    ]]>
    </mx:htmlText>
    </mx:HTML>
    Anybody have any ideas or workarounds?

    Hi,
    I tried your solution, it did not worked, it gave me following error -
    ==========
    ReferenceError: Error #1056: Cannot create property placeLoadStringContentInApplicationSandbox on mx.core.FlexHTMLLoader.
        at com.exa.view::TestView/changeEvt()[/home/sachin/workspace/newed/src/com/exa/view/TestView .mxml:70]
        at com.exa.view::TestView/__toctree_change()[/home/sachin/workspace/newed/src/com/exa/view/T estView.mxml:89]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9308]
        at mx.controls.listClasses::ListBase/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects \framework\src\mx\controls\listClasses\ListBase.as:8989]
        at mx.controls::List/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\m x\controls\List.as:2279]
        at mx.controls::Tree/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\m x\controls\Tree.as:2952]
    ===========
    Here is the code, the function gets called on change event of a tree component(not shown in code here)
    ===============
    <mx:Panel width= "70%" height="100%" id="cpanel" paddingBottom="10" paddingLeft="20" paddingTop ="20">
            <mx:HTML id="htmlc" width="100%" height = "100%">
            </mx:HTML>
        </mx:Panel>
    <mx:Script>
        <![CDATA[
              public function changeEvt(event:Event):void{
                   htmlc.htmlLoader.placeLoadStringContentInApplicationSandbox = true;
                   htmlc.htmlLoader.loadString(rh.content.replace(/src="\/images/mg,'src="assets'));
        ]]>
    </mx:Script>
    ================
    It would be helpful if you give more insight on your html component.
    Adobe air -version - 1.5
    Thanks

  • How to print a HTMLLoader?

    Hey!
    I want to load a htmlstring into a new htmlloader-object and print it via  window.runtime.flash.printing.
    unfortunately, my printer prints only blank pages.
    air tells me that  "Error #2057: The page could not be added to the print job" occured.
    Does anybody know how i can load html-content into a air-window and how i can send the content to the printer?
    My code in air is
    var pjob = new window.runtime.flash.printing.PrintJob;
    var options = new air.NativeWindowInitOptions();
    options.systemChrome = "none";
    options.type = "lightweight";
    var windowBounds = new air.Rectangle(200,250,300,400);
    var htmlStr = "<html><body>Hello <b>world</b>.</body></html>";
    newHTMLLoader = air.HTMLLoader.createRootWindow(true, options, true, windowBounds);
    newHTMLLoader.loadString(htmlStr);
    if (pjob.start()) {
    var poptions = new window.runtime.flash.printing.PrintJobOptions;
    poptions.printAsBitmap = true;
    try {                pjob.addPage(newHTMLLoader.htmlLoader, null, poptions);
    }            catch (e) {
    air.trace(e);
    try {                pjob.send();
    }            catch (err) {
    air.trace(err);           }
    }      else {           air.trace("PrintJob couldn't start");      }

    Hi,
    This is a function that does printing of some HTMLLoader content. It scales the content via the CSS zoom property and than scales it back to 25% in order to improve the quality:
    function printer(){
         // create PrintJob object
         var html = new air.HTMLLoader()
         var container = new runtime.flash.display.Sprite();
         html.width = 2400;
         html.height = 1600;
         html.addEventListener(air.Event.COMPLETE, function(){
                   html.scaleX = 0.25;
                   html.scaleY = 0.25;
                   container.addChild(html);
                   var printjob = new air.PrintJob();
                   if (printjob.start()) {
                         try {
                             var windowBounds = new air.Rectangle(0,0,600,400);
                             printjob.addPage(container,windowBounds);
                         }catch(e) {
                             air.trace("Error: " + e.message + " Detail: " + e.details + " Operation: " + e.operation)
                         printjob.send()
         html.loadString(’<div style="font-size:14px; font-weight:bold; zoom:400%">This is a printing test</div>’)
    Hope this helps,
    Best regards,
    Dragos Georgita | Adobe AIR Engineering

  • How do you use AIR's WebKit/htmlloader?

    Hi everyone,
    A long standing issue in AIR has been the inclusion of an older version of WebKit.  The request to update this library has come up many times in the forum and is in the top 10 on the community driven Uplist feature page.  As with the recent and ongoing physics discussion, we're not committing to any changes purposed below at this time,  as we're purely in an investigation mode at this time.  We realize that this is an important feature and we need further clarification on what you're looking for.  Please read on for questions from our development team.
    We are exploring updating WebKit, but due to our modification of the WebKit source, this will be difficult, and updating WebKit will change the HTML DOM, possibly breaking content authored for our existing DOM.
    So we are also exploring leaving HTMLLoader alone, for now, but providing a reasonable alternative.
    StageWebView was originally written as a replacement for HTMLLoader on mobile (because we could not use our WebKit on mobile, StageWebView took advantage of the browser provided by the platform).
    But it was extended to the desktop as an unsuccessful solution to this problem.
    On mobile, content was probably newly written (so it could be tested with StageWebView), and the browsers were similar enough to our WebKit that the DOM impact was minor.
    But on the desktop, forcing older content written for our WebKit to run on Internet Explorer 8 (as an example) was a disaster due to the differences in the DOM’s. We resolved this by making HTMLLoader versus StageWebView on the desktop a choice.
    Which gets to the questions (for desktop development only).
    Which is more attractive, an embedded web browser or using the system browser? Is it valuable to provide both?
    For instance, using the native browser can save on code size (perhaps 6 MB), but you must create and test portable HTML, and you face the risk that future updates to the system browser breaks your content.
    How much interop do you need between AS and JS?
    Hearsay suggests another problem with StageWebView is there is no interop between ActionScript and JavaScript, whereas HTMLLoader had a lot of support.
    Would StageWebView be sufficient if it exposed an ExternalInterface, or sandbox bridge, level of functionality? For instance, if AS could register a list of functions which could be called from JS (and vice versa), would that be enough? Or is there something else that HTMLLoader does that is essential?
    For instance, one of the ideas being explored is to provide an entirely new class (perhaps as an ANE) which links an unmodified version of the latest WebKit source as a static library. By using unmodified source, we can more readily update to newer versions of WebKit.  As well, if we leave the existing classes unchanged, we don’t risk breaking existing content. But if we use unmodified WebKit source, we may find some of HTMLLoader’s functionality impossible to match, which is why I’m interested in understanding the essential functionality, so we can decide if a sufficient, minimal (so it’s easier to support without customizing Webkit) interface for it.
    Thanks,
    Chris

    Hey Chris,
    Thank you for reaching out to the community! Our team has been working on AIR apps for a while now. It has been frustrating to say the least, trying to integrate sophisticated HTML5 apps into our different AIR apps.
    The existing solutions on mobile and desktop are not very satisfying. Mobile has gotten better because of the StageWebView, but there are still several flaws that make the platform unpredictable. On desktop it is even worse and we are facing a tough decision.
    We want to integrate an HTML5 app into an already existing AIR app. The two applications will have to communicate in some form with each other. The StageWebView approach with a simple ExternalInterface would suffice, as long as we could pick from the browsers that are installed. The ANE class approach also sounds good, but only if there is a similar way of communication.
    We think that keeping the component (WebView or ANE class) as lean as possible is one of the most important things. We don't want to face the same issues in the near future. There is also a need to update that underlying layer fast. Browser vendors (with some exceptions of course ) have much faster release cycles nowadays. They will keep pushing the boundaries and we need to adjust accordingly.
    The HTML5/JS should take care of the DOM manipulation, event handling and communicate back to Actionscript in a simple way. There is no need for Actionscript to worry about these things. And if there is, create a simple JS layer using the interface to do the job.
    Here is a list of features that are essential to us:
    Accessing the local file system (xhr requests on the local file system):
    Worst case scenario: Using the ExternalInterface to feed files to the HTML application.
    Configure the cache or at least manipulate cache handling
    Much better HTML5 / CSS3 support: Video, Audio, SVG, CSS3 Animations, etc.
    Easier and faster way to update the underlying WebKit/Chromium (relevant for ANE)
    Are there any plans yet? Is it on your roadmap? Are we talking about years or months? Answers to these questions are very crucial for us. Only with those answers will we know, whether we can keep working on the AIR platform or if we have to look for alternatives and migrate our entire application.
    We are looking forward to your answers.
    Thanks

  • How can I put Locale.loadString("IDS_001") into button.label

    I am retrieving the Locale from the system, and need to place the fields of the Array into their respective places.
    One of these being for example,
    IDS_001
    This works, and returns what I'd probably expect. Although why it returns multiple instances I can't yet figure.
              public var vIDS_001:String;
              Locale.autoReplace = true;
                     var localeName:String = LocaleID.DEFAULT;
                     var nf:StringTools = new StringTools(localeName);
                                   trace("Actual local ID: " + nf.actualLocaleIDName);
               var defLang:String = nf.actualLocaleIDName;          
                                              trace( "Last Operation Status: " + nf.lastOperationStatus ); 
               Locale.setDefaultLang(defLang);
               Locale.setLoadCallback(localeCallback);
               //Locale.addXMLPath("defLang", "../en/PinPointPremium_en.xml");
                          Locale.addXMLPath("defLang", "../" + defLang + "/PinPointPremium_" + defLang + ".xml");
               function localeCallback(success:Boolean) {
                if (success) {
                    // trace(Locale.stringIDArray); // IDS_GREETING
                     trace(Locale.loadString("IDS_001"));
                     var vIDS_001 = (Locale.loadString("IDS_001"));
                     trace("+++" + vIDS_001);
                } else {
                     trace("unable to load XML");
    Actual local ID: en-GB
    Last Operation Status: noError
    PinPoint the Entered Address
    +++PinPoint the Entered Address
    PinPoint the Entered Address
    +++PinPoint the Entered Address
    Test Movie terminated.
    This is the button code, and I'm trying to figure out how to get that IDS_001 information into the btnGPS.label. No matter what I try, it errors out
                 btnGPS = new Button();
              btnGPS.width = stage.stageWidth - 20;
              btnGPS.height = 25;
              btnGPS.x = 10;
              btnGPS.alpha = 0.9;
                    // btnGPS.label = "PinPoint My Current Location";
              btnGPS.setStyle("textFormat", btnFormat);
              btnGPS.y = stage.stageHeight - 46;
              btnGPS.addEventListener(MouseEvent.CLICK, btnGPSMouseClickHandler);
              addChild(btnGPS);
    None of these following work in place of the original
                    //btnGPS.label = Locale.loadString("IDS_001");
              //btnGPS.label = IDS_001;
                    //btnGPS.label = vIDS_001;
    Theoretically, loading the Locale XML file should populate the occurences of IDS_001 - but I'm totally lost now. Been looking at this for a few days and now can't see the real picture. Does anyone have any idea how I solve this please ... I know this is so simple, but I can't get it.
    thanks

    ok, I need to get back on track.
    The app works and is fine. No problem with buttons etc. It's localization.
    .... and this works - finally
    private static var loc:String = null;
    private static var my_txt:String = null;
    // Checking for LocaleID for globalization.
    // Localization stuff. AS3 2013. (using latest CS6 Flash Pro, AIR and Flex SDK libraries)
    // This example is based on the iPhone/iPad, iOS Template in CS6
                                  // get the system language. That's al lwe need. What language is the user using
                                  loc = Capabilities.language;
                                  // if it's en-GB for example, make en_GB
                                  // loc = loc.replace("-","_");
                                  trace("The default system: " + loc);
                                  loc = "de";
                                  trace("The new system: " + loc);
                                  // you can add individual paths for each language like this
                                  Locale.addXMLPath("en", "en/PinPointPremium_en.xml");
                                  Locale.addXMLPath("de", "de/PinPointPremium_de.xml");
                                  // or set your language to the system default and use that
                   // I put the system language into 'loc'
                                  Locale.addXMLPath(loc, loc + "/PinPointPremium_" + loc + ".xml");
                                  Locale.setLoadCallback(localeCallback);
                                  Locale.loadLanguageXML(loc);
                                            function localeCallback(success:Boolean) {
                                                      if(success){
                                                                //var my_txt:String = Locale.loadString("IDS_001");
                                                                my_txt = Locale.loadString("IDS_001");
                                                                trace("The IDS_001 field is: " + my_txt);
                                                                // returns "PinPoint der eingegebenen Adresse" which is ok
                                                                } else {
                                    trace("unable to load XML");
    /* Output
    The default system: en-GB
    The new system: de
    The IDS_001 field is: PinPoint der eingegebenen Adresse
    Part 2 is the Button. AND is is this that is tricking me.
    I repeat - how do I put the contents of IDS_001 into btnGPS.local with
    IF I can put 'loc' into the label, with
    btnGPS.label = loc;
    why can't I do this
    btnGPS.label = Locale.loadString("IDS_001");
    btnGPS = new Button();
    btnGPS.width = stage.stageWidth - 20;
    btnGPS.height = 25;
    btnGPS.x = 10;
    btnGPS.alpha = 0.9;
    //btnGPS.label = "PinPoint My Current Location";
    // ==============================================
    // This actually works - it places "de" into the button. as it should
      btnGPS.label = loc;
    // this doesn't put the contents into the label
    //btnGPS.label = Locale.loadString("IDS_001");
    btnGPS.setStyle("textFormat", btnFormat);
    btnGPS.y = stage.stageHeight - 46;
    btnGPS.addEventListener(MouseEvent.CLICK, btnGPSMouseClickHandler);
    addChild(btnGPS);

  • HTMLLoader & Content-Disposition of type attachment

    HTMLLoader in Adobe AIR 1.0 does not handle the HTTP
    Content-Disposition response headers set to type 'attachment'. It
    simply ignores this header. This is bad, because many sites on the
    web rely on user-agents handling this header appropriately in order
    to initiate a download of a file to an end-user's local disk.
    An example is
    Content-Disposition: attachment; filename="fname.ext"
    This HTTP response header says to the user agent, 'Don't
    render this response as HTML; instead write the response to a file
    on the user's disk called fname.ext'.
    When the Air HTMLLoader encounters an HTTP response with a
    Content-Disposition similar to the example above, nothing is
    re-rendered (which is the correct behavior), there is no way to
    detect that the attachment Content-disposition header has been
    served (bad), and there is no way to obtain the attachment itself
    (worse).
    The correct behavior for an HTTP client which receives an
    HTTP response parameter of this type can be found in RFC 2616,
    section 19.5.1. It is stated that "If this header is used in a
    response with the application/octet-stream content-type, the
    implied suggestion is that the user agent should not display the
    response, but directly enter a ‘save response as...’
    dialog". I suspect that Adobe hasn't had a chance to implement a
    way for HTMLLoader to notify client code of this situation, or the
    process for getting the HTTP response body.
    Has anyone encountered a work-around? Does anyone know of
    plans in place to correct this bug?

    The problem is that the server script is treating the request as a request for a file to download, rather than as a typical HTTP request/response.  You need to modify the server script so that it doesn't include the Content-Disposition header, there's not much you can do on the client side.

  • HTMLLoader js errors

    I am using Flash CS3 and adobe air and when i create a htmlloader
    main.as
    package {
       import flash.display.NativeWindow;
       import flash.display.Sprite;
       import flash.display.Stage;
       import flash.display.StageAlign;
       import flash.display.StageScaleMode;
       import flash.events.Event;
       import flash.html.HTMLLoader;
       import flash.net.URLLoader;
       import flash.net.URLRequest;
       public class main extends Sprite
       private var mainWindow:NativeWindow;
       private var htmlwebsite:HTMLLoader;
       public function main(){
      htmlwebsite = new HTMLLoader();
      htmlwebsite.addEventListener(Event.COMPLETE, completewebsiteHandler);
       var websiteurlReq:URLRequest = new URLRequest("http://www.kfc.com");
      htmlwebsite.load(websiteurlReq);
       function completewebsiteHandler(e:Event) {
      trace(htmlwebsite.window.document.getElementsByTagName("a")[0].getAttribute("href"));
    I get this error
    TypeError: Value undefined (result of expression document.querySelectorAll) is not object.
    at http://platform.vine.co/static/scripts/embed.js : 21
    at http://platform.vine.co/static/scripts/embed.js : 21
    at http://platform.vine.co/static/scripts/embed.js : 21
    I can see the line in the html, how can I remove the line from the html or stop the error from displaying and continue the code execution?

    when i add this it says cancelable = true how to cancel the error
    htmlwebsite.addEventListener(HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION, cata);
    function cata(e:HTMLUncaughtScriptExceptionEvent) {
                                    trace(e.exceptionValue);

  • .swf inside HtmlLoader appears on top of other air content

    When there is an HtmlLoader with a .swf wmode window the .swf file appears over top of everything!
    I understand that .swf should appear above everything inside the HtmlLoader, but I don't think it should appear over top of anything outside of the HtmlLoader.
    A simple example of this would be:
    <?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">
    <mx:HTML location="http://youtube.com" width="100%" height="100%" />
    <s:Button width="300" height="300" label="should be over all html content, .swf in html appears over it. click and watch a youtube video to see." />
    </s:WindowedApplication>
    I NEED a fix to this~!
    Even placing a second HtmlLoader with an .swf wmode window over top produces random results with the top .swf sometimes on top and other times below the lower .swf

    As you have discovered, two elements on the surface of a <div> cannot occupy the same space. The solution lies in getting one of the elements to "lie down," either by getting it totally off the surface and making it a background of it or by actually "levitating" one above the other.
    Apply a unique id to each div in which an image now lies.
    Place each image in the background of its div, defining it in your CSS.
    You will not then be able to use the image as a button, and you may want to add something else to click on.
    OR (this second way is probably better)
    Change the .FilmStill definition by adding position: relative;
    Change the .SlantedWritingFilms definition by adding position: absolute; and positioning attributes (left: 0; top: 0; for instance)
    Change each .SlantedWritingFilms <span> into a <div> within <div class="FilmStill">.
    Beth

  • Issue with jQuery.animate in secondary HTMLLoader

    This is a follow-up question to my original question (http://forums.adobe.com/message/2027713), which I couldn't figure out how to edit.
    I want to animate an HTML element using jQuery. When I attempt the animation in the original HTML document, there is no problem. However, when I attempt to animate elements in a second document, opened in a second HTMLLoader, the animation isn't smooth - it only 'steps' when I move the mouse.
    That is, the animated property (e.g. top, left, etc.) is still updated - but the incremental changes to the property aren't visible unless the mouse is moved. So if I'm not moving the mouse, the animation completes without seeing any transition between the start and end state.
    The type of animation doesn't seem to be significant. The first HTML file contains the following JavaScript:
    var loader;
    $(function() {
            loader = new air.HTMLLoader();
            loader.addEventListener(air.Event.COMPLETE, start);
            window.htmlLoader.stage.addChild(loader);
            loader.load(new air.URLRequest('test2.html'));
    function start() {
            loader.width = loader.window.document.width;
            loader.height = loader.window.document.height;
            $('li', loader.window.document).click(function() {
                    $(this).animate({ marginLeft: '200px' }, 1000);
    The file test2.html just contains a <ul> with a few <li>s in it - nothing else.
     Is there any problem with the way I'm attempting to open this second document? Can anyone offer any advice on the matter? Thank you!

    Hello Paul,
    In Firebug, if you click Inspect, then Script, then you can select the scripts (sources) from a drop down list next to 'all'. One of them should be your jQuery reference. If you click that one, do you see the jQuery source?
    If you do, jQuery is there. If you don't, check if you uploaded jQuery for the Workspace or for a specific Application and if your reference is referring to WORKSPACE_IMAGES or APP_IMAGES.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • PDF from HTMLLoader is Not Displaying in a Container

    PDF from HTMLLoader is Not Displaying in a Container
    Was there a new version of AIR released recently that breaks the display of a PDF through the HTMLLoader?
    I've been experiencing problems displaying a PDF in a container lately.
    AIR applications that worked a couple weeks ago, are not working now even though no changes have been made to the source.
    To focus on the problem, I created an application that narrows my focus to the broken feature. It's sole purpose is to display a simple PDF through AIR.
    The example can be found here.
    http://www.appfoundation.com/blogs/giametta/2009/04/14/render-pdf-in-adobe-air-with-pdf-sc aling/
    The code used is exactly the same as the one found in the above example, except I swapped the url of the PDF to the following.
    http://www.sfbike.org/download/map.pdf
    It's pretty straightforward.
    But, when I compile and press the "do it" button, nothing displays in the VBOX.
    Using an HTTP Sniffer the "GET" to my url seems to be working fine and, I get a "200 OK" return status, but nothing is displayed in the container.
    Here is my configuration.
    - Windows Vista Ultimate 64 bit
    - AIR 1.5
    - Flex 3.0.2
    - Adobe Acrobat 9 Pro
    - Firefox 3.5.4
    Attached is the source code mxml as a txt.

    Well, like I said, I don't either. Even when loading a very simple PDF, I just see this crash:
    Process:         adl [1003]
    Path:            /Users/base/c_languages/flashplayer/flex_sdk_4.0.0.10079/bin/adl
    Identifier:      adl
    Version:         ??? (???)
    Code Type:       X86 (Native)
    Parent Process:  FlashBuilder [217]
    Date/Time:       2009-11-04 11:41:13.050 -0800
    OS Version:      Mac OS X 10.6.1 (10B504)
    Report Version:  6
    Interval Since Last Report:          1807020 sec
    Crashes Since Last Report:           7
    Per-App Crashes Since Last Report:   4
    Anonymous UUID:                      E63961B9-2C86-42EA-9FBA-0D3F0561CBB8
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000040918216
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Maybe someone on the AIR team will have a more knowledgable response, it looks like a problem with how Webkit is loading up the PDF viewer perhaps.

  • Setting Depth of PDF displayed in HTMLLoader

    Is there anyway to set the depth of the HTMLLoader that is displaying a PDF in my air application?
    Right now the PDF seems to be on top of everything.
    Thanks.

    No. PDFs always render in front of everything else.

  • Problem with HTMLLoader

    I'm loading an external swf with HTMLLoader to open it in a new window from an Air application. But it generates a blank space of 28 pixels above the swf loaded in the new window.
    How could I remove that blank space?

    I am using the application code below to load a .swf file from online and I don't see any padding above the .swf file as you mentioned.  Perhaps its the .swf file you are loading?  Are you loading a webpage that contains a .swf file?  Attached are screenshots of the application running.
    <?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" applicationComplete="execute()">
         <fx:Script>
              <![CDATA[
                   private var html:HTMLLoader;
                   public function execute():void
                        var url:String = "http://cdn.crimereports.com/CrimeReports-20110302160119.swf";
                        var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
                        windowOptions.minimizable = false;
                        windowOptions.maximizable = false;
                        windowOptions.resizable = false;
                        windowOptions.type = NativeWindowType.NORMAL;
                        windowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
                        var bounds:Rectangle = new Rectangle(100, 100, 800, 550);
                        html= HTMLLoader.createRootWindow(true, windowOptions, true, bounds);
                        html.addEventListener(Event.COMPLETE, onComplete);
                        html.load(new URLRequest(url));
                   private function onComplete(event:Event):void
                        event;
              ]]>
         </fx:Script>
    </s:WindowedApplication>

  • HTMLLoader problem with comboBox

    hi guys
    I'm trying to loader pdf file using XML to retrieve the URL  and I have CombBox to list all the files ,and I need to load another file every time I change the silder for the CombBox
    the problem is the pdf file load only first time and dosent  change if I select another one from the list, I dont know what the the probelm I tried manything like removeChild and I tried to use container but no change, only first time the file loaded
    this is the code
    cb_list.addEventListener(
    SliderEvent.CHANGE,changehandler);
    function changehandler(e:Event):void {
        var sort1:String=cb_list.value;
        var id:String = myXML.tip.(title == sort1)[email protected]();
         //trace(id)
        var slectedtip = myXML.tip.(title == sort1).fulltip.text();
        tit_label.text=myXML.tip.(@ID == id).title .text();
        date_label.text=myXML.tip.(@ID == id).date.text();
        full_tip.text=myXML.tip.(@ID == id).fulltip.text();
         var flashfileURL = myXML.tip.(@ID == id).picURL.text();
        swfURL.text=flashfileURL;
        var url:String = new String();
        url= myXML.tip.(@ID == id).picURL.text().toXMLString();
        var requestpdf:URLRequest=new URLRequest(url);
         var container:Sprite = new Sprite();
        var pdf = new HTMLLoader();
        pdf.height=stage.stageHeight-150;
        pdf.width=stage.stageWidth-270;
        pdf.y=100;
        pdf.x=260;
        pdf.load(requestpdf);
           pdf.addEventListener(Event.COMPLETE, completeHandler);
        function completeHandler(event:Event):void {
            addChild(pdf);

    [problem with combobox comes infront of popup window|http://forum.java.sun.com/thread.jspa?threadID=5291468]

Maybe you are looking for

  • How do I convert a word document to a pdf document that is protected

    How do I convert a word document to a pdf document that is protected

  • Fiscal Period Definition

    Is there a way to use the 13 months setting for a fiscal year, but have the periods defined as 4-3-3-3, instead of 4 for all?

  • Settlement Rule Log in WBS

    Hi SAP Gurus I would like to know the log of person who created the settlement rule in WBS.I check WBS master data change report but it does not provide the log of settlement rule maintenance.can any one tell me? Regards

  • How to read empty tag value.

    Suppose there is a tag name with values , <Name>Raj</Name> I am able to read the tag value 'Raj' .. But if the tag is like <Name /> I am getting null pointer exception while reading the tags value.. I have put the reading part in a try catch block .I

  • How to retreive mutiple values from select boxes in jsp

    <select name="indices" style="width:180" size="6">                          <option value=F_ARCHIVEDATE> F_ARCHIVEDATE </option>                           <option value=F_DELETEDATE> F_DELETEDATE </option>                           <option value=F_DO