Interacting with html documents from flash

Hi,
I'm a newbie in actionscript. I created a world map in flash. The map has regions (Europe, North America, Latin America, etc.). The regions on the map are defined as buttons.
The final flash map will be embedded in an html document (map.html). The idea is that when you click for example the "Europe" button on the flash movie, this will open an html document called Europe.html and will show it underneath the map flash (inside map.html).
The "Europe.html" for example contains a list of countries.
In this mission I have 2 problems:
1.       What script I have to attach to every region button on the flash map so it will call the right html file into the div on the map.html?
2.       What script do I have to put inside the html document?
Any help will be much appreciated. thank you
Arie M.

assign your button an instance name (in the properties panel after selecting your button) and use that name in the actions panel:
yourbutton.addEventListener(MouseEvent.CLICK,f);
function f(e:MouseEvent):void{
navigateToURL(new URLRequest("map.html"),"youriframe")

Similar Messages

  • Load html document inside flash

    I have been informed that it is possible to load an html
    document inside flash, that you use an HTML tag, but I cannot find
    it in the scripts, can anyone show an example and explain how to
    make it work or if there is a tutorial for creating this inside of
    flash.
    Thanks

    Dear All
    I do not know why they call themselves professionals in flash and html, while they can not help us with a simple webpage inside a flash movie.
    No offense
    I was trying the whole week to do that by checking if any body post any tip over the internet, but as usual the profs said that you can only make it in test and only text and bla bla bla.....
    Let me tell you that I have managed to open a whole webpage in my flash website.
    I have this page that is html and have so many codes and things that I do not know, and in my flash website I have a menu which one of its buttons must open that html file, and as every body knows that you will loose the whole work if you poped up another window from your flash website.
    So Cheer up I have managed to open my html page in my flash movie website.
    You can check it up following this link www.compuhometech.com/html_inside_flash/index.html
    If you like to have it please mail me : [email protected]
    Thank you

  • HTML documents from Mac to Pad

    I have developed a series of HTML-CSS-JavaScript pages (kind of utilities) on my iMac, and I would like to have them on my newly purchased iPad.
    1. How do I transfer such documents from iMac to iPad?
    2. How do I open these documents with Safari on iPad?
    François

    Sorry,
    I was just reading steve jobs speech on why html5 should be used instead of flash, his big point was html just works the same everywhere so i want the web to stop using flash and switch to html so i can see it too.
    but why would say abc.com take down there flash stuff and replace it with html if the flash they made works everywhere except my device and html needs to be made for every browser.
    i dont like needing an app for every website and not all apps are free. i just want to surf the web like everyone else. and im now worried that my device is never going to be able to.
    I saw this guy watching abc.com right on his phone.
    http://www.youtube.com/watch?v=omBXttm-eec&feature=related
    Then I saw this guy showing how html for macs wont work on ipads
    http://www.youtube.com/watch?v=rfmbZkqORX4&feature=watchresponserev
    now im scared abc.com will never change their site for my device which only supports html, because html needs to be made again for everthing and flash works everywhere.

  • Opening an HTML popup from Flash, not as tab

    Hi
    I need to open an HTML popup from Flash (using ActionScript in
    Flex 4).
    Thus far I found a solution, and it does work in Safari - a new
    and separate HTML window is popped up (with a new web page).
    private function popUpTheHtmlEditor():void {
      var url:String = "http://www.adobe.com";
      var request:URLRequest = new URLRequest(url);
      try {
        navigateToURL(request, '_blank');
      } catch (e:Error) {
        trace("Error occurred!");
    But in (my) Firefox (with my settings), when I click on the Flash
    (Flex) button, the page is being opened in a new tab.
    I need a solution which pops up the HTML page in a new/separate
    window, as far as possible regardless of the browser (and browser
    settings).
    I found an example where a popup is opened from HTML, and it opens a
    separate window (a real popup) in my Firefox:
    http://www.gtalbot.org/FirefoxSection/Popup/PopupAndFirefox.html
    -> "Open a requested popup"
    The JavaScript code seems to be:
      OpenRequestedPopup(this.href, this.target); return false;
    with this function def:
      function OpenRequestedPopup(strUrl, strTarget)
        if (WindowObjectReferenceOfRequestedPopup == null || WindowObjectReferenceOfRequestedPopup.closed)
        WindowObjectReferenceOfRequestedPopup = window.open(strUrl, strTarget, "top=" + windowTop + ",left=" + windowLeft + ",width=" + windowWidth + ",height=" + windowHeight + ",menubar,toolbar,location,resizable,scrollbars,status");
        else
        if(WindowObjectReferenceOfRequestedPopup.focus)
          WindowObjectReferenceOfRequestedPopup.focus();
    How could I call such code from ActionScript? Should this work through
    ExternalInterface? I couldn't even get this to work:
      ExternalInterface.call('alert', 'foo');
    Should I use swfobject.js for embedding the .swf in the HTML wrapper?
    Any other ideas?
    The two files are pasted below.
    Here's the compiler command I'm using:
      mxmlc -output button.swf -target-player 10.0.0 flash_to_editor.mxml
    I'm running the examples locally (as files, not over http). Would it
    help to place the files on a server?
    Tobi
    <?xml version="1.0" encoding="UTF-8"?>
    <mx:Application
      xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      horizontalAlign="center" verticalAlign="middle">
      <fx:Script>
        <![CDATA[
    import mx.controls.Alert;
    import flash.external.ExternalInterface;
    import flash.net.URLRequest;
    // This 'http://www.adobe.com' is just an example URL.
    // Works but opens tab in FF (not a separate window):
    private function popUpTheHtmlEditor():void {
      var url:String = "http://www.adobe.com";
      var request:URLRequest = new URLRequest(url);
      try {
        navigateToURL(request, '_blank');
      } catch (e:Error) {
        trace("Error occurred!");
    // Doesn't work:
    // var url:URLRequest = new URLRequest("javascript:alert('foo'); void(0);");
    // navigateToURL(url, "_self");
    // How to get this to work?
    private function popUpTheHtmlEditor():void {
      ExternalInterface.call('alert', 'foo');
    // How to get this to work?
    private function popUpTheHtmlEditor():void {
      ExternalInterface.call('launch','http://www.adobe.com');
      // Or
      // ExternalInterface.call("window.open", "http://www.adobe.com", "win", "height=200,width=300,toolbar=no,scrollbars=yes");
    // Perhaps it's necessary to try different approaches:
    // (As soon as I get two approaches to work.)
    private function popUpTheHtmlEditor():void {
      var s:String;
      if (ExternalInterface.available) {
        // Necessary? Safe?:
        // Security.allowDomain('*');
        s = ExternalInterface.call('launch','http://www.adobe.com');
      } else {
         // TODO: Then try URLRequest?
         s = "Wrapper not available";
      Alert.show(s);
        ]]>
      </fx:Script>
      <s:Panel title="One way to open the HTML editor"
      width="75%" height="75%">
        <s:Button id="button" label="Open the HTML editor"
        click="this.popUpTheHtmlEditor();"
        horizontalCenter="0" verticalCenter="0"/>
      </s:Panel>
    </mx:Application>
    <html
      xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en" lang="en">
      <head>
        <title>html_around_swf.html</title>
        <script type="text/javascript">
    function launch(url) {
      alert(url);
      //  OpenWin = this.open(url, "FOO", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=400,height=200");
        </script>
      </head>
      <body>
        <object id="button" name="button" width="550" height="400"
        classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
          <param name="movie" value="button.swf" />
          <param name="allowScriptAccess" value="always" />
          <embed id="foo" name="button" src="button.swf" width="550" height="400"></embed>
        </object>
      </body>
    </html>

    Hi, 
    Here's a solution.
    1. Make ExternalInterface work when files are loaded as local files: 
    Go to
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l 
    In tab Global Security Settings: Edit Locations -> Add Location ->
    browse to the .swf file, add it. Make sure it's in the list (under the
    Edit Locations drop down, with a green check mark.) 
    Now open the HTML wrapper in a browser (eg Firefox). 
    Now this works (ActionScript): 
    private function popUpTheHtmlEditor():void {
      ExternalInterface.call('alert', 'foo');
    On Windows: perhaps:
    http://techjig.blogspot.com/2008/03/flash-global-security-settings-windows.html
    "In order for external interface functions to be called, you must also
    specify the folder/file where the swf file is located." 
    The above setup isn't necessary when the files are on a server. 
    Also see: 
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html#call()
    ""ExternalInterface" "
    "call() method" 
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ea6.html
    "About ExternalInterface API security in Flex" 
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf626ae-7fe8.html#WS2d b454920e96a9e51e63e3d11c0bf69084-7f31
    "Using the ExternalInterface API to access JavaScript" 
    2. Open a real popup: Example: 
    ActionScript: 
    private function popUpSomething():void {
      var editorPathOrUrl:String =
        'wrapper.html';
      var windowName:String =
        "SomeNameSeeDocs";
      var windowFeatures:String =
        "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=500,height=700";
      ExternalInterface.call(
        'launch',editorPathOrUrl,windowName,windowFeatures
    JavaScript: 
    function launch(editorPathOrUrl,windowName,windowFeatures) {
      windowRef = window.open(
        editorPathOrUrl,windowName,windowFeatures
    Works in all browser I tested except Opera. 
    Tobi

  • Opening help html documents from 10g form

    We are converting our 6i forms to 10g. I am trying to open my help html documents from the 10g forms. We have modified the httpd.conf file setting the DocumentRoot "/oracle/apps/aces/help". This is the path where my html documents reside. From the 10g forms I am using web.show_document to open the html documents. I am getting a Page not Found error. Is there somewhere else the help path needs to be set?
    Thanks!!
    Shellie Bricker

    The way i know is, putting some AliasMatch in the conf-file of Apache like
    AliasMatch ^/help/(..*) "C:\help/$1"And then use WEB.SHOW_DOCUMENT with this virtual path
    WEB.SHOW_DOCUMENT('//help/helpfile.html', '_blank');

  • How to send a mail with HTML body from Oracle

    Hi Team,
    Can somebody guide me how to send a mail with HTML body from oracle.
    Here is the piece of code i am trying to send a mail.
    procedure SEND_MAIL is
    cursor c_1 is select * from table_name;
    l_mail_id varchar2(40);
    -- ls_mailhost VARCHAR2(64) := Mailhost;
    ls_from VARCHAR2(64) := ‘[email protected]
    ls_subject VARCHAR2(200);
    ls_to VARCHAR2(64);
    l_mail_conn UTL_SMTP.connection;
    ls_left_menu_name VARCHAR2(64);
    ll_emp_num number(8);
    begin
    for i in c_1 loop
    begin
    l_mail_conn := UTL_SMTP.OPEN_CONNECTION('IP');
    UTL_SMTP.HELO(l_mail_conn, 'IP');
    UTL_SMTP.MAIL(l_mail_conn, LS_FROM);
    UTL_SMTP.RCPT(L_mail_conn, LS_TO);
    UTL_SMTP.DATA(l_mail_conn,'From: ' ||ls_from || utl_tcp.crlf ||
    'To: ' ||ls_to || utl_tcp.crlf ||
    'Subject: ' ||ls_subject|| utl_tcp.crlf);
    UTL_SMTP.QUIT(l_mail_conn);
    exception
    when no_data_found then
    null;
    when others then
    RAISE_APPLICATION_ERROR(-20000, 'Failed to send mail due to the following error: ' || sqlerrm);
    end;
    end loop;
    end;
    Thnx

    Hi Nicolas!
    Have you tried to set "Output Format" for "RAW Text" to HTM in SCOT.
    If HTM is missing in your dropdown-list, you could check out table SXCONVERT2. Copy the line with category T/format TXT, and change the format from TXT to HTM. The existing function
    SX_OBJECT_CONVERT__T.TXT does not need to be changed. Now you should be able to choose HTM in SCOT. You will probably need som HTML-tags in your text to make it look good.
    Hope this helps!
    Regards
    Geir

  • How to Call HTML Layers from Flash?

    how to Call HTML Layers from Flash? i need a help on example
    or script.

    What do you mean html layers? You can call JavaScript on the
    page using the
    ExternalInterface class. There's examples in Help if you look
    up the EI
    class, and it's call method.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • I want to read a HTML document from internet

    Is it i should use javax.swing.text.html.HTMLDocument?

    Is it i should use javax.swing.text.html.HTMLDocument?What do the docs for that class say? Does it have methods for reading an HTML document from the internet?

  • Download a document from  flash movie

    This might seem like a bit of a silly question. I have a PDF
    I want to upload and make available to download from my flash
    website. I originally did this by uploading the file to '4share'
    but my employer did not like it saying it was a bit confusing and
    full of adverts. If I upload the PDF with the rest of my site to
    the remote folder how do I connect a button in the website to
    automatically start a download of the file? Should I have the file
    in an html document, or is it a simple case of getURL on the
    desired button? If so, what do I need to do to the PDF before the
    link will work correctly.
    Many Thanks
    JG

    jollygrizzly wrote:
    > This might seem like a bit of a silly question. I have a
    PDF I want to upload
    > and make available to download from my flash website. I
    originally did this by
    > uploading the file to '4share' but my employer did not
    like it saying it was a
    > bit confusing and full of adverts. If I upload the PDF
    with the rest of my
    > site to the remote folder how do I connect a button in
    the website to
    > automatically start a download of the file? Should I
    have the file in an html
    > document, or is it a simple case of getURL on the
    desired button? If so, what
    > do I need to do to the PDF before the link will work
    correctly.
    >
    getURL action and instead of URL, path to your file on sever.
    Depends on user end, if the browser has DPF plugin, the file
    will
    automatically open so if you want to force download, zip that
    file.
    ZIP always prompt download dialog.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Unloading FlashPaper Document from Flash Movie

    I'm using the following script to play a FlashPaper movie clip:
    // function: loadFlashPaper
    // Parameters:
    //   path_s: path of SWF to load
    //  dest_mc: Movie clip to hold the imported SWF
    //  width_i: New size of the dest movie clip
    // height_i: New size of the dest movie clip
    // loaded_o: (optional) Object to be notified that loading is complete
    function loadFlashPaper(path_s, dest_mc, width_i, height_i, loaded_o) {
    var intervalID = 0;
    var loadFunc = function(){          
    dest_mc._visible = false;          
    var fp = dest_mc.getIFlashPaper();
    if (!fp) {
    return;
    } else if (fp.setSize(width_i, height_i) == false)     {
    return;
    } else {
    clearInterval(intervalID);          
    dest_mc._visible = true; // Now show the document
    loaded_o.onLoaded(fp);
    intervalID = setInterval(loadFunc, 100);
    dest_mc.loadMovie(path_s);
    // Function called once the FlashPaper SWF is embedded:
    function onLoaded(fp) {
    // We can now call the FlashPaper API functions.
    // Remove the standard user interface features:
    fp.showUIElement("PrevNext", true);
    fp.showUIElement("Print", true);
    fp.showUIElement("Find", true);
    fp.showUIElement("Tool", true);
    fp.showUIElement("Pop", true);
    fp.showUIElement("Zoom", true);
    fp.showUIElement("Page", true);
    fp.showUIElement("Overflow", true);
    fp.enableScrolling(true);
    // Some additional API features (here commented out):
    // Go to page:
    // fp.setCurrentPage(8);
    // Change the magnification to 50%:
    // fp.setCurrentZoom(50);
    // Now we're ready to start
    // Create the destination movie clip to hold the SWF:
    var theDocMC_mc = this.createEmptyMovieClip("theDocMC",100);
    // Position it on the stage:
    theDocMC_mc._x = -220;
    theDocMC_mc._y = -150;
    // Load the FlashPaper SWF into the clip,
    //   size it, and trigger the onLoaded() function:
    loadFlashPaper("MarketingDoc.swf", theDocMC_mc, 500, 350, this);
    Everything works fine on all pages including the page with the FlashPaper movie. The problem is after I visit the page with the FlashPaper movie my file starts to play through all the pages and wont stop.
    I'm new to flash and this has been driving me mad. Any tips would be greatly apprciated.
    files attached for example of my problem:
    Thanks.

    jollygrizzly wrote:
    > This might seem like a bit of a silly question. I have a
    PDF I want to upload
    > and make available to download from my flash website. I
    originally did this by
    > uploading the file to '4share' but my employer did not
    like it saying it was a
    > bit confusing and full of adverts. If I upload the PDF
    with the rest of my
    > site to the remote folder how do I connect a button in
    the website to
    > automatically start a download of the file? Should I
    have the file in an html
    > document, or is it a simple case of getURL on the
    desired button? If so, what
    > do I need to do to the PDF before the link will work
    correctly.
    >
    getURL action and instead of URL, path to your file on sever.
    Depends on user end, if the browser has DPF plugin, the file
    will
    automatically open so if you want to force download, zip that
    file.
    ZIP always prompt download dialog.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Retrieving html text not html document from RichEditableText control

    Hi,
       I have some html text
    Ex- This is <b> test </b>
    which i am setting to RichEditableText using TextConvert.importToFlow(),I want to format this text just bold and italic and then get back  same html text back with
    only formatting i have done.
    Suppose i have formatted this text in RichEditableText like;
    Ex- This <i>is</i> <b> test</b>
    But when i am trying to get back this from RichEditableText using;
      TextConverter.export(richedittxt.textFlow,TextConverter.TEXT_FIELD_HTML_FORMAT,ConversionT ype.STRING_TYPE);
    It gives a complete html document with <html><body><font> tags, which i dont want. It should not includes all these extra tags.
    Can any one suggest, whether it is feasible or not ? Please reply if any one has solution
    Thanks..

    Leao,
    > I didn't write the original actionscript so I don't
    > really know how to implement what you suggested.
    Aha! Well, that can be a bit like painting yourself into a
    corner. ;)
    > Could you explain a little more?
    Spend a bit of time with the String class. Before you even
    do that, you
    may want to familiarize yourself with the concept of objects
    in general.
    See this introductory article ...
    http://www.quip.net/blog/2006/flash/actionscript-20/ojects-building-blocks
    ... then spend a bit of time in a completely new FLA
    experimenting with the
    String class. Many of its methods are specifically geared
    toward changing
    the value of the text content, including stripping away
    certain characters.
    e.g., you can use String.indexOf() to return the position of
    a particular
    character (or characters) in a string of text. You may then
    use that
    position in cahoots with String.substr() to return a new
    string that as been
    "pruned" of undesired content.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Navigate to HTML anchor from flash menu

    Hi,
    I would like to navigate to an html anchor from a flash menu.
    I use navigateToURL(“#anchorName”,
    “_self”). It work fine in IE 7, Firefox 2 and 3 but in
    safari the page reload. How can I prevent safari from reloading the
    page ?
    Thank you !

    I have solved the problem by using the externalInterface and
    a javascript function with window.location.hash.

  • How to remove document from Flash drive after printing from a PC

    Hi All,
    Here's my problem: Today I needed to print an MS Word file at a printshop, so I saved the document onto my Flash drive and took it to the shop. There, the staff printed the document from a PC and handed the drive back to me.
    Now, back at home, I want to delete this document from the Flash Drive. I plug in the drive, select the document and drag it to the trash. But then I get this message: " The operation cannot be completed because you do not have sufficient privileges for document X".
    This is a document I created from scratch, so I should have read/write privileges, yet the document on the drive is Read Only.
    I went back to the shop, and they get the same message.
    If I try to use disk utility to erase the disk, it appears as an MS-DOS FIle System (FAT 16) disk, and the erase buttons are "greyed out".
    How can I erase this document? Or how I can I reformat the drive?
    Any help much appreciated!~
    12 iBook G4,1.2 GHz, 768 RAM   Mac OS X (10.4.7)  

    I think I just solved my own problem. Just tried pressing the option and command keys at the same time while dragging the document into the trash and now it's gone. For good, I hope....Phew!
    12 iBook G4,1.2 GHz, 768 RAM   Mac OS X (10.4.7)  

  • Interact with HTML Panel

    I've managed to create an html panel inside a tooltip, but
    can't work out how to interact with it. I've looked at the example
    of an interactive tooltip, but arn't sure how to modify this to
    interact with the panel. Can anyone advise please. Thanks. My test
    so far is here:
    http://fctu.org.uk/samplepages/tooltip2.asp

    Sorry, sorted it. Got my curly brackets in the wrong
    place.

  • Recently upgraded to Mavericks... was working with Pages documents from previous OS ... Pages is now frozen and I don't dare force quit and loose my old documents.

    Recently upgraded to Mavericks... was working with Pages documents created with previous OS ... Pages is now frozen and I don't dare force quit and loose my old documents.  How can I "thaw".... unfreeze Pages?  Have several pages windows open that I was working on. 

    I also had this problem after I installed Mavericks: Pages files freezing at close, need to force quit.
    Workaround: when saving any document created with an earlier version of Pages, be sure to untick the "include preview in document".
    For some reason, this resolves the problem.
    BTW "loose" is not a verb. You probably mean "lose".

Maybe you are looking for

  • Blurry images in cover flow view

    why do my tiff files (primarily) look so blurry when I switch to cover flow view on my new mac? I've seen posts about this issue as far back as 2007- has apple still not fixed this, or is it just me? As a photographer it's a major annoyance to have t

  • Too many hard drives?

    I'm experiencing a growing problem, and that's that I'm getting too many hard drives. I originally bought a 250GB drive, then added a 400GB drive, and lastly I got a 100GB bus powered drive for portability. But now I need another drive for media and

  • My Iphone 3G don't detect my Jabra BT2010 headset

    I have a Jabra BT 2010 Bluetooth headset. When I turn on my bluetooth of my Iphone it don't detect my headset. I've look on the website of Jabra and it says that the BT 2010 is compatable for the Iphone 3G but still it will not working. Can someone h

  • Site Studio Placeholder question...

    Hello all, I was wondering if it's possible to check if a placeholder has a subtemplate, regiontemplate or data file associated to it through idoc... for example, consider the code below: <body> <div id="content"> <!--$wcmPlaceholder("Content_Placeho

  • File comments

    For a long time, I've known that UNIX has support for some kind of comment field in its filesystems, and every now and then I get a little confirmation from things like eg a webserver that has an additional "comment" field running alongside the listi