Archive for April, 2009

London Flash Platform User Group (30/04/2009)

2009 04 header London Flash Platform User Group (30/04/2009)

In a couple of hours I’m going to listen Seb Lee-Delisle and Carlos Ulloa talking about Papervision 3D.

From the London Flash Platform User Group website:

Papervision3D, Simplified (19:00 – 20:00) – Seb Lee-Delisle
Finally! Realtime 3D in Flash is taking off and there has never been more demand for 3D games, apps and websites. And naturally, with such a powerful library comes somewhat of a steep learning curve.

This session will cover how to create 3D objects in code, import them from other 3D apps and even make a simple game.

We Make. You Enjoy (20:15 – 21:15) – Carlos Ulloa

Dive deep into the third dimension with the creator of Papervision3D and discover the secrets behind his latest interactive 3D experience, HelloEnjoy.com.

The session will focus on the techniques, workflow and planning necessary to overcome the creative and technical challenges of real time 3D in Flash, giving an inside view of the entire creation process, from concept and planning, to development and art production.

For more informations click here.

Post to Twitter

[AS3 SNIPPET] Copy text to clipboard


System.setClipboard("Lorem ipsum");

Post to Twitter

[AS3 SNIPPET] Webcam supported modes


function webcamSupportedModes(minW:Number, minH:Number, maxW:Number, maxH:Number, fps:Number, step:uint = 20)
{
var cam:Camera = Camera.getCamera();

for (var w:uint = minW; w < maxW + 1; w = w + step)
{
for (var h:uint = minH; h < maxH + 1; h = h + step)
{
cam.setMode(w, h, fps);
if (w == cam.width && h == cam.height)
{
trace(cam.width + " x " + cam.height + " @ " + cam.fps);
}
}
}
}

webcamSupportedModes(320, 240, 640, 480, 15, 100);

Post to Twitter

[AS3 SNIPPET] Object to URLVariables


function objectToURLVariables(parameters:Object):URLVariables
{
var paramsToSend:URLVariables = new URLVariables();
for (var i:String in parameters)
{
if (i != null)
{
if (parameters[i] is Array)
{
paramsToSend[i] = parameters[i];
}
else
{
paramsToSend[i] = parameters[i].toString();
}
}
}
return paramsToSend;
}

Post to Twitter

[AS3 SNIPPET] Detect if the swf is local or online (using regular expression)


var localMode:Boolean = new RegExp("file://").test(loaderInfo.url);

Post to Twitter

[AS3 SNIPPET] Rest parameters


function restParams(value:int, ...items):void
{
for (var i:uint = 0; i < items.length; i++)
{
trace(items[i] + " (" + typeof(items[i]) + ")");
}
}

restParams(11, "Lorem", 123, new Date(), {});

Post to Twitter

[AS3 SNIPPET] Quick benchmark a function


function benchmark(func:Function):void
{
var startTime:Date = new Date();

func();

var endTime:Date = new Date();

var benchmark:Number = endTime.time - startTime.time;
var result:String = benchmark + "ms";

trace("result: " + result);
}

function test():void
{
var counter:int = 100000000;
while (counter > 0)
{
counter--;
}
}

benchmark(test);

Post to Twitter

[AS3 SNIPPET] Who called my actionscript method?


function methodToCall():void
{
calledMethod();
}

function calledMethod():void
{
try
{
throw new Error("my error");
}
catch (e:Error)
{
trace(e.getStackTrace());
}
}

methodToCall();

Source: http://blog.comtaste.com/2008/11/how_to_know_who_called_my_acti.html

Post to Twitter

[AS3 SNIPPET] Detect if the swf is local or online

var localMode:Boolean = loaderInfo.url.indexOf("file") == 0;

Source: http://www.mrdoob.com/blog/post/647

Post to Twitter

Flash CS4 Bug: Clicking the “New library panel” button in the library throw an error message

Bug Description
I was working on 2 open documents and I needed to copy a MovieClip from a library to the other. I clicked the “New library panel” button in the library but it throwed the error “Unable to open a new Library Panel. The limit of ten open Library Panels has been reached.”, and my opened Library Panel is only one. Closing and reopening the documents or create a new blank document didn’ fix the problem. So I closed and reopened Flash and it was throwing the same error. Then I closed Flash, Dreamweaver and Photoshop but after reopening Flash was the same situation.

flash bug error panel 150x150 Flash CS4 Bug: Clicking the New library panel button in the library throw an error message

I rebooted the computer but the error persisted. Then I tried to change the workspace and the problem disappeared. Switching back to my personalized profile throw the error.

How To Reproduce
My os is Windows XP SP3 with Flash CS4 Professional (with latest updates). I tried to recreate the same workspace but the error didn’t appear.

Workaround
Select Window -> Workspace -> Reset ‘your workspace name’ in the menù.

Post to Twitter

Next Page »