Sie befinden sich aktuell in den Archiven des Blogs actionscript microcosmos für November, 2007.
- Actionscript2 (4)
- Actionscript3 (53)
- Astro (3)
- Flash (17)
- Pixel Bender (4)
blogs
projects
siteseeing
Archive für November 2007
Preloading in Flash CS3… reloaded.
28.11.2007 von frank reitberger.
A major obstacle in my daily workflow with Actionscript3 is preloading the output. Like I mentioned in a previous post it´s not as trivial as it used to be in earlier Flash-Versions. I focused that mess again and came to a good solution at the end - so let´s take a look at ( you also can download the source wich contains an example):
package fr.utils {
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.text.TextField;
import flash.utils.getDefinitionByName;
public class preloader extends Sprite {
private var canvas :*;
private var rootNode :Sprite;
private var loaderBar :Sprite;
private var callBack :Function;
private var w :int;
private var h :int;
private var rectWidth :int;
private var rectHeight :int;
private var percent :Number;
private var txt :TextField;
public function preloader() {}
public function launch( canvas:*, rectWidth:int, rectHeight:int, loaderTxt:TextField, callBack:Function ) {
this.canvas = canvas;
this.rootNode = new Sprite();
this.loaderBar = new Sprite();
this.txt = loaderTxt;
this.callBack = callBack;
this.rectWidth = rectWidth;
this.rectHeight = rectHeight;
addChild( this.rootNode );
addChild( this.txt );
this.canvas.stage.align = "TOP_LEFT";
this.canvas.stage.scaleMode = StageScaleMode.NO_SCALE;
this.w = this.canvas.stage.stageWidth;
this.h = this.canvas.stage.stageHeight;
var xPos :Number = Math.round( ( this.w / 2 ) - ( this.rectWidth / 2 ) );
var yPos :Number = Math.round( ( this.h / 2 ) - ( this.rectHeight / 2 ) );
this.rootNode.x = xPos;
this.rootNode.y = yPos
this.rootNode.graphics.lineStyle( 1, 0xFFFFFF );
this.rootNode.graphics.drawRect( 0, 0, this.rectWidth, this.rectHeight );
this.rootNode.addChild( this.loaderBar );
this.rootNode.addEventListener( Event.ENTER_FRAME, catchBytes );
}
private function catchBytes( event: Event):void {
this.percent = Math.round( ( this.canvas.loaderInfo.bytesLoaded / this.canvas.loaderInfo.bytesTotal ) * 100 );
this.loaderBar.graphics.beginFill( 0xFFFFFF );
this.loaderBar.graphics.drawRect( this.loaderBar.x - this.loaderBar.x, this.loaderBar.y - this.loaderBar.y, this.rectWidth, ( this.rectHeight * this.percent ) / 100 );
this.txt.text = this.percent + "%";
if ( this.canvas.loaderInfo.bytesLoaded >= this.canvas.loaderInfo.bytesTotal ) {
removeChild( this.txt );
removeChild( this.rootNode );
this.rootNode.removeEventListener( Event.ENTER_FRAME, catchBytes );
this.callBack();
}
}
}
}
That´s my way of preloading AS3-contents for the future. The class could be a little more handy anyway, but for the fact it´s as little as version0.1, let´s see what next
enhacements version0.2 may bring.
Geschrieben in Actionscript3 | 1 Kommentar »
Turbulence… 100000 particles by 18 FPS.
18.11.2007 von frank reitberger.
One of my favourite playgrounds are particles. Actionscript3 allows amazing gadgeteers when you script class-based to get in use of the just in time compiler. Below is the result of my latest experiment called “turbulence” (inspired by a piece of code written in processing by bit101). It runs with 10000 particles actually because the turbulences are looking nicer then. You can rotate the whole scene by movin´ your mouse, and you can add some filters to it by holding down the mouse-button. But this snippet should handle up to 100000 particles without running lesser then 18 FPS (hopefully). Feel free to grap the sources and make your own experimentations as well.
Geschrieben in Actionscript3 | 1 Kommentar »
FOTB-Review on COD.
16.11.2007 von frank reitberger.
My little Review of the “Flash on the beach“-conference ´07. For all who have missed that unique conference or just want to have a look at my impressions from Brighton, feel free to read the article on www.createordie.de. In my opinion, it was one of the best conferences I´ve been to…

Geschrieben in Actionscript3 | 1 Kommentar »
Flash on the beach… what a sexy beast.
12.11.2007 von frank reitberger.
WOW! Flash on the beach was absolutely amazing. A fantastic line-up of speakers, astonishing inspiring sessions and lots of lovely people… I definitively will take part there again next year! So following up - here are some impressions:









Geschrieben in Flash | 1 Kommentar »
