background preloader

As3

Facebook Twitter

How to embed fonts in pure AS3. On my travels as a contractor, I’ve seen various methods used for embedding fonts in ActionScript 3 projects (code embedded, creating font SWFs, runtime loading, etc).

How to embed fonts in pure AS3

Each of them has its own merits (and limitations), but generally you’re looking for something that’s easy to do, easy to maintain (for others, not just yourself) and of course that works! So, here’s the method I use for pure AS3 projects I compile with the Flex SDK. I embed the TTF or OTF file in a ‘Style’ class and include those font files in the CVS/SVN repository too – it does my head in when fonts go missing, because a designer can’t remember which font they used: [AS] import flash.text.Font; import flash.text.TextFormat; Justpinegames/QuadtreeSprite-Extension. CompiledScripts - as3scriptinglib - Instructions for referencing and re-executing compiled scripts - Library for compiling and executing runtime (dynamic) ActionScript 3/ECMAScript. Library - Home. Thedevstop/asfac. Www.purplesquirrels.com.au/blogstuff/colouruint/ColourUtil.as. AS3: Calculate the perceived brightness of a colour. March 13, 2012 This short post is mainly just a reference for myself but could also come in handy in your projects.

AS3: Calculate the perceived brightness of a colour

I wanted to set text to either white or black depending on the brightness of the colour it was sitting on. I came across this post which provided a formula and some C# code so I was easily able to convert it to AS3. Since red,green and blue are not equally as bright – eg. blue is darker than green – its not as simple as taking an average of all the channels. So the following formula uses some factors to weight the channels in relation to how bright they really appear. brightness = sqrt( 0.241 R2 + 0.691 G2 + 0.068 B2 ) Tom Byrne » Fitting Text into a Box. On a recent job I was tasked with creating a visually elegant replacement for an image out of some text (when an image was unavailable).

Tom Byrne » Fitting Text into a Box

I decided to adjust the font-size of each line of text in a block to fill a box. The result is the TextBoxTest class. To use it, you create a text field, set it’s properties (text/size/multiline etc), then send it to the TextFitter class like this: The second parameter is ‘defaultSize’, this gives the TextFitter a starting point when resizing the text and does affect the end result.

SWF Investigator / Code / [r16] /trunk/SWFInvestigator/src/utils/AS3Compiler. Flump. What Flump converts Flash keyframe animations into texture atlases and XML or JSON that can be easily integrated into any scene graph-based 2D game engine. Flump runtimes exist for a growing number of game engines, including Starling, Sparrow, and Flambe. Create your animations in Flash.

ANE

Odd but valid syntax for retrieving keys or values from an object. MadeInHaus/DraggenDroppen. Hxswfml - xml to swf and abc. AIR SQLite utility library (SQL runner, database copy) A set of libraries for optimizing the process of working with SQLite databases in Adobe AIR.

AIR SQLite utility library (SQL runner, database copy)

Download/Source The AIR SQLite utility library source code is hosted on Github, released under the MIT license. The current version is 0.1.2 beta. Download|Changes Documentation air-sqlite project language reference documentation (including examples) Examples Short examples The minimum to get going. Example 1: Standard (pooled) SQLRunner running a SQL SELECT statement A common use case – running a single SELECT statement to load one row from a table, passing the primary key as a parameter:

Object relational mapping for the Adobe AIR developer - Part 2. By David Tucker In the previous installment of this series, we examined the basics of object relational mapping (ORM) and how it applies to Adobe AIR.

Object relational mapping for the Adobe AIR developer - Part 2

You created an AIR application that uses a single simple data type, and you saved those values to the local embedded SQLite database using FlexORM. In this article, you will expand your application to include some complex relationships using the standard FlexORM metadata. Studios Flash UI Components » [AS3] Referencing Embedded Assets Of Another Class Using Underscore.

This is rather unorthodox but it works.

Studios Flash UI Components » [AS3] Referencing Embedded Assets Of Another Class Using Underscore

In Flash, when you embed an image into the SWF using a static class member of a class, a new class with the name of CLASSNAME_MEMBERNAME is actually created internally. Using flash.utils.getDefinitionByName(), you can access this class, regardless of whether the static member was declared as public or private. This makes it possible to make a very simple embedded image assets manager.

Starling

杜增强.COM-MaxRectsBinPack AS3 Port. What's MaxRectsBinPack MaxRects算法是一个二维图像排列算法,在FlashCS6的Sprite导出功能和TexturePacker中均有使用.

杜增强.COM-MaxRectsBinPack AS3 Port

Reference. ShoeBox. Using ANE (Air Native Extensions) in Haxe. The games we build, are written in Haxe, published as SWFs and packaged with Adobe AIR.

Using ANE (Air Native Extensions) in Haxe

Native-media-picker - ANE allowing iOS users to pick from their media library and play in adobe AIR. Sidescrolling Platformer ~Part 2~ Scrolling the Background with the Arrow Keys « AS3 Game Tutorials. After setting up the basic outline of the platformer in Part 1, we will create a scrolling effect for the background in this tutorial which will be controlled by the arrow keys.

Sidescrolling Platformer ~Part 2~ Scrolling the Background with the Arrow Keys « AS3 Game Tutorials

Keyboard Controls One of the most useful things to be able to do with AS3 is to use the keyboard to control the game. It requires a bit of code, but once you learn to do it you will have a very important building block for any game. Start out by adding the following code to the Actions panel on frame 1 of the timeline: Both of these lines add event listeners to the stage. One problem… those functions don’t exist yet. Right now we only have the shell of each function — they don’t contain the actual code we need to run yet. Time to add the real code of the functions. This code will trace to the output panel whenever you press or release the up, down, left, or right arrow keys.

AS3 iphone like touch scroller. Main Features: Set all of the class inputs live at run timeCPU friendlySwitch between Touch scrolling and desktop scrollingfull interaction with the status of your contentUsing Greensock BlitMask tech for max performance on mobile devicesability to externally scrolling your content, for Anchor purposesHoldArea option in Touch scrolling for easier interaction with the contentSticky scrolling option, just like Android 3.2+ scrolling and iphone like scrollinglots of more detailed options and attentions Click or scan the QR Code to download the sample Android app to see how it works on your own mobile device!

AS3 iphone like touch scroller

Of course the TouchScroll is coded in AS3 and can be used in any AIR mobile apps for IOS/Apple devices too! [ANE] Free AIR Native Extensions Collection. OSX: Fun with Bash and AIR (mount a network device) Unicode Range Finder. AS3 Concurrency/Workers use cases, best practices, and link roundup. Fr.kapit klovis-demo-flex 1.0.0.1. Binding read-only accessors in Flex : Ruben’s blog. Darscan/robotlegs-extensions-Oil. Replacement for object watch [Archive] - kirupaForum.

Node-amf/node-amf at master · timwhitlock/node-amf. Declaring Vectors « JacksonDunstan.com. The differences between Vector and Array have been quite interesting since Vector was introduced in Flash Player 10. Until just recently I didn’t know that there was special syntax for declaring a Vector akin to Array's special a = [1,2,3,4,5] trick.

This got me thinking about the various ways one can declare a Vector and, of course, how they’re implemented in bytecode and what the speed differences, if any, are. Flex 3 - Adobe Flex 3 Help. 3D Realistic Snow, AS2 / AS3. NOW FEATURING on NIKE : Also featured all the winter 2010 on Zara’s worldwide homepage ! This is the best looking snowfall you’ll ever find in Flash. Enjoy the random, realistic and natural-looking 3D motions of the snowflakes. I’m available for support, feel free to ask me your questions. FREE UPCOMING UPDATES : • Presets • “Basic Use” video tutorial • ”Advanced compositing” video tutorial • Examples of layered composition • Optimization advices and explanations • Performance improvements FEATURES • Copy / paste into your project • 100% customizable look and animation • Fill automatically the size your flash file • Very high performances and thousands of snowflakes • Natural and random motion for each snowflake • Natural and random wind simulation • 3D parallax effect for a great feeling of depth • AS3 and AS2 versions • 8Kb only !

Slides

STAGE3D. Mozilla/shumway @ GitHub. Villekoskela. Emotion Fractal in AS3. Aymeric Lamboley » Interactive developer. Hey guys, I hope many of you have seen this amazing video made by Bret Victor: Inventing on Principle. This is one of the best introduction to live coding if you never heard about it. Something about TextField. 2d Visibility. DragonBones - Skeleton Animation Framework. AIR.