<?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>Jurnal Tripmedia &#187; Flash</title>
	<atom:link href="http://jurnal.tripmedia.ro/category/flash/feed" rel="self" type="application/rss+xml" />
	<link>http://jurnal.tripmedia.ro</link>
	<description>Jurnal Tripmedia</description>
	<lastBuildDate>Sat, 24 Jul 2010 06:56:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>New Flash Tutorial: Music trail follows mouse</title>
		<link>http://jurnal.tripmedia.ro/music-trail-follow-mouse/2414.html</link>
		<comments>http://jurnal.tripmedia.ro/music-trail-follow-mouse/2414.html#comments</comments>
		<pubDate>Wed, 17 Mar 2010 10:52:15 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2414</guid>
		<description><![CDATA[In this tutorial I will try to give an idea on how to achieve an effect similar to the one on this site . There is a mouse trail that reacts to the music playing , of course the original app is more complex and instead of loading an mp3 file it loads multiple mp3 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2422" title="Sound Tutorial" src="http://jurnal.tripmedia.ro/wp-content/uploads/2010/03/left_pic2.jpg" alt="" width="231" height="295" />In this tutorial I will try to give an idea on how to achieve an effect similar to the one on <a href="http://soytuaire.labuat.com/" target="_blank">this site</a> . There is a mouse trail that reacts to the music playing , of course the original app is more complex and instead of loading an mp3 file it loads multiple mp3 files for the custom animation sequences, the pace control of the animation and so on. In this example I will try to give you an idea of how this effect could be achieved, it doesn&#8217;t mean that this is how they did it or that this is the best way to create something like this.<span id="more-2414"></span></p>
<p>First let&#8217;s create a new flash document, and create a play button , add it in the middle of the stage and give it an instance name of &#8220;gos&#8221;, or download the starter files <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2010/03/starter.rar" target="_blank">here</a>. Now that we have our document ready let&#8217;s create our variables:<br />
<code><br />
var music=new Sound(new URLRequest("song.mp3"));//the variable in which we load our song<br />
var ba:ByteArray= new ByteArray();//the needed byte array so we can analyze the sound<br />
var spr:Sprite=new Sprite();//a new sprite in which to draw<br />
var arr:Array=[];//and an array to keep the line data</code></p>
<p><code> </code></p>
<p><code>addChild(spr);//add the sprite to the display list</code></p>
<p>Let&#8217;s create the function that plays the music and starts the animation:<br />
<code>gos.addEventListener(MouseEvent.CLICK,doCli);</code></p>
<p><code> </code></p>
<p><code>function doCli(e:MouseEvent){<br />
gos.visible=false;<br />
stage.addEventListener(Event.ENTER_FRAME, loop);<br />
music.play();<br />
}</code></p>
<p>And now the function that does all the drawing and sound analyzing :<br />
<code>function loop(e:Event):void {<br />
spr.graphics.clear();//clear everything drawn<br />
spr.graphics.moveTo(-90,stage.stageHeight/2);//move the graphics outside the visible area </code></p>
<p><code> </code></p>
<p><code>SoundMixer.computeSpectrum(ba,true);//use the SoundMixer to analyze the sound</code></p>
<p><code>//create a for loop to set the properties of the line</code></p>
<p><code> </code></p>
<p><code>for (var i:uint=0; i&lt;256; i=i+4) {</code></p>
<p><code>var num:Number= ba.readFloat()*10;</code></p>
<p><code> var obj:Object=new Object();<br />
obj.x=mouseX;<br />
obj.y=mouseY;<br />
obj.thick=num+3;<br />
arr.push(obj);<br />
}</code></p>
<p><code>//use another for loop to draw<br />
for(var i2:uint=0;i2;i2&lt;arr.length;i2++){</code></p>
<p><code>//decrees the x position on every point to achieve the moving canvas effect<br />
arr[i2].x-=5;<br />
spr.graphics.lineStyle(arr[i2].thick);<br />
spr.graphics.lineTo(arr[i2].x,arr[i2].y);</code></p>
<p><code>//remove any point that goes beyond -100 on the x axis so that the app doesn't run slow<br />
if(arr[i2].x&lt;-100){<br />
arr.splice(i2,1);<br />
}<br />
}<br />
}</code></p>
<p>Now let&#8217;s test the movie and you should have something similar to this:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_sound_22600254"
			class="flashmovie"
			width="444"
			height="400">
	<param name="movie" value="http://jurnal.tripmedia.ro/wp-content/uploads/2010/03/sound.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://jurnal.tripmedia.ro/wp-content/uploads/2010/03/sound.swf"
			name="fm_sound_22600254"
			width="444"
			height="400">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>You can download the finished files <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2010/03/finished.rar" target="_blank">here</a>.</p>
<p>On the labuant website, your every movement is recorded so that you can play your custom &#8220;video&#8221; after you have finished &#8220;playing&#8221; with the site. In order to do this you could save all the data in a new array, and create a custom &#8220;for&#8221; loop to draw your movements automatic. Remember this is not the best way to do something like this, it is just an idea on how to do something like this.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fmusic-trail-follow-mouse%2F2414.html&amp;title=New%20Flash%20Tutorial%3A%20Music%20trail%20follows%20mouse" id="wpa2a_2">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/music-trail-follow-mouse/2414.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create a PDF file with Adobe AIR</title>
		<link>http://jurnal.tripmedia.ro/create-a-pdf-file-with-adobe-air/2382.html</link>
		<comments>http://jurnal.tripmedia.ro/create-a-pdf-file-with-adobe-air/2382.html#comments</comments>
		<pubDate>Tue, 09 Feb 2010 11:25:53 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2382</guid>
		<description><![CDATA[In this tutorial we will learn to create a pdf file with Adobe AIR and the help of an external library called AlivePDF. To get things started go to the AlivePDF download page and get the latest version of the API (in this tutorial I use the AlivePDF 0.1.5 RC version) and we can start [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2394" title="Adobe AIR PDF Tutorial" src="http://jurnal.tripmedia.ro/wp-content/uploads/2010/02/left_pic2.jpg" alt="" width="231" height="295" />In this tutorial we will learn to create a pdf file with Adobe AIR and the help of an external library called AlivePDF. To get things started go to the AlivePDF <a href="http://code.google.com/p/alivepdf/downloads/list" target="_blank">download page </a>and get the latest version of the API (in this tutorial I use the AlivePDF 0.1.5 RC version) and we can start coding our pdf creator app.<span id="more-2382"></span>Create a new Flash File(Adobe AIR) , add an input TextField with an instance name of &#8220;txt&#8221; and create a new button with an instance name of &#8220;but&#8221;; or download the starter files <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2010/02/start.rar" target="_blank">here</a>. Import the classes needed for this example:</p>
<p><code>import org.alivepdf.pdf.PDF;<br />
import org.alivepdf.layout.Size;<br />
import org.alivepdf.saving.Method;<br />
import org.alivepdf.layout.Unit;<br />
import org.alivepdf.layout.Orientation;</code></p>
<p>Now we can start creating our pdf file:</p>
<p><code>var doc:PDF=new PDF(Orientation.PORTRAIT,Unit.MM,Size.A4);</code></p>
<p><span style="color: #800000;">//you can have the orientation either in PORTRAIT or in LANDSCAPE mode<br />
//the unit can be: MM,POINT,CM,INCHES<br />
//Size defines the size of the document page witch can be: //A3,A4,A5,LETTER, LEGAL,TABLOID</span></p>
<p>To add a new page to the pdf file you simply call the addPage method:</p>
<p><code>doc.addPage();</code></p>
<p>Now let&#8217;s create the file and filestream, so we can save the pdf:</p>
<p><code>var stream:FileStream=new FileStream();<br />
var file:File=File.desktopDirectory.resolvePath("mydoc.pdf");<br />
stream.open(file,FileMode.WRITE);</code></p>
<p>The pdf file will be saved on the user&#8217;s desktop as we defined the path. Now it&#8217;s time for the function that creates and saves the file:</p>
<p><code>but.addEventListener(MouseEvent.CLICK,save);</code></p>
<p><code>function save(e:MouseEvent):void{<br />
doc.addText(txt.text,5,10);</code><span style="color: #800000;">//add the text from text input field and position it at the x:5 and y:10</span><br />
<code>var byte:ByteArray=doc.save(Method.LOCAL);</code><span style="color: #800000;"> //if you are publishing for a web application you should set the Method.REMOTE</span><br />
<code>stream.writeBytes(byte);<br />
stream.close();<br />
}</code></p>
<p>If we run our project we should have a little pdf creating app.You can download the finished source files <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2010/02/finish.rar" target="_blank">here</a>. The AlivePDF library has a lot of options like: adding an image to the file using the addImage(displayObject) method, or setting the font style, hyperlinks and much more. If you want to learn more about AlivePDF you can visit the official <a href="http://www.alivepdf.org/" target="_blank">site</a> , or the tutorials page <a href="http://www.alivepdf.org/?page_id=5" target="_blank">here </a>(tough some of the tutorials were written on an earlier version of the library and may not work with the current version).</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fcreate-a-pdf-file-with-adobe-air%2F2382.html&amp;title=Create%20a%20PDF%20file%20with%20Adobe%20AIR" id="wpa2a_4">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/create-a-pdf-file-with-adobe-air/2382.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TripMedia la Adobe AIR Boot Camp</title>
		<link>http://jurnal.tripmedia.ro/tripmedia-la-adobe-air-boot-camp/2366.html</link>
		<comments>http://jurnal.tripmedia.ro/tripmedia-la-adobe-air-boot-camp/2366.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:21:11 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Comunicare]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Adobe air]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2366</guid>
		<description><![CDATA[Sambata, 30 ianuarie, Tripmedia (doi dintre noi) a avut onoarea de a fi invitata la un eveniment organizat de LEC la sediul Adobe Romania. Evenimentul consta in prezentarea noului produs Adobe, Flash Builder, si a capabilitatilor noului Adobe Air 2 prin intermediul a 15 exemple care cresteau treptat in dificultate. Speaker la acest Boot Camp [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2379" title="Adobe Air Boot Camp" src="http://jurnal.tripmedia.ro/wp-content/uploads/2010/02/left_pic1.jpg" alt="" width="231" height="295" />Sambata, 30 ianuarie, Tripmedia (doi dintre noi) a avut onoarea de a fi invitata la un eveniment organizat de <a href="http://line-education-center.blogspot.com" target="_blank">LEC</a> la sediul Adobe Romania. Evenimentul consta in prezentarea noului produs Adobe, <a href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">Flash Builder</a>, si a capabilitatilor noului <a href="http://labs.adobe.com/technologies/air2/" target="_blank">Adobe Air 2</a> prin intermediul a 15 exemple care cresteau treptat in dificultate. Speaker la acest Boot Camp a fost <a href="http://corlan.org/" target="_blank">Mihai Corlan</a>, Platform Evangelist Adobe.<span id="more-2366"></span>In buna traditie a colegului meu Ciprian am intarziat la eveniment 15 minute, dar o data ce ne-am gasit locurile si ne-am instalat laptop-urile a inceput evenimentul. La eveniment au participat in jur de 30 de oameni, pasionati sau interesati de Adobe Air. Am inceput cu exemple de tip &#8220;Hello World&#8221; si am ajuns doar pana la exemplul 5: Reading and Writing Files to local hardisk, din cauza ca timpul alocat acestui Boot Camp a fost de doar 3 ore. S-au facut exmple dar s-a si discutat asupra lor sau a capabilitatilor noului Adobe Air 2. Evenimentul a fost un real succes, in ciuda timpului scurt acordat pentru efectuarea celor 15 exemple, din care fiecare participant a invatat ceva nou, dar din pacate nu s-a ajuns la exemplele care puneau in evidenta noile capabilitati ale Adobe Air 2. Partea buna este ca am primit cu totii exemplele finalizate, pe care le puteti descarca de <a href="http://corlan.org/downloads/air2/" target="_blank">aici</a>, si ca incep sa creasca in calitate evenimentele de acest gen organizate in Romania. Pentru mai multe informatii accesati <a href="http://line-education-center.blogspot.com/2010/02/follow-up-adobe-air-boot-camp.html" target="_blank">blogul LEC</a>, iar pentru imagini de la eveniment aruncati un click <a href="http://www.facebook.com/album.php?aid=146620&amp;id=146076483912" target="_blank">aici</a>.</p>
<p><img class="aligncenter size-full wp-image-2375" title="Adobe Air Boot Camp People" src="http://jurnal.tripmedia.ro/wp-content/uploads/2010/02/Untitled-1.jpg" alt="" width="444" height="333" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Ftripmedia-la-adobe-air-boot-camp%2F2366.html&amp;title=TripMedia%20la%20Adobe%20AIR%20Boot%20Camp" id="wpa2a_6">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/tripmedia-la-adobe-air-boot-camp/2366.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe-Mobile-Packager pe TripMobil</title>
		<link>http://jurnal.tripmedia.ro/adobe-mobile-packager/2249.html</link>
		<comments>http://jurnal.tripmedia.ro/adobe-mobile-packager/2249.html#comments</comments>
		<pubDate>Wed, 22 Jul 2009 11:08:07 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2249</guid>
		<description><![CDATA[De curand am descoperit ca prietenii nostri de la Adobe ne dau voie sa facem aplicatii pentru terminalele mobile prin intermediul noii lor aplicatii Adobe Mobile Packager care ne permita sa publicam ceea ce ne trece noua prin cap si sub forma de aplicatii pentru terminalele mobile. Urmand cursul firesc al evenimentelor si neputand sa [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-2256" title="Adobe Mobile Packager" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/07/left_pic3.jpg" alt="Adobe Mobile Packager" width="231" height="295" />De curand am descoperit ca prietenii nostri de la Adobe ne dau voie sa facem aplicatii pentru terminalele mobile prin intermediul noii lor aplicatii Adobe Mobile Packager care ne permita sa publicam ceea ce ne trece noua prin cap si sub forma de aplicatii pentru terminalele mobile. Urmand cursul firesc al evenimentelor si neputand sa ne stapanim curiozitatea am inceput sa testam capabilitatile noii aplicatii. <span id="more-2249"></span></p>
<p><img class="aligncenter size-full wp-image-2262" title="In game" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/07/print.jpg" alt="In game" width="477" height="509" /></p>
<p>Si ce tip de aplicatie era mai potrivita pentru asa ceva decat un joc (cu muste dupa ideea lui Ciprica si Maximilian)? Ce a iesit puteti vedea descarcand aplicatia de <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/07/bugs.rar" target="_blank">aici</a> pentru Windows Mobile (jocul este gandit pentru telefoanele cu touchscreen). Pentru a putea folosi Adobe Mobile Packager trebuie sa descarcati aplicatia de <a href="http://labs.adobe.com/technologies/distributableplayer/" target="_blank">aici</a>, o instalati apoi urmati pasii din tutorialele video de <a href="http://www.youtube.com/watch?v=ay9AjobZ_Jg&amp;feature=PlayList&amp;p=20BE62FD7F1E1A12&amp;index=0" target="_blank">aici</a>. Iar pentru a putea rula aplicatiile pe telefonul mobil va trebui sa descarcati o noua versiune de Flash Lite Player de <a href="http://labs.adobe.com/technologies/distributableplayer/" target="_blank">aici</a>. Momentan aplicatiile merg pe un numar restrans de telefoane mobile ce se gasesc in lista de <a href="http://labs.adobe.com/wiki/index.php/Distributable_Player:Supported_Devices" target="_blank">aici</a>. Trebuie sa recunoastem ca ne-am fi dorit o data cu lansarea acestei aplicatii sa avem mai mult control asupra terminalului mobil, dar poate vor veni in timp. Puteti descarca si sursa jocului de <a href="http:///jurnal.tripmedia.ro/wp-content/uploads/2009/07/sursa.rar">aici</a> pentru a vedea cum a fost creat.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fadobe-mobile-packager%2F2249.html&amp;title=Adobe-Mobile-Packager%20pe%20TripMobil" id="wpa2a_8">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/adobe-mobile-packager/2249.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Traductor para máximo Maximilian</title>
		<link>http://jurnal.tripmedia.ro/flash-google-translate/2187.html</link>
		<comments>http://jurnal.tripmedia.ro/flash-google-translate/2187.html#comments</comments>
		<pubDate>Wed, 15 Jul 2009 13:13:11 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Maximilian]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2187</guid>
		<description><![CDATA[Ne-am gandit sa-i facem o supriza lui Maximilian. Deoarece acesta a inceput recent sa se initieze in  limba spaniola, am decis sa ii aducem google translate pe pagina lui de start. Intre timp limba spaniola a devenit foarte populara la noi in birou, iar expresii precum: &#8220;yo quiero ir al baño, me llame más tarde&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/07/left_pic2.jpg"><img class="size-full wp-image-2200 alignnone" title="GTranslate" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/07/left_pic2.jpg" alt="GTranslate" width="231" height="295" /></a>Ne-am gandit sa-i facem o supriza lui Maximilian. Deoarece acesta a inceput recent sa se initieze in  limba spaniola, am decis sa ii aducem google translate pe pagina lui de start. Intre timp limba spaniola a devenit foarte populara la noi in birou, iar expresii precum: &#8220;yo quiero ir al baño, me llame más tarde&#8221;, &#8220;Tu conoces a Will Smith?&#8221; sunt utilizate din ce in ce mai des. Asa ca am creat acesta mica aplicatie in flash ce foloseste google translate pentru a traduce din engleza in spaniola.</p>
<p><span id="more-2187"></span></p>
<p><img class="aligncenter size-full wp-image-2206" title="GTranslate" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/07/pp.jpg" alt="GTranslate" width="317" height="178" /></p>
<p>Puteti descarca aplicatia de <a href="http:///jurnal.tripmedia.ro/wp-content/uploads/2009/07/gTranslate.air" target="_blank">aici</a>,iar pentru a vedea codul sursa sau pentru a schimba limbile (in caz ca se doreste invatarea unei alte limbi) puteti descarca sursa de <a href="http:///jurnal.tripmedia.ro/wp-content/uploads/2009/07/gTranslate.rar" target="_blank">aici</a>. Hasta luego!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fflash-google-translate%2F2187.html&amp;title=Google%20Traductor%20para%20m%C3%A1ximo%20Maximilian" id="wpa2a_10">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/flash-google-translate/2187.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Papervision 3D Loading Collada Files</title>
		<link>http://jurnal.tripmedia.ro/papervision-3d-loading-collada-files/2096.html</link>
		<comments>http://jurnal.tripmedia.ro/papervision-3d-loading-collada-files/2096.html#comments</comments>
		<pubDate>Mon, 08 Jun 2009 12:54:31 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[papervision3d]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2096</guid>
		<description><![CDATA[In this new tutorial I will show you the basics of importing a 3d model into papervision 3D. For this tutorial you need Adobe Flash , the papervision 3d library ( you can download it here ), and a 3d Modeling application (like Google Sketchup or 3DS Max) that exports the model in Collada format [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/06/left_picy.jpg"><img class="aligncenter size-full wp-image-2101" title="Papervision 3d tutorial" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/06/left_picy.jpg" alt="Papervision 3d tutorial" width="231" height="295" /></a>In this new tutorial I will show you the basics of importing a 3d model into papervision 3D. For this tutorial you need Adobe Flash , the papervision 3d library ( you can download it <a href="http://code.google.com/p/papervision3d/" target="_blank">here</a> ), and a 3d Modeling application (like Google Sketchup or 3DS Max) that exports the model in Collada format ( with the .dae extension).</p>
<p><span id="more-2096"></span> First you need to create you 3d model (for this tutorial I build a model that resembles a tank) or download a model from <a href="http://sketchup.google.com/3dwarehouse/" target="_blank">google 3D warehouse</a>. You can get the starter files here.</p>
<p>To get things started we create a new flash file and start importing all the papervision classes that we need:</p>
<p><code><br />
import org.papervision3d.scenes.Scene3D;<br />
import org.papervision3d.view.Viewport3D;<br />
import org.papervision3d.render.BasicRenderEngine;<br />
import org.papervision3d.objects.DisplayObject3D;<br />
import org.papervision3d.objects.parsers.Collada;<br />
import org.papervision3d.cameras.Camera3D;<br />
import org.papervision3d.materials.utils.MaterialsList;<br />
import org.papervision3d.materials.shadematerials.FlatShadeMaterial;<br />
import org.papervision3d.lights.PointLight3D;<br />
import org.papervision3d.materials.shaders.CellShader;</code></p>
<p>Now let&#8217;s prepare the 3d scene:</p>
<p><code>var cam:Camera3D=new Camera3D();<br />
var scena:Scene3D=new Scene3D();<br />
var view:Viewport3D=new Viewport3D();<br />
var pl:PointLight3D = new PointLight3D();<br />
var render:BasicRenderEngine=new BasicRenderEngine();</code></p>
<p>So in order to create a papervision scene we need a camera object, a scene3D, viewport3D and a RenderEngine this is necesary for a papervision scene.</p>
<p>Now create the materials:</p>
<p><code><span style="color: #800000;">//the glow filter will give a nice outer stroke to the 3d model</span><br />
var gf:GlowFilter=new GlowFilter(0x000000,1,5,5,4,1);<br />
<span style="color: #800000;">//this is a material from the papervision 3d library that uses a light to cast shadows on the objects</span><br />
var cs:CellShader = new CellShader(pl);<br />
<span style="color: #800000;">//the material list contains all the materials for the different faces, in this case all the faces<br />
//are flast shaded</span><br />
var ml:MaterialsList = new MaterialsList( { all:new FlatShadeMaterial(pl) } );</code></p>
<p>Now import the 3d model and add it to the scene object:</p>
<p><code>var tank:DisplayObject3D=new Collada("tnk.dae",ml);<br />
<span style="color: #800000;">//because the 3d modeling tool used is different this values may need some<br />
//trial and error before getting them right</span><br />
tank.scaleX=tank.scaleY=tank.scaleZ=0.3;<br />
tank.y=-300;<br />
tank.z=300;<br />
tank.rotationY=90;<br />
<span style="color: #800000;">//all you filters are not added to the actual model but on the viewport 3d</span><br />
view.filters=[gf];<br />
<span style="color: #800000;">//add the tank object to the scene 3d</span><br />
scena.addChild(tank);<br />
<span style="color: #800000;">//add the viewport to the flash display list</span><br />
addChild(view);</code></p>
<p>To be able to render animations you need to encapsulate the render function in a EnterFrame event:</p>
<p><code>addEventListener(Event.ENTER_FRAME,anim);</code></p>
<p><code>function anim(e:Event){<br />
tank.rotationY++;<br />
<span style="color: #800000;">//the renderScene function expects 3 parameters: the scene3D where all the objects are<br />
//the camera and the viewport3D</span><br />
render.renderScene(scena,cam,view);<br />
}</code></p>
<p>Now test the movie and you should get the following result:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_dae_1545514305"
			class="flashmovie"
			width="444"
			height="400">
	<param name="movie" value="http://jurnal.tripmedia.ro/wp-content/uploads/2009/06/dae.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://jurnal.tripmedia.ro/wp-content/uploads/2009/06/dae.swf"
			name="fm_dae_1545514305"
			width="444"
			height="400">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>You can download the final source files<a href="http:///jurnal.tripmedia.ro/wp-content/uploads/2009/06/final.rar" target="_blank"> here</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fpapervision-3d-loading-collada-files%2F2096.html&amp;title=Papervision%203D%20Loading%20Collada%20Files" id="wpa2a_12">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/papervision-3d-loading-collada-files/2096.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash BitmapData Glass Effect</title>
		<link>http://jurnal.tripmedia.ro/flash-bitmapdata-glass-effec/2050.html</link>
		<comments>http://jurnal.tripmedia.ro/flash-bitmapdata-glass-effec/2050.html#comments</comments>
		<pubDate>Mon, 11 May 2009 06:56:30 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[BitmapData]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=2050</guid>
		<description><![CDATA[In this new tutorial you will learn how to use BitmapData to draw an image and how to draw only one part of the desired image and apply an effect or transformation to it (in this case a blur effect). To get started we create a new MovieClip in the library and inside it another [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/05/left_pic.jpg"><img class="aligncenter size-full wp-image-2065" title="BitmapData tutorial" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/05/left_pic.jpg" alt="BitmapData tutorial" width="231" height="295" /></a>In this new tutorial you will learn how to use BitmapData to draw an image and how to draw only one part of the desired image and apply an effect or transformation to it (in this case a blur effect).<span id="more-2050"></span> To get started we create a new MovieClip in the library and inside it another MovieClip that will be the holder for our bitmapdata(it has an instance name of <em>&#8220;hld&#8221;</em>). Also import import in the flash file an image and convert it to MovieClip. If you don&#8217;t want to do all of this you should get the starter files <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/05/start.rar" target="_blank">here</a> .</p>
<p>Now let&#8217;s arrange our stage. First of all we add the MovieClip that contains the image and give it an instance name of <em>&#8220;img&#8221;</em> on top of that we add the holder and give it an instance name of <em>&#8220;scrol&#8221;</em>.</p>
<p>Let&#8217;s begin the coding: add the following code in the first frame&#8230;</p>
<p><code>var first:Boolean=true;<br />
var bmp:Bitmap=new Bitmap();</code></p>
<p>The variable <em>&#8220;first&#8221;</em> tell&#8217;s us if it&#8217;s the first time that we call the draw function, if not we can clear our bitmap called <em>&#8220;bmp&#8221;</em>.  Now will add an Event listener to our <em>&#8220;scrol&#8221;</em> MovieClip.</p>
<p><code>scrol.addEventListener(MouseEvent.MOUSE_DOWN,strtDrag);</code><br />
<code><br />
function strtDrag(e:MouseEvent){<br />
first=false;<span style="color: #800000;">//we set the variable first to false</span><br />
scrol.my=scrol.mouseY;<span style="color: #800000;">//we save the current mouse Y</span><br />
scrol.removeEventListener(MouseEvent.MOUSE_DOWN,strtDrag);<br />
scrol.addEventListener(MouseEvent.MOUSE_MOVE,repos);<br />
scrol.addEventListener(MouseEvent.MOUSE_UP,rem);<br />
}</code></p>
<p>When we mouse down on our <em>&#8220;scrol&#8221;</em> MovieClip we remove the event listener for mouse down and add two new events: one to listen for the mouse move event so that our movieclip will follow the mouse on the Y axis and another to listen for the mouse up event so we can stop the draging. Now let&#8217;s add our other functions.<br />
<code><br />
function rem(e:MouseEvent){<br />
scrol.addEventListener(MouseEvent.MOUSE_DOWN,strtDrag);<br />
scrol.removeEventListener(MouseEvent.MOUSE_MOVE,repos);<br />
scrol.removeEventListener(MouseEvent.MOUSE_UP,rem);<br />
}</code><br />
<code><br />
function repos(e:MouseEvent){<br />
scrol.y=mouseY-scrol.my;<span style="color: #800000;">//change the y position</span><br />
beginDraw();<span style="color: #800000;">//the function that does the bitmap drawing</span><br />
}</code></p>
<p>If you are asking: why not use <em>&#8220;startDrag()&#8221;</em> instead of all this code. The answer is that in order to use it only on the Y axis you should create a new Rectangle variable so you can limit it only on the Y axis. Because the center point of <em>&#8220;scrol&#8221;</em> is in the top left corner we need to substract from the current mouse position our variable. Now let&#8217;s create the beginDraw function:</p>
<p><code>function beginDraw() {<br />
if(!first){<br />
scrol.hld.removeChild(bmp);<br />
}<br />
var bmd:BitmapData=new BitmapData(scrol.width,scrol.height);<br />
var bmd2:BitmapData=new BitmapData(444,400);<br />
var rectangle:Rectangle=new Rectangle(0,scrol.y,scrol.width,scrol.height);<br />
bmd2.draw(img);<br />
bmd.copyPixels(bmd2,rectangle,new Point(0,0));<br />
bmd2.dispose();<br />
bmp.bitmapData=bmd;<br />
var bf:BlurFilter=new BlurFilter(6,6,3);<br />
bmp.filters=[bf];<br />
scrol.hld.addChild(bmp);<br />
}</code></p>
<p><code>beginDraw();</code></p>
<p>In order to draw just the part of the image that is under the <em>&#8220;scrol&#8221; </em>MovieClip,  create two bitmapData variables: one to copy the whole image and another to copy only the pixels that we need.Finally we add a blur filter to the bitmap and call our <em>&#8220;beginDraw&#8221;</em> function so we can see the effect the first time we enter the flash movie. When you test your movie it should look like this:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_blurs_1998139444"
			class="flashmovie"
			width="444"
			height="400">
	<param name="movie" value="http://jurnal.tripmedia.ro/wp-content/uploads/2009/05/blurs.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://jurnal.tripmedia.ro/wp-content/uploads/2009/05/blurs.swf"
			name="fm_blurs_1998139444"
			width="444"
			height="400">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>You can download the finished source files <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/05/finished.rar" target="_blank">here</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fflash-bitmapdata-glass-effec%2F2050.html&amp;title=Flash%20BitmapData%20Glass%20Effect" id="wpa2a_14">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/flash-bitmapdata-glass-effec/2050.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adobe Air simple RSS Reader</title>
		<link>http://jurnal.tripmedia.ro/adobe-air-rss-reader/1890.html</link>
		<comments>http://jurnal.tripmedia.ro/adobe-air-rss-reader/1890.html#comments</comments>
		<pubDate>Mon, 13 Apr 2009 07:38:30 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Adobe air]]></category>
		<category><![CDATA[RSS Reader]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=1890</guid>
		<description><![CDATA[This new tutorial is about loading and parsing a rss 2.0 feed (in this case the feed from our blog). For this tutorial you will need Adobe Flash and Adobe AIR. So, what is an RSS feed? With a little search on wikipedia you can find the answer to this question: RSS (an abbreviation for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/left_picu.jpg"><img class="aligncenter size-full wp-image-1946" title="Simple RSS Reader" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/left_picu.jpg" alt="Simple RSS Reader" width="231" height="295" /></a>This new tutorial is about loading and parsing a rss 2.0 feed (in this case the feed from our blog). For this tutorial you will need Adobe Flash and Adobe AIR. So, what is an RSS feed? With a little search on wikipedia you can find the answer to this question:<span id="more-1890"></span></p>
<p><strong>RSS</strong> (an abbreviation for <strong>Really Simple Syndication</strong>) is a family of Web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format&#8230; more information <a href="http://en.wikipedia.org/wiki/RSS_(file_format)" target="_blank">here</a>.</p>
<p>This is how the finished application will look like:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/finished.jpg"><img class="aligncenter size-full wp-image-1924" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/finished.jpg" alt="Adobe Air simple RSS reader" width="199" height="93" /></a></p>
<p>To get things  started I have created a new air file and drew the above graphics. The band at the top of the application holds the title of the post,  is a MovieClip with an instance name of &#8220;post&#8221; and inside it there is a dynamic textField with an instance name of &#8220;the_title&#8221;.  The black MovieClip that holds the text of the post has an instance name of &#8220;all&#8221; and inside it there is a dynamic textField with an instance name of &#8220;descrip&#8221;.You can get the starter files <a title="Start files" href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/start_files.rar" target="_blank">here</a>.</p>
<p>Let&#8217;s add the first lines of code:<br />
<code><span style="color: #800000;">//we declare our variables</span><br />
var loader:URLLoader = new URLLoader();<br />
var xml:XML;<br />
<span style="color: #800000;">//this will hold all the information<br />
//we need about the feed</span><br />
var posts:Array=new Array();<br />
<span style="color: #800000;">//this will remember which post we are reading</span><br />
var cur_comm:uint=0;<br />
<span style="color: #800000;">//this tells if the title is scrolling</span><br />
var scrolling:Boolean=true;<br />
<span style="color: #800000;">//the maximum scroll x position</span><br />
var relx:Number=0;</code></p>
<p>Now let&#8217;s add the event listeners that we need:<br />
<code><span style="color: #800000;">//listener for the rss feed</span><br />
loader.addEventListener(Event.COMPLETE, onLoaded);<br />
<span style="color: #800000;">//when you Mouse Down on the title area<br />
//you can drag the application</span><br />
top.addEventListener(MouseEvent.MOUSE_DOWN,misca);<br />
<span style="color: #800000;">//listener for the close button</span><br />
cls.addEventListener(MouseEvent.CLICK,closeapp);<br />
<span style="color: #800000;">//the listener that will scroll our title</span><br />
top.addEventListener(Event.ENTER_FRAME,scroll_text);<br />
cls.buttonMode=true;<br />
top.the_title.autoSize="left";</code></p>
<p>Now to create the timer that will display the posts from our feed:<br />
<code><span style="color: #800000;">//the timer expects time in milliseconds, 1000 milliseconds =1 sec</span><br />
var timerObject:Timer = new Timer(10000);<br />
<span style="color: #800000;">//at each 10 seconds it will change the post that we are viewing</span><br />
timerObject.addEventListener(TimerEvent.TIMER, start_comments);</code></p>
<p>Now we create the function that parses the feed, just like an xml file:<br />
<code><span style="color: #800000;">//the function that will parse the rss</span><br />
function onLoaded(e:Event):void{<br />
xml = new XML(e.target.data);<br />
<span style="color: #800000;">//all the information that we need<br />
//is located in the root.channel.item node<br />
//of the feed</span><br />
var il:XMLList=xml.channel.item;<br />
for(var i:uint=0;i<br />
<span style="color: #800000;">//create a new object</span><br />
var obj:Object=new Object();<br />
<span style="color: #800000;">//get the link for the full post</span><br />
obj.link=il[i].link.text();<br />
<span style="color: #800000;">//get the title of the post</span><br />
obj.title=il[i].title.text();<br />
<span style="color: #800000;">//get the description of the post</span><br />
obj.descr=il[i].description.text();<br />
<span style="color: #800000;">//add the object in our array</span><br />
posts.push(obj);<br />
}<br />
<span style="color: #800000;">//we start our timer object</span><br />
timerObject.start();<br />
<span style="color: #800000;">//we add our first post in the textFields</span><br />
all.descrip.htmlText=unescape(posts[0].descr);<br />
top.the_title.text=posts[0].title;<br />
<span style="color: #800000;">//create a new timer object, that refreshes<br />
//the feed every 10 minutes</span><br />
var timerObject2:Timer = new Timer(600000);<br />
timerObject2.addEventListener(TimerEvent.TIMER, refresh_feed);<br />
timerObject2.start();<br />
<span style="color: #800000;">//we add the event listener that handles<br />
//the clicks on out description</span><br />
all.addEventListener(MouseEvent.CLICK,go_page);<br />
}</code><br />
<code><span style="color: #800000;">//we load the feed</span><br />
loader.load(new URLRequest("http://jurnal.tripmedia.ro/feed"));</code></p>
<p>Now create the function that changes thepost that we are showing every 10 seconds:<br />
<code>function start_comments(e:TimerEvent):void{<br />
<span style="color: #800000;">//every time the timer reaches<br />
//10 seconds we change the post<br />
//that we are viewing</span><br />
cur_comm++;<br />
if(cur_comm&gt;posts.length-1){<br />
cur_comm=0;<br />
}<br />
all.descrip.htmlText=unescape(posts[cur_comm].descr);<br />
top.the_title.text=posts[cur_comm].title;<br />
}</code></p>
<p>Now the function that refreshes the feed every 10 minutes is actualy realoading the feed all over again:<br />
<code>function refresh_feed(e:TimerEvent):void{<br />
loader.load(new URLRequest("http://jurnal.tripmedia.ro/feed"));<br />
}</code></p>
<p>Next step is to create the function that will handle the closing of the application, the dragging of the application and the click that opens the web browser to read the full post :<br />
<code>function misca(evu:MouseEvent):void{<br />
this.stage.nativeWindow.startMove();<br />
}</code></p>
<p><code>function closeapp(e:MouseEvent):void {<br />
NativeApplication.nativeApplication.exit();<br />
}</code></p>
<p><code>function go_page(e:MouseEvent):void{<br />
var req:URLRequest=new URLRequest(posts[cur_comm].link);<br />
navigateToURL(req,"_self");<br />
}</code></p>
<p>And now our final function, the function that handles the scrolling of the title if it is too long to fit in our application:</p>
<p><code>function scroll_text(e:Event):void{<br />
<span style="color: #800000;">//we calculate the maximum x scroll<br />
//to the left</span><br />
relx=-(top.the_title.width-172);<br />
<span style="color: #800000;">//we scroll the text only if there are more<br />
//than 28 characters in it, if you are<br />
//wondering why 28? well 28 is the maximum<br />
//number of characters that the user can<br />
//see because of the the dynamic textField</span><br />
if(top.the_title.length&gt;28){<br />
<span style="color: #800000;">//if it is scrolling to the left</span><br />
if(scrolling){<br />
top.the_title.x-=0.3;<br />
<span style="color: #800000;">//if the title is lower than relx<br />
//we move tot the right</span><br />
if(top.the_title.x&lt;relx){<br />
scrolling=false;<br />
}<br />
}else if(!scrolling){<br />
top.the_title.x+=0.3;<br />
if(top.the_title.x&gt;0){<br />
scrolling=true;<br />
}<br />
}<br />
}<br />
}</code></p>
<p>You can download the finished application <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/finished.rar" target="_blank">here</a>. Or you can download the AIR Installer file <a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/04/rss.air" target="_blank">here</a>. From this example you can build you own rss reader application, there might be a couple of extensions to this app: letting the user input his own feed location, reading and displaying more feeds at once, alarm the user that there is a new feed, managing the feed where you can save all your feeds and cycle through them and many other features. Feel free to use the code as you like and share with us what you have created.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fadobe-air-rss-reader%2F1890.html&amp;title=Adobe%20Air%20simple%20RSS%20Reader" id="wpa2a_16">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/adobe-air-rss-reader/1890.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parse XML and 3D gallery in Adobe Flash CS4</title>
		<link>http://jurnal.tripmedia.ro/parse-xml-and-3d-gallery-adobe-flash-cs4/1696.html</link>
		<comments>http://jurnal.tripmedia.ro/parse-xml-and-3d-gallery-adobe-flash-cs4/1696.html#comments</comments>
		<pubDate>Thu, 12 Mar 2009 15:53:36 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[3D Gallery]]></category>
		<category><![CDATA[Adobe Flash CS4]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=1696</guid>
		<description><![CDATA[It&#8217;s time for a new tutorial, appropriate for beginners, too. This tutorial ilustrates a couple of basic stuff, for example how to load and parse a xml file. The tutorial also explains how to create a 3D gallery in Flash CS4 without any external 3D library. You must remember that  3D in Flash CS4 is  inferior to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/img.jpg"><img class="aligncenter size-full wp-image-1766" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/img.jpg" alt="img" width="231" height="295" /></a>It&#8217;s time for a new tutorial, appropriate for beginners, too. This tutorial ilustrates a couple of basic stuff, for example how to load and parse a xml file. The tutorial also explains how to create a 3D gallery in Flash CS4 without any external 3D library. You must remember that  3D in Flash CS4 is  inferior to 3D provided by engines like <a href="http://blog.papervision3d.org/" target="_blank">Papervision</a> or <a href="http://away3d.com/" target="_blank">Away3D</a> (there is no Z axis sorting, therefore adding a movieclip to the stage at 100 on the Z axis and then another at 500 on the Z axis, the last added movieclip lays in front, even though it should lay in the back). For this tutorial you  need only <a href="http://www.adobe.com/products/flash/" target="_blank">Adobe Flash CS4</a>.</p>
<p><span id="more-1696"></span></p>
<p>To start things off, I have created a new flash document called photo.fla and saved it, a xml file called gall.xml and 7 pics 200&#215;200. If you don&#8217;t have a desire for creating this files for yourself you may download the start files right <a title="Flash Tutorial" href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/start.rar" target="_blank">here</a>.</p>
<p>Let&#8217;s begin by creating the needed variables:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p1.jpg"><img class="aligncenter size-medium wp-image-1711" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p1-230x92.jpg" alt="Adobe Flash CS4 tutorial" width="230" height="92" /></a><br />
<code>var arr:Array=new Array();<span style="color: #800000;">//this holds out all xml data</span><br />
var pics:Array=new Array();<span style="color: #800000;">//this holds out all the images</span><br />
var str:Number=-90;<span style="color: #800000;">//this is for the maximum angle</span><br />
var decr:Number=0;<span style="color: #800000;">//this is the angle increment</span><br />
var nr:Number=0;<span style="color: #800000;">//this is the number of the picture</span><br />
var uldr:URLLoader=new URLLoader();<span style="color: #800000;">//the url loader variable to load the xml</span></code></p>
<p>Now let&#8217;s load the xml:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p2.jpg"><img class="aligncenter size-medium wp-image-1713" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p2-230x117.jpg" alt="Adobe Flash CS4 Tutorial" width="230" height="117" /></a><br />
<code><br />
<span style="color: #800000;">//add a new event listener for the loader</span><br />
uldr.addEventListener(Event.COMPLETE,doArr);<br />
<span style="color: #800000;">//load our xml</span><br />
uldr.load(new URLRequest("gall.xml"));</code></p>
<p>Now add the code for the Event.Complete function called doArr. This function parses the xml file.</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p3.jpg"><img class="aligncenter size-medium wp-image-1715" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p3-229x156.jpg" alt="Adobe Flash CS4 Tutorial" width="229" height="156" /></a></p>
<p><code><span style="color: #800000;">//create the Event.COMPLETE function that parses the xml</span><br />
function doArr(e:Event){<br />
<span style="color: #800000;">//create a new xml variable</span><br />
var xml:XML=new XML(e.target.data);<br />
<span style="color: #800000;">//create a new xml list variable</span><br />
var il:XMLList=xml.item;<br />
<span style="color: #800000;">//parse the xml</span><br />
for(var i:uint=0;i&lt;il.length();i++){<br />
arr.push(il[i].linku);<br />
}<br />
<span style="color: #800000;">//after the xml has been parsed, calculate the<br />
//rotation distance between photos</span><br />
decr=-Math.round((str/il.length()));<br />
<span style="color: #800000;">//call the function that creates the gallery</span><br />
createGall();<br />
}</code></p>
<p>Let&#8217;s construct the createGall function:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p4.jpg"><img class="aligncenter size-medium wp-image-1717" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p4-230x125.jpg" alt="Adobe Flash CS4 Tutorial" width="230" height="125" /></a><br />
<code><br />
<span style="color: #800000;">//create the function that loads our gallery images</span><br />
function createGall(){<br />
<span style="color: #800000;">//parse the array that contains our images</span><br />
for(var i:uint=0;i&lt;arr.length;i++){<br />
<span style="color: #800000;">//create a new url loader</span><br />
var ldr:Loader=new Loader();<br />
<span style="color: #800000;">//load the image locate at the i position in the array</span><br />
ldr.load(new URLRequest(arr[i]));<br />
<span style="color: #800000;">//add a new event listener that ads the image to the stage</span><br />
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,doImg);<br />
}<br />
}</code></p>
<p>Write the function that adds the gallery to the Stage.</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p5.jpg"><img class="aligncenter size-medium wp-image-1719" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p5-230x170.jpg" alt="Adobe Flash CS4 Tutorial" width="230" height="170" /></a></p>
<p><code>function doImg(e:Event){<br />
<span style="color: #800000;">//create a new movieclip to hold the image</span><br />
var t:MovieClip=new MovieClip();<br />
<span style="color: #800000;">//create a new sprite in wich to draw a white rectangle</span><br />
var spr:Sprite=new Sprite();<br />
<span style="color: #800000;">//we set the fill color to white</span><br />
spr.graphics.beginFill(0xFFFFFF);<br />
<span style="color: #800000;">//we draw the rectangle at x:0,y:0, width:210,height:210<br />
//that means +10 of the width and height of our image (200x200)</span><br />
spr.graphics.drawRect(0,0,210,210);<br />
<span style="color: #800000;">//and drawing</span><br />
spr.graphics.endFill();<br />
<span style="color: #800000;">//we position our sprite</span><br />
spr.x=-spr.width/2;<br />
spr.y=-spr.height+5;<br />
<span style="color: #800000;">//create a new bitmap that receives the loaded image</span><br />
var bm:Bitmap=Bitmap(e.target.content);<br />
<span style="color: #800000;">//position the image</span><br />
bm.x=-bm.width/2;<br />
bm.y=-bm.height;<br />
<span style="color: #800000;">//smooth the image</span><br />
bm.smoothing=true;<br />
<span style="color: #800000;">//add the sprite and image to our movieclip</span><br />
t.addChild(spr);<br />
t.addChild(bm);<br />
<span style="color: #800000;">//position the movieclip on the stage</span><br />
t.x=300;<br />
t.y=300;<br />
<span style="color: #800000;">//set the rotation in 3d space</span><br />
t.rotationY=-40;<br />
t.rotationX=str;<br />
str+=decr;<br />
<span style="color: #800000;">//create a new rot property for the movieclip<br />
//that holds the rotation on the X axis</span><br />
t.rot=t.rotationX;<br />
<span style="color: #800000;">//the number of the picture</span><br />
t.nr=nr;<br />
nr++;<br />
<span style="color: #800000;">//push the picture in the pics array</span><br />
pics.push(t);<br />
<span style="color: #800000;">//add the movieclip to the Stage</span><br />
addChild(t);<br />
<span style="color: #800000;">//add a new event listener to the movieclip<br />
//that animates our gallery when we click an image</span><br />
t.addEventListener(MouseEvent.CLICK,entr);<br />
}</code></p>
<p>Now let&#8217;s write the click function that animates the gallery:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p6.jpg"><img class="aligncenter size-medium wp-image-1721" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p6-230x165.jpg" alt="Adobe Flash CS4 Tutorial" width="230" height="165" /></a></p>
<p><code>function entr(e:MouseEvent){<br />
<span style="color: #800000;">//check to see if the clicked image is in front</span><br />
if(e.currentTarget.nr==nr-1){<br />
nr-=1;<br />
<span style="color: #800000;">//add a new event to the clicked image</span><br />
e.currentTarget.addEventListener(Event.ENTER_FRAME,anim);<br />
for(var i:uint=0;i&lt;pics.length;i++){<br />
<span style="color: #800000;">//all the images in a lower postion than the clicked image<br />
//are animated with another function</span><br />
if(i&lt;e.currentTarget.nr){<br />
<span style="color: #800000;">//create a temporary movieclip</span><br />
var tmp:MovieClip=MovieClip(pics[i]);<br />
<span style="color: #800000;">//animate th movieclip</span><br />
tmp.addEventListener(Event.ENTER_FRAME,anim2);<br />
}<br />
}<br />
<span style="color: #800000;">//remove the click event from the current clicked image</span><br />
e.currentTarget.removeEventListener(MouseEvent.CLICK,entr);<br />
}<br />
}</code></p>
<p>Add the following code to create the first animation function:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p7.jpg"><img class="aligncenter size-medium wp-image-1722" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p7-230x107.jpg" alt="Adobe Flash CS4 Tutorial" width="230" height="107" /></a><br />
<code><br />
function anim(e:Event){<br />
if(e.currentTarget.rotationX&lt;90){<br />
<span style="color: #800000;">//roatate the front image</span><br />
e.currentTarget.rotationX+=(90-e.currentTarget.rotationX)/10;<br />
<span style="color: #800000;">//decrease the alpha of the image</span><br />
e.currentTarget.alpha+=(0-e.currentTarget.alpha)/10;<br />
}<br />
}</code></p>
<p>Now the code that animates the rest of the images:</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p8.jpg"><img class="aligncenter size-medium wp-image-1724" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/p8-230x134.jpg" alt="Adobe Flash CS4 Tutorial" width="230" height="134" /></a></p>
<p><code>function anim2(e:Event){<br />
<span style="color: #800000;">//calculate the rotation at wich the picture<br />
//will be set at the final of the animation</span><br />
var nrx:Number=e.currentTarget.rot+decr;<br />
<span style="color: #800000;">//animate the rotation</span><br />
e.currentTarget.rotationX+=Math.round((nrx-e.currentTarget.rotationX)/10);<br />
<span style="color: #800000;">//check to see the rotation value</span><br />
if(e.currentTarget.rotationX&gt;=nrx-4){<br />
<span style="color: #800000;">//remove this function</span><br />
e.currentTarget.removeEventListener(Event.ENTER_FRAME,anim2);<br />
<span style="color: #800000;">//set the rot property</span><br />
e.currentTarget.rot=nrx;<br />
}<br />
}</code></p>
<p>Let&#8217;s test our movie to see the final result:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_photo_722194586"
			class="flashmovie"
			width="444"
			height="400">
	<param name="movie" value="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/photo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/photo.swf"
			name="fm_photo_722194586"
			width="444"
			height="400">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>You can get the final source files <a title="Flash Tutorial" href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/photo.rar" target="_blank">here</a> , play with it and show me what you come up with.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fparse-xml-and-3d-gallery-adobe-flash-cs4%2F1696.html&amp;title=Parse%20XML%20and%203D%20gallery%20in%20Adobe%20Flash%20CS4" id="wpa2a_18">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/parse-xml-and-3d-gallery-adobe-flash-cs4/1696.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adobe Air HTML Tutorial</title>
		<link>http://jurnal.tripmedia.ro/adobe-air-html-tutorial/1732.html</link>
		<comments>http://jurnal.tripmedia.ro/adobe-air-html-tutorial/1732.html#comments</comments>
		<pubDate>Sun, 08 Mar 2009 17:26:07 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[Adobe air]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=1732</guid>
		<description><![CDATA[Today I have decided to start with a simple tutorial that quickly shows what Adobe Air can do. So for this tutorial we will create a simple web browser. To do this you need Adobe Flash CS4 and Adobe AIR 1.5 .  Adobe AIR uses Webkit to render the HTML content, the same engine that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/tutx.jpg"><img class="aligncenter size-medium wp-image-1735" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/03/tutx-230x293.jpg" alt="Flash and Air and Tutorial" width="230" height="293" /></a>Today I have decided to start with a simple tutorial that quickly shows what Adobe Air can do. So for this tutorial we will create a simple web browser. To do this you need <a href="http://www.adobe.com/products/flash/" target="_blank">Adobe Flash CS4</a> and <a href="http://www.adobe.com/products/air/" target="_blank">Adobe AIR 1.5</a> .  Adobe AIR uses <a href="http://webkit.org/" target="_blank">Webkit</a> to render the HTML content, the same engine that powers <a href="http://www.apple.com/safari/" target="_blank">Safari</a>.</p>
<p><span id="more-1732"></span>Let&#8217;s get started by creating a new flash file and adding the following code:</p>
<p><code><span style="color: #800000;">Create a new HTML loader variable</span><br />
var htmlL:HTMLLoader=new HTMLLoader();<br />
<span style="color: #800000;">set the dimensions of your html content to the<br />
dimensions of the stage</span><br />
htmlL.width=stage.stageWidth;<br />
htmlL.height=stage.stageHeight;<br />
<span style="color: #800000;">add the html to the stage</span><br />
addChild(htmlL);<br />
<span style="color: #800000;">this next line disables cache for your browser<br />
if you set it to true when you revisit a web page<br />
it will take some components of that web site from<br />
the cache saved on your computer</span><br />
htmlL.cacheResponse=false;<br />
<span style="color: #800000;">this loads the desired web page</span><br />
htmlL.load(new URLRequest("http://tripmedia.ro"));</code></p>
<p>Now test your file and you will see the web page. This is just an example to show what Adobe Air can do, the browser is not completly functional because the user can not input the adress and there is no UI(user interface) . But this is something that everybody can experiment with and let their imagination loose.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fadobe-air-html-tutorial%2F1732.html&amp;title=Adobe%20Air%20HTML%20Tutorial" id="wpa2a_20">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/adobe-air-html-tutorial/1732.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adobe AIR &amp; Flash Tutorial</title>
		<link>http://jurnal.tripmedia.ro/phone-book-adobe-air/1536.html</link>
		<comments>http://jurnal.tripmedia.ro/phone-book-adobe-air/1536.html#comments</comments>
		<pubDate>Tue, 24 Feb 2009 08:36:04 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[Adobe air]]></category>
		<category><![CDATA[baze de date]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=1536</guid>
		<description><![CDATA[It&#8217;s time for a new tutorial. Now let&#8217;s move to the intermediate users who have basic knowledge of Adobe Flash and are starting to use Adobe AIR . Let&#8217;s build a little address book application using the power of Adobe AIR and a local database (note that this is just an introduction to air and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/left_pic.jpg"><img class="aligncenter size-full wp-image-1611" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/left_pic.jpg" alt="left_pic" width="231" height="295" /></a>It&#8217;s time for a new tutorial. Now let&#8217;s move to the intermediate users who have basic knowledge of Adobe Flash and are starting to use Adobe AIR . Let&#8217;s build a little address book application using the power of Adobe AIR and a local database (note that this is just an introduction to air and local mysql lite databases).</p>
<p>First &#8230; What is Adobe AIR? Adobe AIR is a cross-platform <span class="mw-redirect">runtime environment</span> for building rich Internet applications using Adobe Flash, Adobe Flex, HTML, or Ajax, that can be deployed as a desktop application.<span id="more-1536"></span></p>
<p>For this tutorial you will need at least <a href="http://www.adobe.com/products/flash/">Adobe Flash CS3</a> and the latest <a href="http://www.adobe.com/products/air/develop/flash/">Adobe Air</a> runtime for Flash. In order to start our application I&#8217;ve created a background movie clip called &#8220;<em>back</em>&#8221; , two buttons (one to add new contacts with an instance name of &#8220;<em>plus</em>&#8221; and one to close the application with an instance name of &#8220;<em>xu</em>&#8220;). In the first frame I have a combo box component with an instance name of &#8220;<em>lister</em>&#8221; , in the second frame two input text fields with the instance names of &#8220;<em>nume</em>&#8221; and &#8220;<em>tel</em>&#8220;. If you don&#8217;t want to create this for yourself you can download the <a title="Start files" href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/start.rar" target="_blank">start.fla file</a>.<br />
<a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p1.jpg"><img class="aligncenter size-medium wp-image-1542" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p1-230x163.jpg" alt="Pasul 1" width="230" height="163" /></a></p>
<p>Add the following code to the first frame of your movie:</p>
<p><code>stop();</code></p>
<p style="text-align: left;"><code><span style="color: #800000;">//create a new sql connection</span><br />
var conn:SQLConnection= new SQLConnection();<br />
<span style="color: #800000;">//add an event handeler for the open event</span><br />
conn.addEventListener(SQLEvent.OPEN, openHandler);<br />
<span style="color: #800000;">//create the database if it doesn't exist, otherwise just opens it</span><br />
var dbFile:File =File.applicationDirectory.resolvePath ("exemplu.db");<br />
conn.openAsync(dbFile);</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p2.jpg"><img class="aligncenter size-medium wp-image-1546" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p2-230x125.jpg" alt="pasul2" width="230" height="125" /></a></p>
<p>Now add a new function that creates a table in the database. To do so, write the following code in the first frame of your application:</p>
<p><code>function openHandler(event:SQLEvent):void {<br />
<span style="color: #800000;">//create a new sql statement</span><br />
var sql:SQLStatement=new SQLStatement();<br />
<span style="color: #800000;">//set the statement to connect to our database</span><br />
sql.sqlConnection=conn;<br />
<span style="color: #800000;">//parse the sql command that creates the table if it doesn't exist</span><br />
sql.text= "CREATE TABLE IF NOT EXISTS contacte(" +<br />
"id INTEGER PRIMARY KEY AUTOINCREMENT, " +<br />
"nume TEXT, " +<br />
"telefon INTEGER)";<br />
<span style="color: #800000;">//add a new event listener to the sql when it completes </span>creating the table<br />
sql.addEventListener(SQLEvent.RESULT,retrieveData);<br />
<span style="color: #00ff00;"><span style="color: #800000;">/</span><span style="color: #800000;">/call the execute function to execute our statement</span></span><br />
sql.execute();<br />
}</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p3.jpg"><img class="aligncenter size-medium wp-image-1553" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p3-230x147.jpg" alt="Pasul 3" width="230" height="147" /></a></p>
<p>The next step is to create the function that retrieves the data from the table in the database. Just write the following code in the first frame of your application:</p>
<p><code>function retrieveData(event:SQLEvent = null):void {<br />
<span style="color: #800000;">//create a new sql statemant</span><br />
var sql:SQLStatement = new SQLStatement();<br />
sql.sqlConnection=conn;<br />
<span style="color: #800000;">//this sql command retrieves all the fields from our<br />
//table in the database and orders it by name</span><br />
sql.text =  "SELECT id, nume, " +<br />
"telefon " +<br />
"FROM contacte ORDER BY nume";<br />
<span style="color: #800000;">//add a new event listener if there is data<br />
//to display it</span><br />
sql.addEventListener(SQLEvent.RESULT, selectHandler);<br />
sql.execute();<br />
}</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p4.jpg"><img class="aligncenter size-medium wp-image-1561" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p4-230x177.jpg" alt="Pasul 4" width="230" height="177" /></a></p>
<p>Now it is time to create the function that shows the contacts in the list component. To create it just insert in the first frame of your file the following code:</p>
<p><code>function selectHandler(event:SQLEvent):void {<br />
<span style="color: #800000;">//first we clear our list</span><br />
lister.removeAll();<br />
<span style="color: #800000;">//the we create a result variable that holds<br />
//all our contacts</span><br />
var result:SQLResult=event.target.getResult();<br />
<span style="color: #800000;">//we check if results is not empty</span><br />
if (result!=null&amp;&amp;result.data!=null) {<br />
<span style="color: #800000;">//and we add a new item to our list for<br />
//each contact in our database</span><br />
for (var i:Number = 0; i &lt; result.data.length; i++) {<br />
lister.addItem ({ label:result.data[i].nume + "-" +result.data[i].telefon<br />
, nr:result.data[i].id });<br />
}<br />
}<br />
}</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p5.jpg"><img class="aligncenter size-medium wp-image-1565" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p5-230x145.jpg" alt="Pasul 5" width="230" height="145" /></a></p>
<p>Now to add some code to our buttons :</p>
<p><code>plus.addEventListener(MouseEvent.CLICK,adder);<br />
xu.addEventListener(MouseEvent.CLICK,closeapp);<br />
back.addEventListener(MouseEvent.MOUSE_DOWN,drag);<br />
<span style="color: #800000;">//because my buttons are not real buttons<br />
//but movieclips i need to set the<br />
//buttonMode property to true</span><br />
plus.buttonMode=true;<br />
xu.buttonMode=true;</code></p>
<p><code>function adder(e:MouseEvent):void{<br />
<span style="color: #800000;">//remove the eventlistener and move to the<br />
//next frame</span><br />
plus.removeEventListener(MouseEvent.CLICK,adder);<br />
nextFrame();<br />
}</code></p>
<p><code>function closeapp(e:MouseEvent):void {<br />
<span style="color: #800000;">//close the application</span><br />
NativeApplication.nativeApplication.exit();<br />
}</code></p>
<p><code>function drag(e:MouseEvent):void {<br />
<span style="color: #800000;">//drag the application</span><br />
this.stage.nativeWindow.startMove();<br />
}</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p6.jpg"><img class="aligncenter size-medium wp-image-1575" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p6-230x152.jpg" alt="Pasul 6" width="230" height="152" /></a></p>
<p>You&#8217;ve finished the first frame, it&#8217;s time to go to the second frame where we add the contacts. Start by adding the next code:</p>
<p><code><span style="color: #800000;">//this line restricts the user input<br />
//to just numbers in the phone input box</span><br />
tel.restrict="0-9";<br />
<span style="color: #800000;">//add a new event listener to our plus button</span><br />
plus.addEventListener(MouseEvent.CLICK,adder2);</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p7.jpg"><img class="aligncenter size-medium wp-image-1578" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p7-230x132.jpg" alt="Pasul 7" width="230" height="132" /></a></p>
<p>Now create the final function that adds a new contact in the database:</p>
<p><code>function adder2(e:MouseEvent):void {<br />
<span style="color: #800000;">//create a new sql statement variable</span><br />
var sql:SQLStatement=new SQLStatement();<br />
sql.sqlConnection=conn;<br />
<span style="color: #800000;">//the next sql command creates a new entry<br />
//in the table contacte from our database</span><br />
sql.text =  "INSERT INTO contacte(nume, " +<br />
"telefon)" +<br />
"VALUES(@nume, " +<br />
"@telefon)";<br />
<span style="color: #800000;">//to insert variables into sql commnads<br />
//we use the parameters definition</span><br />
sql.parameters["@nume"]=nume.text;<br />
sql.parameters["@telefon"]=tel.text;<br />
<span style="color: #800000;">//add a new event listener that calls the<br />
//function that retrieves the data</span><br />
sql.addEventListener(SQLEvent.RESULT,retrieveData);<br />
sql.execute();<br />
<span style="color: #800000;">//go to frame no. 1</span><br />
prevFrame();<br />
<span style="color: #800000;">//remove the eventlistener from our plus button</span><br />
plus.removeEventListener(MouseEvent.CLICK,adder2);<br />
}</code></p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p8.jpg"><img class="aligncenter size-medium wp-image-1582" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/p8-230x223.jpg" alt="Pasul 8" width="230" height="223" /></a></p>
<p>Now you can test the application like you would normaly do (CTRL+Enter on windows or command+enter on Mac). This is how my finished application looks like on desktop.</p>
<p><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/finished.jpg"><img class="aligncenter size-medium wp-image-1583" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/finished-230x216.jpg" alt="finished" width="230" height="216" /></a></p>
<p>Now to publish the file as an Air application, so that other users can use the application, go to File&gt;AIR Settings . A new window will appear; you can set whatever names in there but be sure to set the Window Style to Custom Chrome (transparent). Press the Publish AIR file button that creates an air installer file in the same directory where you&#8217;ve saved your .fla file. <a title="Final sources" href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/final.rar" target="_blank">Here</a> is the finished source file.</p>
<p>This tutorial is just to get you started on using Adobe AIR. It is not a complete application, because there are some missing functions. For example there is no checking to see that the users input is not empty. You can not delete or  modify a contact and the list could go on, the only limit is your imagination. If you want to add extra features to your application, you should use the same techniques shown in this tutorial. For more Sql commands you should use google or ask Maximilian to search what you want to modify in the database.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fphone-book-adobe-air%2F1536.html&amp;title=Adobe%20AIR%20%26%23038%3B%20Flash%20Tutorial" id="wpa2a_22">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/phone-book-adobe-air/1536.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Carti de vizita la Tripmedia</title>
		<link>http://jurnal.tripmedia.ro/carti-de-vizita-la-tripmedia/1379.html</link>
		<comments>http://jurnal.tripmedia.ro/carti-de-vizita-la-tripmedia/1379.html#comments</comments>
		<pubDate>Fri, 06 Feb 2009 14:19:41 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Diverse]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[carti vizita]]></category>
		<category><![CDATA[papervision3d]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=1379</guid>
		<description><![CDATA[Avand in vedere ca nu ne putem lauda la toata lumea cu noile noastre carti de vizita, ne-am gandit sa vi le prezentam intr-un mod inedit si in acelasi timp sa ne &#8220;jucam&#8221; un pic in Flash. Pe langa Flash am adaugat si putin Papervision3D 2.0 si pentru umbra o clasa aparte numita ShadowCaster. Vizionare [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/cartivizita.jpg"><img class="size-full wp-image-1387 aligncenter" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/cartivizita.jpg" alt="Carti de vizita la Tripmedia" width="231" height="295" /></a></p>
<p style="text-align: left;">Avand in vedere ca nu ne putem lauda la toata lumea cu noile noastre carti de vizita, ne-am gandit sa vi le prezentam intr-un mod inedit si in acelasi timp sa ne &#8220;jucam&#8221; un pic in Flash.<span id="more-1379"></span> Pe langa Flash am adaugat si putin <a href="http://code.google.com/p/papervision3d/">Papervision3D 2.0</a> si pentru umbra o clasa aparte numita <a href="http://blog.zupko.info/?p=146">ShadowCaster</a>. Vizionare placuta!</p>
<p style="text-align: left;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_carti_1704769946"
			class="flashmovie"
			width="444"
			height="400">
	<param name="movie" value="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/carti.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://jurnal.tripmedia.ro/wp-content/uploads/2009/02/carti.swf"
			name="fm_carti_1704769946"
			width="444"
			height="400">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Fcarti-de-vizita-la-tripmedia%2F1379.html&amp;title=Carti%20de%20vizita%20la%20Tripmedia" id="wpa2a_24">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/carti-de-vizita-la-tripmedia/1379.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial AS 3.0 ComputeSpectrum</title>
		<link>http://jurnal.tripmedia.ro/tutorial-as-30-computespectrum/133.html</link>
		<comments>http://jurnal.tripmedia.ro/tutorial-as-30-computespectrum/133.html#comments</comments>
		<pubDate>Fri, 30 Jan 2009 12:18:18 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[tutoriale]]></category>

		<guid isPermaLink="false">http://jurnal.tripmedia.ro/?p=82</guid>
		<description><![CDATA[Pentru acest exemplu aveti nevoie de Adobe Flash si cunostiinte de baza in Action Script 3.0 . Pornim prin a creea un nou document flash ActionScript 3.0. Salvam acest document cu numele de Spectrum.fla, apoi selectăm primul keyframe al acestui document si apasam tasta F9 pentru a ne aduce in fata fereastra de programare. In [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --><img class="alignnone size-full wp-image-122" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/spectrum.jpg" alt="Flash Tutorial" width="231" height="295" />Pentru acest exemplu aveti nevoie de Adobe Flash si cunostiinte de baza in Action Script 3.0 .</p>
<p class="MsoNormal">Pornim prin a creea un nou document flash ActionScript 3.0. Salvam acest document cu numele de Spectrum.fla, apoi selectăm primul keyframe al acestui document si apasam tasta F9 pentru a ne aduce in fata fereastra de programare.</p>
<p class="MsoNormal">
<div id="attachment_106" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-106" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas2.jpg" alt="Pasul 1" width="444" height="333" /><p class="wp-caption-text">Pasul 1</p></div>
<p class="MsoNormal">
<p class="MsoNormal">In fereastra de programare introducem urmatoarea linie de cod:</p>
<p class="MsoNormal">var muzica=new Sound(new URLRequest(&#8220;song.mp3&#8243;));<span id="more-133"></span></p>
<p class="MsoNormal">
<div id="attachment_107" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-107" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas3.jpg" alt="Pasul 3" width="444" height="333" /><p class="wp-caption-text">Pasul 3</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Aici declaram variabila <em>muzica</em> fiind de tipul <em>Sound</em>, iar pentru a incarca melodia noastra,<em>song.mp3</em>,(care se afla an acelasi director cu Spectrum.fla) folosim comanda <em>new URLRequest</em>.</p>
<p class="MsoNormal">Apoi adaugam o noua variabila ce va tine toată informatia de care avem nevoie pentru a creea Spectrumul.</p>
<p class="MsoNormal">var ba:ByteArray= new ByteArray();</p>
<p class="MsoNormal">
<div id="attachment_108" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-108" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas4.jpg" alt="Pasul 3" width="444" height="333" /><p class="wp-caption-text">Pasul 3</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Dupa care adaugam o noua variabila de tip <em>Sprite</em> ce va contine toata grafica necesara si o adaugam pe scena principala.</p>
<p class="MsoNormal">var grafica:Sprite=new Sprite();</p>
<p class="MsoNormal">addChild(grafica);</p>
<p class="MsoNormal">
<div id="attachment_109" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-109" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas5.jpg" alt="Pasul 4" width="444" height="333" /><p class="wp-caption-text">Pasul 4</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Urmeaza sa construim o noua functie numita <em>loop</em> care ne va procesa toata informatia</p>
<p class="MsoNormal">function loop(e:Event):void{</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">
<div id="attachment_110" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-110" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas6.jpg" alt="Pasul 5" width="444" height="333" /><p class="wp-caption-text">Pasul 5</p></div>
<p class="MsoNormal">
<p class="MsoNormal">In interiorul functiei <em>loop</em> adaugam urmatoarele linii de cod:</p>
<p class="MsoNormal">grafica.graphics.clear();<br />
grafica.graphics.lineStyle(1,0&#215;000000);<br />
grafica.graphics.beginFill(0&#215;000000);</p>
<p class="MsoNormal">
<div id="attachment_111" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-111" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas7.jpg" alt="Pasul 6" width="444" height="333" /><p class="wp-caption-text">Pasul 6</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Aceasta linie de cod ne sterge orice am “desenat” in pasii anteriori</p>
<p class="MsoNormal">grafica.graphics.clear();</p>
<p class="MsoNormal">Aceasta linie de cod defineste stilul liniei, cifra 1 reprezentand grosimea liniei, iar 0&#215;000000 reprezinta culoarea neagra in sistem hexadecimal</p>
<p class="MsoNormal">grafica.graphics.lineStyle(1,0&#215;000000);</p>
<p class="MsoNormal">Aceasta linie de cod ne defineste culoarea care va “umple” Spectrumul, in cazul nostru folosim tot culoarea neagra</p>
<p class="MsoNormal">grafica.graphics.beginFill(0&#215;000000);</p>
<p class="MsoNormal">Acum vom folosi functia din flash ,<em>SoundMixer.computeSpectrum</em> , ce ne va oferi informatii legate de melodie</p>
<p class="MsoNormal">SoundMixer.computeSpectrum(ba,true);</p>
<p class="MsoNormal">
<div id="attachment_112" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-112" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas8.jpg" alt="Pasul 7" width="444" height="333" /><p class="wp-caption-text">Pasul 7</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Dupa care vom creea un ciclu <em>for</em> care ne va “desena” spectrumul prin functia <em>drawRect</em></p>
<p class="MsoNormal">for(var i:uint=0; i&lt;512;i++){</p>
<p class="MsoNormal">var num:Number=-ba.readFloat()*100-10;</p>
<p class="MsoNormal">sp.graphics.drawRect(i,200,1,num);</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">
<div id="attachment_113" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-113" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas9.jpg" alt="Pasul 8" width="444" height="333" /><p class="wp-caption-text">Pasul 8</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Iar acum adaugam un <em>event listener</em> pentru scena</p>
<p class="MsoNormal">addEventListener(Event.ENTER_FRAME, loop);</p>
<p class="MsoNormal">Si apelam functia <em>play</em></p>
<p class="MsoNormal">muzica.play();</p>
<p class="MsoNormal">
<div id="attachment_114" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-114" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/pas10.jpg" alt="Pasul 9" width="444" height="333" /><p class="wp-caption-text">Pasul 9</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Apoi testam aplicatia cu tastele CTRL+Enter si obtinem urmatorul rezultat:</p>
<p class="MsoNormal">
<div id="attachment_115" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-115" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/rezultat.jpg" alt="Rezultat" width="444" height="333" /><p class="wp-caption-text">Rezultat</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Acum puteti experimenta cu acest cod pentru a obtine mai multe rezultate. De exemplu daca schimam urmatoarea linie de cod</p>
<p class="MsoNormal">SoundMixer.computeSpectrum(ba,false);</p>
<p class="MsoNormal">Vom obtine</p>
<p class="MsoNormal">
<div id="attachment_116" class="wp-caption aligncenter" style="width: 454px"><img class="size-full wp-image-116" src="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/rezultat2.jpg" alt="Rezultat 2" width="444" height="333" /><p class="wp-caption-text">Rezultat 2</p></div>
<p class="MsoNormal">
<p class="MsoNormal">Daca schimbati in ciclul <em>for</em></p>
<p class="MsoNormal">for(var i:uint=0; i&lt;256;i++)</p>
<p class="MsoNormal">veti obtine un spectrum calculat doar pentru un canal audio.Putem seta pozitia pe orizontala a elementului <em>grafica</em></p>
<p class="MsoNormal">grafica.x=20;</p>
<p class="MsoNormal">iar apoi facem urmatoarele modificari in ciclul <em>for</em></p>
<p class="MsoNormal">for(var i:uint=0; i&lt;256;i=i+4){</p>
<p class="MsoNormal">var num:Number=-ba.readFloat()*100-1;</p>
<p class="MsoNormal">grafica.graphics.drawRect(i,200,1,num);</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">Pentru a obtine urmatorul rezultat:</p>
<p class="MsoNormal">
<p class="MsoNormal">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_spectrum_1366110422"
			class="flashmovie"
			width="444"
			height="400">
	<param name="movie" value="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/spectrum.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/spectrum.swf"
			name="fm_spectrum_1366110422"
			width="444"
			height="400">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
Apasa <span style="color: #ff0000;"><a title="Sursa" href="http://jurnal.tripmedia.ro/wp-content/uploads/2009/01/Tutorial_spectrum.rar" target="_blank">aici</a></span> pentru a descarca sursele.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjurnal.tripmedia.ro%2Ftutorial-as-30-computespectrum%2F133.html&amp;title=Tutorial%20AS%203.0%20ComputeSpectrum" id="wpa2a_26">Articol favorit</a></p>]]></content:encoded>
			<wfw:commentRss>http://jurnal.tripmedia.ro/tutorial-as-30-computespectrum/133.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
