Profile
Achievement
adrianparr's Recent Snippets
- All /
This JavaScript gets you the percentage position of the browser's scrollbar.
1
2996
posted 13 years ago by adrianparr
Font Squirrel is a great place to convert your fonts to the different formats required.
http://www.fontsquirrel.com/fontface/generator
0
1893
posted 13 years ago by adrianparr
Credit for this goes to Adobe, Ric Ewing, Kevin Williams, Aden Forshaw and Sidney de Koning.
0
5436
posted 13 years ago by adrianparr
Basic setup code for jQuery, linking to Google APIs for the jQuery library.
2
2349
posted 14 years ago by adrianparr
TimedText (TT) XML captions files can have namespaces that cause problems when parsing them in AS3. To get around this you can use this code to remove the namespace from the root XML node using Regex. This example uses
0
4210
posted 14 years ago by adrianparr
ActionScript 3
AS3 Convert TextField LineBreaks to CRLF for Display as Plain Text (Notepad) on Windows
Linebreaks differ between Flash TextField and a plain text file like Notepad. In this example we convert the html linebreaks in Flash to \r\n
0
4605
posted 14 years ago by adrianparr
This code gets the current caretIndex in the textfield and then inserts the specified string at that point. The caretIndex position is then updated using setSelection, ready for the next insertion. This was developed to be used with an on-screen keyb...
0
2985
posted 14 years ago by adrianparr
Examples of different ways to truncate/round a decimal number.
0
2463
posted 15 years ago by adrianparr
These two classes demonstrate how to create an external font SWF that contains embedded fonts, and how to then load that external font SWF and access and use the fonts inside it.
0
2825
posted 15 years ago by adrianparr
This font SWF was created using the handy tool FontSwffer (http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/)
0
2014
posted 15 years ago by adrianparr
If you don't deal with namespaces in XML correctly they can break your parsing in AS3. One way of getting around this is to remove the namespace from the XML a using regular expression.
0
2273
posted 15 years ago by adrianparr
I was working on a project where the timestamp string I was getting from the backend developer was pretty dirty in the way it was formatted. For example, it looked like "/Date(1310127448000+0100)/". I needed to get a nicely formatted time from it in...
0
2393
posted 15 years ago by adrianparr
For this to work you need the as3corelib classes from here ... https://github.com/mikechambers/as3corelib
0
5505
posted 15 years ago by adrianparr
This example expects there to be a dynamic textfield on the stage with the instance name of 'myTextFieldOnStage'. Remember to embed the fonts (Numerals and Colon).
0
2665
posted 15 years ago by adrianparr
All credit for this class goes to Ben Kanizay (http://bk4d.com)
0
1878
posted 15 years ago by adrianparr
Full credit for this goes to Deva Raj (@nsdevaraj). This is also a good function for doing a similar thing, http://snipplr.com/view/27954/as3-convert-a-number-to-a-string/
2
2772
posted 15 years ago by adrianparr
ActionScript 3
AS3 ColorUtil Class (inc. RGBtoCMYK, CMYKtoRGB, subtractive colour & addative colour)
Full credit for this class goes to Deva Raj (@nsdevaraj). Many thanks.
1
2409
posted 15 years ago by adrianparr