<?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>A K Chauhan's Blog &#187; Flash</title>
	<atom:link href="http://www.akchauhan.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.akchauhan.com</link>
	<description>PHP, MySql, JavaScript, JQuery, Prototype, Drupal, HTML, CSS and more...</description>
	<lastBuildDate>Mon, 02 Jan 2012 03:29:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Initialize LightBox using JSON string and Run it from Flash</title>
		<link>http://www.akchauhan.com/initialize-lightbox-using-json-string-and-run-it-from-flash/</link>
		<comments>http://www.akchauhan.com/initialize-lightbox-using-json-string-and-run-it-from-flash/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 06:19:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[LightBox]]></category>

		<guid isPermaLink="false">http://www.akchauhan.com/?p=491</guid>
		<description><![CDATA[Lightbox is the most popular way of showing large image on click on thumbnail over the web. Lot of websites are using the LightBox. Normally, We use lightbox using the &#8220;rel&#8221; attribute of anchor tag. We use lightbox this way:- &#60;a href=&#34;images/image-1.jpg&#34; rel=&#34;lightbox&#34; title=&#34;thumb&#34;&#62;&#60;img src=&#34;images/thumb-1.jpg&#34; width=&#34;100&#34; height=&#34;40&#34; alt=&#34;&#34; /&#62;&#60;/a&#62; Here, we provided the &#8220;rel&#8221; attribute [...]]]></description>
			<content:encoded><![CDATA[<p>Lightbox is the most popular way of showing large image on click on thumbnail over the web. Lot of websites are using the LightBox. Normally, We use lightbox using the<strong> &#8220;rel&#8221; </strong>attribute of anchor tag. We use lightbox this way:-</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;images/image-1.jpg&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;lightbox&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;images/thumb-1.jpg&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;40&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>Here, we provided the <strong>&#8220;rel&#8221;</strong> attribute as <strong>&#8220;lightbox&#8221;</strong> in hyperlink. What lightbox script do is when page load completed its check all the hyperlinks of page and if <strong>rel=&#8221;lightbox&#8221;</strong> is exists them it push this link into an array.<br />
Lightbox extract the <strong>&#8220;href&#8221;</strong> and <strong>&#8220;title&#8221;</strong> attributes of each link having <strong>rel=&#8221;lightbox&#8221;</strong> and push all of them into array. <strong>&#8220;href&#8221;</strong> is normally the URL of larger image. Lingtbox also add <strong>&#8220;click&#8221;</strong> event on all of these hyperlinks and when user click on any particular thumbnail the lightbox starts.</p>
<p>Here, I&#8217;m showing a way in which you can initialize the lightbox by using the <strong>JSON</strong> string. Basically, this JSON string contains the <strong>&#8220;href&#8221;</strong> and <strong>&#8220;title&#8221;</strong> information which we want to show. We can create this string dynamically using any server side scripting language. Here is one of sample JSON string.</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;">var</span> img_json <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'pics/photo-80.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Title 01'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'pics/photo-128.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Title 02'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'pics/photo-160.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Title 03'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'pics/photo-165.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Title 04'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'pics/photo-205.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Title 05'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'pics/photo-206.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Title 06'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>You can learn more about JSON <a href="http://www.json.org/" target="_blank">here</a>.</p>
<p>We also need to do some small changes in lightbox javascript file so it use our JSON string for image array instead of create array by checking the <strong>&#8220;rel&#8221; </strong>attribute in whole page. <br/><br/><strong>You can download the customized lightbox javascript file from <a href="http://www.akchauhan.com/downloads/example12.rar">here</a>.</strong><br/><br />
<strong>You can see the working demo <a href="http://www.akchauhan.com/examples/example12/" tagret="_blank">here</a>.</strong><br/><br/></p>
<p><strong>1. Remove the &#8220;imageLink&#8221; parameter from start function because now we not starting LightBox by not clicking any thumbnail.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">start<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>imageLink<span style="color: #009900;">&#41;</span></pre></div></div>

<p>function to</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">start<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>2. Now we are initializing the &#8220;imageArray&#8221; using JSON string.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageArray</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p> to</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageArray</span> <span style="color: #339933;">=</span> img_json<span style="color: #339933;">;</span></pre></div></div>

<p><strong>3. Comment these line of code inside start function bacause we not want to check whole page links for lightbox.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*if ((imageLink.rel == 'lightbox')){
           // if image is NOT part of a set, add single image to imageArray
           this.imageArray.push([imageLink.href, imageLink.title]);         
  } else {
            // if image is part of a set..
            this.imageArray = 
                $$(imageLink.tagName + '[href][rel=&quot;' + imageLink.rel + '&quot;]').
                collect(function(anchor){ return [anchor.href, anchor.title]; }).
                uniq();
&nbsp;
            while (this.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
  }*/</span></pre></div></div>

<p><strong>4. Add function startLightBox() at the end of Lightbox class. This function start the lightbox when we click on the link having id=&#8221;start&#8221;.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">startLightBox<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> th <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	Event.<span style="color: #660066;">observe</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'start'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	 	th.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>5. Add this line in initialize() function to call &#8220;startLightBox()&#8221; function which create the click event on link having id=&#8221;start&#8221;.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">startLightBox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After completing all the five changes in lightbox.js you need to create a link with<strong> id = &#8220;start&#8221;</strong> in your HTML file. When you click on this link its starts the LightBox. Here is the code for HTML file.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Initialize LightBox using JSON string and Run it from Flash<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/lightbox.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/prototype.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/scriptaculous.js?load=effects,builder&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/lightbox.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;start&quot;</span>&gt;</span>Start LightBox<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span>&gt;</span>
	var img_json = [['pics/photo-80.jpg', 'Title 01'],['pics/photo-128.jpg', 'Title 02'],['pics/photo-160.jpg', 'Title 03'],['pics/photo-165.jpg', 'Title 04'],['pics/photo-205.jpg', 'Title 05'],['pics/photo-206.jpg', 'Title 06']];
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.akchauhan.com/initialize-lightbox-using-json-string-and-run-it-from-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How call JavaScript function from FLASH</title>
		<link>http://www.akchauhan.com/how-call-javascript-function-from-flash/</link>
		<comments>http://www.akchauhan.com/how-call-javascript-function-from-flash/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 10:30:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.akchauhan.com/?p=190</guid>
		<description><![CDATA[We can call the JavaScript function from FLASH application. I am showing here how we do that. getURL&#40;&#34;javascript:helloWorld();&#34;&#41;; Here &#8220;getURL()&#8221; is the Flash ActionScript function. We have give the name of our JavaScript function with &#8220;javascript:&#8221; as prefix. This will call the &#8220;helloWorld()&#8221; function which we have defined in JavaScript. &#60;script type=&#34;text/javascript&#34;&#62; function helloWorld&#40;&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>We can call the JavaScript function from FLASH application. I am showing here how we do that.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">getURL<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;javascript:helloWorld();&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here <strong>&#8220;getURL()&#8221;</strong> is the Flash ActionScript function. We have give the name of our JavaScript function with &#8220;javascript:&#8221; as prefix. This will call the &#8220;helloWorld()&#8221; function which we have defined in JavaScript.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
     <span style="color: #003366; font-weight: bold;">function</span> helloWorld<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hello World'</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>

<p>Also, add the following parameter to the <strong>OBJECT</strong> and <strong>EMBED</strong> tag:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">classid</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span> <span style="color: #000066;">codebase</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;150&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;120&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;movie&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;swf/myflash.swf&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;allowscriptaccess&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;always&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wmode&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;transparent&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;embed <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;120&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;150&quot;</span> allowscriptaccess<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;always&quot;</span> wmode<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;transparent&quot;</span> menu<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;swf/myflash.swf&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">object</span>&gt;</span></pre></div></div>

<p><strong>allowscriptaccess</strong> let the Flash application to communicate with the HTML page hosting it. This is required because <strong>getURL()</strong> function can cause JavaScript to use the permissions of the HTML page, which can be different from the permissions of your Flash application. This has important implications for cross-domain security. </p>
<p>The valid values for <strong>allowscriptaccess</strong> are:</p>
<p><strong>always</strong> permits scripting operations at all times.<br />
<strong>never</strong> forbids all scripting operations.<br />
<strong>samedomain</strong> permits scripting operations only if the Flash application is from the same domain as the HTML page.</p>
<p>The default value used by all HTML publish templates is <strong>samedomain</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.akchauhan.com/how-call-javascript-function-from-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use wmode as transparent for flash and what&#8217;s its use?</title>
		<link>http://www.akchauhan.com/how-to-use-wmode-as-transparent-for-flash-and-whats-its-use/</link>
		<comments>http://www.akchauhan.com/how-to-use-wmode-as-transparent-for-flash-and-whats-its-use/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 04:26:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.akchauhan.com/?p=46</guid>
		<description><![CDATA[Sometime our embedded flash object comes over our websites dropdown menus or over other objects like light box, jQuery Boxy, fancybox etc. We can solve this problem by changing the wmode of embed to transparent. By changing the wmode to transparent the flash object becomes transparent. We can do it in following ways. HTML:- Add [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime our embedded flash object comes over our websites dropdown menus or over other objects like light box, jQuery Boxy, fancybox etc.</p>
<p>We can solve this problem by changing the wmode of embed to transparent. By changing the wmode to transparent the flash object becomes transparent.</p>
<p>We can do it in following ways.</p>
<p><strong>HTML:-</strong></p>
<p>Add the following parameter to the OBJECT tag:<em></em></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span>”wmode” <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span>”transparent”&gt;</span></pre></div></div>

<p><em></em>Add the following parameter to the EMBED tag:<em></em></p>
<p>wmode=&#8221;transparent&#8221;</p>
<p><strong>JavaScript:-</strong></p>
<p>If you are using swfobject.js javascript file for embedding. Then do it like this.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> obj <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> SWFObject<span style="color: #009900;">&#40;</span>”player.<span style="color: #660066;">swf</span>”<span style="color: #339933;">,</span>”ply”<span style="color: #339933;">,</span>”<span style="color: #CC0000;">300</span>″<span style="color: #339933;">,</span>”<span style="color: #CC0000;">250</span>″<span style="color: #339933;">,</span>”<span style="color: #CC0000;">9</span>″<span style="color: #339933;">,</span>”#FFFFFF”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
obj.<span style="color: #660066;">addParam</span><span style="color: #009900;">&#40;</span>”wmode”<span style="color: #339933;">,</span>”transparent”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>If you want to apply the wmode transparent to whole HTML page. You can do this way.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> ems <span style="color: #339933;">=</span> document.<span style="color: #660066;">embeds</span><span style="color: #339933;">,</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> em<span style="color: #339933;">;</span> em <span style="color: #339933;">=</span> ems<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	em.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span>’wmode’<span style="color: #339933;">,</span> ‘transparent’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> nx <span style="color: #339933;">=</span> em.<span style="color: #660066;">nextSibling</span><span style="color: #339933;">,</span> pn <span style="color: #339933;">=</span> em.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
	pn.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>em<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	pn.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span>em<span style="color: #339933;">,</span> nx<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>

]]></content:encoded>
			<wfw:commentRss>http://www.akchauhan.com/how-to-use-wmode-as-transparent-for-flash-and-whats-its-use/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

