<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - tuffstudio</title>
<link>http://snipplr.com/users/tuffstudio</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Fri, 24 May 2013 03:09:56 GMT</pubDate>
<item>
<title>(JavaScript) E4X add nodes</title>
<link>http://snipplr.com/view/67982/e4x-add-nodes/</link>
<description><![CDATA[ <p>prints:


  
  
</p> ]]></description>
<pubDate>Sat, 27 Oct 2012 09:47:06 GMT</pubDate>
<guid>http://snipplr.com/view/67982/e4x-add-nodes/</guid>
</item>
<item>
<title>(JavaScript) String converter</title>
<link>http://snipplr.com/view/67981/string-converter/</link>
<description><![CDATA[ <p>example of use:

var translationTable = { a:1, bb:2, b:3, c:4 };
var MyTranslater = CreateTranslator( translationTable );
MyTranslater('aabbbc'); // returns: 11234</p> ]]></description>
<pubDate>Sat, 27 Oct 2012 09:41:03 GMT</pubDate>
<guid>http://snipplr.com/view/67981/string-converter/</guid>
</item>
<item>
<title>(JavaScript) multi-line text</title>
<link>http://snipplr.com/view/67978/multiline-text/</link>
<description><![CDATA[ <p>prints:

this
is
my
multi-line
text

note
If you want to support special XML chars, you can use a CDATA section:

>> hello

]]>.toString();</p> ]]></description>
<pubDate>Sat, 27 Oct 2012 09:36:09 GMT</pubDate>
<guid>http://snipplr.com/view/67978/multiline-text/</guid>
</item>
<item>
<title>(ActionScript 3) call a function from external swf</title>
<link>http://snipplr.com/view/64559/call-a-function-from-external-swf/</link>
<description><![CDATA[ <p>code below assumes you have method testing() in external swf.</p> ]]></description>
<pubDate>Sun, 15 Apr 2012 07:02:32 GMT</pubDate>
<guid>http://snipplr.com/view/64559/call-a-function-from-external-swf/</guid>
</item>
<item>
<title>(ActionScript 3) Optimized Loops</title>
<link>http://snipplr.com/view/59528/optimized-loops/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 07 Oct 2011 19:09:15 GMT</pubDate>
<guid>http://snipplr.com/view/59528/optimized-loops/</guid>
</item>
<item>
<title>(ActionScript 3) Call function from external SWF in AS3</title>
<link>http://snipplr.com/view/57480/call-function-from-external-swf-in-as3/</link>
<description><![CDATA[ <p>The code below assume you have a method in your external SWF called testing().</p> ]]></description>
<pubDate>Mon, 01 Aug 2011 21:46:17 GMT</pubDate>
<guid>http://snipplr.com/view/57480/call-function-from-external-swf-in-as3/</guid>
</item>
<item>
<title>(ActionScript 3) AS3 recursive font embed</title>
<link>http://snipplr.com/view/52255/as3-recursive-font-embed/</link>
<description><![CDATA[ <p>Well….the truth is: the way Flash deals with font managing just suck! Normally, you’ll have to export the font’s characters. To do this follow these steps:

On the Main Menu go to Text -> Font Embeding
Click on the + thing and add a new font.
Give a name to the font
Select the font on the combobox, and select which group of characters to be exported.
Tip: Be sure to select only the characters you’ll actually use (it doesn’t make sense to export Japanese characters to a brazilian website, right?), because flash will export them on the SWF and this will increase filesize.

5. Go to the actionscript tab and select “Export for Actionscript”

Tip: This is actually optional, but if you are doing a lot of actionscript coding, it’s good to do this because you can use the font asset as an actionscript object and initialize with the new keyword and everything.

6. Select the Textfield you want that font for and type the name of the font you set on step 3. Notice that Flash will put an * after the font name. This is just to identify the font as a library asset.

Now there’s the trick. For every dynamic textfield you have, you must set TextField.embedFonts = true to it’s instance.</p> ]]></description>
<pubDate>Mon, 18 Apr 2011 14:53:13 GMT</pubDate>
<guid>http://snipplr.com/view/52255/as3-recursive-font-embed/</guid>
</item>
<item>
<title>(ActionScript) AS2 trace all items within Object</title>
<link>http://snipplr.com/view/51286/as2-trace-all-items-within-object/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 30 Mar 2011 00:54:19 GMT</pubDate>
<guid>http://snipplr.com/view/51286/as2-trace-all-items-within-object/</guid>
</item>
<item>
<title>(ActionScript 3) Strip HTML Markup</title>
<link>http://snipplr.com/view/47521/strip-html-markup/</link>
<description><![CDATA[ <p>If there is ever a time when you load text from an external source containing unwanted HTML markup use the following function. This uses a regular expression to strip all HTML tags from the input string. The string “Click here to find out more” would simply be converted to “Click here to find out more.”. This returns a new string, leaving the input string unchanged.</p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:17:43 GMT</pubDate>
<guid>http://snipplr.com/view/47521/strip-html-markup/</guid>
</item>
<item>
<title>(ActionScript 3) Remove "http://" &amp;amp;/or "www"</title>
<link>http://snipplr.com/view/47520/remove-http-or-www/</link>
<description><![CDATA[ <p>This function takes a string and returns a copy with all occurrences of http:// and https:// removed. The string, "Please visit http://example.com to find out more" would convert to "Please visit example.com to find out more". Generally this is more compact as the http:// is redundant when you are obviously referring to a URL.

Optionally, this function can also strip the www subdomain by passing true as the second parameter. It's set to false by default as example.com and www.example.com could theoretically contain different websites.</p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:16:09 GMT</pubDate>
<guid>http://snipplr.com/view/47520/remove-http-or-www/</guid>
</item>
<item>
<title>(ActionScript 3) Slugify</title>
<link>http://snipplr.com/view/47519/slugify/</link>
<description><![CDATA[ <p>A slug is usually a few words with each word separated by a delimiting character, usually an underscore or hyphen. A slugified version of the string “10 Tips to a Better Life!” would be “10-tips-to-a-better-life”.
This function takes an arbitrary string and converts in for use as a slug. We use two regular expressions to accomplish this, the first is used to remove any character which is not a word character, space or hyphen, the second replaces any spaces with a single hyphen. Finally we convert the string to lowercase. This returns a new string, leaving the input string unchanged.</p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:13:41 GMT</pubDate>
<guid>http://snipplr.com/view/47519/slugify/</guid>
</item>
<item>
<title>(ActionScript 3) Email Validation</title>
<link>http://snipplr.com/view/47517/email-validation/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:11:42 GMT</pubDate>
<guid>http://snipplr.com/view/47517/email-validation/</guid>
</item>
<item>
<title>(ActionScript 3) Random Number Between Two Values</title>
<link>http://snipplr.com/view/47516/random-number-between-two-values/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:10:11 GMT</pubDate>
<guid>http://snipplr.com/view/47516/random-number-between-two-values/</guid>
</item>
<item>
<title>(ActionScript 3) Get URL of the Page Where SWF is Embedded</title>
<link>http://snipplr.com/view/47515/get-url-of-the-page-where-swf-is-embedded/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:08:52 GMT</pubDate>
<guid>http://snipplr.com/view/47515/get-url-of-the-page-where-swf-is-embedded/</guid>
</item>
<item>
<title>(ActionScript 3) Position Display Objects in a Grid Layout</title>
<link>http://snipplr.com/view/47514/position-display-objects-in-a-grid-layout/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:08:02 GMT</pubDate>
<guid>http://snipplr.com/view/47514/position-display-objects-in-a-grid-layout/</guid>
</item>
<item>
<title>(ActionScript 3) Randomize an Array</title>
<link>http://snipplr.com/view/47513/randomize-an-array/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 19 Jan 2011 22:06:48 GMT</pubDate>
<guid>http://snipplr.com/view/47513/randomize-an-array/</guid>
</item>
<item>
<title>(ActionScript 3) [AS3] Create a random number within a range</title>
<link>http://snipplr.com/view/46626/as3-create-a-random-number-within-a-range/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 06:33:00 GMT</pubDate>
<guid>http://snipplr.com/view/46626/as3-create-a-random-number-within-a-range/</guid>
</item>
<item>
<title>(ActionScript) [AS2] Create a random number within a range</title>
<link>http://snipplr.com/view/46625/as2-create-a-random-number-within-a-range/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 06:31:46 GMT</pubDate>
<guid>http://snipplr.com/view/46625/as2-create-a-random-number-within-a-range/</guid>
</item>
<item>
<title>(ActionScript 3) Custom Random number within range</title>
<link>http://snipplr.com/view/46624/custom-random-number-within-range/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 06:28:06 GMT</pubDate>
<guid>http://snipplr.com/view/46624/custom-random-number-within-range/</guid>
</item>
<item>
<title>(ActionScript) Rotation With Mouse Formulas</title>
<link>http://snipplr.com/view/46293/rotation-with-mouse-formulas/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 30 Dec 2010 21:44:38 GMT</pubDate>
<guid>http://snipplr.com/view/46293/rotation-with-mouse-formulas/</guid>
</item>
</channel>
</rss>