Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6677915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:10:50+00:00 2026-05-26T04:10:50+00:00

Suppose, that I need to have a HTML control inside my Flex/AIR app. The

  • 0

Suppose, that I need to have a HTML control inside my Flex/AIR app.

The user should be able to click somewhere into the currently rendered HTML-page and the flex app should know, which DOM element the user clicked.

Ideally, the app would be able to retrieve the DOM path of the selected element. Posting back the innermost surrounding DIV-element to some Flex/AIR method would be fine too.

Q: Does flex provide something in the framework for this task? Or do you know of sample code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:10:50+00:00Added an answer on May 26, 2026 at 4:10 am

    You add a callback to the window property of the HTMLLoader within the HTML element. A quick example (using jQuery for expediency):

    HTML page here: http://fiddle.jshell.net/w23Xx/1/show/ (Source here)

    Flex code:

    <?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">
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
    
                protected function html1_creationCompleteHandler(event:FlexEvent):void
                {
                    // Add the click callback
                    html.htmlLoader.window.flexClickCallback = function(element:Object):void
                    {
                        trace("Element ID:", element.id);
                    };
                }
    
            ]]>
        </fx:Script>
    
        <mx:HTML id="html" location="http://fiddle.jshell.net/w23Xx/1/show/" left="10" right="10" top="10" bottom="10" creationComplete="html1_creationCompleteHandler(event)" />
    
    </s:WindowedApplication>
    

    I believe you can add listeners directly, but this shows how you access the page’s window.

    Edit:

    Mike Chambers posted an example of doing DOM manipulation directly within the AS of an AIR app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control inside a webpart inside sharepoint that I add some
I have a user control inside a webpart inside sharepoint that I add some
Suppose I have ActivityA and ActivityB, also suppose that ActivityA is active. I need
Suppose you have two seperate ASP.NET Web Application projects that both need to use
I understand that we need to create MXML file to define a view. Suppose
Suppose that you have two huge files (several GB) that you want to concatenate
Suppose that I have a Java program within an IDE (Eclipse in this case).
Suppose that I have a Java class with a static method, like so: class
I have a Table containing some information that I need. All these rows also
Suppose I have a <select> element on my HTML page, and I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.