<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>{&#34;sintax&#34;:[&#34;C#&#34;,&#34;C&#34;,&#34;AS3&#34;,&#34;...&#34;]}</title>
	<atom:link href="http://coisasdesintaxe.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://coisasdesintaxe.wordpress.com</link>
	<description>Software development</description>
	<lastBuildDate>Tue, 29 Nov 2011 15:08:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='coisasdesintaxe.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/67b27eecb9442fd7c3e3fdc69542ced7?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>{&#34;sintax&#34;:[&#34;C#&#34;,&#34;C&#34;,&#34;AS3&#34;,&#34;...&#34;]}</title>
		<link>http://coisasdesintaxe.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://coisasdesintaxe.wordpress.com/osd.xml" title="{&#34;sintax&#34;:[&#34;C#&#34;,&#34;C&#34;,&#34;AS3&#34;,&#34;...&#34;]}" />
	<atom:link rel='hub' href='http://coisasdesintaxe.wordpress.com/?pushpress=hub'/>
		<item>
		<title>XNA Bone Based Animation</title>
		<link>http://coisasdesintaxe.wordpress.com/2011/11/03/xna-bone-based-animation/</link>
		<comments>http://coisasdesintaxe.wordpress.com/2011/11/03/xna-bone-based-animation/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 15:56:46 +0000</pubDate>
		<dc:creator>chuckytuh</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://coisasdesintaxe.wordpress.com/?p=59</guid>
		<description><![CDATA[I willl show you how you can accomplish in XNA relative transforms like the ones shown in the next video. The model we are going to use can be found in the microsoft app hub website or just follow this link.  This model has its mesh parts named with the following architecture: tank_geo r_engine_geo r_back_wheel_geo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=59&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I willl show you how you can accomplish in XNA relative transforms like the ones shown in the next video. <span style="text-align:center; display: block;"><a href="http://coisasdesintaxe.wordpress.com/2011/11/03/xna-bone-based-animation/"><img src="http://img.youtube.com/vi/Zki9woyrbwM/2.jpg" alt="" /></a></span><span id="more-59"></span></p>
<p>The model we are going to use can be found in the microsoft app hub website or just follow this <a title="link" href="http://create.msdn.com/en-US/education/catalog/sample/model_viewer_demo" target="_blank">link</a>.  This model has its mesh parts named with the following architecture:</p>
<pre>tank_geo
	r_engine_geo
		r_back_wheel_geo
		r_steer_geo
			r_front_wheel_geo
	l_engine_geo
		l_back_wheel_geo
		l_steer_geo
			l_front_wheel_geo
	turret_geo
		canon_geo
		hatch_geo</pre>
<div>When you import this model to your xna game it will be processed on the ContentManager and this architecture is going to be transformed into a single array where the parent-child relation is made by its index.  The resulting array is stored in the Bones property of the Model object with the order shown in the following image.</div>
<div><a href="http://coisasdesintaxe.files.wordpress.com/2011/11/bones.png"><img class="aligncenter size-medium wp-image-62" title="bones" src="http://coisasdesintaxe.files.wordpress.com/2011/11/bones.png?w=300&#038;h=178" alt="" width="300" height="178" /></a></div>
<div>Each ModelBone present in the Model.Bones property has the following properties : (int) Index and (ModelBone) Parent. Its this data structure that we will be using in the solution.</div>
<div>
<p>Everytime we load an asset with the ContentManager it get cached so that if you try to load the same asset twice it wont load the second one and used the cached version so, having this in mind let&#8217;s build the following class:</p>
<p><pre class="brush: csharp;">
public class ModelObject
    {
        Vector3 m_position;
        Vector3 m_rotation;
        Matrix[] m_localTransforms;
        Matrix[] m_absoluteTransforms;
        Model m_model;
        float m_turretGeoRotation = 0;
        float m_canonGeoRotation = 0;

        public ModelObject(Model model, Vector3 pos)
        {
            m_model = model;
            m_position = pos;

            //Initiate the local tranforms array
            int boneCount = m_model.Bones.Count;
            m_localTransforms = new Matrix[boneCount];
            for (int i = 0; i &lt; boneCount; i++)
            {
                m_localTransforms[i] = Matrix.Identity;
            }

            //Initiate the placeholder for the model transforms
            m_absoluteTransforms = new Matrix[boneCount];
        }

        public void Update(GameTime gameTime)
        {
            KeyboardState ks = Keyboard.GetState();
            if (ks.IsKeyDown(Keys.Down))
                m_canonGeoRotation += 1;
            if (ks.IsKeyDown(Keys.Up))
                m_canonGeoRotation += -1;
            if (ks.IsKeyDown(Keys.Left))
                m_turretGeoRotation += 1;
            if (ks.IsKeyDown(Keys.Right))
                m_turretGeoRotation += -1;

            //We transform directly the bone that we want to transform locally
            m_localTransforms[9] *= Matrix.CreateRotationY(MathHelper.ToRadians(m_turretGeoRotation));
            m_localTransforms[10] *= Matrix.CreateRotationX(MathHelper.ToRadians(m_canonGeoRotation));

            m_canonGeoRotation = 0;
            m_turretGeoRotation = 0;
        }

        private void CalculateAbsoluteTransforms()
        {
            //Copy all the transformations imported on the model
            m_model.CopyAbsoluteBoneTransformsTo(m_absoluteTransforms);

            //Iterate trough all of the bones transformations and apply the
            //local transformations that we have made to the model.
            ModelBoneCollection bones = m_model.Bones;
            for (int i = 0; i &lt; bones.Count; i++)
            {
                m_absoluteTransforms[i] = m_localTransforms[i] * bones[i].Transform;

                ModelBone bone = bones[i];
                //If the actual bone has a parent then we have to transform it so that
                //it keep relative to his parent.
                if (bone.Parent != null)
                {
                    int parentIndex = bone.Parent.Index;
                    m_absoluteTransforms[i] *= m_absoluteTransforms[parentIndex];
                }
            }
        }

        public void Draw(Matrix projection, Matrix view)
        {
            //When we want to draw the model we need to apply the local
            //transformations before we apply the world transformation to each mesh on the model
            CalculateAbsoluteTransforms();
            foreach (ModelMesh mesh in m_model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.Projection = projection;
                    effect.View = view;
                    effect.World = m_absoluteTransforms[mesh.ParentBone.Index] * Matrix.CreateTranslation(m_position);
                    effect.EnableDefaultLighting();
                }
                mesh.Draw();
            }
        }
    }
</pre></p>
<p>With the ModelObject class we can transform the bones of a Model without changing on all occurences of the same Model around the game and that&#8217;s it!</p>
<p>Suggestions and/or questions? Comment out please! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coisasdesintaxe.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coisasdesintaxe.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coisasdesintaxe.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coisasdesintaxe.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coisasdesintaxe.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coisasdesintaxe.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coisasdesintaxe.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coisasdesintaxe.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=59&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coisasdesintaxe.wordpress.com/2011/11/03/xna-bone-based-animation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e580e99107d4c70d0deb3f5cf2f47b2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chuckytuh</media:title>
		</media:content>

		<media:content url="http://coisasdesintaxe.files.wordpress.com/2011/11/bones.png?w=300" medium="image">
			<media:title type="html">bones</media:title>
		</media:content>
	</item>
		<item>
		<title>Zend Framework , wamp and bootstrap!</title>
		<link>http://coisasdesintaxe.wordpress.com/2009/08/28/zend-framework-wamp-and-bootstrap/</link>
		<comments>http://coisasdesintaxe.wordpress.com/2009/08/28/zend-framework-wamp-and-bootstrap/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 04:04:45 +0000</pubDate>
		<dc:creator>chuckytuh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[wamp]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://coisasdesintaxe.wordpress.com/?p=50</guid>
		<description><![CDATA[I&#8217;m starting on the zend framework and, like many people ( I hope -.-&#8217; ), I had some problems with the bootstrap and the Zend_Application API. I spent almost 3 hours today trying to understand the source of the problem that I found and yes, it was REALLY stupid! I&#8217;m developing a web application with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=50&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting on the zend framework and, like many people ( I hope -.-&#8217; ), I had some problems with the bootstrap and the Zend_Application API. I spent almost 3 hours today trying to understand the source of the problem that I found and yes, it was REALLY stupid!</p>
<p>I&#8217;m developing a web application with this simple file structure:</p>
<div id="attachment_51" class="wp-caption aligncenter" style="width: 272px"><img class="size-full wp-image-51" title="estrutura" src="http://coisasdesintaxe.files.wordpress.com/2009/08/estrutura.png?w=510" alt="file structure"   /><p class="wp-caption-text">file structure</p></div>
<p>As you can see I have a modules directory and an &#8220;admin&#8221; module. This app consists in a web store for motor electrical parts and it will have and administration part that will allow the client insert new products, manage stock, manage clients, manage requests, etc, and the default module is for searching products and present products basically. The main problem for me was how could I setup zend in order to recognize my module and after some googling  i found some answers:</p>
<ul>
<li><a href="http://monzee.wordpress.com/2009/06/08/modular-applications-in-zf-1-8/" target="_blank">http://monzee.wordpress.com/2009/06/08/modular-applications-in-zf-1-8/</a></li>
<li><a href="http://www.zfforums.com/zend-framework-general-discussions-1/general-q-zend-framework-2/boostraping-modules-models-all-fun-3068.html" target="_blank">http://www.zfforums.com/zend-framework-general-discussions-1/general-q-zend-framework-2/boostraping-modules-models-all-fun-3068.html</a></li>
<li><a href="http://blog.vandenbos.org/2009/07/19/zend-framework-module-specific-layout/" target="_blank">http://blog.vandenbos.org/2009/07/19/zend-framework-module-specific-layout/</a></li>
<li><a href="http://framework.zend.com/manual/en/zend.controller.front.html" target="_blank">http://framework.zend.com/manual/en/zend.controller.front.html</a></li>
<li><a href="http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.frontcontroller" target="_blank">http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.frontcontroller</a></li>
</ul>
<p>So basically you can incorporate your modules with the rest of the application with the Zend_Controller_Front using setControllerDirectory, addControllerDirectory or through the Zend_Application Resources but basically it is the same as with the Zend_Controller_Front however you use the Zend_Application and the config file.</p>
<p>So where would you do that? Simple, in your application bootstrap file!</p>
<p>Let&#8217;s see some examples:</p>
<ul>
<li>Let&#8217;s do it with the Zend_Front_Controller API. In your bootstrap if you make one function protected and with the name starting with _init then it will be executed automatically as if it was an resource ( <a href="http://framework.zend.com/manual/en/zend.application.theory-of-operation.html" target="_blank">check out</a> ) :</li>
</ul>
<p><code>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{<br />
protected function _initSetupModulesDirectories(){<br />
$front = Zend_Controller_Front::getInstance();<br />
$front-&gt;setControllerDirectory(array(<br />
'default' =&gt; APPLICATION_PATH . '/controllers',<br />
'admin' =&gt; APPLICATION_PATH . '/admin/controllers'<br />
));<br />
}<br />
}</code></p>
<ul>
<li><span style="color:#333333;">The next example is basically the same but not using directly the Zend_Controller_Front class, instead it uses the frontController  resource!</span></li>
</ul>
<p><code>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{<br />
protected function _initSetupModulesDirectories(){<br />
self::$frontController = $this-&gt;getResource('FrontController');<br />
self::$frontController-&gt;setControllerDirectory(array(<br />
'default' =&gt; APPLICATION_PATH . '/controllers',<br />
'admin' =&gt; APPLICATION_PATH . '/admin/controllers'<br />
));<br />
}<br />
}</code></p>
<ul>
<li>Now using addControllerDirectory():</li>
</ul>
<p><code><br />
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{<br />
protected function _initSetupModulesDirectories(){<br />
$front = $this-&gt;getResource('FrontController');<br />
$front-&gt;addControllerDirectory(APPLICATION_PATH . '/admin/controllers','admin');<br />
}<br />
}</code></p>
<ul>
<li><span style="color:#333333;"><span style="color:#000000;">And for the last but not the least let&#8217;s use the application.ini to load the modules directory and plus set up resource </span></span><span style="color:#333333;"><span style="color:#000000;">autoloaders for</span></span><span style="color:#333333;"><span style="color:#000000;"> models, forms, services, etc:</span></span></li>
</ul>
<p>Open up your configuration file (application.ini) and add this:<br />
<code>resources.modules = ""<br />
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"</code></p>
<p>This will initialize the module resource plugin and set the modules directory! Next what we need to do is create a bootstrap file for your module directory (application/modules/admin/Bootstrap.php).</p>
<p>It must be something like this:</p>
<p><code> class Admin_Bootstrap extends Zend_Application_Module_Bootstrap{<br />
}</code></p>
<p>Pay attention the the class name, it starts with Admin_, this is named the PEAR convention for class names, don&#8217;t forget about it!</p>
<p>And finally in the application bootstrap class just add:<br />
<code>protected function _initAutoload()<br />
{<br />
new Zend_Application_Module_Autoloader(array(<br />
'basePath'  =&gt; APPLICATION_PATH,<br />
'namespace' =&gt; '',<br />
));<br />
}</code><br />
This will initialize the resource autoloaders for the default module. (An explanation of autoloaders <a href="http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html" target="_blank">here</a>)</p>
<p>I hope this can help you and give you and idea with modules and boostraping. Just a quick tip, be carefull with typing errors, do not be like me! I&#8217;ve been 3 hours around one problem and the real problem was that I created a virtual host on apache (working with wamp) and there I&#8217;ve specified that the directory was for C:\wamp\www\mypage\public however the real name of the directory was Mypage with a big M and this was enough to let htaccess block all the request for http://mypage/index/ or http://mypage/admin &#8230;.</p>
<p>Happy coding and happy personal life xP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coisasdesintaxe.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coisasdesintaxe.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coisasdesintaxe.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coisasdesintaxe.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coisasdesintaxe.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coisasdesintaxe.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coisasdesintaxe.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coisasdesintaxe.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=50&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coisasdesintaxe.wordpress.com/2009/08/28/zend-framework-wamp-and-bootstrap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e580e99107d4c70d0deb3f5cf2f47b2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chuckytuh</media:title>
		</media:content>

		<media:content url="http://coisasdesintaxe.files.wordpress.com/2009/08/estrutura.png" medium="image">
			<media:title type="html">estrutura</media:title>
		</media:content>
	</item>
		<item>
		<title>Create your own custom menu in Flex 4</title>
		<link>http://coisasdesintaxe.wordpress.com/2009/06/23/create-your-own-custom-menu-in-flex-4/</link>
		<comments>http://coisasdesintaxe.wordpress.com/2009/06/23/create-your-own-custom-menu-in-flex-4/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:53:29 +0000</pubDate>
		<dc:creator>chuckytuh</dc:creator>
				<category><![CDATA[Actionscript3]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://coisasdesintaxe.wordpress.com/?p=42</guid>
		<description><![CDATA[Hi there, what I&#8217;m bringing here today is a &#8220;kind of tutorial&#8221; on how to build your own custom menu with the new Flex 4. I&#8217;ll be mostly talking about skinning and you&#8217;ll see that this maybe is the most power full tool on the new Flex SDK.Before we start let&#8217;s just see an image [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=42&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi there, what I&#8217;m bringing here today is a &#8220;kind of tutorial&#8221; on how to build your own custom menu with the new Flex 4. I&#8217;ll be mostly talking about skinning and you&#8217;ll see that this maybe is the most power full tool on the new Flex SDK.Before we start let&#8217;s just see an image with the final result, IMO it came out pretty well, what do you think? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/bin-debug/skinTest.html"><img class="alignnone" title="Menu" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/menu.jpg?w=489&#038;h=41" alt="" width="489" height="41" /></a></p>
<p>So let&#8217;s just start&#8230;</p>
<p>Create a new project on Flash Builder(if you don&#8217;t have it yet you can grab the 30 days free license at adobe website) and lets create three folders: Components, Events and Skins. This way we can get things in order. First lets start with the skins, to what we need to achieve, we need to custom skins, one for each button and one for the background of the menu, right?^^</p>
<p>For the button skin we have this little amount of code:</p>
<p><img class="alignnone" title="ButtonSkin" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonSkin.png?w=606&#038;h=735" alt="" width="606" height="735" /></p>
<p>If you come from Flex 3 you might be wondering, what the heck are those mxml tags?oO Calm down, calm down! As you might know, Flex 4 supports fxg so we can use fxg tags and this is suppa duppa cool because you can jump to you Adobe Illustrator, draw whatever you want, export for .fxg, open that image with any text editor, copy that code,past it to flash builder, run it and voilá, you get that image rendered in your application!Adding to that we can even use binding methods with it so that, for example, we get some dynamic width or height!Let&#8217;s just see what this does:</p>
<p>first of all you can see this is a Skin type component, and this let us assign this skin to the skinClass property of any skinnable component.But how do we specify that this this skin is for one Button?Simple, you just need to add the metadata HostComponent.</p>
<p><img class="alignnone" title="fxMetada" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/fxMetadata.png?w=429&#038;h=54" alt="" width="429" height="54" /></p>
<p>As you know,base Button has 4 states: up, down, over, disabled, but we are going to use the toggle Button in order to get the selected state, so we end up with this more states: upAndSelected, overAndSelected, downAndSelected and disabledAndSelected.</p>
<p>Next we start the real &#8220;drawing&#8221; and we want to create one background filled with a gradient:</p>
<p><img class="alignnone" title="buttonBackground" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonBackground.png?w=525&#038;h=131" alt="" width="525" height="131" /></p>
<p>As you could see, every buttons have a separator between them.If you want the button to be dynamic then we need to get a solution to make those separators appear automatically, and we do this by creating a right margin on each button..simple uh?xP</p>
<p><img class="alignnone" title="buttonRightBorder" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonRightBorder.png?w=325&#038;h=81" alt="" width="325" height="81" /></p>
<p>And for the last, the dynamic text on the button:</p>
<p><img class="alignnone" title="buttonText" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonText.png?w=454&#038;h=184" alt="" width="454" height="184" /></p>
<p>What we do to get dynamic text is just make a reference to the hostComponent.label property, see that our HostComponent makes reference to the togglebutton class, and the ToggleButton component has one property named label, so all we have to do is to bind that label to the text property of the SimpleText component and we do that with text=&#8221;{hostComponent.label}&#8221;.You can see that the text color is black however we want to make it red when we mouse over it or select it, and we can do this by simple do color.nameOfTheState = &#8220;#wantedColor&#8221;.</p>
<p>For the button skin, thats it! Next is the skin for the background.</p>
<p><img class="alignnone" title="menuSkin" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/menuSkin.png?w=509&#038;h=858" alt="" width="509" height="858" /></p>
<p>Well, this is pretty much the same as the button skin so I wont explain the code.</p>
<p>Now we create a new component based on the SkinnableContainer and place it on the Components folder. This is going to be the content holder for the buttons that makes our menu.</p>
<p><img class="alignnone" title="myMenu" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/myMenu.png?w=543&#038;h=1580" alt="" width="543" height="1580" /></p>
<p>I think the comments on the code say it all, however don&#8217;t hesitate to ask me anything!</p>
<p>And for the last the custom event:</p>
<p><img class="alignnone" title="customEvent" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/myCustomEvent.png?w=510&#038;h=362" alt="" width="510" height="362" /></p>
<p>Now all you have to do in order to get it working is this:</p>
<p><img class="alignnone" title="myMenuUsage" src="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/myMenuUsage.png?w=577&#038;h=146" alt="" width="577" height="146" /></p>
<p>That&#8217;s it, hope you liked <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coisasdesintaxe.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coisasdesintaxe.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coisasdesintaxe.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coisasdesintaxe.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coisasdesintaxe.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coisasdesintaxe.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coisasdesintaxe.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coisasdesintaxe.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=42&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coisasdesintaxe.wordpress.com/2009/06/23/create-your-own-custom-menu-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e580e99107d4c70d0deb3f5cf2f47b2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chuckytuh</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/menu.jpg" medium="image">
			<media:title type="html">Menu</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonSkin.png" medium="image">
			<media:title type="html">ButtonSkin</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/fxMetadata.png" medium="image">
			<media:title type="html">fxMetada</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonBackground.png" medium="image">
			<media:title type="html">buttonBackground</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonRightBorder.png" medium="image">
			<media:title type="html">buttonRightBorder</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/buttonText.png" medium="image">
			<media:title type="html">buttonText</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/menuSkin.png" medium="image">
			<media:title type="html">menuSkin</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/myMenu.png" medium="image">
			<media:title type="html">myMenu</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/myCustomEvent.png" medium="image">
			<media:title type="html">customEvent</media:title>
		</media:content>

		<media:content url="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/menuTutorial/myMenuUsage.png" medium="image">
			<media:title type="html">myMenuUsage</media:title>
		</media:content>
	</item>
		<item>
		<title>Flash + Action Script 3  = 3DSlider</title>
		<link>http://coisasdesintaxe.wordpress.com/2009/06/18/flash-action-script-3-3dslider/</link>
		<comments>http://coisasdesintaxe.wordpress.com/2009/06/18/flash-action-script-3-3dslider/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 23:06:07 +0000</pubDate>
		<dc:creator>chuckytuh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Actionscript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://coisasdesintaxe.wordpress.com/?p=33</guid>
		<description><![CDATA[I&#8217;m bringing you one component I&#8217;ve made with flash and action script 3. I&#8217;m not going to post the source code now because it needs to be refined and commented but asap I post it here   Check out the demo! This loads an XML that contains the source path for the image and a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=33&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m bringing you one component I&#8217;ve made with flash and action script 3. I&#8217;m not going to post the source code now because it needs to be refined and commented but asap I post it here <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Check out the <a class="wpGallery" title="3DSlider Demo" href="http://files.getdropbox.com/u/20786/coisasdesintaxe.wordpress.com/3DSlider/MySlider.html" target="_blank">demo</a>!</p>
<p>This loads an XML that contains the source path for the image and a title for the image so that when you click in one image it flip over the y axis and shows the title.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coisasdesintaxe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coisasdesintaxe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coisasdesintaxe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coisasdesintaxe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coisasdesintaxe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coisasdesintaxe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coisasdesintaxe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coisasdesintaxe.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=33&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coisasdesintaxe.wordpress.com/2009/06/18/flash-action-script-3-3dslider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e580e99107d4c70d0deb3f5cf2f47b2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chuckytuh</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome</title>
		<link>http://coisasdesintaxe.wordpress.com/2009/06/18/welcome/</link>
		<comments>http://coisasdesintaxe.wordpress.com/2009/06/18/welcome/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 20:05:01 +0000</pubDate>
		<dc:creator>chuckytuh</dc:creator>
				<category><![CDATA[Actionscript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://coisasdesintaxe.wordpress.com/?p=19</guid>
		<description><![CDATA[Hi there, welcome to my blog! This is the first ever made for me and I&#8217;ll be talking about RIA Development and technology related topics, hope you enjoy the content!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=19&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi there, welcome to my blog! This is the first ever made for me and I&#8217;ll be talking about RIA Development and technology related topics, hope you enjoy the content!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coisasdesintaxe.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coisasdesintaxe.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coisasdesintaxe.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coisasdesintaxe.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coisasdesintaxe.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coisasdesintaxe.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coisasdesintaxe.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coisasdesintaxe.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coisasdesintaxe.wordpress.com&amp;blog=8233813&amp;post=19&amp;subd=coisasdesintaxe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coisasdesintaxe.wordpress.com/2009/06/18/welcome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e580e99107d4c70d0deb3f5cf2f47b2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chuckytuh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
