JD Isaacks
JD Isaacks

Reputation: 57974

Flex/AIR: loaded HTML links don't work?

I have an <mx:HTML/> component in my flex air app that shows a web page. The problem is, if the web page has a link on it and they click it, it does not take them to that page. Is there a way to allow this, or a work around? is there a way for the loaded webpage to send Flex info about events that occur in it?

Here is my code:

<mx:HTML
        id="html"
        width="100%" 
        height="100%" 
        location="http://www.mywebsite.com/updates/help/" 
        locationChange="dispatchLocationChange(event)"
    />

Thanks!!

Upvotes: 2

Views: 1294

Answers (1)

Josh Buhler
Josh Buhler

Reputation: 27678

Do you have any other DisplayObjects handling mouse events that may be covering the HTML control, and blocking any clicks that it might receive? It seems that something may be interfering with the mouse events reaching your HTML content. I threw together a dirt-simple AIR app that loads some web content using the code above, and I'm not seeing any issues - everything appears to be working the way that it should:

    <?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            private function dispatchLocationChange (e:Event):void
            {
                trace ("locationChange:", html.location);
            }
        ]]>
    </mx:Script>
    <mx:HTML
        id="html"
        width="100%" 
        height="100%" 
        location="http://www.google.com/" 
        locationChange="dispatchLocationChange(event)"
    />
</mx:WindowedApplication>

Off the top of my head, I can't really think of anything else other than some issues with the HTML content itself that might be causing the problems. Have you tried loading other web content into the HTML control to see if you experience the same issues with different content?

Upvotes: 1

Related Questions