Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

I need actionscript3 code to close a flash embeded html  page

Posted on 2009-04-28
4
Medium Priority
?
960 Views
Last Modified: 2013-12-16
My flash application has two links that open flash embeded html pages. The flash embeded html pages have back buttons with the follow code:
import flash.events.MouseEvent;
import flash.net.navigateToURL;

back.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void
{
      var request:URLRequest =  new URLRequest("index.html");
      navigateToURL(request,"_blank");
}
This code will take me back to the index.html but will leave the html page with the back button open. I need AS3 code to close the html  pages when returning to the index.html page.
Thanks for any help
0
Comment
Question by:hu3ypilot
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:biyik
ID: 24259918
In your code:
navigateToURL(request,"_blank");
use "_self" instead of "_blank".
0
 

Author Comment

by:hu3ypilot
ID: 24261996
biyik
The _self did not work. I click the button to run the code and my index page did not open and the page with the button did not close:
back.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void
{
      var request:URLRequest =  new URLRequest("index.html");
      navigateToURL(request,"_self");
      //liveplayer.stop();
}
0
 
LVL 6

Accepted Solution

by:
biyik earned 2000 total points
ID: 24262272
import flash.net.navigateToURL;
back.addEventListener(MouseEvent.CLICK, backClickFunc);
function backClickFunc(event:MouseEvent):void
{
      var indexLink:URLRequest =  new URLRequest("index.html");
      navigateToURL(indexLink, "_self");
}

I would write it like this and It should work.
0
 

Author Closing Comment

by:hu3ypilot
ID: 31575678
Thank for all the Help!!
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

576 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