<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Style Press, Best Practices from all the Web, Build Better Websites &#187; Browser</title>
	<atom:link href="http://www.webstylepress.com/category/adobe-flash/browser-adobe-flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstylepress.com</link>
	<description>Web VS Style</description>
	<lastBuildDate>Mon, 26 Dec 2011 10:35:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Browser Control From Flash</title>
		<link>http://www.webstylepress.com/browser-control-from-flash/</link>
		<comments>http://www.webstylepress.com/browser-control-from-flash/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 09:41:20 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash tips]]></category>

		<guid isPermaLink="false">http://www.webstylepress.com/?p=249</guid>
		<description><![CDATA[In this section you will learn how to do the following in Flash using ActionScript. Close Browser From Flash Without POPUP Alert (browser close) With POPUP Alert (browser close) With POPUP Alert (browser close) Print From Flash Add to Favourites From Flash Launch Popup or Fullscreen Window From Flash For Full Screen in Html Page [...]<p><a href="http://www.webstylepress.com/browser-control-from-flash/">Browser Control From Flash</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In this section you will learn how to do the following in Flash using ActionScript.</p>
<ul>
<li>Close Browser From Flash</li>
<li>Without POPUP Alert (browser close)</li>
<li>With POPUP Alert (browser close)</li>
<li>With POPUP Alert (browser close)</li>
<li>Print From Flash</li>
<li>Add to Favourites From Flash</li>
<li>Launch Popup or Fullscreen Window From Flash</li>
<li>For Full Screen in Html Page Containing Swf</li>
<li>Open Many Popups From Flash (if u have many buttons and which indicate different windows to open)</li>
</ul>
<p>and more&#8230;</p>
<p><span id="more-249"></span></p>
<h4>Close Browser From Flash</h4>
<h5>With POPUP Alert (swf close)</h5>
<p>fscommands will do the task. Write the following script on button in flash and you are done.<br />
This script will close the swf and not the browser page.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">fscommand</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;quit&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h5>Without POPUP Alert (browser close)</h5>
<p>Write the following script on button in flash and you are done.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;javascript:window.opener=self;window.close(); &quot;</span>, <span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h5>With POPUP Alert (browser close)</h5>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;javascript:window.close()&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h5>With POPUP Alert (browser close)</h5>
<h6>On Flash Button</h6>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;JavaScript:close();&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>In that webpage in body section write the following anywhere.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=JavaScript:close();&gt;&lt;/a&gt;</pre></div></div>

<h4>Print From Flash</h4>
<p>There is print function in flash under printing action script menu, you can use that.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_root</span>, <span style="color: #ff0000;">&quot;bmax&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>It will print the whole _root timeline. If you want to specify frames (like one frame only put a label on the frame that says #p (hash sign + p) everything else will be excluded.</p>
<p>OR</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">printAsBitmapNum</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #ff0000;">&quot;bmovie&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Printing can be customised and you can define area and other options for that i.e.</p>
<p><a rel="nofollow" target="_blank" href="http://www.flashkit.com/tutorials/Getting_Started/Customis-Eddie_Ca-31/index.php" target="_blank">Check out following instructions</a></p>
<h4>Add to Favourites From Flash</h4>
<p>Following is the example of how to add to favorites from flash movie. You will have to add some actionscript at some button in flash and also some javascript code in webpage head section inwhich that flash movie is beingcalled.</p>
<h5>On Flash Button</h5>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;javascript:AjoutFavo()&quot;</span>, <span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h5>In Webpage Head Section</h5>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>SCRIPT LANGUAGE<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span> 
<span style="color: #003366; font-weight: bold;">function</span> AjoutFavo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appName</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appVersion</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
window.<span style="color: #660066;">external</span>.<span style="color: #660066;">AddFavorite</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://www.websiteurl.com&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;web site name&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>SCRIPT<span style="color: #339933;">&gt;</span></pre></div></div>

<h4>Launch Popup or Fullscreen Window From Flash</h4>
<h4>Popup From Flash</h4>
<h5>Script For Flash Button</h5>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;javascript:openWin();&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h5>For Html Page that Contain Swf with Button</h5>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> openWin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://yahoo.com'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'win_ranking'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'width=320,height=400,toolbar=0,menubar=0,location=0,left=0,top=113,screenX=0,screenY=100,scrollbars=no'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<h5>For Full Screen in Html Page Containing Swf</h5>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> openWin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://yahoo.com'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'win_ranking'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'toolbar=0,menubar=0,location=0,left=0,top=113,screenX=0,screenY=100,scrollbars=no,fullscreen=yes'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<h6>Open Many Popups From Flash (if u have many buttons and which indicate different windows to open)</h6>
<p>Add following scripts to your flash buttons.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;JavaScript: OpenWin('1.htm');&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;JavaScript: OpenWin2('2.htm');&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;JavaScript: OpenWin3('3.htm');&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>and so on&#8230;</p>
<p>Add this script in the head of your page inwhich this swf is embedded.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>Script Language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #003366; font-weight: bold;">function</span> OpenWin<span style="color: #009900;">&#40;</span>fileName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>fileName<span style="color: #339933;">,</span><span style="color: #3366CC;">'mNew'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;width=270,height=179,toolbar=0,menubar=0,location=0,left=0,top=113,screenX=0,screenY=100,scrollbars=no&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> OpenWin2<span style="color: #009900;">&#40;</span>fileName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>fileName<span style="color: #339933;">,</span><span style="color: #3366CC;">'mNew2'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;width=172,height=268,toolbar=0,menubar=0,location=0,left=0,top=113,screenX=0,screenY=100,scrollbars=no&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span> <span style="color: #003366; font-weight: bold;">function</span> OpenWin3<span style="color: #009900;">&#40;</span>fileName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>fileName<span style="color: #339933;">,</span><span style="color: #3366CC;">'mNew3'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;width=411,height=270,toolbar=0,menubar=0,location=0,left=0,top=113,screenX=0,screenY=100,scrollbars=no&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// and so on ................................</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p><a href="http://www.webstylepress.com/browser-control-from-flash/">Browser Control From Flash</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.webstylepress.com/embed-swf-files-javascript-run-active-content/" title="Embed SWF Files Via Javascript &#8211; Active Content Script">Embed SWF Files Via Javascript &#8211; Active Content Script</a></li><li><a href="http://www.webstylepress.com/random-bubble-animation-in-flash/" title="Create Random Bubble Animation In Flash">Create Random Bubble Animation In Flash</a></li><li><a href="http://www.webstylepress.com/flash-random-text-animation/" title="Create Flash Random 3D Text Animation">Create Flash Random 3D Text Animation</a></li><li><a href="http://www.webstylepress.com/flash-resources-and-tutorials/" title="Flash Resources and Tutorials">Flash Resources and Tutorials</a></li><li><a href="http://www.webstylepress.com/scrollbars-in-flash-flash-content-scroll/" title="Scrollbars In flash &#8211; Flash Content Scroll">Scrollbars In flash &#8211; Flash Content Scroll</a></li><li><a href="http://www.webstylepress.com/flash-mouse-effects/" title="Flash Mouse Effects">Flash Mouse Effects</a></li><li><a href="http://www.webstylepress.com/google-search-from-flash/" title="Google Search From Flash Using ActionScript">Google Search From Flash Using ActionScript</a></li><li><a href="http://www.webstylepress.com/flash-hit-counter/" title="Flash Hit Counter Using ActionScript and PHP">Flash Hit Counter Using ActionScript and PHP</a></li><li><a href="http://www.webstylepress.com/swap-depth-in-flash/" title="Swap Depth In Flash">Swap Depth In Flash</a></li><li><a href="http://www.webstylepress.com/flash-slide-shows/" title="Create Flash Slide Shows Using ActionScript &#8211; Example Downloads">Create Flash Slide Shows Using ActionScript &#8211; Example Downloads</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.webstylepress.com/browser-control-from-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

