<?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>DoItFlash</title>
	<atom:link href="http://doitflash.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://doitflash.com</link>
	<description>What&#039;s TextArea</description>
	<lastBuildDate>Sun, 08 Apr 2012 08:16:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>full facebook paypal store with CMS</title>
		<link>http://doitflash.com/full-facebook-paypal-store-with-cms/</link>
		<comments>http://doitflash.com/full-facebook-paypal-store-with-cms/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 08:08:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=487</guid>
		<description><![CDATA[Checkout our brand new Facebbok store, exclusively for sale on Activeden With our facebook shop, you can easily sell your products directly within your facebook page. It supports both digital and physical products. For digital products, your customers will receive download links after a successful payment. Download links are highly secured and encrypted and work [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://activeden.net/item/extendable-facebook-paypal-shop-template/236230?ref=tahadaf" target="_blank"><img src="http://doitflash.com/wp-content/uploads/2011/07/full-facebook-paypal-store-with-CMS_blog.jpg" alt="" title="full-facebook-paypal-store-with-CMS_blog" width="690" height="176" class="aligncenter size-full wp-image-488" /></a></p>
<h3><a href="http://activeden.net/item/extendable-facebook-paypal-shop-template/236230?ref=tahadaf" target="_blank">Checkout our brand new Facebbok store, exclusively for sale on Activeden</a></h3>
<p>With our facebook shop, you can easily sell your products directly within your facebook page. It supports both digital and physical products. For digital products, your customers will receive download links after a successful payment. Download links are highly secured and encrypted and work only on a certain time limit that you can set.</p>
<p>You can add as many products as you wish in different categories and for every product you can have a detailed description and in product’s info page.</p>
<p>Besides the products, you can create info pages on the header of the application easily. Everything is nicely organized and controlled through XML files and FCMS (Flash Content Management System). You can not only install this application on your facebook page, but it works as a standalone file also.</p>
<div><a href="http://activeden.net/item/extendable-facebook-paypal-shop-template/236230?ref=tahadaf" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">For more details and previews click here</span></span></span></a></div>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/full-facebook-paypal-store-with-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>adobe talked about us</title>
		<link>http://doitflash.com/adobe-talked-about-us/</link>
		<comments>http://doitflash.com/adobe-talked-about-us/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 07:55:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[adobe tweet]]></category>
		<category><![CDATA[doitflash]]></category>
		<category><![CDATA[talking about TextArea]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=485</guid>
		<description><![CDATA[I know that this is for some time ago but I&#8217;ve just been busy and couldn&#8217;t send a post here, but now I&#8217;m back and proudly announce that Adobe mentioned us on their Twitter post here.]]></description>
				<content:encoded><![CDATA[<p><img src="http://doitflash.com/wp-content/uploads/2011/07/adobe-talked-about-us_blog.jpg" alt="" title="adobe-talked-about-us_blog" width="690" height="176" class="aligncenter size-full wp-image-486" /></p>
<p>I know that this is for some time ago but I&#8217;ve just been busy and couldn&#8217;t send a post here, but now I&#8217;m back and proudly announce that <a href="https://twitter.com/#!/AdobeFlash/status/152101521029464064"  target="_blank">Adobe mentioned us on their Twitter post here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/adobe-talked-about-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play videos with a simple &lt; video &gt; tag in your html text field</title>
		<link>http://doitflash.com/play-videos-with-a-simple-video-tag-in-your-html-text-field/</link>
		<comments>http://doitflash.com/play-videos-with-a-simple-video-tag-in-your-html-text-field/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 13:36:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[external SWF file]]></category>
		<category><![CDATA[inline of TextField]]></category>
		<category><![CDATA[loading MovieClip]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[Video player]]></category>
		<category><![CDATA[Video tag in flash]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=479</guid>
		<description><![CDATA[&#160; There are many flash video players around which you can embed into your html webpage and use it to play flv or YouTube videos. But what would you do if you are working on a full AS3 project (mobile or desktop) and you need to have a video player inside your TextField? Check the [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://doitflash.com/#">&nbsp;</a></p>
<p>There are many flash video players around which you can embed into your html webpage and use it to play flv or YouTube videos. But what would you do if you are working on a full AS3 project (mobile or desktop) and you need to have a video player inside your TextField? Check the demo below to see how the player has been loaded inside the text field:</p>
<div class="columns one_half">
You know that flash.text.TextField loads external content with the < img > tag only, right? In the following 30 minutes, you will learn everything you need about how you can play videos inside your text content with the new < video > tag, like this:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
<video width="305" height="200" align="left" id="video1"><br />
<source><br />
	<src>videoPlayer/party.mp4</src><br />
	<ratio>ratio</ratio><br />
	<autoplay>autoplay</autoplay><br />
	<loop>loop</loop><br />
</source><br />
<face><br />
	<controls>controls</controls><br />
	<config>videoPlayer/videoPlayer.xml</config></p>
<poster>videoPlayer/01.jpg</poster>
</face><br />
<events><br />
	<onPlay>onPlay()</onPlay><br />
	<onPause>onPause()</onPause><br />
	<onStop>onStop()</onStop><br />
	<onFullScreen>onFullScreen()</onFullScreen><br />
	<onEnded>onEnded()</onEnded><br />
	<onVolumeChange>onVolumeChange()</onVolumeChange><br />
	<onSeeking>onSeeking()</onSeeking><br />
</events><br />
</video><br />
</code></p>
</div>
<div class="columns one_half last">
<img src="http://doitflash.com/wp-content/uploads/2012/02/Play-videos-with-a-simple-tag_video-screenshot.jpg" alt="" title="" width="499" height="374" class="alignnone size-full wp-image-480" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<h3>Step1) Create a new Project</h3>
<p>Regardless of what IDE you’re using, create a new project and initialize TextArea in it. To learn more about TextArea you may read here <a href="http://active.tutsplus.com/tutorials/tools-tips/easily-create-souped-up-flash-text-fields-with-textarea" target="_blank">http://active.tutsplus.com/tutorials/tools-tips/easily-create-souped-up-flash-text-fields-with-textarea</a> and download it from here: <a href="http://doitflash.com/" target="_blank">http://doitflash.com/</a></p>
<p>Ok, I’m using FlashDevelop and my document class looks like below. Yours may be a little different though if you’re using Flex builder or CS IDE.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
package<br />
{<br />
	import flash.display.Sprite;<br />
	import flash.events.Event;</p>
<p>	/**<br />
	 * ...<br />
	 * @author Hadi Tavakoli - 2/19/2012 5:27 PM<br />
	 */<br />
	public class Main extends Sprite<br />
	{</p>
<p>		public function Main():void<br />
		{<br />
			if (stage) init();<br />
			else addEventListener(Event.ADDED_TO_STAGE, init);<br />
		}</p>
<p>		private function init(e:Event = null):void<br />
		{<br />
			removeEventListener(Event.ADDED_TO_STAGE, init);<br />
			// entry point</p>
<p>		}</p>
<p>	}<br />
}<br />
</code></p>
<p>To initialize TextArea, first you need to import the required classes.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
import com.doitflash.text.TextArea;<br />
import com.doitflash.text.events.TextInLineEvent;<br />
</code></p>
<p>Then create a new variable which will hold an instance of the TextArea.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
private var _textArea:TextArea;<br />
</code></p>
<p>Now create a function where the instance will be initialized and added to stage.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
private function initTxt():void<br />
{<br />
_textArea = new TextArea();<br />
_textArea.condenseWhite = true;<br />
_textArea.embedFonts = false;<br />
_textArea.border = true;<br />
_textArea.multiline = true;<br />
_textArea.wordWrap = true;<br />
_textArea.width = 500;<br />
_textArea.height = 500;</p>
<p>_textArea.fmlText = "<font face='Tahoma' size='11'>some content in your text field...</font>";<br />
this.addChild(_textArea);<br />
}<br />
</code></p>
<p>Up to here, your document class should look like below.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
package<br />
{<br />
	import flash.display.Sprite;<br />
	import flash.events.Event;<br />
	import com.doitflash.text.TextArea;<br />
	import com.doitflash.text.events.TextInLineEvent;</p>
<p>	/**<br />
	 * ...<br />
	 * @author Hadi Tavakoli - 2/19/2012 5:27 PM<br />
	 */<br />
	public class Main extends Sprite<br />
	{<br />
		private var _textArea:TextArea;</p>
<p>		public function Main():void<br />
		{<br />
			if (stage) init();<br />
			else addEventListener(Event.ADDED_TO_STAGE, init);<br />
		}</p>
<p>		private function init(e:Event = null):void<br />
		{<br />
			removeEventListener(Event.ADDED_TO_STAGE, init);<br />
			// entry point</p>
<p>			initTxt();<br />
		}</p>
<p>		private function initTxt():void<br />
		{<br />
			_textArea = new TextArea();<br />
			_textArea.condenseWhite = true;<br />
			_textArea.embedFonts = false;<br />
			_textArea.border = true;<br />
			_textArea.multiline = true;<br />
			_textArea.wordWrap = true;<br />
			_textArea.width = 500;<br />
			_textArea.height = 500;</p>
<p>			_textArea.fmlText = "<font face='Tahoma' size='11'>some content in your text field...</font>";<br />
			this.addChild(_textArea);<br />
		}</p>
<p>	}<br />
}<br />
</code></p>
<p>And if you run your project, you must see a 500 X 500 pixel text field with a black border with some sample script in it. If you have noticed, initializing TextArea is similar to the original TextField class. It’s important to remember that if you want to use the new html tags in your project, like how we’ll be using < video > tag in the rest of this tutorial, you need to use the fmlText property for TextArea rather than htmlText introduced in TextField.</p>
<h3>Step2) Setup the assets</h3>
<p>If you have tested the project till here, a swf file must have been generated. Go to where the published swf file is located and extract the content of this zip file to it. <a href="http://doitflash.com/downloads/tuts/videoTagTut.zip">http://doitflash.com/downloads/tuts/videoTagTut.zip</a></p>
<p>Now you must have two new folders, assets and videoPlayer where your project is published. To get you out of the dark and tell you what you have downloaded, I must say that you have just setup the video player skin and a sample .mp4 file to help you see something real with your project. After we successfully played the .mp4 I will talk about how you can also play YouTube videos!</p>
<p>For the sake of this tutorial, don’t change the skin and button designs and leave everything as is. Yet, it’s worthy to mention that you can easily change the location of button designs from this xml file: videoPlayer/videoPlayer.xml </p>
<p>Feel free to explore this xml file and play with values there to create your own custom designed player.</p>
<p>There is also another important thing to mention about this xml file and it’s about the timer field of the player where you have the following:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
<timer> <!-- Set style for the timer text --><br />
	<font>Arimo</font></p>
<color>0xFFFFFF</color>
	<size>10</size><br />
</timer><br />
</code></p>
<p>As you see, we have used the font “Arimo” for the timer field of the player. If you want to use other font types, you may change it from here. Regardless of what font you’re using, you must remember to embed it in your project. We’ll do so in the next step.</p>
<h3>Step2) Embed fonts</h3>
<p>Choose your font .ttf files and put them in a folder named “fonts” where you have your project document class .as file. I suggest using Arimo though, it looks great in AS3 projects and its license is ok also. Just Google “Arimo font” and you’ll find where to download the .ttf files.</p>
<p>Then embed them all like below in your document class.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
[Embed(source="fonts/Arimo-Regular.ttf", embedAsCFF="false", fontFamily="Arimo", mimeType="application/x-font-truetype")]<br />
private var arimoRegular:Class;</p>
<p>[Embed(source="fonts/Arimo-Bold.ttf", embedAsCFF="false", fontFamily="Arimo", fontWeight="Bold", mimeType="application/x-font-truetype")]<br />
private var arimoBold:Class;</p>
<p>[Embed(source="fonts/Arimo-Italic.ttf", embedAsCFF="false", fontFamily="Arimo", fontStyle="Italic", mimeType="application/x-font-truetype")]<br />
private var arimoItalic:Class;</p>
<p>[Embed(source="fonts/Arimo-BoldItalic.ttf", embedAsCFF="false", fontFamily="Arimo", fontWeight="Bold", fontStyle="Italic", mimeType="application/x-font-truetype")]<br />
private var arimoBoldItalic:Class;<br />
</code></p>
<p>You’re not done with the font embedding step yet! For the player skin to be able to access these fonts that you just embedded, you need to register them. So, import the following class:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
import flash.text.Font;<br />
</code></p>
<p>And then put the following in the constructor function of your document class.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
Font.registerFont(arimoRegular);<br />
Font.registerFont(arimoBold);<br />
Font.registerFont(arimoItalic);<br />
Font.registerFont(arimoBoldItalic);<br />
</code></p>
<p>Now that we have embedded some fonts, it should be a good idea to change the embedFonts property of our TextArea instance to true and make some visual enhancements to it.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
_textArea.antiAliasType = "advanced";<br />
_textArea.embedFonts = true;<br />
_textArea.fmlText = "<font face='Arimo' size='15'>some content in your text field...</font>";<br />
</code></p>
<p>You’re document class should look like this by now:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
package<br />
{<br />
	import flash.display.Sprite;<br />
	import flash.events.Event;<br />
	import flash.text.Font;<br />
	import com.doitflash.text.TextArea;<br />
	import com.doitflash.text.events.TextInLineEvent;</p>
<p>	/**<br />
	 * ...<br />
	 * @author Hadi Tavakoli - 2/19/2012 5:27 PM<br />
	 */<br />
	public class Main extends Sprite<br />
	{<br />
		private var _textArea:TextArea;</p>
<p>		[Embed(source="fonts/Arimo-Regular.ttf", embedAsCFF="false", fontFamily="Arimo", mimeType="application/x-font-truetype")]<br />
		private var arimoRegular:Class;</p>
<p>		[Embed(source="fonts/Arimo-Bold.ttf", embedAsCFF="false", fontFamily="Arimo", fontWeight="Bold", mimeType="application/x-font-truetype")]<br />
		private var arimoBold:Class;</p>
<p>		[Embed(source="fonts/Arimo-Italic.ttf", embedAsCFF="false", fontFamily="Arimo", fontStyle="Italic", mimeType="application/x-font-truetype")]<br />
		private var arimoItalic:Class;</p>
<p>		[Embed(source="fonts/Arimo-BoldItalic.ttf", embedAsCFF="false", fontFamily="Arimo", fontWeight="Bold", fontStyle="Italic", mimeType="application/x-font-truetype")]<br />
		private var arimoBoldItalic:Class;</p>
<p>		public function Main():void<br />
		{<br />
			if (stage) init();<br />
			else addEventListener(Event.ADDED_TO_STAGE, init);</p>
<p>			Font.registerFont(arimoRegular);<br />
			Font.registerFont(arimoBold);<br />
			Font.registerFont(arimoItalic);<br />
			Font.registerFont(arimoBoldItalic);<br />
		}</p>
<p>		private function init(e:Event = null):void<br />
		{<br />
			removeEventListener(Event.ADDED_TO_STAGE, init);<br />
			// entry point</p>
<p>			initTxt();<br />
		}</p>
<p>		private function initTxt():void<br />
		{<br />
			_textArea = new TextArea();<br />
			_textArea.antiAliasType = "advanced";<br />
			_textArea.condenseWhite = true;<br />
			_textArea.embedFonts = true;<br />
			_textArea.border = true;<br />
			_textArea.multiline = true;<br />
			_textArea.wordWrap = true;<br />
			_textArea.width = 500;<br />
			_textArea.height = 500;</p>
<p>			_textArea.fmlText = "<font face='Arimo' size='15'>some content in your text field...</font>";<br />
			this.addChild(_textArea);<br />
		}</p>
<p>	}<br />
}<br />
</code></p>
<h3>Step3) Setup TextArea for the new html tags</h3>
<p>In this tutorial, you’ll learn about < video > tag, but there are more tags for you to explore on doitflash.com. I’m saying this, because in order to work with the new html tags, you need to setup your TextArea instance. Modify the initTxt() function like this.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
private function initTxt():void<br />
{<br />
	_textArea = new TextArea();<br />
	_textArea.antiAliasType = "advanced";<br />
	_textArea.condenseWhite = true;<br />
	_textArea.embedFonts = true;<br />
	_textArea.border = true;<br />
	_textArea.multiline = true;<br />
	_textArea.wordWrap = true;<br />
	_textArea.width = 500;<br />
	_textArea.height = 500;</p>
<p>	_textArea.holder = this;<br />
	_textArea.client = this;<br />
	_textArea.assetsPath = "assets/";<br />
	_textArea.funcSecurity = false;<br />
	_textArea.addEventListener(TextInLineEvent.MODULE_LOADED, onModuleLoaded);</p>
<p>	_textArea.fmlText = "<font face='Arimo' size='15'>some content in your text field...</font>";<br />
	this.addChild(_textArea);<br />
}<br />
</code></p>
<p>The property holder, saves a reference to the class which has initialized the TextArea instance. This property is mainly used for TextArea internal works so I’m not explaining what it does here!</p>
<p>The property client, is a reference to where you will put functions which your TextArea instance will call. Let me explain this a bit more. You see, later in this tutorial, you will learn that you can create functions in your project which will interact with your video player. For example when the fullscreen button on the player is clicked, you want to do something special on your project, right? So you will write a function to handle the work. I will later tell you more about these dispatches from the video tag, but what you should know is that your will use the client property of TextField to let it know where these functions will be. For the sake of this tutorial we’ll set it to this. So we don’t have to create other classes for our functions and will put all the functions required by the video player dispatches in our document class.</p>
<p>The property assetsPath, will let TextArea know about the assets folder that you downloaded in previous steps.</p>
<p>The property funcSecurity, is helpful when you want to make sure your code is secure! When you are feeding the TextArea instance from external sources, for example an external xml file, it will be possible to hack into and call some other functions in your project just by changing the strings in the xml file! To stop this, set the value of funcSecurity to true and then use the following method to introduce the allowed functions!</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
_textArea.funcSecurity = true;<br />
_textArea.allowedFunctions(func1, func2, func3);<br />
</code></p>
<p>This will make sure that only the above three functions are allowed to be called from external sources.</p>
<p>There is also a listener:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
TextInLineEvent.MODULE_LOADED<br />
</code></p>
<p>Which is for TextArea which will be dispatched as soon as a module, or better to say, a tag, is loaded. As we are trying to load a video player, it is worthy to be able to know when it’s loaded inside the TextArea instance. So, we have set the listener to call onModuleLoaded(). When the player is loaded, it will call this function. Checkout the trace calls to see what information you’ll receive from this dispatch.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
private function onModuleLoaded(e:TextInLineEvent):void<br />
{<br />
	trace("reference to the loaded module: "+ e.param.module);<br />
	trace("id of the loaded tag: "+ e.param.id);<br />
	trace("name of the tag: "+ e.param.tagName);<br />
}<br />
</code></p>
<h3>Step4) Add the < video > tag into your html content</h3>
<p>Just change the value of _textArea.fmlText to this and test your project! The player will work now and plays the sample video you had previously downloaded.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
_textArea.fmlText = "<font face='Arimo' size='15'>some content in your text field..." +<br />
	"<video width='305' height='200' align='left' id='video1'>" +<br />
	"<source>" +<br />
		"<src>videoPlayer/party.mp4</src>" +<br />
		"<ratio>ratio</ratio>" +<br />
		"<autoplay>autoplay</autoplay>" +<br />
		"<loop>loop</loop>" +<br />
	"</source>" +<br />
	"<face>" +<br />
		"<controls>controls</controls>" +<br />
		"<config>videoPlayer/videoPlayer.xml</config>" +<br />
		"
<poster>videoPlayer/01.jpg</poster>" +<br />
	"</face>" +<br />
	"</video>" +<br />
"</font>";<br />
</code></p>
<p>For this tutorial to be as easy as possible to follow, I did not try to feed the text area with external data, but you will enjoy the < video > tag more when you can load it from a simple .txt or .xml file!</p>
<p>If you have a look at the < video > structure, you will understand what they mean and I don’t think it would be necessary to explain what each tag does. Let me just give you a hint though, if you want the player not to auto play the video, remove the whole <autoplay>autoplay</autoplay> line and it will stop at the beginning.</p>
<h3>Step5) Make it play YouTube videos</h3>
<p>To play YouTube videos, all you have to do is to set the video type to YouTube and pass the video id. Change the source part to below and test your project.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
"<source>" +<br />
	"<src>hfcd1Nlpwgs</src>" +<br />
	"<type>youtube</type>" +<br />
	"<ratio>ratio</ratio>" +<br />
	"<autoplay>autoplay</autoplay>" +<br />
	"<loop>loop</loop>" +<br />
"</source>" +<br />
</code></p>
<h3>Step6) Listen to events</h3>
<p>In previous steps, I mentioned that each tag module has its own events which you can set some functions to receive them. The video module has the following events to listen to. Change of _textArea.fmlText to following.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
_textArea.fmlText = "<font face='Arimo' size='15'>some content in your text field..." +<br />
	"<video width='305' height='200' align='left' id='video1'>" +<br />
	"<source>" +<br />
		"<src>videoPlayer/party.mp4</src>" +<br />
		"<ratio>ratio</ratio>" +<br />
		"<autoplay>autoplay</autoplay>" +<br />
		"<loop>loop</loop>" +<br />
	"</source>" +<br />
	"<face>" +<br />
		"<controls>controls</controls>" +<br />
		"<config>videoPlayer/videoPlayer.xml</config>" +<br />
		"
<poster>videoPlayer/01.jpg</poster>" +<br />
	"</face>" +<br />
	"<events>" +<br />
		"<onPlay>onPlay()</onPlay> " +<br />
		"<onPause>onPause()</onPause>" +<br />
		"<onStop>onStop()</onStop>" +<br />
		"<onFullScreen>onFullScreen()</onFullScreen>" +<br />
		"<onEnded>onEnded()</onEnded>" +<br />
		"<onVolumeChange>onVolumeChange()</onVolumeChange>" +<br />
		"<onSeeking>onSeeking()</onSeeking>" +<br />
	"</events>" +<br />
	"</video>" +<br />
"</font>";<br />
</code></p>
<p>The names of the events are self-explanatory but what you should know is that every event that is dispatched will send an object with itself in which you will find some useful information about the event. Let’s build the functions and I will show you all the possible data that you may receive for each event. Notice that these functions are all “public” and must be where set the textArea.client property.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
public function onPlay($obj:Object=null):void<br />
{<br />
	trace("on play clicked");<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);<br />
	trace("--------------------------------------");<br />
}</p>
<p>public function onPause($obj:Object=null):void<br />
{<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);<br />
	trace("--------------------------------------");<br />
}</p>
<p>public function onStop($obj:Object=null):void<br />
{<br />
	trace("on stop clicked");<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);<br />
	trace("--------------------------------------");<br />
}</p>
<p>public function onEnded($obj:Object=null):void<br />
{<br />
	trace("Video finished");<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);<br />
	trace("--------------------------------------");<br />
}</p>
<p>public function onFullScreen($obj:Object=null):void<br />
{<br />
	trace("on fullscreen clicked");<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);<br />
	trace("--------------------------------------");<br />
}</p>
<p>public function onVolumeChange($obj:Object=null):void<br />
{<br />
	trace("on volume clicked");<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);<br />
	trace("video volume: " + $obj.volume);<br />
	trace("--------------------------------------");<br />
}</p>
<p>public function onSeeking($obj:Object=null):void<br />
{<br />
	trace("event type: " + $obj.type);<br />
	trace("reference to module: " + $obj.target);</p>
<p>	if ($obj.target.youtube)<br />
	{<br />
		trace("YouTube current time: " + $obj.currentTime);<br />
		trace("YouTube video duration: " + $obj.duration);<br />
	}<br />
	else<br />
	{<br />
		trace("video position: " + $obj.position);<br />
		trace("video length: " + $obj.length);<br />
	}<br />
	trace("--------------------------------------")<br />
}<br />
</code></p>
<p>It’s not like you would need all of these events in your every project, you may just remove the whole < event > tag and build your project without them, but it’s good to know how to interact with them, right?</p>
<p>To make sure you have set your document class correctly, here’s the whole document class for your reference.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
package<br />
{<br />
	import flash.display.Sprite;<br />
	import flash.events.Event;<br />
	import flash.text.Font;<br />
	import com.doitflash.text.TextArea;<br />
	import com.doitflash.text.events.TextInLineEvent;</p>
<p>	/**<br />
	 * ...<br />
	 * @author Hadi Tavakoli - 2/19/2012 5:27 PM<br />
	 */<br />
	public class Main extends Sprite<br />
	{<br />
		private var _textArea:TextArea;</p>
<p>		[Embed(source="fonts/Arimo-Regular.ttf", embedAsCFF="false", fontFamily="Arimo", mimeType="application/x-font-truetype")]<br />
		private var arimoRegular:Class;</p>
<p>		[Embed(source="fonts/Arimo-Bold.ttf", embedAsCFF="false", fontFamily="Arimo", fontWeight="Bold", mimeType="application/x-font-truetype")]<br />
		private var arimoBold:Class;</p>
<p>		[Embed(source="fonts/Arimo-Italic.ttf", embedAsCFF="false", fontFamily="Arimo", fontStyle="Italic", mimeType="application/x-font-truetype")]<br />
		private var arimoItalic:Class;</p>
<p>		[Embed(source="fonts/Arimo-BoldItalic.ttf", embedAsCFF="false", fontFamily="Arimo", fontWeight="Bold", fontStyle="Italic", mimeType="application/x-font-truetype")]<br />
		private var arimoBoldItalic:Class;</p>
<p>		public function Main():void<br />
		{<br />
			if (stage) init();<br />
			else addEventListener(Event.ADDED_TO_STAGE, init);</p>
<p>			Font.registerFont(arimoRegular);<br />
			Font.registerFont(arimoBold);<br />
			Font.registerFont(arimoItalic);<br />
			Font.registerFont(arimoBoldItalic);<br />
		}</p>
<p>		private function init(e:Event = null):void<br />
		{<br />
			removeEventListener(Event.ADDED_TO_STAGE, init);<br />
			// entry point</p>
<p>			initTxt();<br />
		}</p>
<p>		private function initTxt():void<br />
		{<br />
			_textArea = new TextArea();<br />
			_textArea.antiAliasType = "advanced";<br />
			_textArea.condenseWhite = true;<br />
			_textArea.embedFonts = true;<br />
			_textArea.border = true;<br />
			_textArea.multiline = true;<br />
			_textArea.wordWrap = true;<br />
			_textArea.width = 500;<br />
			_textArea.height = 500;</p>
<p>			_textArea.holder = this;<br />
			_textArea.client = this;<br />
			_textArea.assetsPath = "assets/";<br />
			_textArea.funcSecurity = false;<br />
			_textArea.addEventListener(TextInLineEvent.MODULE_LOADED, onModuleLoaded);</p>
<p>			_textArea.fmlText = "<font face='Arimo' size='15'>some content in your text field..." +<br />
				"<video width='305' height='200' align='left' id='video1'>" +<br />
				"<source>" +<br />
					"<src>videoPlayer/party.mp4</src>" +<br />
					//"<type>youtube</type>" +<br />
					"<ratio>ratio</ratio>" +<br />
					"<autoplay>autoplay</autoplay>" +<br />
					"<loop>loop</loop>" +<br />
				"</source>" +<br />
				"<face>" +<br />
					"<controls>controls</controls>" +<br />
					"<config>videoPlayer/videoPlayer.xml</config>" +<br />
					"
<poster>videoPlayer/01.jpg</poster>" +<br />
				"</face>" +<br />
				"<events>" +<br />
					"<onPlay>onPlay()</onPlay> " +<br />
					"<onPause>onPause()</onPause>" +<br />
					"<onStop>onStop()</onStop>" +<br />
					"<onFullScreen>onFullScreen()</onFullScreen>" +<br />
					"<onEnded>onEnded()</onEnded>" +<br />
					"<onVolumeChange>onVolumeChange()</onVolumeChange>" +<br />
					"<onSeeking>onSeeking()</onSeeking>" +<br />
				"</events>" +<br />
				"</video>" +<br />
			"</font>";<br />
			this.addChild(_textArea);<br />
		}</p>
<p>		private function onModuleLoaded(e:TextInLineEvent):void<br />
		{<br />
			trace("reference to the loaded module: "+ e.param.module);<br />
			trace("id of the loaded tag: "+ e.param.id);<br />
			trace("name of the tag: " + e.param.tagName);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onPlay($obj:Object=null):void<br />
		{<br />
			trace("on play clicked");<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onPause($obj:Object=null):void<br />
		{<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onStop($obj:Object=null):void<br />
		{<br />
			trace("on stop clicked");<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onEnded($obj:Object=null):void<br />
		{<br />
			trace("Video finished");<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onFullScreen($obj:Object=null):void<br />
		{<br />
			trace("on fullscreen clicked");<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onVolumeChange($obj:Object=null):void<br />
		{<br />
			trace("on volume clicked");<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);<br />
			trace("video volume: " + $obj.volume);<br />
			trace("--------------------------------------");<br />
		}</p>
<p>		public function onSeeking($obj:Object=null):void<br />
		{<br />
			trace("event type: " + $obj.type);<br />
			trace("reference to module: " + $obj.target);</p>
<p>			if ($obj.target.youtube)<br />
			{<br />
				trace("YouTube current time: " + $obj.currentTime);<br />
				trace("YouTube video duration: " + $obj.duration);<br />
			}<br />
			else<br />
			{<br />
				trace("video position: " + $obj.position);<br />
				trace("video length: " + $obj.length);<br />
			}<br />
			trace("--------------------------------------")<br />
		}</p>
<p>	}<br />
}<br />
</code></p>
<h3>Conclusion</h3>
<p>In this tutorial you learned how to load a video player inside your text field using a simple < video > tag in your html texts. Adobe supports only basic html tags in TextField but using TextArea as an alternative to TextField, you will be able to do more with texts in your AS3 projects. In future tutorials, I’ll talk about other custom tags and then I will also tell you how you can create your own custom tag and use it in TextArea! That’s all for now. I hope you have enjoyed it.</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/play-videos-with-a-simple-video-tag-in-your-html-text-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert string to function!</title>
		<link>http://doitflash.com/convert-string-to-function/</link>
		<comments>http://doitflash.com/convert-string-to-function/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 09:26:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[argument support]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[create dynamic function]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[string to function]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=476</guid>
		<description><![CDATA[It’s Sunday night and few hours ago I was sitting in front of the TV watching some silly shows that I thought maybe I can write a short article about how you can convert a string into a function call! A little class that I had written a while ago when I was working on [...]]]></description>
				<content:encoded><![CDATA[<p align="center">
<img src="http://doitflash.com/wp-content/uploads/2011/07/Convert-string-to-function_blog.jpg" alt="" title="Convert-string-to-function_blog" width="690" height="176" class="alignnone size-full wp-image-477" />
</p>
<p>It’s Sunday night and few hours ago I was sitting in front of the TV watching some silly shows that I thought maybe I can write a short article about how you can convert a string into a function call! A little class that I had written a while ago when I was working on the <a href="http://doitflash.com/" target="_blank">TextArea</a> project is named DynamicFunc. You may download it from <a href="http://doitflash.com/" target="_blank">here</a> <strong>(it’s inside the TextArea package). com.doitflash.tools.DynamicFunc</strong></p>
<p>Don’t look inside of it as it’s full of complex and nonsense RegExp commands that even I can’t remember what they mean! You see, I love RegExp because of the great power it has in parsing strings. Actually with the help of it, I was able to build a semi-xml parser and it was a great experience but I hate the bastard as much as I love it! Simply because I can never memories the commands and whenever I want to create a new pattern, I have to get back to all possible references in my books and online.</p>
<p>Anyway, <strong>what you’ll be able to do in the next 5 minutes is to convert the following string into a real function call! “myFunc(value,value2,[arr1,arr2,arr3],{var1:value1,var2:value2,var3:value3})”</strong>. As you see, it seems like a function call which you’re passing arguments in 3 different formats, simple strings, arrays and objects.</p>
<p>You can think of many occasions that you would need this. Imagine you’re working with external data in your database or just a simple xml file and from there you want to be able to control how a function in your AS3 project is called, then what will you do? </p>
<p>If you don’t know how to work with RegExp, you may think of many different hacks around this, just like how I used to do few years back. I’m not going to talk about those hacks as I believe, the DynamicFunc solution, is the best.</p>
<p>So, basically, DynamicFunc will grab the string and reads each character and understands what type of parameters you’re passing. If you have your string in a variable like this:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
var myString:String = "myFunc(value,value2,[arr1,arr2,arr3],{var1:value1,var2:value2,var3:value3})";</p>
<p> Then all you have to do is to initialize DynamicFunc and feed it with the string like this:<br />
var df:DynamicFunc = new DynamicFunc(myString);</p>
<p>Maybe you have the function in your AS3 code like below:<br />
function myFunc($str1:String, $str2:String, $arr:Array, $obj:Object):void<br />
{<br />
	trace($str1);<br />
	trace($str2);<br />
	trace($arr);<br />
	trace($obj);<br />
}<br />
</code></p>
<p>After sending the string into DynamicFunc, then it will be easy to call the function, like below:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
this[df.funcName].apply(null, df.inputs);<br />
</code></p>
<p>Cool, right?<br />
Hadi</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/convert-string-to-function/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://doitflash.com/472/</link>
		<comments>http://doitflash.com/472/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 15:00:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false">http://doitflash.com/?p=472</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/472/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Showcase</title>
		<link>http://doitflash.com/showcase/</link>
		<comments>http://doitflash.com/showcase/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 14:39:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false">http://doitflash.com/?page_id=464</guid>
		<description><![CDATA[Checkout the products that have used TextArea technology, see how TextArea and all of our modules are all flexible with any kind of usage and can be used anywhere and make a project to a pro one in a second and let it to support slideshows, video players and more… It even gives much more [...]]]></description>
				<content:encoded><![CDATA[<p>Checkout the products that have used <strong>TextArea technology</strong>, see how TextArea and all of our modules are all flexible with any kind of usage and can be used anywhere and make a project to a pro one in a second and let it to support slideshows, video players and more… It even gives much more abilities to the developer himself, such as having easy connection between his dynamic content and his functions inside the project…  <strong>you don’t feel the power of TextArea unless you go through it yourself</strong>.</p>
<p>For me myself that was just like that! I created TextArea demos and tried to give as much examples as I could inside the download packages among all of the Documentations but I don’t know was I able to show off the powers of TextArea or not , so I also decided to showcase some projects that used TextArea too!</p>
<p>And let me mention that we would be happy to see your works too, if you have also used TextArea, let us know about it, maybe we would find it interesting and would have a link to your project too.</p>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_third">
<p><a href="http://activeden.net/item/extendable-facebook-paypal-shop-template/236230?ref=tahadaf" target="_blank"><img title="FACEBOOK_STORE_FRESH" src="http://doitflash.com/showcase/FACEBOOK_STORE_FRESH/MORE/banner/FACEBOOK_STORE_FRESH_305X200.png" alt="" width="305" height="200" /></a></p>
</div>
<div class="columns one_third">
<p><a href="http://activeden.net/item/fresh-facebook-fan-page-template/1318060?ref=tahadaf" target="_blank"><img class="alignnone" title="FACEBOOK_FANPAGE_FRESH" src="http://doitflash.com/showcase/FacebookTemplate_Fresh/MORE/banner/FacebookTemplate_Fresh_305X200.png" alt="" width="305" height="200" /></a></p>
</div>
<div class="columns one_third last">
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<h3>Custom Work?</h3>
<p>Do you want us to do a custom work for you?</p>
<p>Simply contact us and let us know about your project details and descriptions and we will get back to you!</p>
</div>
<div class="columns one_half last">
<div class="contact_submit_form form_29" style="width:450px;">
<div class="quickly_elements_left">
<div class="quickly_elements_label"> <input type="text" name="name" class="input" value="Name *"> </div>
<div class="quickly_elements_label"> <input type="text" name="email" class="input" value="Email *"> </div>
<div class="quickly_elements_label"> <input type="text" name="telephone" class="input" value="Telephone"> </div>
</p></div>
<div class="quickly_elements_right">
<div class="quickly_elements_label"> <input type="text" name="subject" class="input" value="Subject *"> </div>
<div class="quickly_elements_label"> <textarea class="textarea" name="message" style="width:90%; height:65px;">Message *</textarea> </div>
</p></div>
<div class="quickly_elements_label">
<div class="form_29 contact_submit alignright">
<h6><span class="small_buttons"><span class="orange_l small_left"><span class="orange_r small_right">Send Message</span></span></span></h6>
</p></div>
<div class="quickly_form_message alignright">&nbsp;</div>
</p></div>
</p></div>
<div class="cleardiv"></div>
</p></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/showcase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>anchor module</title>
		<link>http://doitflash.com/anchor-module/</link>
		<comments>http://doitflash.com/anchor-module/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 17:13:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Free Modules]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=portfolio_mod&#038;p=453</guid>
		<description><![CDATA[[wp_eStore_cart_fancy1_when_not_empty] How to use: [cc lang="php" line_numbers="true" nowrap="false" width="100%"] [/cc]]]></description>
				<content:encoded><![CDATA[<p>[wp_eStore_cart_fancy1_when_not_empty]</p>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<div class="columns one_half">
<h3>Main Functionality:</h3>
<p>The anchor tag helps you to put an anchor in line of your text blocks and get its location when ever that you like! for example you can use it to get to your favorite titles inside of your content, just like the preview we have created.</p>
<p>[wp_eStore_download_now_button id=15]</p>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<p><span class="info_boxes simple_box" style="width:100%;"><span class="info_text"><em><a href="http://doitflash.com/?page_id=19" target="_blank">Join the club</a> for more permissions, bonuses and more files to download.</em></span></span></p>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<h3>Features:</h3>
<p>It just acts like a ghost inside of your text blocks which you can get its location when ever you want.
</p></div>
<div class="columns one_half last">
<h3>Preview:</h3>
<p>[kml_flashembed movie="http://doitflash.com/demo/main.swf" allowfullscreen="true" menu="false" bgcolor="#FFFFFF" width="450" height="400" quality="high" wmode="window" fvars="serverPath=http://doitflash.com/demo/; margin=5; xml=anchor.xml" /]</p>
</div>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<h3>How to use:</h3>
<p>[cc lang="php" line_numbers="true" nowrap="false" width="100%"]<br />
<anchor name="name" id="anchor1" align="right" /><br />
[/cc]</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/anchor-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily Create Souped-Up Flash Text Fields With TextArea</title>
		<link>http://doitflash.com/easily-create-souped-up-flash-text-fields-with-textarea/</link>
		<comments>http://doitflash.com/easily-create-souped-up-flash-text-fields-with-textarea/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 13:14:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[create custom HTML tags]]></category>
		<category><![CDATA[custom functions]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[handy classes]]></category>
		<category><![CDATA[hyperlink]]></category>
		<category><![CDATA[missing link between flash and HTML]]></category>
		<category><![CDATA[pass argument]]></category>
		<category><![CDATA[pass arguments from dynamic content]]></category>
		<category><![CDATA[roll over detection]]></category>
		<category><![CDATA[RollOver]]></category>
		<category><![CDATA[RollOver detection href links]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=447</guid>
		<description><![CDATA[In this tutorial I’ll walk you through the steps required to install and use the TextArea component as an alternative to Flash’s native TextField class, and show you how to detect mouse roll over/out events on hyperlinks. I’ll also talk about how you can call custom functions and pass different data types as arguments. Background [...]]]></description>
				<content:encoded><![CDATA[<p align="center">
<img src="http://doitflash.com/wp-content/uploads/2011/12/How-TextArea-helps.jpg" alt="" title="How-TextArea-helps" width="690" height="290" class="alignnone size-full wp-image-448" />
</p>
<p>In this tutorial I’ll walk you through the steps required to install and use the TextArea component as an alternative to Flash’s native TextField class, and show you how to detect mouse roll over/out events on hyperlinks. I’ll also talk about how you can call custom functions and pass different data types as arguments.</p>
<h4>Background</h4>
<p>The native TextField class was the first to support text scripts in Flash projects. With TextField, you could support dynamic and static text, as well as the input type to allow user interactivity. It also supported a (very limited) selection of HTML tags for styling your scripts – but when comparing this narrow availability of HTML support in TextField to what is possible with regular HTML files being used within browsers, Flash developers felt the extreme lack of flexibility when dealing with text.</p>
<p>In 2009 when TLFTextField was introduced, developers were hoping to see some solutions – but these didn’t appear. Today, with the TextArea class, you can do what you always wanted with your text blocks. Functionalities like detecting roll over/out on href links, calling custom functions from text blocks, creating anchor links, loading custom created tags like video players, slideshow, and buttons: these are all now possible with TextArea. </p>
<div><a href="http://active.tutsplus.com/tutorials/tools-tips/easily-create-souped-up-flash-text-fields-with-textarea/" target="_blank"><span class="small_buttons"><span class="orange_l small_left"><span class="orange_r small_right">Click to see the full tutorial on active.tutsplus.com</span></span></span></a></div>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/easily-create-souped-up-flash-text-fields-with-textarea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FileSaver Data Transfer</title>
		<link>http://doitflash.com/filesaver-data-transfer/</link>
		<comments>http://doitflash.com/filesaver-data-transfer/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 16:12:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3 player 10]]></category>
		<category><![CDATA[data transfer]]></category>
		<category><![CDATA[encrypt data on flash]]></category>
		<category><![CDATA[encrypted data transfer]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[save byteArray locally]]></category>
		<category><![CDATA[save byteArray on server]]></category>
		<category><![CDATA[save file locally]]></category>
		<category><![CDATA[send and receive data from flash]]></category>
		<category><![CDATA[send data to server]]></category>
		<category><![CDATA[transfer data to server]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=444</guid>
		<description><![CDATA[In my recent project, http://www.myflashlab.com/2010/01/27/contactform-class/ I was trying to do a lot of data transfer to and from flash to PHP (or any serverside script), I had to send attachments to php, I even had to encrypt the data before the transfer and that stuff. having to do all these things, I decided to write [...]]]></description>
				<content:encoded><![CDATA[<p>In my recent project, <a href="http://www.myflashlab.com/2010/01/27/contactform-class/">http://www.myflashlab.com/2010/01/27/contactform-class/</a> I was trying to do a lot of data transfer to and from flash to PHP (or any serverside script), I had to send attachments to php, I even had to encrypt the data before the transfer and that stuff. having to do all these things, I decided to write a class to take care of all these things for me.</p>
<p>so I wrote this fine class that I have named it FileSaver! <img src='http://doitflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This class is good for the following purposes:</p>
<ul>
<li>you want to save a file from your flash app to your desktop.</li>
<li>you want to save a file from your flash app to your server.</li>
<li>you want to save a file to your server and send some variables along with it.</li>
<li>you want to send some variables to a server side script.</li>
<li>you can encrypt the data before sending them out to server script.</li>
</ul>
<p>before I forget, I have used <a href="http://code.google.com/p/as3crypto/" target="_blank">as3crypto </a>for the encryption thing in my class.</p>
<p>you may download the class .as files <a href="http://myflashlab.com/showcase/com/doitflash/tools/fileSaver/fileSaver.zip">here</a>.</p>
<p>here is how you can work with it if you want to save a file on your server along with some variables to be send to the server side script.<br />
<code lang="actionscript3" line_numbers="false" width="100%"><br />
import com.doitflash.tools.fileSaver.FileSaver;<br />
import com.doitflash.tools.fileSaver.FileSaverConst;<br />
import com.doitflash.events.FileSaverEvent;</p>
<p>// if we're saving to server<br />
var _fileSaver:FileSaver = new FileSaver();<br />
_fileSaver.method = FileSaverConst.SERVER;</p>
<p>// by default the encryption is turned off. if you are turning it on,<br />
// make sure to put a key for your encryption which is not longer than 8 characters.<br />
// to deal with encrypted data on your server side script, refer to http://code.google.com/p/as3crypto/<br />
//_fileSaver.encrypt(true, "TESTTEST");<br />
_fileSaver.encrypt(false);<br />
_fileSaver.gateway = "phpProcessor.php";</p>
<p>// save all parameters that you want to send out in an object like below.<br />
_fileSaver.vars = {var1:"value1",var2:"value2"};</p>
<p>// you may also wish to add a listener to receive the server script respond!<br />
_fileSaver.addEventListener(FileSaverEvent.RESPOND, onRespond);</p>
<p>// call the save method and pass the file byteArray to it along with its name like below.<br />
_fileSaver.save(_byte, "filename", ".gif");</p>
<p>function onRespond(e:FileSaverEvent):void<br />
{<br />
	trace(e.paramURLVars) // paramURLVars is of type URLVariables<br />
	trace(e.paramOBJVars) // paramOBJVars is of type Object</p>
<p>	// OR</p>
<p>	trace(_fileSaver.theRespond);// theRespond is of type URLVariables<br />
	trace(_fileSaver.theRespondObject);// theRespondObject is of type Object<br />
}<br />
</code></p>
<p>If you want to save some byteArray object on your local computer, try below:<br />
<code lang="actionscript3" line_numbers="false" width="100%"><br />
import com.doitflash.tools.fileSaver.FileSaver;<br />
import com.doitflash.tools.fileSaver.FileSaverConst;</p>
<p>var _fileSaver:FileSaver = new FileSaver();<br />
_fileSaver.method = FileSaverConst.LOCAL;<br />
_fileSaver.save(_byte, "filename", ".gif");<br />
</code></p>
<p>And finally if you don&#8217;t want to save any file but just send some variables to a server side script, try below:<br />
<code lang="actionscript3" line_numbers="false" width="100%"><br />
import com.doitflash.tools.fileSaver.FileSaver;<br />
import com.doitflash.tools.fileSaver.FileSaverConst;<br />
import com.doitflash.events.FileSaverEvent;</p>
<p>var _fileSaver:FileSaver = new FileSaver();<br />
_fileSaver.method = FileSaverConst.SERVER;</p>
<p>// by default the encryption is turned off. if you are turning it on,<br />
// make sure to put a key for your encryption which is not longer than 8 characters.<br />
// to deal with encrypted data on your server side script, refer to http://code.google.com/p/as3crypto/<br />
//_fileSaver.encrypt(true, "TESTTEST");<br />
_fileSaver.encrypt(false);<br />
_fileSaver.gateway = "phpProcessor.php";</p>
<p>// save all parameters that you want to send out in an object like below.<br />
_fileSaver.vars = {var1:"value1",var2:"value2"};</p>
<p>// you may also wish to add a listener to receive the server script respond!<br />
_fileSaver.addEventListener(FileSaverEvent.RESPOND, onRespond);<br />
_fileSaver.save();</p>
<p>function onRespond(e:FileSaverEvent):void<br />
{<br />
	//trace(e.paramURLVars) // paramURLVars is of type URLVariables<br />
	//trace(e.paramOBJVars) // paramOBJVars is of type Object</p>
<p>	// OR</p>
<p>	trace(_fileSaver.theRespond);// theRespond is of type URLVariables<br />
	trace(_fileSaver.theRespondObject);// theRespondObject is of type Object<br />
}<br />
</code></p>
<p></br><br />
I am sure you will enjoy this small but useful class <img src='http://doitflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it will help you get rid of all those URLLoader and URLVariables and that stuff! it will do them all with an easy interface.</p>
<p>I hope you like it,<br />
Hadi</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/filesaver-data-transfer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Event Listener</title>
		<link>http://doitflash.com/custom-event-listener/</link>
		<comments>http://doitflash.com/custom-event-listener/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 16:14:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[custom event class]]></category>
		<category><![CDATA[custom events]]></category>
		<category><![CDATA[dispatch event]]></category>
		<category><![CDATA[eventListener]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[oop programming]]></category>
		<category><![CDATA[send parameters when dispatching an event]]></category>

		<guid isPermaLink="false">http://doitflash.com/?post_type=blog_mod&#038;p=441</guid>
		<description><![CDATA[When writing your AS3 projects, you will need events. The main thing that events do is to help you make a bridge between your instances of classes. take the adobe&#8217;s MouseEvent as an example. you add a MouseEvent.CLICK listener to a movieclip so that when you click on a movieclip instance it will dispatch the [...]]]></description>
				<content:encoded><![CDATA[<p>When writing your AS3 projects, you will need events. The main thing that events do is to help you make a bridge between your instances of classes. take the adobe&#8217;s MouseEvent as an example. you add a MouseEvent.CLICK listener to a movieclip so that when you click on a movieclip instance it will dispatch the &#8220;CLICK&#8221; event. it works like below as you know.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
import flash.events.MouseEvent;<br />
mc.addEventListener(MouseEvent.CLICK, onClick);<br />
function onClick(e:MouseEvent):void<br />
{<br />
	trace("mc is clicked")<br />
}<br />
</code></p>
<p>this is all good, you have used an event being built by adobe (there are many other premade events by flash if you just check the package flash.events)<span id="more-441"></span></p>
<p>what you have done above is very nicely OOP because you can call the function &#8220;onClick&#8221; on your document class without being worried about that when you are writting the code inside your mc class. because you know your mc instance which has extended MovieClip will automatically dispatch the MouseEvent.CLICK event and all you have to do is to add a listener to grab that dispatch and do something with it.</p>
<p>now, let&#8217;s see why custom events are useful. imagine you are building a game in which there is a counter which will let users play the game for 60 seconds only. the counter will count down until it reaches the value 0 and as soon as the value is 0 you want to stop the game and let the user know about that.</p>
<p>so you can call it an event, right? the event of TIME_OUT, for example, OK? so this event is not something available by default in flash events. so you will know that your mc class will not dispatch anything when the counter value reaches zero. so you must dispatch that yourself! it&#8217;s so easy, you can dispatch it inside your mc class like this:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
if(counter == 0)<br />
{<br />
	dispatchEvent(new Event("timeOut"));<br />
}<br />
</code></p>
<p>if you notice the code above, you will see that we have used the Event class. this is good enough and you can add a listener in your document class to grab this event whenever it is dispatched. you may add a listener in your document class like this:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
addEventListener("timeOut", onTimeOut);<br />
function onTimeOut(e:Event):void<br />
{<br />
	trace("game is over!");<br />
}<br />
</code></p>
<p>But I can give you fair good reasons why you would need to build a custom event class! keep reading and you will be convinced!</p>
<p>when I say a custom event class, I mean creating a class which will extends the flash.events.Event class. in our example, let&#8217;s create the custom event class with the name of McEvent.as and put the below code in it.</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
package<br />
{<br />
	import flash.events.Event;</p>
<p>	public class McEvent extends Event<br />
	{<br />
		public static const TIME_OUT:String = "timeOut";<br />
		private var _param:*;</p>
<p>		public function McEvent(type:String, data:*=null, bubbles:Boolean=false, cancelable:Boolean=false):void<br />
		{<br />
			_param = data;<br />
			super(type, bubbles, cancelable);<br />
		}</p>
<p>		public function get param():*<br />
		{<br />
			return _param;<br />
		}<br />
	}<br />
}<br />
</code></p>
<p>now that you have build your custom event class, you may dispatch the timeOut event from your mc class, like below:<br />
<code lang="actionscript3" line_numbers="false" width="100%"><br />
if(counter == 0)<br />
{<br />
	dispatchEvent(new McEvent(McEvent.TIME_OUT));<br />
}<br />
</code></p>
<p>and in your document class, you can add the listener like this:<br />
<code lang="actionscript3" line_numbers="false" width="100%"><br />
addEventListener(McEvent.TIME_OUT, onTimeOut);<br />
function onTimeOut(e:McEvent):void<br />
{<br />
	trace("game is over!");<br />
}<br />
</code></p>
<p>you may say this is just some extra unnecessary process! but take a look at the bright side, you have a nicely organized events being introduced for your mc class! you may have other events and you can put them all in one place and you can make sure you are not mistyping the name of the events. because they are now some constants being introduced in McEvent class.</p>
<p>the advantage is not limited to a better project organizing only. the main advantage is that you can send extra values along with your dispatch! take another look at your custom event class, McEvent, you see the variable </p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
private var _param:*;<br />
</code></p>
<p>The variable _param is of type anything which means you can save and transfer any data through it while you are dispatching the event. in our example, imagine you want to send the player score along with the timeOut event. you can dispatch that event like this:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
if(counter == 0)<br />
{<br />
	dispatchEvent(new McEvent(McEvent.TIME_OUT, 99)); // 99 is the player score!<br />
}<br />
</code></p>
<p>now you are dispatching the event and you are also sending some parameters. you can grab and use this parameter in your document class like this:</p>
<p><code lang="actionscript3" line_numbers="false" width="100%"><br />
addEventListener(McEvent.TIME_OUT, onTimeOut);<br />
function onTimeOut(e:McEvent):void<br />
{<br />
	trace("game is over!");<br />
	trace("Your score is: " + e.param);<br />
}<br />
</code></p>
<p>This is just a simple sample of why you may need custom events <img src='http://doitflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  when you use it in your projects, I&#8217;m sure you will love how it will help you code better OOP.</p>
<p>I hope that helps,<br />
Hadi</p>
]]></content:encoded>
			<wfw:commentRss>http://doitflash.com/custom-event-listener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.656 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-25 20:08:21 -->
