<?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>Think2Loud &#187; Flash</title> <atom:link href="http://think2loud.com/tag/flash/feed/" rel="self" type="application/rss+xml" /><link>http://think2loud.com</link> <description>Random thoughts from a few geeks</description> <lastBuildDate>Wed, 04 Jan 2012 01:43:02 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Add Scroll Bars to Full Browser Flash with a Simple jQuery Plugin</title><link>http://think2loud.com/268-add-scroll-bars-to-full-browser-flash-with-a-simple-jquery-plugin/</link> <comments>http://think2loud.com/268-add-scroll-bars-to-full-browser-flash-with-a-simple-jquery-plugin/#comments</comments> <pubDate>Wed, 10 Sep 2008 03:09:36 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Flash]]></category><guid isPermaLink="false">http://www.think2loud.com/?p=268</guid> <description><![CDATA[<p>Got a great Flash site? Can it be used by someone with low resolution? This plugin offers an easy way to keep your full browser Flash from getting too small. <a href="http://think2loud.com/268-add-scroll-bars-to-full-browser-flash-with-a-simple-jquery-plugin/">Read More</a></p><p><a href="http://think2loud.com/268-add-scroll-bars-to-full-browser-flash-with-a-simple-jquery-plugin/">Add Scroll Bars to Full Browser Flash with a Simple jQuery Plugin</a></p>]]></description> <content:encoded><![CDATA[<p><a target="_blank" class="button" href="http://www.think2loud.com/examples/flashresize.zip">.zip</a> <a target="_blank" class="button" href="http://www.think2loud.com/examples/flashresize/jquery.flashResize.js">.js only</a> <a target="_blank" class="button" href="http://www.think2loud.com/examples/flashresize/">Demo</a></p><p><span id="more-268"></span><br /> The first thing you need to do is get <a target="_blank" href="http://www.jquery.com">jQuery</a> set up and running. Once you have that done, I recommend the <a target="_blank" href="http://jquery.lukelutman.com/plugins/flash">jQuery Flash Plugin</a> for embedding your Flash movies, but you can use any method you like. Now you need to download and include the <a target="_blank" href="http://www.think2loud.com/examples/flashresize/jquery.flashResize.js">jQuery FlashResize Plugin</a>.</p><p>With the plugin included and ready to use, we need to get it running. You will need to have an element to use as your placeholder. The body tag can be used, but I always use a container element, usually a div.<br /> <br/></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;">body</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flash-scroll&quot;</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Html to be replaced by 100% Flash.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div><p>With the HTML set up for the scroll bars, you simply need to add the call to the FlashResize plugin in the document.ready function. The plugin only has two parameters <em>minWidth</em> and <em>minHeight</em>. If you don&#8217;t specify a value, then the Flash container is set to 100% and no scroll bar is added.</p><p>So just set the parameters to your minimum values and that&#8217;s it. As you can see below, the Flash has been set to a minimum of 800 by 750.<br /> <br/></p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</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: #009900;">&#40;</span><span style="color: #3366CC;">'#flash-scroll'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">flashResize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  		minWidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">800</span><span style="color: #339933;">,</span>
  		minHeight<span style="color: #339933;">:</span> <span style="color: #CC0000;">750</span>
	<span style="color: #009900;">&#125;</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></pre></div></div><p>If you would like to see this plugin in action, check out the demo.</p><p><a target="_blank" class="button" href="http://www.think2loud.com/examples/flashresize.zip">.zip</a> <a target="_blank" class="button" href="http://www.think2loud.com/examples/flashresize/jquery.flashResize.js">.js only</a> <a target="_blank" class="button" href="http://www.think2loud.com/examples/flashresize/">Demo</a></p><p><a href="http://think2loud.com/268-add-scroll-bars-to-full-browser-flash-with-a-simple-jquery-plugin/">Add Scroll Bars to Full Browser Flash with a Simple jQuery Plugin</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/268-add-scroll-bars-to-full-browser-flash-with-a-simple-jquery-plugin/feed/</wfw:commentRss> <slash:comments>36</slash:comments> </item> <item><title>Function Override for AS3?</title><link>http://think2loud.com/83-function-override-for-as3/</link> <comments>http://think2loud.com/83-function-override-for-as3/#comments</comments> <pubDate>Fri, 22 Aug 2008 04:30:41 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[Flash]]></category> <category><![CDATA[ActionScript 3]]></category><guid isPermaLink="false">http://www.think2loud.com/?p=79</guid> <description><![CDATA[<p>Alright, so here is the problem: I work with several designers with varying abilities who all tinker with Flash. With making the switch to AS3, I am trying to package more stuff into classes for them to reuse. One of the classes I just created is a simple image loader that rotates the images using <a href="http://blog.greensock.com">TweenMax</a>. <a href="http://think2loud.com/83-function-override-for-as3/">Read More</a></p><p><a href="http://think2loud.com/83-function-override-for-as3/">Function Override for AS3?</a></p>]]></description> <content:encoded><![CDATA[<p>Where I work it&#8217;s hard to get everyone on the same page, so it is nice to have some classes written  that they can pull from. It certainly makes my life easier when they ask for help because everything is broken. Now I have this great class that is sometimes pulled into an FLA on the TimeLine. By default, the gallery  rotates the image after 4 seconds. What if someone wanted to completely change the rotation or fire other events when the first photo tweens in?</p><p>To solve this issue, here is what I did: I am not sure that this is the best way, so if you have a better way, please send it to me. Once my class was finished, I decided I needed to expose part of it to the TimeLine. I created a private variable that was of type Function. Then I used &#8220;get&#8221; and &#8220;set&#8221; functions to change that variable.</p><p>variable setup:<br /> <code><br /> private var _galleryTweenFunction : Function = defaultImageRotation();<br /> </code><br /> then I added the &#8220;get&#8221; and &#8220;set&#8221; functions to my class:<br /> <code><br /> public function set  galleryTweenFunction ( newFunction:Function){<br /> _galleryTweenFunction = newFunction;<br /> }</code></p><p><code><br /> public function get galleryTweenFunction (){<br /> return _galleryTweenFunction;<br /> }<br /> </code></p><p>My class is set to call galleryTweenFunction when it&#8217;s time to rotate the images. It passes two MovieClips to the function, one being the photo to fade in and the other the photo to fade out. So now the function can be changed by someone on the TimeLine without having to edit the class.</p><p>Changing the function on the TimeLine looks something like this using TweenMax:<br /> <code><br /> var myGallery:gallery = new gallery();<br /> myGallery.galleryTweenFunction = function(fadeIn:MovieClip,fadeOut:MovieClip){<br /> TweenMax.to(fadeIn,2,{alpha:1});<br /> TweenMax.to(fadeOut,2,{alpha:0});<br /> }<br /> </code></p><p>I also have a get and set for another function that is used to run events when the first photo begins&#8211;it transitions in. The class calls this function when the first photo is loaded and ready for animation. It passes the MovieClip the photo is in. So then someone can also just override this function.<br /> <code><br /> myGallery.showFirstImage = function(FirstImage:MovieCliip){<br /> doSomeStuff();<br /> TweenMax.to(FirstImage,1,{alpha:1});<br /> }<br /> </code></p><p>This worked great for me. I hope it can help you out as well.</p><p><a href="http://think2loud.com/83-function-override-for-as3/">Function Override for AS3?</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/83-function-override-for-as3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>A List of Tweening Classes for Flash</title><link>http://think2loud.com/33-flash-tween-classes/</link> <comments>http://think2loud.com/33-flash-tween-classes/#comments</comments> <pubDate>Sun, 17 Aug 2008 03:59:27 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[Flash]]></category> <category><![CDATA[ActionScript 2]]></category> <category><![CDATA[ActionScript 3]]></category><guid isPermaLink="false">http://www.think2loud.com/?p=33</guid> <description><![CDATA[<p>There are a lot of great options for tweening in Flash. My current favorite is TweenMax and it's little brother TweenLite. <a href="http://think2loud.com/33-flash-tween-classes/">Read More</a></p><p><a href="http://think2loud.com/33-flash-tween-classes/">A List of Tweening Classes for Flash</a></p>]]></description> <content:encoded><![CDATA[<p>Since we are getting ready to finally make the switch to ActionScript 3 at work, it is nice to have a version that is written for both AS3 and AS2. This will hopefully allow for fewer issues as we make the transition to AS3.</p><ul><li><a target="_blank" href="http://blog.greensock.com/" target="_blank">TweenLite</a> and <a target="_blank" href="http://blog.greensock.com/" target="_blank">TweenMax</a> are written by GreenSock. TweenMax is the one that I have been using lately. I also really like the ease of use and the tiny file size of TweenLite. These are ActionScript 2 &amp; 3 ready. (Just make sure you download the right one.)</li><li><a target="_blank" href="http://www.mosessupposes.com/Fuse/" target="_blank">Fuse Kit</a> from mosesssupposes.com is a great setup for tweening. I have used this many times and like working with it. The only issue is that it is ActionScript 2 only.</li><li><a target="_blank" href="http://code.google.com/p/tweener/" target="_blank">Tweener</a>: I have not yet used this. However, some of my friends have used it and love it. I am hoping to test it out very soon. This one is also good for ActionScript 2 &amp; 3.</li></ul><p>If you are not already using one of these, I would highly recommend you check them out. If you have something you like better, please drop me a line so I can check it out.</p><p><a href="http://think2loud.com/33-flash-tween-classes/">A List of Tweening Classes for Flash</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/33-flash-tween-classes/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: think2loud.com @ 2012-02-03 21:50:15 by W3 Total Cache -->
