<?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>indieas &#187; tween</title>
	<atom:link href="http://www.indieas.org/tag/tween/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indieas.org</link>
	<description>independent actionscript developer team</description>
	<lastBuildDate>Tue, 19 Oct 2010 13:43:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Buttons the indieas way</title>
		<link>http://www.indieas.org/2010/08/buttons-the-indieas-way/</link>
		<comments>http://www.indieas.org/2010/08/buttons-the-indieas-way/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 22:39:54 +0000</pubDate>
		<dc:creator>mich</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[down]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[over]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[simplebutton]]></category>
		<category><![CDATA[state]]></category>
		<category><![CDATA[tween]]></category>
		<category><![CDATA[up]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.indieas.org/?p=187</guid>
		<description><![CDATA[As announced I optimized the usage of Buttons in the indieas library. SimpleButton with disabled state So the first I create a MovieClip with the different states: As you can see there is an additional disabled state compared to the normal SimpleButton. So one way to use this MovieClip now as a Button in my [...]]]></description>
			<content:encoded><![CDATA[<p>As announced I optimized the usage of Buttons in the <a href="http://www.indieas.org/library/" target="_self">indieas library</a>.</p>
<p><strong>SimpleButton with disabled state</strong></p>
<p><strong> </strong>So the first I create a MovieClip with the different states:</p>
<p><a href="http://www.indieas.org/wp-content/uploads/2010/08/states.png"><img class="alignnone size-full wp-image-188" title="states" src="http://www.indieas.org/wp-content/uploads/2010/08/states.png" alt="" width="359" height="132" /></a></p>
<p>As you can see there is an additional <em>disabled </em>state compared to the normal SimpleButton. So one way to use this MovieClip now as a Button in my Actionscript project is to export it as a Class:</p>
<p><a href="http://www.indieas.org/wp-content/uploads/2010/08/export.png"><img class="alignnone size-full wp-image-189" title="export" src="http://www.indieas.org/wp-content/uploads/2010/08/export.png" alt="" width="536" height="160" /></a></p>
<p>Now when I use the exported swc file as a library in my Actionscript project I can easily create a Button like that:</p>
<pre class="brush: as3; title: ; notranslate">
var but:Button = Button.FromClass( DemoButton );
but.enable = false; // to jump to the disabled state.
addChild( but );
</pre>
<p>Another way to create a Button is to turn an already placed DemoButton MovieClip into a Button. So you don&#8217;t have to add it as a Child and it just turns it into a Button instance:</p>
<pre class="brush: as3; title: ; notranslate">
var but:Button = Button.FromMC( myDemoButton ); // where myDemoButton is an instance of the DemoButton
</pre>
<p><strong>Adding scripting animations</strong></p>
<p>This is the simplest usage but more often I like to add scripting animations on mouse events. So for example you have an icon on the button that should pop-up on roll-over. The Button class provides an easy way to access MovieClips placed on the timeline. So lets enhance the DemoButton with an icon:</p>
<p><a href="http://www.indieas.org/wp-content/uploads/2010/08/icon.png"><img class="alignnone size-medium wp-image-199" title="icon" src="http://www.indieas.org/wp-content/uploads/2010/08/icon-300x175.png" alt="" width="300" height="175" /></a></p>
<p>As this Button is special we create an IconButton class:</p>
<pre class="brush: as3; title: ; notranslate">
package {

	import org.indieas.tween.easing.Bounce;
	import org.indieas.tween.easing.Elastic;
	import org.indieas.tween.property.Scaler;
	import org.indieas.widget.button.Button;

	public class IconButton extends Button {

		public function IconButton() {
			super();
		}

		protected override function onOver():void {
			Scaler.To( stateManager.icon, 0.7, 1.5, 1.5, Elastic.easeOut ).start();
		}

		protected override function onUp():void {
			Scaler.To( stateManager.icon, 0.3, 1, 1, Bounce.easeOut ).start();
		}
	}
}
</pre>
<p>The animation is now done by the indieas tween engine, but you can use any tweening engine you like. The stateManager handles the access to the icon MovieClip that we placed earlier.</p>
<p>To instantiate the IconButton we can again do it with a MovieClip or the class:</p>
<pre class="brush: as3; title: ; notranslate">
var but:IconButton = new IconButton();

but.buildFromClass( DemoButton );
addChild( but );

// or
but.buildFromMC( myDemoButton );
</pre>
<p>This results in a button like this:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ButtonTest_572661037"
			class="flashmovie"
			width="150"
			height="50">
	<param name="movie" value="http://www.indieas.org/wp-content/uploads/2010/08/ButtonTest.swf" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.indieas.org/wp-content/uploads/2010/08/ButtonTest.swf"
			name="fm_ButtonTest_572661037"
			width="150"
			height="50">
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>One big advantage of this approach is that you can have different MovieClips with other assets that uses the same Button class. For example to create another IconButton that just looks different you can call the<em> buildFrom* </em>method with another MovieClip/Class.</p>
<p><strong>Buttons with labels</strong></p>
<p>There is another handy class called LabelButton, where you place a TextField into the Button called <em>label</em>. You have now methods where you can style the Text with CSS. For example:</p>
<pre class="brush: as3; title: ; notranslate">
var label:LabelButton = LabelButton.FromMC( draft.labelButton );
label.setStyle( upFormat ); // set the style for all states.
label.setStyle( overFormat, Button.OVER_STATE ); // specific style for over state.
label.embedFont = true;
label.antiAliasType = AntiAliasType.ADVANCED;
label.gridFitType = GridFitType.SUBPIXEL;
</pre>
<p>So thats it, if you like to use these classes too,  go to the <a href="http://www.indieas.org/library/" target="_self">libary page</a> and download the latest classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indieas.org/2010/08/buttons-the-indieas-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PropertyTween the indieas way</title>
		<link>http://www.indieas.org/2009/10/propertytween-the-indieas-way/</link>
		<comments>http://www.indieas.org/2009/10/propertytween-the-indieas-way/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 15:38:27 +0000</pubDate>
		<dc:creator>mich</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[property]]></category>
		<category><![CDATA[sfug]]></category>
		<category><![CDATA[tween]]></category>

		<guid isPermaLink="false">http://www.indieas.org/?p=150</guid>
		<description><![CDATA[I know there are so many different tweening engines out there and it makes really no sense program another one. But as I always had my one version from the sfug library I thought it would be the time to port that to the indieas library. Further more I not just copy it and adapted [...]]]></description>
			<content:encoded><![CDATA[<p>I know there are so many different tweening engines out there and it makes really no sense program another one. But as I always had my one version from the sfug library I thought it would be the time to port that to the indieas library. Further more I not just copy it and adapted the package name I tried to improve it once more. So in the new version when you apply another tween on the same object it checks the tweened properties and takes over only the properties defined by the new tween and let the old tween running with the other properties. So no more flickering when to tweens are acting on the same target/property.</p>
<p>As always feel free to download the library: <a href="http://www.indieas.org/library/">http://www.indieas.org/library/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indieas.org/2009/10/propertytween-the-indieas-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

