Oscar Trelles
19Mar/070

Domani Studios is hiring

Domani Studios, the company I work for, is looking for two Flash developers to join our team either on a Fulltime or Freelance basis. This position will involve creating games, animations, sites, integrating video content, and tons of other interactive components. We are looking for mid-to-senior level professionals to become a crucial part of a growing team of passionate developers pushing our medium forward.

Requirements
- 3+ years of professional Flash development.
- Expert knowledge of ActionScript 2 and OOP concepts.
- Experience with data-driven Flash applications (XML, Flash Remoting)
- Experience with Flash Video (progressive and streaming)
- Knowledge of HTML, CSS, and Javascript.

Bonus Points:
- Knowledge of databases and content management tools.
- Experience instrumenting sites with Omniture or WebTrends.
- Basic understanding of ActionScript 3.
- 3D or AfterEffects experience.
- Experience with version control systems (SVN)
- Active participation in the Flash community.

Please email your resume and a list of URLs (or portfolio site) clearly
explaining your involvement on each project to: workwithus@domanistudios.com
with "FLASH DEVELOPER" as the subject. You can say that I sent you ;)

About Domani Studios
Domani Studios is an award-winning 25-person interactive design firm in Brooklyn

Filed under: Uncategorized No Comments
19Mar/070

Apollo is Available for Download

Go get your copy on Labs! You get the Apollo SDK, the Apollo Runtime for your platform, documentation and sample applications, and even an extension for Flex Builder.

Can't wait to play with it this week. I was very disappointed after missing ApolloCamp and felt left behind. So, I'm glad it didn't take much longer for Apollo to be available for the general public.

The wave of posts about the release of Apollo on MXNA reminds of the release of Macromedia Central, long ago. The difference is that this one looks much bigger, as Flex and Coldfusion developers join in the fun, not Flash junkies, which was the case for Central.

Enjoy Apollo! and you are doing anything cool with it, keep us posted.

Filed under: Uncategorized No Comments
16Mar/070

Stranded

My flight to San Francisco was canceled, and now I'm stranded in JFK, waiting to see if we can make it into the next flight.

Update
Wireless is kind of screwy around here, trying to find a spot where the connection is more stable.

Update
Scratch that. The T-mobile hotspot at this terminal sucks ass.

Update
All of AA flights to the West Coast for today are canceled, so not a single chance to make to San Francisco on time for ApollCamp.

Filed under: Uncategorized No Comments
15Mar/072

Dynamic MovieClip Registration with AS3

So, you wanna change the registration point of a MovieClip at runtime? Here is some piece of code that allows you to do just that.

Based on an old AS2 class written by Darron Schall, this AS3 class extends MovieClip and adds a new set of properties (x2, y2, rotation2, scaleX2, scaleY2, mouseX2, mouseY2) that allow you to manipulate the sprite based on a contextual registration point that can be set using the setRegistration method.

Here is how it works:

1
2
3
4
5
6
7
8
9
10
11
// Create a new instance
var square:DynamicMovieClip = new DynamicMovieClip();
addChild(square);
 
// Change registration coordinates at runtime
square.setRegistration(20, 20);
 
// From this point on, instead of using 'rotation' 
// we use 'rotation2'
// Same principle applies for 'x', 'y', 'scaleX' and 'scaleY' 
square.rotation2 = 45;

Here's a simple application.

Sources

Filed under: Uncategorized 2 Comments
13Mar/070

FileReference Bug in Flash Player 9 for Mac OS

We found this one at work last week while doing some test for an applications that requires tracking of user uploads. On Flash Player 9 for the Mac, even though tracking progress of the upload went smoothly, the "complete" event failed to trigger every time. Apparently this one was around on Flash Player 8 as well, but the only suggested solution we found, to return an empty string, did not work for Flash Player 9.

We realized the script handling the upload needs to actually output something for the "complete" event to trigger on the Flash Player 9 on the Mac, if even a blank space. However, I decided that if we are going to return something, it'd better be something we can actually use.

In addition to the "uploadComplete" event, the FileReference class has an "uploadCompleteData" event, which can be used to capture the response sent by the script, once the file has been uploaded (or not, depends on your goals). So, here is a simple example of how that may be accomplished with PHP: the following script handles a file upload and returns a string containing the current session id.

upload.php

1
2
3
4
5
6
7
8
9
<?php
 
session_start(); // Not needed if your server is set to start sessions automatically
 
move_uploaded_file($_FILES['Filedata']['tmp_name'], "images/".$_FILES['Filedata']['name']);
 
echo "sessionID=" . session_id();
 
?>

The next AS3 code uses the previous PHP script to save a file to the server. Once the transaction is completed, it will print the value of the sessionID variable to the Output panel.

UploadTest.as

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package
{
	import flash.events.*;
	import flash.net.FileReference;
	import flash.net.URLRequest;
	import flash.net.URLVariables;
 
	public class UploadTest
	{
		var fileRef:FileReference;
 
		function UploadTest()
		{
			init();
		}
 
		private function init():void
		{
			fileRef = new FileReference();
 
			fileRef.addEventListener("select", onSelect);
			fileRef.addEventListener("complete", onComplete);
			fileRef.addEventListener("uploadCompleteData", onUploadCompleteData);
 
			try
			{
				fileRef.browse();
			}
			catch (error:Error)
			{
				trace("Unable to browse for files.");
			}
		}
 
		private function onSelect(event:Event):void
		{
			var request:URLRequest = new URLRequest("path/to/upload.php");
 
			try
			{
				fileRef.upload(request);
			}
			catch (error:Error)
			{
				trace("Unable to upload file.");
			}
		}
 
		private function onComplete(event:Event):void
		{
			var file:FileReference = FileReference(event.target);
 
			trace("completeHandler: " + file.name + "n");
		}
 
		private function onUploadCompleteData(event:DataEvent):void
		{
			var vars:URLVariables = new URLVariables(event.data);
 
			trace(vars.sessionID); // prints the variable value
		}
	}
}

Filed under: Uncategorized No Comments
12Mar/070

AS3 Flash Remoting Example

Using remoting in AS3 is actually quite simple. Remoting calls are now made directly through NetConnection, so there's no need for Remoting classes or components, everything you need is readily available. Here is a quick example.

This is a wrapper class for NetConnection that makes sure we are using the right AMF encoding. The default is AMF3, which is not supported on AMFPHP versions lower than 2.0. So, we use AMF0 instead:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package
{
	import flash.net.NetConnection;
	import flash.net.ObjectEncoding;
 
	public class RemotingService extends NetConnection
	{		
		function RemotingService(url:String)
		{
			// Set AMF version for AMFPHP
			objectEncoding = ObjectEncoding.AMF0;
			// Connect to gateway
			connect(url);
		}
	}
}

The next class is just a test that uses the previous class to make a call.

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
26
27
28
29
30
31
32
33
34
package 
{
	import flash.net.Responder;
 
	public class RemotingTest
	{
		private var rs:RemotingService;
 
		function RemotingTest()
		{
			init();
		}
 
		private function init()
		{
			rs = new RemotingService("http://your.domain.com/amfphp/gateway.php");
			var responder:Responder = new Responder(onResult, onFault);
			var params:Object = new Object();
			params.arg1 = "something";
			params.arg2 = "2";
			rs.call("Class.method", responder, params);
		}
 
		private function onResult(result:Object):void
		{
			trace(result);
		}
 
		private function onFault(fault:Object):void
		{
			trace(fault);
		}
	}
}

Given the following PHP class, the previous exercise could be easily adjusted to print "something and 2" to the Output panel. Just copy it to the 'services' folder of your AMFPHP installation, and replace "Class.method" with "Test.test" on the RemotingTest class.

Test.php

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
<?php
 
class Test
{
 
	function __construct()
	{
		$this->methodTable = array(
 
				"test" => array(
				"description" => "Tests service",
				"access" => "remote"
			)
		);
	}
 
 
	function test($params)
	{
		return $params['arg1'] . " and " . $params['arg2'];
	}
 
}
 
?>

Filed under: Uncategorized No Comments
8Mar/070

VideoCube3d Source File

I got a couple of messages this week requesting the source files for the VideoCube3d example, so here you have them.

I can only provide the classes for the specific exercise. To get the Papervision3d classes, you would be required to join the Papervision3d mailing list.

Enjoy!

Filed under: Uncategorized No Comments
2Mar/070

Scheduled maintenance

I will be doing some maintenance work on my site over the weekend, so you might experience some hiccups starting tomorrow.

Hard hat area

I have already put together a maintenance plan. Most of the work will be in the back-end, not much on the design. I will be upgrading the blog engine, tightening the comment/subscription system, adding a search widget and taking care of orphan documents and other material that didn't make it to the last update (can't remember when was that).

Time permiting, I will be also checking broken links, adding new ones and re-categorizing some blog posts. If you have any suggestions, fell free to post them here.

Filed under: Uncategorized No Comments
2Mar/070

VideoCube 3d Revisited

Last night I found some time to try and figure out was was going on with the video on my previous Papervision3d example. Here is the updated version.

What has changed? the way the video player is being attached to the movie. Before everything was in code and in a single class, which was pretty neat but for some reason I am yet to understand caused the playback to stop at a random point in time.

In order to track the bug I started with a blank slate: and empty FLA and a single class that created a new video object, and then reproduced each frame using a BitmapData object. It worked fine, no problem at all. To test performance I attached the BitmapData object to six different Sprites, all showing at the same time. Still fine. Then I moved this example into a 3D scene in Papervision. Problem. Video got stuck a few times.

The I went the other way around. I placed a video player in the timeline and used it with the original video cube class, removing the code that attached the video. Voila! The only problem being that the resulting SWF is a little bit bigger than necessary and that not everything needed for the movie is in the class. *sigh*

Filed under: Uncategorized No Comments
   

Twitter

Recent

Pages

Categories

Archives

Flickr

669 Bergen St, Brooklyn, NY 11238, USA669 Bergen St, Brooklyn, NY 11238, USA669 Bergen St, Brooklyn, NY 11238, USA669 Bergen St, Brooklyn, NY 11238, USADouble cheese burgerDouble Rainbow