Posted by Shiggs | Posted in Actionscript 3.0 | Posted on 03-06-2010
package
{
import flash.external.ExternalInterface;
public function bug(... args):void
{
ExternalInterface.call("console.log", args);
}
}
Place that in a file called bug.as and drop it in your classpath, now you have a top level function called bug, that takes as many arguments as you want that even traces out objects and their contents. I'm convinced this is the easiest way to trace from the browser.
Posted by Shiggs | Posted in Actionscript 3.0 | Posted on 23-05-2010
I recently started using Firebug for outputting, I usually use Monster Debugger, but Firebug turns out to be really impressive and to have some surprising capabilities. I came across this article on Blitz's blog. Here is a quick recap:
Can take multiple arguments
console.log(a, b, c);
Has message levels
console.debug("message");
console.info("message");
console.warn("message");
console.error("message"); Read the rest of this entry »
Posted by Shiggs | Posted in Actionscript 3.0 | Posted on 20-05-2010
import flash.external.ExternalInterface;
function t(msg:*):void
{
ExternalInterface.call("console.log", msg.toString());
}
Very useful.
Posted by Shiggs | Posted in AIR, Actionscript 3.0, Flash, Flex | Posted on 21-04-2010
I just ran across this on Senocular's blog. It's a comprehensive Actionscript 3.0 reference, I'm surprised I never ran across this before, the beauty of it is that it allows to browse by platform and provides other filtering options as well. If you are a FP (Flash Platform) developer, check it out --> AS3 Ref. Also, check this out too, for your documentation needs --> DOC?
I like seeing that many JS libraries are being hosted online. Saves me a few minutes, but mostly it's just nice to have. SWFObject is now hosted on google here http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js, check it out here. If that's not enough for you here is a generator in AIR to produce embed code for you.
Posted by Shiggs | Posted in Actionscript 3.0, Algorithms | Posted on 18-11-2009
This is a great experiment from Sakri.net. The applications for this should be amazing. It's incredibly simple to use as well. Say you have an object on the stage named test, you simply do the following:
import flash.display.BitmapData;
import net.sakri.flash.bitmap.MarchingSquares;
var bmd:BitmapData = new BitmapData(test.width, test.height, true, 0x00000000);
bmd.draw(test);
var temp:Array = MarchingSquares.getBlobOutlinePointsClockwise(bmd);
Now temp contains Point objects that describe the outline of your item!
DEMO
Posted by Shiggs | Posted in Actionscript 3.0, Flex | Posted on 13-11-2009
It's pretty simple, just do the following
1.) Make sure your SDK supports it. I used 3.4 which you can download here.
2.) After you have done this go to your Flex preferences and add it to "Installed Flex SDK's"
3.) Now go to your project properties and under "Flex Build Path" under the "Library Path" tab remove playerglobal.swc from under the Flex SDK
4.) Click "Add SWC" and navigate to where your SDK is installed which will looks something like this Flex Builder 3\sdks\3.4.0.3794\frameworks\libs\player\10 and add playerglobal.swc from there
5.) Under the new playerglobal.swc you will see Link Type: merged into code click edit and select "external" from the drop down.
6.) Last thing is under "Flex Compiler" make sure your check is for flash player 10.
That's it.
Posted by Shiggs | Posted in AIR, Actionscript 3.0 | Posted on 29-10-2009
HERE
He also provides code for an Air app that will receive a dropped SWF and encrypt it.
Posted by Shiggs | Posted in Actionscript 3.0 | Posted on 07-10-2009
It's really simple. Just place a file in your classpath with the name of the function you want to have. I created one for the DemonstersDebugger that looks like this (filename is fm.as):
package
{
import nl.demonsters.debugger.MonsterDebugger;
public function fm(msg:*):void
{
MonsterDebugger.trace(this, msg);
}
}
That's it. Now I can call fm("testing") from any project. Pretty awesome.