AS3


16
Feb 12

WinAnt: Unable to locate tools.jar (solved)

I thought I’d post this to save some time for people.

I was setting up WinAnt to run the build script for HTML5 Boilerplate and was thrown an error. It said ‘unable to locate tools.jar…”. I found out that I needed to point the JAVA_HOME path in windows, to the JDK I had just installed. It was pointing at JRE, which was the problem.

SOLUTION: Set JAVA_HOME to the correct path:

C:\>set JAVA_HOME=C:\Program Files\Java\{JDE folder name}

Problem solved.

 

http://forums.devshed.com/showpost.php?p=2472542&postcount=9
http://stackoverflow.com/questions/7697044/ant-and-eclipse


22
Dec 11

PlayStation Unwrapped!

Here’s a little something we put together for SCEE this Christmas. They have been having a free gift givaway. No catch! Pure free gifty goodness! There were some amazing prizes to win, and a big juicy present to throw about to give you a clue to what’s inside!!!!

Hurry, it ends in two days!!

Oh well! It’s all finished now. According to our stats 311,377 people unwrapped 474,436 layers!! Not bad going.

Merry Christmas!

http://unwrapped.eu.playstation.com/


14
Oct 11

Targeting Flash Player 11 & AIR3 for Flash Builder 4.5

Step-by-step for overlaying AIR3 into Flex 4.5.1, and targeting FP11. Unfortunately it’s a little bit complicated at the moment. So here’s what I’ve learnt.

1. First download these:

Adobe AIR3 SDK

PlayerGlobal.swc

 

2. In finder go to “Mac HD > Applications > Adobe Flash Builder 4.5 > sdks” and duplicate “4.5.1″, rename it to “4.5.1-FP11″ or something.

3. Create a folder 4.5.1-FP11/frameworks/libs/player/11.0/ and paste the downloaded playerglobal.swc inside (make sure you rename it to playerglobal.swc)

4. Place the Adobe AIR3 sdk .tbz2 file in the root of the sdk: “4.5.1-FP11/air3.tbz2″.

5. Mac OS: In Terminal, cd to the root directory of the new “4.5.1-FP11″ and run this command:

1
tar jxvf air3X.tbz2

6. Run Flashbuilder.

7. Create a new ActionScript project, then click “configure flex sdks…” then add your new one targeting FP11.

8. Create a new project, then edit html-template/index.template and add this after line 48:

1
params.wmode ='direct';

9. Right-click on your project in FB navigate to “Properties > ActionScript Compiler”, then add the following compiler argument:

1
-swf-version=13

 

You should be good to go!

 

 

Other resources:

http://kb2.adobe.com/cps/495/cpsid_49532.html

 


13
Oct 11

functionToString: Return function name as String in AS3

As simple as this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import flash.utils.describeType;

function functionToString(target:*, f:Function):String
{
  var functionName:String = "error!";
  var type:XML = describeType(target)
  for each (var node:XML in type..method) {
    if (target[node.@name] == f) {
      functionName = node.@name;
      break;
    }
  }
 
  return functionName;
}


function foo():void {
}

function bar():void {
}

trace(functionToString(this, foo)); // returns "foo"
trace(functionToString(this, bar)); // returns "bar"

18
Sep 11

Ableton Live to Flash (AS3)

After seeing Surya Buchwald (http://www.mmmlabs.com) demoing Ableton Live to Flash at Flash on the Beach 2011, I had to find out how it was done. So I got in touch and was led to a link to download their ‘Music Event Description System’. It is a ‘Max for Live’ addon that enables Ableton Live to output OSC messages. I then recieve this data in Flosc which converts the OSC messages from UDP to XML so the data can be used in AS3 via an XML Socket. The rest is magic, and a couple of MovieClips :-)


23
Jun 11

Get Building – Flash Builder 4.5 / Molehill / Incubator / Broomstick

All you Interactive Developers out there – get your free 60 day trial of FlashBuilder, the most recent version of Flex Hero SDK, the accompanying playerglobal.swc, and FlashPlayer 11 and start playing…

Theres a load of info here about how to setup everything up.


26
May 11

Set Properties Function AS3

Here’s a simple, but very useful function that sets the properties of a specified target, with properties of an object.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* Set properties from object
*/

function setProps($target:Object, $props:Object):void
{
  for(var p:String in $props)
  {
    $target[p] = $props[p];
  }
}

// Example use
import flash.text.TextFormat;

var props:Object = {leading:12, color:0xFF0000, size:24};
var tf:TextFormat = new TextFormat();

setProps(tf, props);    // Set the properties of tf with props object

trace(tf.leading + ", " + tf.color + ", " + tf.size);     // check the result

7
Apr 11

YouTube Player API – Sound but No Video (AS3 Gotcha)

Here is a gotcha for the YouTube Player AS3 API . I was trying to use the chromeless player, hearing sound, but not seeing any video. The player was added to the display list, alpha=1, visible=true and it was the only display object.

Solution…

If you use the embedded player, you can call the player.resize() method before the video is playing because the video has already been cued. But if you want to use the chromeless player, you can only call player.resize() after you have cued/loaded a video, not just when the player has dispatched the ‘ready’ event.

Hope this helps someone!


16
Feb 11

Umbro 1350

Here is a site I’ve been developing over the past couple of months at LOVE. It’s for Umbro’s global campaign for 1350. The custom module has been built to run on the existing Umbro Flash site.

umbro.com/1350

Umbro 1350

Umbro 1350

Umbro 1350

Umbro 1350


25
Dec 10

Bed Peace Installation at the Bluecoat

This installation was setup by DOROTHY and LOVE to mark the anniversary of what would have been John Lennon’s 70th birthday and the 30th anniversary of his death in 1980. It was then screened onto Ocean’s media screen outside Liverpool Lime Street Station. It is using software similar to our Two Fingers to War installation, except with the additional challenge of capturing the content to be displayed on the big screen.