This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ok i want a root <a> node that has two children: a <b> node and a random text node | |
// the random text node should be automatically escaped if appropriate: | |
// <a> | |
// <b/> | |
// a < b | |
// </a> | |
var txt:String = "a < b"; | |
var xml:XML = <a/>; | |
xml.appendChild(<b/>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Visualization/simulation of resolution independent rendering of curves in OpenGL | |
// See http://www.mdk.org.pl/2007/10/27/curvy-blues | |
for(var px:Number = 0; px <= 400; px += 4) { | |
for(var py:Number = 0; py <= 400; py += 4) { | |
drawPixel(px, py); | |
} | |
} | |
// triangle edges |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Draws the first glyph of the first embedded font in a SWF | |
// Visualizes on and off curve points | |
import com.codeazur.as3swf.SWF; | |
import com.codeazur.as3swf.tags.TagDefineFont3; | |
import com.codeazur.as3swf.exporters.AS3GraphicsDataShapeExporter; | |
import flash.display.IGraphicsData; | |
import flash.display.GraphicsPath; | |
import flash.display.GraphicsPathCommand; | |
import flash.geom.Point; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move point on quad Bezier | |
// (De Casteljau's Algorithm) | |
import flash.geom.Point; | |
import flash.display.Shape; | |
import flash.events.Event; | |
var tangent:Shape = new Shape(); | |
addChild(tangent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Implements different bin packer algorithms that use the MAXRECTS data structure. | |
See http://clb.demon.fi/projects/even-more-rectangle-bin-packing | |
Author: Jukka Jylänki | |
- Original | |
Author: Claus Wahlers | |
- Ported to ActionScript3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Show the compile date of a SWF. | |
See http://wahlers.com.br/claus/blog/undocumented-swf-tags-written-by-mxmlc/ | |
--> | |
<s:Application | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
xmlns:mx="library://ns.adobe.com/flex/mx" | |
minWidth="600" minHeight="400" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Records a local webcam feed and converts the recording to SWF. | |
import flash.display.BitmapData; | |
import flash.display.Bitmap; | |
import flash.display.Loader; | |
import flash.events.Event; | |
import flash.events.MouseEvent; | |
import flash.geom.Rectangle; | |
import flash.media.Camera; | |
import flash.media.Video; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.MovieClip; | |
import com.codeazur.as3swf.SWF; | |
import com.codeazur.as3swf.tags.ITag; | |
import com.codeazur.as3swf.tags.TagDefineText; | |
import com.codeazur.as3swf.data.SWFTextRecord; | |
import com.codeazur.as3swf.data.SWFGlyphEntry; | |
import com.codeazur.as3swf.tags.TagDefineFont2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.utils.ByteArray; | |
import flash.display.Loader; | |
import flash.display.Stage; | |
import flash.display.MovieClip; | |
import com.codeazur.as3swf.SWF; | |
import com.codeazur.as3swf.tags.ITag; | |
import com.codeazur.as3swf.tags.TagDefineEditText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gd:Vector.<IGraphicsData> = new Vector.<IGraphicsData>(); | |
gd.push(new GraphicsStroke(1, false, LineScaleMode.NONE, CapsStyle.ROUND, JointStyle.ROUND, 3, new GraphicsSolidFill(0x00ff00, 1))); | |
var potrace:POTrace = new POTrace(); | |
potrace.backend = new GraphicsDataBackend(gd); | |
potrace.potrace_trace(bitmap.bitmapData); | |
graphics.drawGraphicsData(gd); |