<?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>eli geske &#187; Flash</title>
	<atom:link href="http://eligeske.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://eligeske.com</link>
	<description>Good information for the geeky kind.</description>
	<lastBuildDate>Tue, 15 May 2012 00:20:18 +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>Change your Mouse Cursor to a Pointer in Flash, well actually.. ActionScript 3.0</title>
		<link>http://eligeske.com/flash/change-your-mouse-cursor-to-a-pointer-in-flash-well-actually-actionscript-3-0/</link>
		<comments>http://eligeske.com/flash/change-your-mouse-cursor-to-a-pointer-in-flash-well-actually-actionscript-3-0/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 05:26:24 +0000</pubDate>
		<dc:creator>eligeske</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[mouse pointer]]></category>

		<guid isPermaLink="false">http://eligeske.com/?p=683</guid>
		<description><![CDATA[I like css, html, javascript, php, etc. etc. But I haven't jumped into ActionScript in a while. So here goes a simple but cool feature implemented in ActionScript 3.0.]]></description>
			<content:encoded><![CDATA[<p>Recently I have been making a new tool for us web developers out there. (I&#8217;ll release it in the next couple weeks)  Part of this new tool I needed to use a flash movie to access some data in the OS which JavaScript cannot access&#8230;&#8230;yet. Since I have not dabbled in any ActionScript in several years it was pretty interesting to see the changes ActionScript 3.0 has brought about.  One of those is the ability to have many mouse pointers styles.  Pretty painless actually.</p>
<p>What I will be showing you is how to make a flash video, load it into an HTML page, and when you hover over it the cursor turns into a pointer.  Building blocks&#8230;building blocks.</p>
<p><span style="text-decoration: underline;">Quick Overview:</span></p>
<ol>
<li>We make the flash file that we will hover over in the html.</li>
<li>We will make the ActionScript for the flash file.</li>
<li>I&#8217;ll show you the html to test this, in case you didn&#8217;t know.</li>
</ol>
<p><strong>First</strong> let&#8217;s open up Flash and create a new fla file and name it something.  Now for me I set my stage to be 1px x 1px, which is what will set the actual size we want in the html.</p>
<p><strong>Secondly.</strong> The ActionScript is made right on the stage, or without selecting an object.</p>
<p><span style="text-decoration: underline;">ActionScript</span><strong>:</strong> (See Code)</p>
<p>At the top we call in the library references we will be using for MouseEvents, import flash.events.MouseEvent.</p>
<p>Then we add the actual method to turn the cursor into a pointer, or as flash would like to call it.. a &#8220;button&#8221;. Mouse.cursor=&#8221;button&#8221;.<br />
<strong><span>Code:</span></strong></p>
<pre>import flash.events.MouseEvent; // for library for mouseevents
Mouse.cursor="button"; // change cursor to pointer when over top the flash movie</pre>
<p><a href="http://eligeske.com/wp-content/uploads/2012/04/actionscript_mouse_cursor.jpg"><img class="alignnone size-full wp-image-713" title="actionscript_mouse_cursor" src="http://eligeske.com/wp-content/uploads/2012/04/actionscript_mouse_cursor.jpg" alt="" width="539" height="633" /></a></p>
<p>&nbsp;</p>
<p>Ok, Let&#8217;s take a look at that html.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://eligeske.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="html4strict" style="font-family:monospace;"><span class="sc0">&lt;!DOCTYPE HTML&gt;</span>
<span class="sc2">&lt;<a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span>
<span class="sc2">&lt;<a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span>
<span class="sc2">&lt;<a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span>Mouse Cursor<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span>
	<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span>
&nbsp;
	<span class="sc2">&lt;<a href="http://december.com/html/4/element/style.html"><span class="kw2">style</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/css&quot;</span>&gt;</span>
		#btn { height: 30px; width: 30px; border: 1px solid red; background: red;  }
	<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/style.html"><span class="kw2">style</span></a>&gt;</span>
&nbsp;
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span>
<span class="sc2">&lt;<a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span>
	<span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;btn&quot;</span>&gt;</span>
		<span class="sc2">&lt;<a href="http://december.com/html/4/element/object.html"><span class="kw2">object</span></a> <span class="kw3">width</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> <span class="kw3">height</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span>&gt;</span>
			<span class="sc2">&lt;<a href="http://december.com/html/4/element/param.html"><span class="kw2">param</span></a> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;movie&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;test.swf&quot;</span>&gt;</span>
			<span class="sc2">&lt;embed <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;test.swf&quot;</span> <span class="kw3">width</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> <span class="kw3">height</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> mode<span class="sy0">=</span><span class="st0">&quot;transparent&quot;</span>&gt;</span> <span class="sc2">&lt;<span class="sy0">/</span>embed&gt;</span>
		<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/object.html"><span class="kw2">object</span></a>&gt;</span>
	<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span>
&nbsp;
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span>
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span></pre></div></div>
<p>Once you run your flash file it will output an swf. This is a shockwave file, and what you actually use in most websites if it isn&#8217;t video. Those are flv&#8217;s.  There is a certain way to embed these into your html.</p>
<p>The object tag and also using the two different methods to cover cross browsers. Set the height and width here to cover your div.  That way it acts somewhat like a button. If you have everything correct it should appear as the pointer.</p>
<p>If you have any issues, feel free to drop a comment.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://eligeske.com/flash/change-your-mouse-cursor-to-a-pointer-in-flash-well-actually-actionscript-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

