AIR / HTML Bridging

Hi,
I'm trying to handle an HTML page loaded using the
mx.controls.HTML, when trying to access the div element inside the
page, using the domWindow object, I've realized that i dont have
getElementById function so i insert the following javascript
function
function setText(id, text) {
var target = document.getElementById(id);
if (target != null) target.innerHTML = text;
and I call it from AIR in this way
browser.domWindow.setText("description", text);
the text is assigneg form a RTE control after a cleaning
operation of the produced tags and styles
text = cleanHTML( rte.textArea.htmlText) ; the result of
cleaning doesnt introduce any strange char just put
the html font tags in a compliant form.
it works but I have problem with chars like à è
ì ò ù space, thart are shows in the html page as
%E0, %E8, %20, ......
I've tried to understand why, the html page has this meta:
<meta http-equiv="Content-Type" content="text/html"
charset="ISO-8859-1" />
the page code of the HTML editor is using the same charset.
If I put an alert(text) in the javascritp function i can see
that the problem is already present and when tracing text variable
in the AIR app just before calling the javascript the result is a
clean string, so it's something in the middle.
Is there other ways to set a text in an HTML page from Air,
is there a list of available javascript functions.
A part of this problem the bridge between the twos works
well, AIR lets you to have a lot of control over the browser.
It it would be possible to have a better Flex Rich Text
Editor control would be really nice
Thanks in advance
Paolo

To prevent the image from bing selectable or draggable, set the CSS properties: -webkit-user-drag and/or -webkit-user-select.
To stop the default context menu from appearing, you have to listen for the contextmenu event and call preventDefault(). (See http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7de2.html).

Similar Messages

  • Bug in navigateToURL? (AIR HTML/JavaScript) window name parameter not working

    Hi,
    I have to popup the default browser from a HTML/JavaScript application.
    All links on the Air page should be opened in the same tab in the same browser window that was opened by the first click on a link.
    The code I use is
    var urlString = "http://www.adobe.com";
    var request = new air.URLRequest(urlString);
    air.navigateToURL(request, "myNewWindow");
    The myNewWindow parameter does not seem to be taken into account:  a new tab is opened on every click.
    I created a new Air application in Aptana and added the following straightforward code to it:
    <html>
        <head>
            <title>navigateToURLTest</title>
            <script type="text/javascript" src="lib/air/AIRAliases.js"></script>       
        </head>
        <body>   
    <a href="http://www.google.com"
                onclick="javascript:air.navigateToURL(new air.URLRequest('http://www.adobe.com'), 'AirTestWindow');return false;">New Tab</a>
            <br />
            <a href="http://www.adobe.com"
                onclick="javascript:air.navigateToURL(new air.URLRequest('http://www.adobe.com'), 'AirTestWindow');return false;">Same Tab</a>
        </body>
    </html>
    Same problem.
    Does anyone have any idea?
    Thanks

    Is there really nobody who can answer or at least try to reproduce this? 
    It's just creating a new Air HTML/Javascript application with one link with a named window target!

  • AIR HTML component problem

    I am using the AIR HTML component to load various website
    directories with. However, any directory that gets loaded into the
    HTML control that uses CAPTCHA, only loads maybe 2 pixels high
    worth of the image. Is this a bug with the HTML control itself, or
    have I failed to instantiate something? To see what I mean, try
    loading this URL into AIR's HTML component.
    http://www.mygreencorner.com/submit.php

    I might add that this is flex 3 Retail version, not the beta.
    Seems to work in the flex 3 milestone 4 beta.

  • Global error handlers in AIR/HTML

    Dear Adobe,
    there is good article on flobal error handling in Flex and AIR 2.0: http://www.adobe.com/devnet/flex/articles/global-exception-handling.html
    Is there a global javascript exception handling mechanism in AIR/HTML? window.onerror does not work (that seems to be Webkit bug fixed in latest Chrome, but not yet in the AIR environment).

    Dear Adobe,
    any thoughts?)

  • Using Facebook SDK in Air HTML environment

    Hi,
    I am building an AIR application using HTML/JS and I'm trying to work with Facebook Javascript SDK for some simple functionality.
    It seem however when running and an AIR environment I am not able to access the FB object.
    I have the SDK locally so I know its there but simple FB.init() and FB.login() are non-existent and without errors...
    I also tried using the FB AS3 library by incldeding it in <script> tags but this gives me an error
    TypeError new window.runtime.com.facebook.graph.Facebook() is not a constructor
    Don't know if its because my xml namespace is version 2.0 and not 1.5 (1.5 errors as well but it says some IFilePromise class is not found.
    Can the Javascript SDK be used in building Adobe AIR HTML apps?

    Annoyingly the SDK hasn't been updated in over three years. I've had a casual look via Visual Studio's object inspector to see if I can spot any new methods or properties that could be useful but if they are there then they are hidden well. Media Kind, for example, was introduced in iTunes 9, I think, but can't be read from code.
    I don't know what tasks you're hoping to automate, but you might find some of my scripts useful either in their own right or as food for thought.
    tt2

  • Consuming SOAP services from AIR/HTML (JavaScript).

    Hi All.
    I am trying to consume SOAP web services from an AIR/HTML application for a research on AIR I am doing for my company, and I am having very little success.
    I am creating JavaScript clients using apache's cxf wsdl2js utility.
    When I try to use the client to call any web service I've tried, I always get an 'error 500' response.
    The web services work fine if i call them from other clients.
    Before trying cxf generated clients I googled a lot to see if there was a more native way of doing these calls from AIR, but found nothing. I don't see anything in documentation or the web about it.
    Am I the only one trying this?
    Could this be a cross-domain issue? I'm certainly hoping AIR apps don't have this issue.
    Any pointers as to how to succesfully consume SOAP services from AIR is greatly appreciated.
    Thanks!

    In Visual Basic, you can set Network Credentials like this (assuming that you first declare Public CallWebService001 As New <WebReference>):
            ' Create a new instance of CredentialCache.
            Dim mycredentialCache As Net.CredentialCache = New Net.CredentialCache()
            ' Create a new instance of NetworkCredential using the client
            ' credentials.
            Dim credentials As Net.NetworkCredential = New Net.NetworkCredential(<username>, <password>)
            ' Add the NetworkCredential to the CredentialCache.
            mycredentialCache.Add(New Uri(CallWebService001.Url), "Basic", credentials)
            ' Add the CredentialCache to the proxy class credentials.
            CallWebService001.Credentials = mycredentialCache

  • Adobe Air - HTML, Javascript and Threading

    Hello,
    I am developing an application using Adobe Air - HTML and
    Javascript. What I am trying to do is to implement threading in
    Javascript. I am using implementing threading in Javascript as per
    this Neil blog.
    Click
    Here. It clearly says that this threading works only in Firefox
    2.0 and I am trying to use this in with my Adobe Air, but when I
    try to refer a function , it gives me error saying "unable to find
    it".
    I was wondering if this is the best way to go for threading
    in Adobe Air HTML application or there is some other way also.
    Thanks,
    Jaikishan

    Hi jjalan,
    The yield and generator functionality is only available in
    Firefox's javascript execution engine. When you are executing
    javascript in AIR, it is done by the webkit and squirrelfish. Take
    a look at
    http://webkit.org/blog/189/announcing-squirrelfish/
    If you can find a javascript library that works on safari /
    webkit, chances are high that it may work in AIR.
    Also, you can always do pseudo-threading via the age old
    setTimeout()

  • AIR HTML+JavaScript app vs. hardware accelerated composing

    I'm developing an HTML application for mobiles and desktops. The application is optimized for WebKit based environment. To improve a rendering speed I'm using hardware accelerated layers (something like -webkit-transform: translateZ(0); etc...).
    This works great on my iOS devices (using PhoneGap aka Cordova to package a "native" app).
    On Windows and OS X I'm using Adobe AIR 3.5 to package a captive runtime HTML/JavaScript based application. I have found this to be the best solution (for now) even though I have tried many others (Cordova for Windows 7 / OS X, TideSDK, ...).
    The point is that the HTML rendering in Adobe AIR seems not to be hardware accelerated. Does anyone of you have experience with this? Is here any possibility to enable hardware accelerated layers in AIR HTML rendering?
    Thanks a lot

    Thanks a lot, actually I tried AIR SDK 3.6 yesterday and it seems it still doesn't support an acceleration. In a browser it works just fine even in fullscreen (zoomed page). It seems that the best way to achieve my goal will be using Cordova wrappers for OS X and Win Desktop. But as an AIR developer I really want to use AIR SDK So I will do some more tests..
    Thanks,
    Pavel

  • Adobe AIR HTML component ignores Google Maps GPolyline opacity

    I have a Google Maps mashup web site that I want to display
    in an
    Adobe AIR app using the AIR HTML component. My mashup shows a
    Google map with some semi-
    transparent polylines (drawn as circles) drawn with the
    Google Maps API . In Safari, everything looks
    as it should. In AIR, the polylines are opaque; the GPolyline
    opacity
    value is ignored. I've tried the AIR app on Linux and Windows
    XP.
    Has anyone else encountered this issue or have some
    suggestions?
    The web site:
    http://dstresearch.com/map.html
    The AIR code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" height="800" width="800">
    <mx:HTML id="html"
    width="100%"
    height="100%"
    location="
    http://dstresearch.com/map.html"
    />
    </mx:WindowedApplication>
    Thanks,
    Josh

    You might also want to check out the useCache property to see if this helps.  See these links:
    http://forums.adobe.com/thread/726573
    http://forums.adobe.com/thread/490497
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.h tml

  • Adobe air html/js - application act like a browser.

    I just started in Adobe air html/js . In the current application I want to do something like this .
    I want to open the urls/web pages in the application and application should act like a web-browser to them .
    But with that I want to modify the opened pages a little, like add some css/js to them.
    Something like when you open Web pages in Firefox and a plugin (example grease monkey scripts) modifies the displayed content .
    Is it possible ?
    I tried opening in iframe it works , but I cannot add my own  JavaScript to the page (is there any way in air to remove cross domain  strictness?).
    Note: Please don't suggest that I fetch the html content of the page  and add it to the app body.  My app should really act as browser. (Adobe  air is webkit based so I think it can be achieved)

    Hi,
    Thank you for reporting this. The internal bug number for the issue is #2740755. The issue is currently under review and will be investigated by one of AIR team members.
    Regards,
    Catalin

  • AS3 Workers in Air HTML Environment?

    Hi there,
    I've begun to look into the practicality of running AS3 workers in my JavaScript based desktop AIR project.  While I have not successfully nailed down a working implementation, it would seem that this is possible. 
    However, am I right to assume that I would not be able to leverage the WebKit HTML environment from within a worker?
    Lastly, is anyone actually using AS3 workers within a AIR HTML environment?  It seems to be an entirely unspoken feature within this context.  It it not documented because this is just not possible?
    Thanks,
    Mike

    Hi,
    I've been doing some work trying to get an AS3 worker running from the webkit enviroment and am having a really strange problem.  As soon as I start the worker, the worker starts chewing through all available CPU.  No messages are being passed, it has just been started.
    Here is an example of the worker:
    package DDX
         import flash.events.Event;
         import flash.system.MessageChannel;
         import flash.system.Worker;
         public class Worker
              private var mainToBack:MessageChannel;
              private var backToMain:MessageChannel;
              public function Worker()
                   var current:flash.system.Worker = flash.system.Worker.current;
                   mainToBack = current.getSharedProperty("mainToBack");
                   backToMain = current.getSharedProperty("backToMain");
                   mainToBack.addEventListener(Event.CHANNEL_MESSAGE, onMainToBack);
              private function onMainToBack(event:Event):void
                   if (mainToBack.messageAvailable) {
                        var msg:* = mainToBack.receive();
                        if (msg == "SOLVE") {
                             backToMain.send("SOLVED");
    And here is how I set it up in JavaScript:
    var workerLoader = new air.URLLoader(),
        mainToBack,
        backToMain,
        bgWorker,
        workerBytes;
    workerLoader.dataFormat = air.URLLoaderDataFormat.BINARY;
    workerLoader.addEventListener(air.Event.COMPLETE, function(event) {
        workerBytes = event.target.data;
        bgWorker = air.WorkerDomain.current.createWorker(workerBytes);
        mainToBack = air.Worker.current.createMessageChannel(bgWorker);
        backToMain  = bgWorker.createMessageChannel(air.Worker.current);
        backToMain.addEventListener(air.Event.CHANNEL_MESSAGE, function() {
            if (backToMain.messageAvailable) {
                var msg = backToMain.receive();
                console.log('RECEIVED ' + msg);
        }, false, 0, true);
        bgWorker.setSharedProperty("backToMain", backToMain);
        bgWorker.setSharedProperty("mainToBack", mainToBack);
        // listen for worker state changes to know when the worker is running
        bgWorker.addEventListener(air.Event.WORKER_STATE, function(e) {console.trace(e)});
    workerLoader.load(new air.URLRequest("assets/flash/DDXWorker2.swf"));
    As soon as I start the worker, CPU starts being eaten up entierly:
    bgWorker.start();
    No messages being sent via the channel, just the worker started.
    Any ideas?
    Thanks,
    Mike

  • Is there a way to download inside AIR HTML?

    Hi,
    Is there any way to download files from the webpage running inside AIR HTML component? i.e. mail attachment etc.?
    Thanks!

    I'm already overriding loaded HTML page's links etc. but yes its true to determine which link is for download or to open just a web page.
    StageWebView!! I was in impression for a long time, this made for mobile! After you saying so, at help.adobe.com I can see this also for all desktop operating systems too! Great!
    Though our existing ol' HTML component is already coded/modified heavily through the application, I don't know how far we can replace them with new StageWebView.. but you simply given me an option. Thanks!
    I'll see a simple demo how enable it is downloading files in an AIR application, shortly.

  • Flash Player Settings Manager does not response in AIR HTML control

    Hello All,
    We are working on a AIR application which is quite big and have around 22 modules. We have some of the functionalities which open an URL inside a browser (HTML control of AIR SDK). Most of the URL related functionalities are working fine in AIR HTML control but have a problem with one functionality. The functionality opens an URL of Flash based application in AIR HTML control which on launch shows the followuing screen
    and when I try to click on either allow or deny button they do not respond however you may close this NativeWindow Object. Actually we are putting AIR HTML control inside NativeWindow obejct and then opening it. when we tried to open this application directly from browser (IE 9.0) it was working perfectly. the settings box came and allowed me to click on allow and behave accordingly.
    Please suggest some workaround.
    Regards,
    Ashish.
    9880536981

    Just registering that I have the same problem as well.  Tried flash 10.0.42 on Firefox 3.5.5 and IE 8.  I had this problem on two seperate windows XP machines, both running SP 3.
    Anyone have an idea as to what's up?
    Andy

  • NativeWindow reload in AIR/HTML apps?

    In an AIR/HTML app, is it possible to make a NativeWindow
    reload itself? I don't see anything in the API docs for
    NativeWindow that would allow this.
    I am opening new NativeWindows via a JS function, but if a
    particular window is already open, i call orderToFront() to get the
    window in focus instead of creating a new NativeWindow, but I would
    like to have the window contents refreshed because I am passing
    different parameters in the query string. Any way to do a simple
    HTML/JS-style window.reload() equivalent for NativeWindow?
    thanks,
    -norm

    Hi,
    Since this is an HTML AIR app, you probably only need to
    refresh HTMLLoader.
    For eg: nativeWindowObj.stage.htmlLoader.reload().

  • Webkit and safari supporting mathml -- when AIR HTML component supports MATHML

    latest version of Safari that uses webkit  supports MATHML.
    When can the AIR HTML component supports MATHML support for viewing the expressions.

    penugonda wrote:
    latest version of Safari that uses webkit  supports MATHML.
    Hmm. Don't know I'd go so far as to say that. Here's a more complete picture: "Webkit has an experimental MathML implementation which is enabled in Safari but the support is still limited and the rendering quality not very high. This implementation has not passed Google's security review and so is not integrated yet in Chrome."
    MathML support is far from complete in Safari and other Webkit browsers.

Maybe you are looking for

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "'Subreport Formula'"  or</p><p>crxSubreport.FormulaFields.Item("des

  • Mac Mini Purchase Question HDTV

    Hello, I want to buy a mac mini for an entertainment computer. I think the hdmi out will be great. All I want to do is watch movies through my samsung 55" HDTV. I am wondering if the basic model will be enough or should I get a suped up model. If I n

  • Iphone 4s problems with names not showing up

    When i get incoming calls the names don't show up but with txt messages the names show up........ I need some help here please

  • Case statement for dashboard text title based on NQ_SESSION.ROLES

    Hello, I figured out on my dashboard I can add a textbox with the code '@{biserver.variables['NQ_SESSION.ROLES']}'  and it shows the user groups. That works great. Now I need to have a case statement or so that shows a text, that changes with each us

  • Data Transmission via Ad Hoc Network in LabVIEW

    Hi, I'm trying to transmit some data (position, velocity, and etc) from a laptop to a host computer. Both the laptop and the desktop have wireless card installed so I thought it would be a good idea to transmit the data via Wi-Fi using TCP. However,