Want to do Popups using text taken from XML file.

Posted on 2011-05-12
Last Modified: 2013-11-11

I am currently reading the content of an XML file to populate a Textfield in Flash.
However, I would like to be able to add mouseover/mouseclick popup actions to selected/highlighted text .

While general html works, i dont think Div popup works. The following code inserted into my xml text doesnt not work :

<div id="simplediv" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;">Click anywhere in the document to auto-close me</div>
<a href="#" onclick="'simplediv');return false;">Click Here To Show DIV</a>

My other option maybe is to create the popups using MovieClips. However, I would still need to know that my mouse is hovering on a specific text for me to call it.
Any ideas/pointers I can set myself off to?
    LVL 29

    Expert Comment

    For what Zone and Language this question?
    LVL 10

    Accepted Solution

    I'm a little out of my depth here; I'm not an expert at HTML and divs and such.
    So, I'm stuck simply giving you a reference page:

    This tells what html is supported.  <div> is not.  Also, Popup is presumably Java or javascript, so is also not necessarily accessible to Flash's html.text setting.

    The good news is that this reference also gives you a way to go about it.  Use an event anchor instead of an href, and catch the event inside your action script.
    It also makes some mention that you can define hover styles for the anchor using CSS (of which I'm also blissfully ignorant).

    Hope this helps.  I can make an event anchor example for you, if you want me to go further down that route.
    LVL 29

    Expert Comment

    Actually in AS we arenot supporting div and span, but you can open popup using <a href tag and call javascript

    Author Comment

    It worked flawlessly :) Thanks so much, and I will now have to also see what to do about the hover styles. But maybe I will tag a hover thing right on the event listener. Cheers ^_^

    Author Closing Comment


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now