Skip to content

Instantly share code, notes, and snippets.

View davestewart's full-sized avatar
⚙️
Workin' on Chrome extensions!

Dave Stewart davestewart

⚙️
Workin' on Chrome extensions!
View GitHub Profile
@davestewart
davestewart / gist:1041464
Created June 22, 2011 22:52
Multiple JSDoc parameters example
/**
* Set the Frame of the Context object
* @param value {Context} A Context object with a valid frame property
* @param value {Boolean} Pass true to grab the current frame
* @param value {String} The name of the frame
* @param value {Number} The 0-based index of the frame
* @param value {Frame} A Frame
* @param [allLayers] {Boolean} Optionally search all layers, when specifying a named frame
* @returns
*/
@davestewart
davestewart / gist:1042345
Created June 23, 2011 10:52
xJSFL reporting output
// --------------------------------------------------------------------------------
// core
/core
/assets
/swf
/config
/templates
/errors
@davestewart
davestewart / gist:1042352
Created June 23, 2011 11:01
xJSFL reporting code
// initialize framework
xjsfl.init(this);
// file / folder callback
function callback(element, index, level, indent)
{
var str = ' ' + indent + '/' + element.name;
if(element instanceof File)
{
if(/^jsfl|xml|as$/.test(element.extension))
@davestewart
davestewart / Dependency loader test.js
Created August 17, 2011 16:35
Dependency loader test
/**
* Dependancy loader test
*/
// --------------------------------------------------------------------------------
// functions
trace = fl.trace;
clear = fl.outputPanel.clear;
@davestewart
davestewart / gist:1151965
Created August 17, 2011 16:37
Dependency loader test: Output
=> LOADING "A" (requires "B", "E")
=> LOADING "B" (requires "A")
"A" is already loaded!
:) "B" COMPLETE!
=> LOADING "E" (requires "F")
=> LOADING "F" (requires "B", "E")
"B" is already loaded!
"E" is already loaded!
:) "F" COMPLETE!
@davestewart
davestewart / prototype demo.js
Created August 18, 2011 19:08
prototype + for..in demo
// modify Object.prototype
Object.prototype.property = 'NEW PROPERTY';
// decalre datatypes
var datatypes =
[
'hello',
1,
new Date(),
{a:1, b:2, c:3},
@davestewart
davestewart / gist:1170345
Created August 25, 2011 09:48
Make Animation: Imports a sequence of png files and exports an SWF
/**
* Make Animation
* Imports a sequence of png files and exports an SWF
* @author Dave Stewart
* @see www.xjsfl.com
*/
function makeAnimation()
{
var folder = fl.browseForFolderURL();
if(folder)
@davestewart
davestewart / gist:1176129
Created August 28, 2011 01:43
/libraries/pocket god lib.jsfl
// From line 829...
// --------------------------------------------------------------------------------
// add a root node to the xml so we can add two nodes
oXml = "<export>\n" + oXml;
if ( oButtonGroupId != null)
{
@davestewart
davestewart / A4Page.as
Created September 14, 2011 22:43
A4Page class
package utils
{
import flash.display.Bitmap;
import flash.display.DisplayObject;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Rectangle;
import flash.net.URLRequest;
import flash.printing.*;
@davestewart
davestewart / auto-comment.js
Created September 21, 2011 15:06
Auto-Commenting macro for Komodo Edit
/**
* @fileoverview Enter trigger for PHPdoc (code based on TAB trigger for Abbreviations by Stan Angeloff)
* @author Nathan Rijksen (http://naatan.com/)
* @contributor Todd Whiteman
* @contributor Michal Kocarek (http://brainbox.cz/)
* @contributor Alexander Kavoun (http://takkmoil.com/)
* @contributor Dave Stewart (http://davestewart.co.uk/)
* @version 0.3
*/
xjsfl.autocomment =