<?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>Flash, ActionScript, Flash SEO &#187; Problems</title>
	<atom:link href="http://flash.sikotiko.com/category/problems/feed/" rel="self" type="application/rss+xml" />
	<link>http://flash.sikotiko.com</link>
	<description>Lessons, ideas, solved problems</description>
	<lastBuildDate>Fri, 30 Jul 2010 08:55:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>[AS3] Event.ENTER_FRAME strange behaviour</title>
		<link>http://flash.sikotiko.com/2009/10/11/as3-event-enterframe-strange-behaviour/</link>
		<comments>http://flash.sikotiko.com/2009/10/11/as3-event-enterframe-strange-behaviour/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 21:19:55 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Problems]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=116</guid>
		<description><![CDATA[Have you ever tried in ActionScript 3 this: this.addEventListener&#40;Event.ENTER_FRAME, cpF1&#41;; this.addEventListener&#40;Event.ENTER_FRAME, cpF2&#41;; &#160; function cpF1&#40;e:Event&#41;:void&#123; trace&#40;&#34;cpF1&#34;&#41; &#125; function cpF2&#40;e:Event&#41;:void&#123; trace&#40;&#34;cpF2&#34;&#41; &#125; Don&#8217;t expect to have traces like &#8220;cpF2&#8243; only. You&#8217;ll have &#8220;cpF1 cpF2&#8243; traced on every frame. This is a very hard to find mistake, if you expect an object to have only one onEnterFrame [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried in ActionScript 3 this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, cpF1<span style="color: #000000;">&#41;</span>;
<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, cpF2<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> cpF1<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;cpF1&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #339966; font-weight: bold;">function</span> cpF2<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;cpF2&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Don&#8217;t expect to have traces like &#8220;cpF2&#8243; only. You&#8217;ll have &#8220;cpF1 cpF2&#8243; traced on every frame. This is a very hard to find mistake, if you expect an object to have only one onEnterFrame listener but you add another.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/10/11/as3-event-enterframe-strange-behaviour/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving from ActionScript 2 to ActionScript 3 troubles</title>
		<link>http://flash.sikotiko.com/2009/07/06/moving-from-actionscript-2-to-actionscript-3-troubles/</link>
		<comments>http://flash.sikotiko.com/2009/07/06/moving-from-actionscript-2-to-actionscript-3-troubles/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 10:35:43 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[linkage identifier]]></category>
		<category><![CDATA[syntax error]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=114</guid>
		<description><![CDATA[1086: Syntax error: expecting semicolon before line Have you ever seen this error, when trying to move your fla from AS2 to AS3: &#8220;Location: tempInit, Line 2   Description: 1086: Syntax error: expecting semicolon before line.&#8221; In my case the problem was that I had a movieclip with a Linkage identifier in my AS2 file that [...]]]></description>
			<content:encoded><![CDATA[<h2>1086: Syntax error: expecting semicolon before line</h2>
<p>Have you ever seen this error, when trying to move your fla from AS2 to AS3:</p>
<p>&#8220;<span style="text-decoration: underline;">Location:</span> tempInit, Line 2   <span style="text-decoration: underline;">Description:</span> 1086: Syntax error: expecting semicolon before line.&#8221;</p>
<p>In my case the problem was that I had a movieclip with a Linkage identifier in my AS2 file that contained space in the name. When I moved to AS3 all my Linkage identifiers were converted to class names and when I tried to compile my AS3 flash file I got this error above.</p>
<p>So be careful when you name your linkage identifiers. Better use &#8220;camel case&#8221; instead of using spaces. This will help you move your AS2 fla file to AS3 fla file without seeing this error.</p>
<p>Happy coding!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/07/06/moving-from-actionscript-2-to-actionscript-3-troubles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[AS3] Be careful with Shape tweens above buttons</title>
		<link>http://flash.sikotiko.com/2009/07/03/as3-be-careful-with-shape-tweens-above-buttons/</link>
		<comments>http://flash.sikotiko.com/2009/07/03/as3-be-careful-with-shape-tweens-above-buttons/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 15:39:41 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[shape tween]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=112</guid>
		<description><![CDATA[If you use a standart timeline animation with a shape tween above a button and you want to call a function that sets the events for the button from a frame &#8211; put the call to the function after the shape tween is over. If the shape tween is over the button, the shape receives [...]]]></description>
			<content:encoded><![CDATA[<p>If you use a standart timeline animation with a shape tween above a button and you want to call a function that sets the events for the button from a frame &#8211; put the call to the function after the shape tween is over. If the shape tween is over the button, the shape receives the Mouse events and the button won&#8217;t work.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/07/03/as3-be-careful-with-shape-tweens-above-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[AS3] Skinning Flash Components &#8211; Part II</title>
		<link>http://flash.sikotiko.com/2009/05/05/as3-skinning-slider-component/</link>
		<comments>http://flash.sikotiko.com/2009/05/05/as3-skinning-slider-component/#comments</comments>
		<pubDate>Tue, 05 May 2009 20:33:03 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[skinning]]></category>
		<category><![CDATA[Slider]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=97</guid>
		<description><![CDATA[Skinning Slider Component In a comment on my previous post [AS3] Skinning Flash Components I was asked to show how to change the size of the thumb of the Slider component. After some experiments with the component here is the way it can be done: import fl.controls.Slider; &#160; var s:Slider = new Slider&#40;&#41;; s.move&#40;10,10&#41;; s.setSize&#40;500,300&#41;; [...]]]></description>
			<content:encoded><![CDATA[<h2>Skinning Slider Component</h2>
<p>In a comment on my previous post <a href="http://flash.sikotiko.com/2009/01/21/as3-skinning-flash-components/" target="_self">[AS3] Skinning Flash Components</a> I was asked to show how to change the size of the thumb of the Slider component. After some experiments with the component here is the way it can be done:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl.controls.Slider;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> s<span style="color: #000000; font-weight: bold;">:</span>Slider = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
s.move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span>,<span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
s.setSize<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">500</span>,<span style="color: #000000; font-weight:bold;">300</span><span style="color: #000000;">&#41;</span>;
<span style="color: #3f5fbf;">/*s.setStyle(&quot;thumbUpSkin&quot;, SliderThumbCustomSkin);
s.setStyle(&quot;thumbDownSkin&quot;, SliderThumbCustomSkin);
s.setStyle(&quot;thumbOverSkin&quot;, SliderThumbCustomSkin);*/</span>
s.maximum = <span style="color: #000000; font-weight:bold;">100</span>;
s.minimum = <span style="color: #000000; font-weight:bold;">0</span>;
s.tickInterval = <span style="color: #000000; font-weight:bold;">5</span>;
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span>;
s.<span style="color: #004993;">getChildAt</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">50</span>;
s.<span style="color: #004993;">getChildAt</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">height</span> = <span style="color: #000000; font-weight:bold;">100</span>;</pre></div></div>

<p>With the code above I found that<span id="more-97"></span> the thumb of the <strong>Slider component</strong> is positioned at index 1 and can be reached by s.getChildAt(1) (where <strong>s</strong> is the instance of the Slider component). Then you can easily change its properties like Width, Height, etc.</p>
<p>Here is the list of the styles that can be used for skinning a Slider component:</p>
<p><span style="text-decoration: underline;"><strong>Slider component styles</strong></span></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">sliderTrackDisabledSkin</span></strong></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">sliderTrackSkin</span></strong></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">thumbDisabledSkin</span></strong></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">thumbDownSkin</span></strong></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">thumbOverSkin</span></strong></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">thumbUpSkin</span></strong></p>
<p style="padding-left: 30px;"><strong><span class="signatureLink">tickSkin</span></strong></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/05/05/as3-skinning-slider-component/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash Player 10: Strange Artifacts</title>
		<link>http://flash.sikotiko.com/2009/05/02/flash-player-10-strange-artifacts/</link>
		<comments>http://flash.sikotiko.com/2009/05/02/flash-player-10-strange-artifacts/#comments</comments>
		<pubDate>Sat, 02 May 2009 11:31:58 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[artifacts]]></category>
		<category><![CDATA[blend mode overlay]]></category>
		<category><![CDATA[flash player 10]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=88</guid>
		<description><![CDATA[Using PNG in a MovieClip with Blend mode set to Overlay causes strange artifacts in Flash player 10 As you can see in the flash demo below, in Flash player 10 the  left image has strange artifacts while in the right image there are no artifacts. I used Alpha: 99% for the Movie clip with [...]]]></description>
			<content:encoded><![CDATA[<h2>Using PNG in a MovieClip with Blend mode set to Overlay causes strange artifacts in Flash player 10</h2>
<p>As you can see in the flash demo below, in Flash player 10 the  left image has strange artifacts while in the right image there are no artifacts.</p>
<p>I used Alpha: 99% for the Movie clip with the PNG and the artifacts were gone. I&#8217;m not sure what causes the artifacts in FP10 and if this solution is the right one, but it worked for me.</p>
<p>Here is the demo flash:<span id="more-88"></span></p>
<p><script type="text/javascript" src="http://flash.sikotiko.com/wp-content/plugins/pb-embedflash/js/swfobject.js"></script><span class="embededflash" id="swfid10f86f0475a54f155f3e9c6006e9b3d9"><small>(Please open the article to see the flash file or player.)</small></span><script type="text/javascript">
				var flashvars = {}; var params = {}; var attributes = {};params.allowfullscreen = "true"; params.allowscriptaccess = "always";
				swfobject.embedSWF("http://flash.sikotiko.com/wp-content/uploads/2009/05/fp10_artifacts.swf","swfid10f86f0475a54f155f3e9c6006e9b3d9","550","400","9.0.0","http://flash.sikotiko.com/wp-content/plugins/pb-embedflash/swf/expressInstall.swf",flashvars,params,attributes);
		</script></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/05/02/flash-player-10-strange-artifacts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[AS3] Scaling Sprite Containing TextField &#8211; Problem</title>
		<link>http://flash.sikotiko.com/2009/02/04/as3-scaling-sprite-containing-textfield-problem/</link>
		<comments>http://flash.sikotiko.com/2009/02/04/as3-scaling-sprite-containing-textfield-problem/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 22:09:11 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[scaling textfield]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=60</guid>
		<description><![CDATA[Today I run into this strange problem while trying to scale a Sprite containing dynamic TextField. As you can see in the flash demo below, when you scale the Sprite the TextField retains its position in the Sprite container. (Please open the article to see the flash file or player.) This is the code that [...]]]></description>
			<content:encoded><![CDATA[<p>Today I run into this strange problem while trying to scale a Sprite containing dynamic TextField. As you can see in the flash demo below, when you scale the Sprite the TextField retains its position in the Sprite container.</p>
<p><object type="application/x-shockwave-flash" data="http://flash.sikotiko.com/wp-content/uploads/2009/02/textfieldscaleproblem.swf" width="550" height="200" class="embededflash"><param name="movie" value="http://flash.sikotiko.com/wp-content/uploads/2009/02/textfieldscaleproblem.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object></p>
<p>This is the code that I use for scaling:<span id="more-60"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> testTxt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span> = btn.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;labelTxt&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span>
<span style="color: #004993;">TextField</span>;
testTxt.<span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span>.<span style="color: #004993;">LEFT</span>;
testTxt.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;SCALE SPRITE+TXT&quot;</span>;
testTxt.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">4</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> bg<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = btn.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;bg&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Sprite</span>;
bg.<span style="color: #004993;">width</span> = testTxt.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">8</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> orig<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> txt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span> = orig.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;labelTxt&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">TextField</span>;
txt.<span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span>.<span style="color: #004993;">LEFT</span>;
txt.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;SCALE SPRITE+TXT&quot;</span>;
txt.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">4</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> bg2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = orig.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;bg&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Sprite</span>;
bg2.<span style="color: #004993;">width</span> = txt.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">8</span>;
orig.<span style="color: #004993;">x</span> = btn.<span style="color: #004993;">x</span>;
orig.<span style="color: #004993;">y</span> = btn.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">+</span> btn.<span style="color: #004993;">height</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">4</span>;
&nbsp;
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>orig<span style="color: #000000;">&#41;</span>;
&nbsp;
btn.<span style="color: #004993;">scaleX</span> = <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000; font-weight: bold;">/</span>btn.<span style="color: #004993;">width</span>;</pre></div></div>

<p>And THE SOLUTION is to use <strong>GridFitType.NONE</strong> for the <strong>gridFitType property</strong> of the TextField. The default value of the gridFitType property is GridFitType.PIXEL, which forces the text field to position according to the grid.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/02/04/as3-scaling-sprite-containing-textfield-problem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[AS3] Skinning Flash Components</title>
		<link>http://flash.sikotiko.com/2009/01/21/as3-skinning-flash-components/</link>
		<comments>http://flash.sikotiko.com/2009/01/21/as3-skinning-flash-components/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 13:50:55 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[flash component]]></category>
		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=39</guid>
		<description><![CDATA[You can easily skin a Flash component using only ActionScript using component&#8217;s method setStyle() providing as parameters: the name of the style and your class that you want to use as the skin. Here is the list of the styles that can be used for skinning a component: ComboBox component styles cellRenderer disabledSkin downArrowDisabledSkin downArrowDownSkin [...]]]></description>
			<content:encoded><![CDATA[<p>You can easily skin a Flash component using only ActionScript using component&#8217;s method setStyle() providing as parameters:</p>
<ol>
<li>the name of the style and</li>
<li>your class that you want to use as the skin.</li>
</ol>
<p>Here is the list of the styles that can be used for skinning a component:<br />
<span id="more-39"></span><br />
<span style="text-decoration: underline;"><strong>ComboBox component styles</strong></span></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">cellRenderer</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">disabledSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">downArrowDisabledSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">downArrowDownSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">downArrowOverSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">downArrowUpSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">downSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">thumbArrowUpSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">thumbDisabledSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">thumbDownSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">thumbIcon</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">thumbOverSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">trackDisabledSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">trackDownSkin</span></em></strong></p>
<div class="summarySignature" style="padding-left: 30px;"><strong><em><span class="signatureLink">trackOverSkin</span></em></strong></div>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">trackUpSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">upArrowDisabledSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">upArrowOverSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">upArrowUpSkin</span></em></strong></p>
<p style="padding-left: 30px;"><strong><em><span class="signatureLink">upSkin</span></em></strong></p>
<p>Information for any of the above styles of the ComboBox component can be found in the Flash Help for the ComboBox class.</p>
<p>The code for skinning is:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">myComboBox.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;upArrowUpSkin&quot;</span>, CustomUpArrowUpSkin<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Where <em>CustomUpArowUpSkin</em> is the class of your custom upArrow skin for Up state of the up arrow button.</p>
<p><span class="signatureLink">to be continued&#8230;</span><strong><em><span class="signatureLink"><br />
</span></em></strong></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2009/01/21/as3-skinning-flash-components/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SWFAddress Subversion Repository</title>
		<link>http://flash.sikotiko.com/2008/11/03/swfaddress-subversion-repository/</link>
		<comments>http://flash.sikotiko.com/2008/11/03/swfaddress-subversion-repository/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 09:42:30 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[SWFAddress]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=34</guid>
		<description><![CDATA[After searching and trying a lot of different URLs for the Subversion repository of SWFAddress I finally found the right URL for my Tortoise SVN client. The address is: https://swfaddress.svn.sourceforge.net/svnroot/swfaddress]]></description>
			<content:encoded><![CDATA[<p>After searching and trying a lot of different URLs for the Subversion repository of SWFAddress I finally found the right URL for my Tortoise SVN client. The address is:</p>
<p>https://swfaddress.svn.sourceforge.net/svnroot/swfaddress</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2008/11/03/swfaddress-subversion-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful ActionScript code snippets: Snippet 1</title>
		<link>http://flash.sikotiko.com/2008/09/08/useful-actionscript-code-snippets/</link>
		<comments>http://flash.sikotiko.com/2008/09/08/useful-actionscript-code-snippets/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 13:32:01 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Code snippets]]></category>
		<category><![CDATA[Problems]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ActionScript button]]></category>
		<category><![CDATA[code snippet]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=12</guid>
		<description><![CDATA[List of some useful ActionScript code snippets: How to toggle button with two states in two lines of code,i.e. sound on/off button? Let&#8217;s say you have a movieclip called &#8220;sound_btn&#8221; with two frames for the two states &#8211; sound on and sound off. Here is the code: sound_btn.onRelease = function&#40;&#41;&#123; &#160; this.gotoAndStop&#40;Number&#40;soundIsOn&#41;+1&#41;; &#160; soundIsOn = [...]]]></description>
			<content:encoded><![CDATA[<p>List of some useful ActionScript code snippets:</p>
<h2><strong>How to toggle button with two states in two lines of code,i.e. sound on/off button?</strong></h2>
<p>Let&#8217;s say you have a movieclip called &#8220;sound_btn&#8221; with two frames for the two states &#8211; sound on and sound off. Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">sound_btn.<span style="color: #0066CC;">onRelease</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>soundIsOn<span style="color: #66cc66;">&#41;</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
soundIsOn = <span style="color: #66cc66;">!</span>soundIsOn;
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The code <strong>soundIsOn = !soundIsOn;</strong> is equal to:<span id="more-12"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>soundIsOn<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
soundIsOn = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
soundIsOn = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>And the line <strong>this.gotoAndStop(Number(soundIsOn)+1);</strong> sends the movie clip to a frame number depending on the value of the Boolean variable soundIsOn. Number(soundIsOn) = 1 if soundIsOn = true, and Number(soundIsOn) = 0 if soundIsOn = false.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2008/09/08/useful-actionscript-code-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>stopAllSounds() blocks FLVPlayback component</title>
		<link>http://flash.sikotiko.com/2008/09/04/stopallsounds-blocks-flvplayback-component/</link>
		<comments>http://flash.sikotiko.com/2008/09/04/stopallsounds-blocks-flvplayback-component/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 09:42:56 +0000</pubDate>
		<dc:creator>SikoTiko</dc:creator>
				<category><![CDATA[Problems]]></category>
		<category><![CDATA[FLVPlayback component]]></category>
		<category><![CDATA[stopAllSounds]]></category>

		<guid isPermaLink="false">http://flash.sikotiko.com/?p=8</guid>
		<description><![CDATA[This is the answer I got to my e-mail from Adobe: Hello, &#8230;.. Unfortunately there is a bug filed against the use of the stopAllSounds()and the FLVPlayback component. The stopAllSounds method breaks the play/pause button in FLVPlayback component. The bug is currently deferred, so I can’t give you a potential fix date for this. Regards, [...]]]></description>
			<content:encoded><![CDATA[<p>This is the answer I got to my e-mail from Adobe:</p>
<blockquote class="uncited">
<div>Hello,<br />
&#8230;..</div>
<div>
Unfortunately there is a bug filed against the use of the stopAllSounds()and the FLVPlayback component. The stopAllSounds method breaks the play/pause button in FLVPlayback component.</p>
<p>The bug is currently deferred, so I can’t give you a potential fix date for this.</p>
<p>Regards,<br />
Chris Bedford</p>
<p>Chris Bedford | Sr. Technical Writer | Adobe Systems</p></div>
</blockquote>
<p>But I found a workaround using <em><strong>instanceof </strong></em>and checking if the object is <em><strong>instanceof Sound</strong></em> or <em><strong>instanceof FLVPlayback</strong></em> and then I call the Sound object&#8217;s stop() or the FLVPlayback component&#8217;s stop().</p>
<p>This is not very professional solution, but when I found a better one I&#8217;ll post it here.</p>
<p>BG version &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<span id="more-8"></span></p>
<p>Ето какво ми отговориха на и-мейла от Adobe по повод на този проблем:</p>
<blockquote class="uncited">
<div>Здравейте,<br />
&#8230;..</div>
<div>
За съжаление има регистриран проблем за използването на stopAllSounds() с FLVPlayback компонента. Методът stopAllSounds &#8220;разбива&#8221; play/pause бутона на FLVPlayback компонента.</p>
<p>За момента решението на този проблем е отложено, затова не мога да ви дам конкретна дата за решаване на проблема.</p>
<p>Поздрави,<br />
Крис Бедфорд</p></div>
</blockquote>
<p>Аз обаче намерих един начин да заобиколя този проблем като ползвам <em><strong>instanceof</strong></em> и проверявам дали обекта е <em><strong>instanceof Sound</strong></em> или <em><strong>instanceof FLVPlayback</strong></em> и им давам едно stop(). Това е малко тромаво решение, но за момента не се сещам за нещо по-добро.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://flash.sikotiko.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://flash.sikotiko.com/2008/09/04/stopallsounds-blocks-flvplayback-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
