SkillAgentSearch skills...

Navigatetowindow

navigateToWindow() is a package-level ActionScript function that encapsulates the logic around opening a browser popup window

Install / Use

/learn @alimills/Navigatetowindow
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

h1. navigateToWindow()

navigateToWindow() is a package-level ActionScript function that encapsulates all of the logic around opening a browser popup window from within Flash.

The function works very similarly to "navigateToURL()":http://livedocs.adobe.com/flex/3/langref/flash/net/package.html#navigateToURL except that you call it with the parameters that JavaScript's "window.open":https://developer.mozilla.org/En/Window.open might expect.

The "test/patternpark/net/NavigateToWindowTest.as":http://github.com/alimills/navigatetowindow/blob/5d1a72f4033a6e61d06fefe7574329957d8c083d/test/patternpark/net/NavigateToWindowTest.as file demonstrates how you might use navigateToWindow(). This project was build with "Project Sprouts":http://github.com/lukebayes/project-sprouts/tree/master. To run the test suite, install "Sprouts":http://github.com/lukebayes/project-sprouts/tree/master and then run 'rake html' from the location where you pulled this project down.

One of the unique and interesting features of this implementation is that the developer using it doesn't have to write any JavaScript. Using a method derived from the ideas of "Abdul Qabiz":http://www.abdulqabiz.com/blog/ and his post "A MXML component that embeds JavaScript in html":http://www.abdulqabiz.com/blog/archives/macromedia_flex/a_mxml_component_tha.php, "Doug McCune":http://dougmccune.com/blog/ and his post "Multi-line strings in Actionscript 3":http://dougmccune.com/blog/2007/05/15/multi-line-strings-in-actionscript-3/, and "Jordan Ambra":http://www.zorked.com/ and his post "Popups Blocked in AS3 with navigateToURL()":http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/ we are able to execute all necessary JavaScript directly from ActionScript.

For background on this project, you can check out "my":http://www.asserttrue.com/ old post "Workaround for Safari Blocking Flash Initiated Pop Ups":http://www.asserttrue.com/articles/2007/08/22/workaround-for-safari-blocking-flash-initiated-pop-ups.

For another interesting project that solves this same problem through a JavaScript file and an ActionScript file, check out Matt Lohkampl's "popupfromflash":http://code.google.com/p/popupfromflash/.

Related Skills

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated1y ago
Forks2

Languages

ActionScript

Security Score

70/100

Audited on Feb 18, 2025

No findings