<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>assertTrue: navigateToWindow() project added to github</title>
    <link>http://www.asserttrue.com/articles/2009/04/29/navigatetowindow-project-added-to-github</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>powered by Pattern Park</description>
    <item>
      <title>navigateToWindow() project added to github</title>
      <description>&lt;p&gt;I just added a new project to &lt;a href="http://github.com/"&gt;github&lt;/a&gt; called &lt;a href="http://github.com/alimills/navigatetowindow/tree/master"&gt;navigateToWindow()&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://github.com/alimills/navigatetowindow/tree/master"&gt;navigateToWindow()&lt;/a&gt; is a package-level ActionScript function that encapsulates all of the logic around opening a browser popup window from within Flash.&lt;/p&gt;


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


	&lt;p&gt;The &lt;a href="http://github.com/alimills/navigatetowindow/blob/e81fef17d80db50b57e1b12979ad6a9630460e87/test/patternpark/net/NavigateToWindowTest.as"&gt;test/patternpark/net/NavigateToWindowTest.as&lt;/a&gt; file demonstrates how you might use navigateToWindow(). This project was build with &lt;a href="http://github.com/lukebayes/project-sprouts/tree/master"&gt;Project Sprouts&lt;/a&gt;.  To run the test suite, install &lt;a href="http://github.com/lukebayes/project-sprouts/tree/master"&gt;Sprouts&lt;/a&gt; and then run &amp;#8216;rake html&amp;#8217; from the location where you pulled this project down.&lt;/p&gt;


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


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


	&lt;p&gt;For another interesting project that solves this same problem through a JavaScript file and an ActionScript file, check out Matt Lohkampl&amp;#8217;s &lt;a href="http://code.google.com/p/popupfromflash/"&gt;popupfromflash&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Wed, 29 Apr 2009 13:52:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:59e6ad62-b6fc-473b-9b9b-d26954f3970e</guid>
      <author>Ali Mills</author>
      <link>http://www.asserttrue.com/articles/2009/04/29/navigatetowindow-project-added-to-github</link>
      <category>actionscript</category>
      <trackback:ping>http://www.asserttrue.com/articles/trackback/1612</trackback:ping>
    </item>
  </channel>
</rss>
