Skip to content

Instantly share code, notes, and snippets.

View IQAndreas's full-sized avatar

Andreas Renberg IQAndreas

View GitHub Profile
@IQAndreas
IQAndreas / gist:1525275
Created December 27, 2011 21:49
FlxDelay with static dispatcher
/**
* FlxDelay
* -- Part of the Flixel Power Tools set
*
* v1.4 Modified abort so it no longer runs the stop callback (thanks to Cambrian-Man)
* v1.3 Added secondsElapsed and secondsRemaining and some more documentation
* v1.2 Added callback support
* v1.1 Updated for the Flixel 2.5 Plugin system
*
* @version 1.4 - July 31st 2011
@IQAndreas
IQAndreas / dynamicObjectTest.as
Created January 15, 2012 12:13
Adding property with custom namespace to dynamic object
package
{
public function dynamicObjectTest():void
{
// Namespace works elsewhere, but not on this dynamic object
//Exception fault: ReferenceError: Error #1056: Cannot create property custom::prop on Object.
var obj:Object = {};
obj.custom::prop = "val";
for (var property:* in obj)
@IQAndreas
IQAndreas / dynamicObjectWithSpaces.as
Created January 16, 2012 04:34
Adding properties with spaces in the name to dynamic objects
var obj:Object = {"my prop":2};
trace(obj["my prop"]);
@IQAndreas
IQAndreas / compass_rotation_compact.as
Created January 17, 2012 06:43
Sample code for making an item point towards the mouse
compass.rotation = Math.atan2(event.stageY - compass.y, event.stageX - compass.x) * (180/Math.PI) + 90;
@IQAndreas
IQAndreas / FDT5.desktop
Created January 17, 2012 14:17
Ubuntu Launcher for FDT5
[Desktop Entry]
Name=FDT5
#Comment=
Exec=fdt5
Icon=/opt/fdt5/fdt-icon.png
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;Application;IDE;
@IQAndreas
IQAndreas / Main.as
Created January 17, 2012 16:03
Performance test for Static Vs Non-Static
package
{
import flash.utils.getTimer;
import flash.text.TextFieldAutoSize;
import flash.text.TextField;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
@IQAndreas
IQAndreas / gist:1657551
Created January 22, 2012 16:15
Progress for dynamic Task queue
//Users can add tasks at ANY time,
// but they are only removed after they are finished
var tasks:Vector.<Task>;
var currentTask:Task;
function nextTask():void
{
//Remove the first task from the list
currentTask = tasks.shift();
}
@IQAndreas
IQAndreas / blogspot-01-23-2012.xml
Created January 24, 2012 10:58
Error message for "Octopress Blogger Import Script"
<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4287406376578749857.archive</id><updated>2012-01-19T02:44:22.086-06:00</updated><category term='images'/><category term='flash'/><category term='solution'/><category term='setChildIndex'/><category term='development'/><category term='965'/><category term='soy tu aire'/><category term='ponycorns'/><category term='offline'/><category term='events'/><category term='reply'/><category term='adobe'/><category term='responds'/><category term='DisplayObject'/><category term='war'/><category term='volumeknob'/><category term='k2'/><category term='iqanderas'/><category term='set'/><category term='not'/><category term='player'/><category t
@IQAndreas
IQAndreas / gist:2580769
Created May 2, 2012 21:46
MineCraft BlockReed.java snippet
// Snippet from class BlockReed.java
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (par1World.isAirBlock(par2, par3 + 1, par4))
{
int i;
@IQAndreas
IQAndreas / Terminal output
Created June 12, 2012 03:56
Terminal output from FDT 5.5
[ERROR]: java.io.FileNotFoundException: .SWFViewerCheck (No such file or directory)
[ERROR]: at java.io.FileInputStream.open(Native Method)
[ERROR]: at java.io.FileInputStream.<init>(FileInputStream.java:137)
[ERROR]: at java.io.FileReader.<init>(FileReader.java:72)
[ERROR]: at com.powerflasher.swfViewer.SWFViewer.readPort(SWFViewer.java:136)
[ERROR]: at com.powerflasher.swfViewer.SWFViewer.getConnection(SWFViewer.java:96)
[ERROR]: at com.powerflasher.swfViewer.SWFViewer.start(SWFViewer.java:31)
[ERROR]: at com.powerflasher.swfViewer.SWFViewer.main(SWFViewer.java:26)
[STDOUT]: No Socket.
[STDOUT]: #