<?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"
	>

<channel>
	<title>Tenegri's blog</title>
	<atom:link href="http://blog.tengerstudio.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tengerstudio.com</link>
	<description>Problems, questions and discoveries related to my daily development work</description>
	<pubDate>Wed, 04 Jun 2008 20:12:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Some videos on Flash CS4</title>
		<link>http://blog.tengerstudio.com/2008/06/03/some-videos-on-flash-cs4/</link>
		<comments>http://blog.tengerstudio.com/2008/06/03/some-videos-on-flash-cs4/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 21:10:08 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[CS4]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=12</guid>
		<description><![CDATA[New tween engine
Inverse kinematics engine
3D tools
Design time video playing &#038; inverse kinematics
New tween engine &#038; 3D &#038; inverse kinematics
Thanks to Reider for the links 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=8_wRMswNLiU">New tween engine</a><br />
<a href="http://www.youtube.com/watch?v=wDjewbDF4bo">Inverse kinematics engine</a><br />
<a href="http://www.youtube.com/watch?v=0GAbMRj0IV0">3D tools</a><br />
<a href="http://www.youtube.com/watch?v=vqMI480D668">Design time video playing &#038; inverse kinematics</a><br />
<a href="http://www.youtube.com/watch?v=AnJKimyTIjo">New tween engine &#038; 3D &#038; inverse kinematics</a></p>
<p>Thanks to Reider for the links <img src='http://blog.tengerstudio.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/06/03/some-videos-on-flash-cs4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useful resources for Flash 10</title>
		<link>http://blog.tengerstudio.com/2008/05/19/useful-resources-for-flash-10/</link>
		<comments>http://blog.tengerstudio.com/2008/05/19/useful-resources-for-flash-10/#comments</comments>
		<pubDate>Mon, 19 May 2008 20:28:35 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=11</guid>
		<description><![CDATA[In this post I collected some useful resources related to Flash 10, which I found up to now. I&#8217;m going to keep this list up to date and extend it as I obtain more interesting links.
Targeting Flash Player 10 beta and development tools
1. Targeting Flash Player 10 Beta with Flex SDK 3.0.x
2. Flex 3 SDK [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I collected some useful resources related to Flash 10, which I found up to now. I&#8217;m going to keep this list up to date and extend it as I obtain more interesting links.</p>
<p><strong>Targeting Flash Player 10 beta and development tools</strong><br />
1. <a href="http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10+Beta+with+Flex+SDK+3.0.x" target="_blank">Targeting Flash Player 10 Beta with Flex SDK 3.0.x</a><br />
2. <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3" target="_blank">Flex 3 SDK Downloads - The latest Flex SDK, which is capable of compiling Flash 10 targeted movies. Also includes a stand-alone debug player (version 10)</a><br />
3. <a href="http://www.flashdevelop.org/community/viewtopic.php?t=3039" target="_blank">Flash Player 10 support in FlashDevelop</a><br />
4. <a href="http://www.gotoandlearn.com/player.php?id=73" target="_blank">How to get started with creating content for Flash Player 10 (video tutorial)</a></p>
<p><strong>3D, the new Drawing API, GPU acceleration</strong><br />
1. <a href="http://www.senocular.com/flash/tutorials/flash10drawingapi" target="_blank">Senocular: Flash Player 10 Drawing API</a><br />
2. <a href="http://www.kaourantin.net/2008/05/what-does-gpu-acceleration-mean.html" target="_blank">Tinic Uro: What does GPU acceleration mean?</a><br />
3. <a href="http://www.gotoandlearn.com/player.php?id=74" target="_blank">How to take ordinary display objects into the third dimension in Astro (video tutorial)</a><br />
4. <a href="http://blogs.adobe.com/penguin.swf/2008/05/flash_uses_the_gpu.html" target="_blank">Mike Melanson: Flash Uses The GPU</a></p>
<p><strong>Creating dynamic sounds</strong><br />
1. <a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-1.html" target="_blank">Tinic Uro: Adobe is making some noise. Part 1</a><br />
2. <a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html" target="_blank">Tinic Uro: Adobe is making some noise. Part 2</a><br />
3. <a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-3.html" target="_blank">Tinic Uro: Adobe is making some noise. Part 3</a><br />
4. <a href="http://www.bit-101.com/blog/?p=1264" target="_blank">Keith Peters: Astro dynamic sound!</a><br />
5. <a href="http://www.gotoandlearn.com/player.php?id=75" target="_blank">How to dynamically create sounds using the new features in Astro (video tutorial)</a><br />
6. <a href="http://www.blixtsystems.com/2008/05/random-thoughts-on-vectors-and-samplescallbackdata/" target="_blank">Leo Bergman: Random thoughts on Vectors and samplesCallbackData</a></p>
<p><strong>Advanced text rendering</strong><br />
1. <a href="http://www.flashmagazine.com/news/detail/flash_player_10_feature_new_text_engine/" target="_blank">New text engine</a></p>
<p><strong>Loading and saving files without server (FileReference)</strong><br />
1. <a href="http://www.flashmagazine.com/news/detail/flash_player_10_new_feature_load_and_save_files_using_filereference/" target="_blank">Load and save files using FileReference</a><br />
2. <a href="http://www.gotoandlearn.com/player.php?id=76" target="_blank">How to read and write local files using the new methods of the FileReference class (video tutorial)</a></p>
<p><strong>Streaming, peer-to-peer audio and video</strong><br />
1. <a href="http://www.flashcomguru.com/index.cfm/2008/5/15/player-10-beta-speex-p2p-rtmfp" target="_blank">Peer to peer, Speex and UDP now in Flash Player 1</a><br />
2. <a href="http://justin.everett-church.com/index.php/2008/05/16/rtmfp-in-flash-player-10-beta/" target="_blank">Justin Everett-Church: RTMFP in Flash Player 10 beta</a><br />
3. <a href="http://justin.everett-church.com/index.php/2008/05/23/astrop2p/" target="_blank">Justin Everett-Church: Peer to Peer (P2P) in Flash Player 10 beta</a></p>
<p><strong>Other topics</strong><br />
1. <a href="http://www.blixtsystems.com/2008/05/random-thoughts-on-vectors-and-samplescallbackdata/" target="_blank">Leo Bergman: Random thoughts on Vectors and samplesCallbackData</a></p>
<p><strong>Documentation</strong><br />
1. <a href="http://dev.dschini.org/astro/api/" target="_blank">Flash Player 10 (Astro) API (new additions only)</a><br />
2. <a href="http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_as3langref_052008.zip" target="_blank">Flash Player 10 Language Reference (official Adobe documentation)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/05/19/useful-resources-for-flash-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Player 10 Class Browser</title>
		<link>http://blog.tengerstudio.com/2008/05/16/flash-player-10-class-browser/</link>
		<comments>http://blog.tengerstudio.com/2008/05/16/flash-player-10-class-browser/#comments</comments>
		<pubDate>Fri, 16 May 2008 09:01:08 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Astro]]></category>

		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=10</guid>
		<description><![CDATA[Since there is no public documentation for the new Flash Player 10 API I have created a small Flex application which makes easier to discover the properties and methods of the new classes. I also extracted the list of classes defined in the Flash 10&#8217;s playerglobal.swc (it is accessible in the latest build of Flex [...]]]></description>
			<content:encoded><![CDATA[<p>Since there is no public documentation for the new Flash Player 10 API I have created a small Flex application which makes easier to discover the properties and methods of the new classes. I also extracted the list of classes defined in the Flash 10&#8217;s playerglobal.swc (it is accessible in the latest build of Flex SDK) and placed into the class browser. So, now you can pick a class name from this list or enter a class name of your choice, click on the Describe button and see the result.</p>
<p>The class browser is on-line <a href="http://www.tengerstudio.com/public/flash10/class_browser" target="_blank">here</a>.</p>
<p>Maybe I will post the results of my (and other&#8217;s) discoveries later with examples <img src='http://blog.tengerstudio.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Some keywords till then (beyond the features mentioned on Adobe&#8217;s site):</p>
<ul>
<li>run-time sound generation</li>
<li>accessing local files through FileReference without uploading to a server</li>
<li>new Vector class with generics</li>
<li>etc.</li>
</ul>
<p>[Update]<br />
Some people reported that the class browser doesn&#8217;t worksand the version detection script prevents it from running (claiming a new player installation). I don&#8217;t know what does cause the problem, yet, but I provide here a direct link to the SWF itself until I solve the issue:<br />
<a href="http://tengerstudio.com/public/flash10/class_browser/ClassBrowser.swf" target="_blank">http://tengerstudio.com/public/flash10/class_browser/ClassBrowser.swf</a></p>
<p>[Update 2]<br />
I made a minor addition, and the class browser now displays also the class&#8217; constructor among the methods.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/05/16/flash-player-10-class-browser/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Player 10 beta released</title>
		<link>http://blog.tengerstudio.com/2008/05/16/flash-player-10-beta-released/</link>
		<comments>http://blog.tengerstudio.com/2008/05/16/flash-player-10-beta-released/#comments</comments>
		<pubDate>Thu, 15 May 2008 23:13:42 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Astro]]></category>

		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=9</guid>
		<description><![CDATA[Adobe released the beta version of the next Flash Player 10 (codename Astro). Further details, downloads, examples and videos are here:
http://labs.adobe.com/technologies/flashplayer10/
The development tools are not published yet, but you can configure Flex SDK to compile to Flash Player 10. Here is the how to.
If somebody is not familiar with Flex, it is possible to use [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe released the beta version of the next Flash Player 10 (codename Astro). Further details, downloads, examples and videos are here:</p>
<p><a title="http://labs.adobe.com/technologies/flashplayer10/" href="http://labs.adobe.com/technologies/flashplayer10/" target="_blank">http://labs.adobe.com/technologies/flashplayer10/</a></p>
<p>The development tools are not published yet, but you can configure Flex SDK to compile to Flash Player 10. <a href="http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10+Beta+with+Flex+SDK+3.0.x" target="_blank">Here</a> is the how to.</p>
<p>If somebody is not familiar with Flex, it is possible to use Flash CS3 for the same purpose by utilizing some minor hacks. Just follow these steps:<br />
<span id="more-9"></span><br />
1. Create your Flash movie and write ActionScript with the current development tool (Flash CS3).</p>
<p>2. While writing your ActionScript code take into consideration that the new identifiers, methods and properties will not be recognized by the compiler, so use square brackets where necessary, so instead myObject.propertyName use myObject[&#8221;propertyName&#8221;], and instead myObject.methodName() use myObject[&#8221;methodName&#8221;]().</p>
<p>3. Compile the sources into a SWF file.</p>
<p>4. (This step seems to be optional.) Up to now my SWFs compiled for player 9 were running in Flash Player 10 without any change, and I could use the new features. However it seems possible that setting the target version to 10 is required in some cases, so if you meet such case just change the 4th byte of the SWF file to hexadecimal value 0A (decimal 10 - this byte indicates the target player version) using a hexa editor (e.g.: <a title="XVI32" href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm" target="_blank">XVI32</a>).</p>
<p>5. Create an HTML document for embedding your Flash movie. I used <a title="http://code.google.com/p/swfobject/" href="http://code.google.com/p/swfobject/" target="_blabk">SWFObject 2</a>, which is compatible with Flash Player 10, and the embedding HTML looks like this one:</p>

<div class="wp_syntax"><div class="code"><pre>&amp;lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;
&nbsp;
		&lt;script src=&quot;http://blog.tengerstudio.com/wp-admin/swfobject.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;
&lt;div id=&quot;myContent&quot;&gt;
&lt;h1&gt;Alternative content&lt;/h1&gt;
&lt;a href=&quot;http://www.adobe.com/go/getflashplayer&quot;&gt;&lt;img src=&quot;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&quot; alt=&quot;Get Adobe Flash player&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</pre></div></div>

<p>Replace the parameter values of the embedSWF() method and let&#8217;s go. Don&#8217;t forget to place swfobject.js into the same directory as the HTML document, and of course install Flash Player 10 <img src='http://blog.tengerstudio.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here is a small sample script which uses the new 3D features for creating a rotating object:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> ns: Namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.adobe.com/2008/actionscript/Flash10/&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> minZ: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">var</span> maxZ: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1000</span>;
<span style="color: #000000; font-weight: bold;">var</span> zStep: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">10</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> enterFrame<span style="color: #66cc66;">&#40;</span>aEvent: Event<span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	logo.<span style="color: #006600;">ns</span>::rotationY += <span style="color: #cc66cc;">1</span>;
	logo.<span style="color: #006600;">ns</span>::rotationZ += <span style="color: #cc66cc;">1</span>;
	logo.<span style="color: #006600;">ns</span>::z += zStep;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>logo.<span style="color: #006600;">ns</span>::z <span style="color: #66cc66;">&amp;</span>lt; minZ <span style="color: #66cc66;">||</span> logo.<span style="color: #006600;">ns</span>::z <span style="color: #66cc66;">&amp;</span>gt; maxZ<span style="color: #66cc66;">&#41;</span>
		zStep = -zStep;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, enterFrame<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>You can see this sample on-line <a href="http://tengerstudio.com/public/flash10/3d_test1">here</a>. Don&#8217;t forget to install Flash Playar 10 to see it in action.</p>
<p>The API documentation of the new player is not available at the moment, so discovering the new features is a must <img src='http://blog.tengerstudio.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/05/16/flash-player-10-beta-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Are there real int and uint types?</title>
		<link>http://blog.tengerstudio.com/2008/05/03/are-there-real-int-and-uint-types/</link>
		<comments>http://blog.tengerstudio.com/2008/05/03/are-there-real-int-and-uint-types/#comments</comments>
		<pubDate>Sat, 03 May 2008 15:19:29 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=8</guid>
		<description><![CDATA[In Actionscript 3 all types, even the primitive types are considered as classes, so String, Number, Boolean, int are such ones, too. By invoking getQualifiedClassName() we can get the fully qualified class name of an object:

1
2
3
4
5
var n_num: Number;
trace&#40;getQualifiedClassName&#40;n_num&#41;&#41;; // Number
&#160;
var n_int: int;
trace&#40;getQualifiedClassName&#40;n_int&#41;&#41;; // int

This outputs the result as expected: Number and int. The uint however [...]]]></description>
			<content:encoded><![CDATA[<p>In Actionscript 3 all types, even the primitive types are considered as classes, so String, Number, Boolean, int are such ones, too. By invoking getQualifiedClassName() we can get the fully qualified class name of an object:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> n_num: <span style="color: #0066CC;">Number</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_num<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Number</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> n_int: <span style="color: #0066CC;">int</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_int<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// int</span></pre></td></tr></table></div>

<p>This outputs the result as expected: Number and int. The uint however seems to be somewhat different. If a value of uint type passed to getClassByName(), one would except that the result will be &#8220;uint&#8221;, but actually this is not true.<br />
<span id="more-8"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> n_uint: uint;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_uint<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// int</span></pre></td></tr></table></div>

<p>The result is &#8220;int&#8221; instead of &#8220;uint&#8221;. Well, that&#8217;s not a big surprise, I can imagine that unsigned integers are internally handled by the same class as signed ones. But the situation is more complex, not only uint behaves weird:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> n_num: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">12</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_num<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// int</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> n_int: <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">12</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_int<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// int</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> n_uint: uint = <span style="color: #cc66cc;">12</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_uint<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// int</span></pre></td></tr></table></div>

<p>If I overwrite the default values and assign the same integer value to all three variables even n_num (of type Number) will be considered as of class int! If I assign a non-integer value to n_num, the result will be Number as expected:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> n_num: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">12.3</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>getQualifiedClassName<span style="color: #66cc66;">&#40;</span>n_num<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Number</span></pre></td></tr></table></div>

<p>Does it mean that the class depends on the actual value of the variable? At the first look it seems to be possible, but when I checked whether the class definition (class object) of int and Number are really different, I found that they are not!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> n_num: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">12.3</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>n_num<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;constructor&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// [class Number]</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> n_int: <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">12</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>n_int<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;constructor&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// [class Number]</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> n_uint: uint = <span style="color: #cc66cc;">12</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>n_uint<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;constructor&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// [class Number]</span>
&nbsp;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>n_num<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;constructor&quot;</span><span style="color: #66cc66;">&#93;</span> == n_int<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;constructor&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// true</span></pre></td></tr></table></div>

<p>All three numeric types are handled by the same Number class. It doesn&#8217;t mean however that both integer and real numbers are handled similarly by the Number class, but their classes are actually the same.</p>
<p>Earlier there was another weird issue with uint, namely that sometimes its type was changed from int to Number and sometimes back from Number to int. This occured with certain values assigned to the variable. I met this issue some times ago, but it seems to be not reproductible now, probably a recent player update corrected the problem. At last I provide here some links where the actual explanation for this issue can be found (see the comments, too) and some general information related to numbers in Actionscript 3 are also collected there:</p>
<p><a href="http://drawlogic.com/2007/06/06/as3-interesting-numeric-storage-behavior/#comments">Ryan Christensen: AS3 Interesting Numeric Storage Behavior</a><br />
<a href="http://blog.andre-michelle.com/2007/weird_behavior_of_numbers_in_as3/">Andre Michelle: Weird behavior of numbers in as3</a><br />
<a href="http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/">Michael Baczynski: Bitwise gems - fast integer math</a><br />
<a href="http://lab.polygonal.de/2007/06/06/int-uint-and-number-data-type-conversion/">Michael Baczynski: Int, uint and number data type conversion</a><br />
<a href="http://kuwamoto.org/2006/06/15/avoid-ints-in-actionscript/">Sho Kuwamoto: Avoid ints in ActionScript</a><br />
<a href="http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html">Grant Skinner: Types in AS3: ints not so fast, uints slow!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/05/03/are-there-real-int-and-uint-types/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ApplicationDomain - parent and child</title>
		<link>http://blog.tengerstudio.com/2008/04/15/applicationdomain-parent-and-child/</link>
		<comments>http://blog.tengerstudio.com/2008/04/15/applicationdomain-parent-and-child/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 21:29:34 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=5</guid>
		<description><![CDATA[When loading a SWF into a Flash movie you can specify the application domain which the loaded movie will use. If this application domain is a child domain of the loader&#8217;s (or other movie&#8217;s) domain and &#8220;the child defines a class with the same name as a class already defined by the parent, no error [...]]]></description>
			<content:encoded><![CDATA[<p>When loading a SWF into a Flash movie you can specify the application domain which the loaded movie will use. If this application domain is a child domain of the loader&#8217;s (or other movie&#8217;s) domain and <i>&#8220;the child defines a class with the same name as a class already defined by the parent, no error results; the child simply inherits the parent&#8217;s definition of that class, and the child&#8217;s conflicting definition goes unused unless either child or parent calls the ApplicationDomain.getDefinition() method to retrieve it.&#8221;</i> (quoted from the documentation)</p>
<p>The first part of the quoted sentence is true, but the second one is not working. Calling getDefinition() on the child domain will return a reference to the parent&#8217;s class instead of the child&#8217;s original one. I think this is rather a mistake in the documentation than a player bug, since it seems quite logical: referencing a class by the normal way and through getDefinition() should evaluate to the same value. Anyway, I already posted a small note about that to the online documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/04/15/applicationdomain-parent-and-child/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Namespace and URI</title>
		<link>http://blog.tengerstudio.com/2008/04/13/namespace-and-uri/</link>
		<comments>http://blog.tengerstudio.com/2008/04/13/namespace-and-uri/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 16:35:31 +0000</pubDate>
		<dc:creator>tenegri</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://blog.tengerstudio.com/?p=4</guid>
		<description><![CDATA[Recently I played a little bit with namespaces in ActionScript 3 and found a somewhat weird thing. Namespaces have an associated URI which makes them unique. When you define a namespace you can specify an explicit URI or you can omit it. In the latter case the compiler will assign a unique value automatically, so [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I played a little bit with namespaces in ActionScript 3 and found a somewhat weird thing. Namespaces have an associated URI which makes them unique. When you define a namespace you can specify an explicit URI or you can omit it. In the latter case the compiler will assign a unique value automatically, so everything should work perfectly. Class members placed into a namespace can be referenced by two ways:</p>
<p>1) by opening the namespace and then referring to the desired member:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript">use namespace something;
myFunction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>2) by qualifying the method or property with the namespace:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript">something::myFunction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>This is what the documentation says. But in practice when I omit the URI only the first way will work and the second one will not. The compiler passes over, everything seems to be OK, but suddenly my namespaces defined without URI are not found at run-time. E.g. I have a package where I define two namespaces, one without an explicit URI and one with a URI:<br />
<span id="more-4"></span><br />
first.as</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript">package mypackage <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> namespace first;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>second.as</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript">package mypackage <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> namespace second = <span style="color: #ff0000;">&quot;http://tengerstudio.com/namespace/second&quot;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>And also there is a class using them and defining some methods placed into the above two namespaces:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="actionscript">package mypackage <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyClass <span style="color: #66cc66;">&#123;</span>
    first <span style="color: #000000; font-weight: bold;">function</span> doSomething<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;doing something&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    first <span style="color: #000000; font-weight: bold;">function</span> doSomethingElse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;doing something else 1&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    second <span style="color: #000000; font-weight: bold;">function</span> doSomethingElse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;doing something else 2&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>This all works, yet, so I instantiate this class and try to invoke the doSomething() method:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> mypackage.<span style="color: #006600;">*</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> obj: MyClass = <span style="color: #000000; font-weight: bold;">new</span> MyClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
use namespace first;
&nbsp;
obj.<span style="color: #006600;">doSomething</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>This works. But if I use the namespace qualifier, a ReferenceError is thrown:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> mypackage.<span style="color: #006600;">*</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> obj: MyClass = <span style="color: #000000; font-weight: bold;">new</span> MyClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
obj.<span style="color: #006600;">first</span>::doSomething<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The result is:</p>
<blockquote><p>ReferenceError: Error #1069: Property mypackage:first::doSomething not found on mypackage.MyClass and there is no default value.<br />
	at namespace2_fla::MainTimeline/frame1()</p></blockquote>
<p>It can be avoided of course if I use the first method, but sometimes it&#8217;s not possible, e.g. when there are two or more identical identifiers in different namespaces (as in the case of the doSomethingElse() methods in MyClass) and I want to use all of them.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> mypackage.<span style="color: #006600;">*</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> obj: MyClass = <span style="color: #000000; font-weight: bold;">new</span> MyClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
use namespace first;
obj.<span style="color: #006600;">doSomethingElse</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
use namespace second;
obj.<span style="color: #006600;">doSomethingElse</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>It will result in a compiler error saying that the reference to doSomething() is ambiguous (of course). But when I try to avoid this and specify exact namespaces:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> mypackage.<span style="color: #006600;">*</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> obj: MyClass = <span style="color: #000000; font-weight: bold;">new</span> MyClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
obj.<span style="color: #006600;">first</span>::doSomethingElse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
obj.<span style="color: #006600;">second</span>::doSomethingElse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>I get a run-time error:</p>
<blockquote><p>ReferenceError: Error #1069: Property mypackage:first::doSomething not found on mypackage.MyClass and there is no default value.<br />
	at namespace2_fla::MainTimeline/frame1()</p></blockquote>
<p>The result is the same when I include the <i>use namespace</i> statement. If I don&#8217;t refer to namespace <i>first</i> (which has no associated URI), there is no error, namespace <i>second</i> is working (which has a URI), and if I add a URI to namespace <i>first</i> it will run perfectly, too:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript">package mypackage <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> namespace first = <span style="color: #ff0000;">&quot;http://tengerstudio.com/namespace/first&quot;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>What is the conclusion? Never forget to associate a URI with a namespace, even if the documentation says that this is optional.</p>
<p>Well, beside the above ones I mention one more thing related to namespaces, which was not evident to me, but finally I figured out how to use it. This is accessing a namespace defined in a class rather than in a package:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="actionscript">package mypackage <span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyClass2 <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #0066CC;">public</span> namespace third = <span style="color: #ff0000;">&quot;http://tengerstudio.com/namespace/third&quot;</span>;
&nbsp;
    third <span style="color: #000000; font-weight: bold;">function</span> foo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The only way I could access and use what is in namespace <i>third</i> was placing it&#8217;s value into a variable and referring to the members through this variable:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> mypackage.<span style="color: #006600;">*</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> obj: MyClass2 = <span style="color: #000000; font-weight: bold;">new</span> MyClass2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> ns: Namespace = MyClass2.<span style="color: #006600;">third</span>;
&nbsp;
obj.<span style="color: #006600;">ns</span>::foo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>So it seems that namespaces defined in a class are always static members, although the static attribute is not allowed on namespace definitions (it throws a compiler error). No other ways worked for me including these ones:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre>// 1
obj.third::foo();
&nbsp;
// 2
obj.(MyClass2.third)::foo();
&nbsp;
// 3
use namespace MyClass2.third;
obj.third::foo();
&nbsp;
// 4
var ns: Namespace = MyClass.third;
use namespace ns;
obj.foo();</pre></td></tr></table></div>

<p>What is also interesting, that I can omit the URI at the definition of namespace <i>third</i> and it will work through the variable reference, so only package level namespaces require URI for using them as direct qualifiers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tengerstudio.com/2008/04/13/namespace-and-uri/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
