— React-Native Programmierer . Patrick Tresp

Archive
Allgemein

If this service is really working, it will save a lot of pushing informations through different channels and will make some peoples days.

It only works by invitation currently, but i will give it a try now.

http://ifttt.com/

 

Read More

While trying to set up a simple Example with the StageVideo in FlashPlayer 10.2 i had lots of trouble setting up the Environment. Neither could i use Flash IDE to export correctly for FP10.2 nor could i use FDT to compile a running version.

I relied on the fact, that Flex Hero automatically includes FP10.2 which turned out to be false. Therefore i downloaded the last update and finally had the playerglobal.swc for FlashPlayer 10.2 available.

After having this working, the Example to check the performance was a piece of cake.

package vid
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.StageVideoAvailabilityEvent;
	import flash.events.StageVideoEvent;
	import flash.geom.Rectangle;
	import flash.media.StageVideo;
	import flash.media.StageVideoAvailability;
	import flash.media.Video;
	import flash.net.NetConnection;
	import flash.net.NetStream;
 
	/**
	 * @author patricktresp
	 */
	public class StageVideoTest extends Sprite
	{
		private var _nc : NetConnection;
		private var _ns : NetStream;
		private var _stageVideo : StageVideo;
		private var _video : Video;
 
		public function StageVideoTest()
		{
			var stage : Stage = Main.getInstance().stage;
 
			stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState );
		}
 
		private function onStageVideoState( event : StageVideoAvailabilityEvent ) : void
		{
			var available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE);
 
			_nc = new NetConnection();
			_nc.connect( null );
			_ns = new NetStream( _nc );
			_ns.bufferTime = 0;
 
			var customClient : Object;
			customClient = new Object;
 
			customClient.onMetaData = onMetaDataHandler;
			_ns.client = customClient;
 
			if ( available )
			{
				addStageVideo();
			}
			else
			{
				addRegularVideo();
			}
 
			_ns.play( "video/hd.f4v" );
		}
 
		private function addRegularVideo() : void
		{
			var stage : Stage = Main.getInstance().stage;
 
			var video : Video = _video = new Video();
 
			video.smoothing = true;
 
			video.attachNetStream( _ns );
			stage.addChildAt( video, 0 );
		}
 
		private function addStageVideo() : void
		{
			var stage : Stage = Main.getInstance().stage;
 
			var v : Vector. = stage.stageVideos;
 
			var sv : StageVideo;
			if ( v.length >= 1 )
			{
				sv = _stageVideo = v[0];
				sv.addEventListener( StageVideoEvent.RENDER_STATE, stageVideoStateChange );
				sv.attachNetStream( _ns );
			}
		}
 
		private function stageVideoStateChange( event : StageVideoEvent ) : void
		{
			resize();
		}
 
		private function resize() : void
		{
			_stageVideo.viewPort = new Rectangle( 0, 0, _stageVideo.videoWidth, _stageVideo.videoHeight );
		}
 
		private function onMetaDataHandler( meta : Object ) : void
		{
			if ( _video )
			{
				_video.width = meta.width;
				_video.height = meta.height;
			}
		}
	}
}

Next Step will be the test within an existing application running in Projector.

For Performance Testing i used a very fast Picture-Changing Movie:

No StageVideo:

Yes StageVideo:

Of Course the video.smoothing has a direct effect on the high CPU-usage, without smoothing:

Still more than 30% saved and another step closer to „green programming“.

Read More

Another FFK ( Flash Forum Konferenz ) / beyondtellerrand has passed and left me with new inspirations on how i want to work on and what i want to work on in the future.

Find some interesting Ressources here:

FDT

Molehill

JavaScript

The conference hat obviously more topics than listet before but these are the resources i will need to use in the future.

I am very curious, how molehill will affect the complete Flash importance in the web.

Thanks FFK11!

Read More

Just a try to use WP-Syntax available at the Plugins page…

ActionScript Code Snippet Test

public static function getSquareButton( width : uint, height : uint, color : uint ) : Sprite
{
	var s : Sprite = new Sprite();
	s.graphics.beginFill( color );
	s.graphics.drawRect( 0, 0, width, height );
	s.graphics.endFill();
	return s;
}
Read More