AS3 Bulk Loader Library by Arthur Debert

This morning reading my feeds I found a great Library for AS3 posted by Zeh, the Bulk Loader kit nicely written by Authur Debert it’s meant to make complex loading easy freeing you from the Loading and letting you concentrate on other parts of your project.
The project is released under the MIT Licence
Ryan Christensen posted an example of how to use it at his blog [draw.logic]

Google Code

Be sure to check the project at google code

Here’s a little summary of what it does as found on the Project :

* Connection pooling.
* Unified interface for different loading types.
* Unified progress notification.
* Events for individual items and as groups.
* Priority
* Stop and resuming individually as well as in bulk.
* Cache managing.
* Statistics about loading (latency, speed, average speed).
* Multiple kinds on progress indication: ratio (items loaded / items to load), bytes , and weighted percentage.
* Multiple number of retries.
* Configurable logging.

Design goals:

* Minimal imports.
* Few method to learn.
* Dynamic nature: items can be added by specifying a url as a String or a URLRequest .
* Items can be assigned an identifier key to be used on retrival.
* Only one class to learn / use.

BulkLoader tries to gracefully handle progress notification in these use cases:

* Few connections to open: bytes total can be used instantly.
* Many connections opened: progress by ratio
* Many connections opened for data of widely varying sizes: progress by weight.

Download the Bulk Loader here
Test it Yourself and Happy Coding !!!

Dragging and Dropping in Actionscript 3.0

Ok this is a little tip for Dragging your clips on Actionscript 3.0, remember how we used a lot of tricks in Flash to drag a clip from other points that weren’t the anchor point , well in Actionscript 3.0 (herenow AS3) is quite simple to do that by using the new Point class.
Class Point.
Package flash.geom
Class public class Point
InheritancePoint Object
Language version: ActionScript 3.0
Player version: Flash Player 9
The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

So here’s a very short example made in AS3 in wish no matter where your grab the Sprite, it will be dragged from that specific Point.
Heres the example :

This movie requires Flash Player 10

Open in New Window

Here’s the code:

?View Code ACTIONSCRIPT3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
bear.addEventListener(MouseEvent.MOUSE_DOWN, startbearDrag);
stage.addEventListener(MouseEvent.MOUSE_UP, stopbearDrag);
bear.addEventListener(Event.ENTER_FRAME, dragbear);
 
var clickOffset:Point = null;
 
function startbearDrag(event:MouseEvent) {
	clickOffset = new Point(event.localX, event.localY);
}
 
function stopbearDrag(event:MouseEvent) {
	clickOffset = null;
}
 
function dragbear(event:Event) {
	if (clickOffset != null) {
		bear.x = mouseX - clickOffset.x;
		bear.y = mouseY - clickOffset.y;
	}
}

Flash is on the AIR ( AIR:Flash CS3 Professional Update Beta 1 )

Adobe Labs released an Integrated Runtime (AIR) update for Flash CS3 beta 1 this will let you create, package , preview and publish .air Desktop applications right within your Flash CS3, to keep it simple this means that with a Command + Enter (Ctrl +Enter on PC) you’ll be exporting AIR applications.
AIR on Flash

H.264 Format supported in Flash Player, AIR Export within Flash, Now that’s a busy week. : )

My copy of Essential Actionscript 3.0 by Colin Moock arrived

My copy of Essential Actionscript 3.0
This morning at my doorstep was the long awaited Amazon Box containing my copy of O’Reilly Essential Actionscript 3.0 by Colin Moock the longtime waited follow up to what is known in the Flash programing world as The Colin Moock Book, and I’m happy to say it was worth the waiting.
The book it’s equally appealing to first time actionscript users and long time actionscript veterans, Mr. Moock has such a way to make translations from a computer based language to a much more accessible and easy to understand form.

ActionScript 3.0 presents perhaps the most substantial upgrade to Flash’s programming language ever. The enhancements to ActionScript’s performance, feature set, ease of use, cleanliness, and sophistication are simply staggering. Revolutionary improvements abound. Essential ActionScript 3.0 is an update to Essential ActionScript 2.0, once again focusing on the core language and object-oriented programming with some coverage of the Flash Player API. Approximately half of the book focuses on the new features and functionality of ActionScript 3.0, while the rest focuses on changes between the 2 and 3 releases.

The Book is divided in three parts,
Part 1 Actionscript form the ground up.
Where he provides and exhaustive coverage of the core Actionscript language.
Part 2 Display and Interactivity.
Where he explores the techniques for displaying content on screen and responding to input events. ( This is for all of you interactivity lovers ).
Part 3 Applied Actionscript Topics.
In this part the book focuses on Actionscript code-production issues .

To be sincere if you are really a Flash Beginner or a seasoned user of the Flash Technology this book should really be at your desk as a trusty companion in those long coding nights. the book can be found at Amazon Click here to buyor at O’Reilly and don’t forget to visit Mr.Moock site.

Cheers and happy reading!!!.
.swfgeek

San Moore’s Papervision 3D cheatsheets are out

Sean Moore released a very nice set of Papervision 3D cheatsheets. The Papervision 3D Cheatsheet is a free, three page PDF download displaying the entire Papervision 3D programming API. All packages, objects, methods and properties are shown.These are great if you’re an experienced user of Papervision 3D and more usefull if it’s entirely new to you.
Check his post on it here.
Papervision 3D cheatsheets

DOWNLOAD PAPERVISION 3D CHEATSHEETS

FZip Update with support for Adobe AIR

FZIP

Claus Wahlers just released an update for FZIP, a AS3 class library to load, extract/decompress files.

Main updates are:

  • Added support for Adobe Air. The Adobe Air runtime provides a low level inflate method, making it possible to load any ZIP archive and decompress compressed files without the need of injecting Adler32 checksums.
  • Added FZipLibrary class for higher level access to files in a ZIP archive. ?FZipLibrary processes files (based on file extensions) from an FZip instance and converts them into usable formats. Files can be converted to either a BitmapData or DisplayObject classes. Data embedded in SWF files (like classes) can also be retrieved. Flash?s built-in Loader class is used to convert formats, so the only formats currently supported are ones that Loader supports. As of this writing they are SWF, JPEG, GIF, and PNG.?
  • Bug fix: There was a problem with filenames containing special characters. Filename encoding now defaults to UTF-8. In case the filenames are encoded differently in your ZIP, you can specify the encoding in the FZip constructor.

Sound Fun with SoundMixer.computeSpectrum();

computeSpectrum

This is an example of how the computeSpectrum works on Flash CS3, I’ts just great the posible things you can make with it , this is based on a great example made by Peter deHaan In my example I just made the spectrum being represented by circles and have a gradient fill across the spectrum here’s the link.

And here’s the script:

?View Code ACTIONSCRIPT3
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
var url:String ="songs/mysong.mp3";
var request:URLRequest = new URLRequest(url);
var s:Sound = new Sound();
s.addEventListener(Event.COMPLETE, completeHandler);
s.load(request);
var song:SoundChannel = s.play();
song.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
var ba:ByteArray = new ByteArray();
 
var gr:Sprite = new Sprite();
 
gr.x = 20;
gr.y = 200;
 
addChild(gr);
 
var time:Timer = new Timer(50);
time.addEventListener(TimerEvent.TIMER, timerHandler);
time.start();
 
function completeHandler(event:Event):void {
	event.target.play();
}
function soundCompleteHandler(event:Event):void {
	time.stop();
}
function timerHandler(event:TimerEvent):void {
	SoundMixer.computeSpectrum(ba, true);
	var i:int;
	// Gradien Fill
	var fillType:String = GradientType.LINEAR;
	var colors:Array = [0xFF0000, 0x0000FF];
	var alphas:Array = [100, 100];
	var ratios:Array = [0x00, 0xFF];
	var matr:Matrix = new Matrix();
	matr.createGradientBox(400, 20, 0, 0, 0);
	var spreadMethod:String = SpreadMethod.PAD;
	// ends fill
	gr.graphics.clear();
	gr.graphics.lineStyle(0, 0xFF0000);
	gr.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
	gr.graphics.moveTo(0, 0);
	var w:uint = 2;
	for (i=0; i<512; i+=w) {
		var t:Number = ba.readFloat();
		var n:Number = (t * 100);
 
		gr.graphics.drawCircle(i, w, -n);
 
	}
}

Adobe Flex 3 Beta is out.

flex3

Adobe Flex 3 Beta

This prerelease version begins a new, more transparent product development process from Adobe, with frequent, regular access to early builds and greater insight provided into the feature roadmap and planning process. The Flex Builder 3 beta release will provide you with an opportunity to explore powerful new features, communicate early feedback, and test existing Flex applications with the new Flex 3 framework. Some of the new major features include:

* Support for the new Adobe Integrated Runtime (AIR).
* Code refactoring.
* Memory and performance profilers.
* SWF file size reduction through persistent framework caching.
* Advanced datagrid.
* Web service introspection.

Downoad the Beta here

Ted Patrick gave a more in depth info on the subject check his blog here.