<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: flash</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>ArrowBase and wmode transparent on Flash</title>
        <link>http://www.posteet.com/view/1362</link>
        <description>
        <![CDATA[<pre>package tools
{
	
	/**
	 * this class allows to bypass the wmode restriction for the @ character
	 * @author lcharpentier
	 */
	
	import flash.events.KeyboardEvent;
	import flash.events.TextEvent;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.ui.Keyboard;
	import flash.display.Stage;
	import Error;
	 
	public class  ArrowBaseConverter
	{
		private static var arrObject:Array = new Array();
		private static var arrKey:Array = new Array();
		private static var bPower:Boolean = false;
		private static var bDetected:Boolean = false;
		private static var oTarget:TextField;
		
		/**
		 * Static method used to watch a textfield object and detect an @ character
		 * @param	text
		 */
		public static function watch(text:TextField) 
		{
			if (!bPower)
				startConverter(text);
			if (!isMonitored(text))
			{
				text.addEventListener(Event.CHANGE, handleChange);
				arrObject.push(text);
			}
		}
		
		/**
		 * Method used to stop the survey of a textField
		 * @param	text
		 * @return boolean
		 */
		public static function release(text:TextField):Boolean
		{
			try{
				if (isMonitored(text))
				{
					text.removeEventListener(Event.CHANGE, handleChange);
					arrObject.splice(arrObject.indexOf(text), 1);
					return true;
				}
				return false;
			}
			catch (err:Error)
			{
				throw(&quot;An error occured while trying to unregister a the ArrowBaseConverter :&quot; + err.message);
			}
			finally
			{
				return false;
			}
		}
		
		
		/**
		 * Method used to check if a textfield is already under survey
		 * @param	text
		 * @return boolean
		 */
		public static function isMonitored(text:TextField):Boolean
		{
			
			if (arrObject.indexOf(text)!=-1)
				return true;
			else
				return false;
		}
	
		/**
		 * Method used to initialize the survey engine
		 * @param	text
		 */
		private static function startConverter(text:TextField):void
		{
			if (text.stage == null)
				throw new ArgumentError(&quot;the TextField has to be into the display list to use this Class&quot;);
			else
			{
				text.stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeydown)
				text.stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyUp)
			}
		}

		/**
		 * Listener used to check on change on a textfield
		 * @param	e
		 */
		private static function handleChange(e:Event):void
		{
			oTarget = e.currentTarget as TextField;
			
			if (bDetected)
			{
				oTarget.text = oTarget.text.slice(0, -1)+&quot;@&quot;;
				bDetected = false;
			}
		}
		
		/**
		 * Listeners used to detect an key press
		 * @param	e
		 */
		private static function handleKeydown(e:KeyboardEvent):void
		{
			trace(&quot;key:&quot;+detectArrowbase(e.keyCode, e.charCode));
			if(arrKey.length == 0 || (arrKey.length &gt; 0 &amp;&amp; e.keyCode != arrKey[arrKey.length-1].key))
			{
				if (detectArrowbase(e.keyCode, e.charCode))
					bDetected = true;
				else
				{
					bDetected = false;
					arrKey.push({ key:e.keyCode, char:e.charCode});
				}
			}
		}
		
		/**
		 * Listener used to detect any key press
		 * @param	e
		 */
		private static function handleKeyUp(e:KeyboardEvent):void
		{
			arrKey = arrKey.splice(arrKey.indexOf(e.keyCode), 1);
		}	
		
		/**
		 * Method used to recognize a key associations which match the @ character
		 * @param	kCode
		 * @param	cCode
		 * @return bollean
		 */
		private static function detectArrowbase(kCode:Number, cCode:Number):Boolean
		{
			//trace(kCode + &quot; | &quot; + cCode);
			//Mac @ key verification
			if (kCode == 50 &amp;&amp; cCode == 64)
				return true;
			//PC Azerty @ verification
			else if (arrKey.length &gt; 0 &amp;&amp; arrKey[arrKey.length - 1].key == 18 &amp;&amp; arrKey[arrKey.length - 1].char == 0 &amp;&amp; kCode == 48 &amp;&amp; cCode == 224)
				return true;
			else
				return false;
		}
		
	
	}
	
}</pre> <a href="http://www.posteet.com/tags/AS3">[AS3]</a>  <a href="http://www.posteet.com/tags/embed">[embed]</a>  <a href="http://www.posteet.com/tags/flash">[flash]</a>  <a href="http://www.posteet.com/tags/object">[object]</a>  <a href="http://www.posteet.com/tags/wmode">[wmode]</a> ]]>        </description>
        <dc:creator>loctar</dc:creator>
        <pubDate>Thu, 13 Nov 2008 15:13:59 +0000</pubDate>

            <category>AS3</category>
            <category>embed</category>
            <category>flash</category>
            <category>object</category>
            <category>wmode</category>
    
    </item>

  
    <item>
        <title>Solapamiento Div's y Flash</title>
        <link>http://www.posteet.com/view/723</link>
        <description>
        <![CDATA[<pre>&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0&quot; width=&quot;500&quot; height=&quot;200&quot; title=&quot;slip&quot;&gt;
&lt;param name=&quot;movie&quot; value=&quot;RUTA_ARCHIVO&quot;&gt;
&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;
&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt; &lt;!-- este es el parametro que hara que los div's esten por encima del objeto flash --&gt; 
&lt;embed src=&quot;RUTA_ARCHIVO&quot; width=&quot;500&quot; height=&quot;200&quot; quality=&quot;high&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;</pre> <a href="http://www.posteet.com/tags/css">[css]</a>  <a href="http://www.posteet.com/tags/flash">[flash]</a>  <a href="http://www.posteet.com/tags/html">[html]</a>  <a href="http://www.posteet.com/tags/object">[object]</a> ]]>        </description>
        <dc:creator>jacinmontava</dc:creator>
        <pubDate>Mon, 04 Feb 2008 09:54:11 +0000</pubDate>

            <category>css</category>
            <category>flash</category>
            <category>html</category>
            <category>object</category>
    
    </item>

  
    <item>
        <title>ActionScript replace function</title>
        <link>http://www.posteet.com/view/685</link>
        <description>
        <![CDATA[<pre>function replace(str:String,find:String,replace:String):String
{
	var index:Number;
	while(str.indexOf(find)!=-1)
	{
		index= str.indexOf(find);
		str = str.substr(0,index) + replace + str.substr(index + find.length);
	}
	return str;
}</pre> <a href="http://www.posteet.com/tags/actionscript">[actionscript]</a>  <a href="http://www.posteet.com/tags/flash">[flash]</a>  <a href="http://www.posteet.com/tags/replace">[replace]</a>  <a href="http://www.posteet.com/tags/string">[string]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Tue, 22 Jan 2008 22:41:26 +0000</pubDate>

            <category>actionscript</category>
            <category>flash</category>
            <category>replace</category>
            <category>string</category>
    
    </item>


</channel>
</rss>
