The new version of flash is now 10.0.12.36 go keep the web freash! http://get.adobe.com/flashplayer/
Archive for the 'Uncategorized' Category
I have been playing with BitmapData type and getPixelAt to make histograms. When I seen that the flash 10's BitmapData has a new method called histogram I thought it was a new improvement on analyzing BitmapData. Boy was I wrong. it's really really slow and I don't have clue why. Bug maybe??
Here's the code for any one who thinks it maybe that. Whats your thoughts?
FYI: with a for loop and getPixelAt I could still get 25fps at 1ms cycles. Though I have yet to see the frame rate for histogram, I cant event get close to a 1fps.
-
package
-
{
-
import flash.display.BitmapData;
-
import flash.display.MovieClip;
-
import flash.display.Shape;
-
import flash.display.Sprite;
-
import flash.events.AsyncErrorEvent;
-
import flash.events.Event;
-
import flash.events.TimerEvent;
-
import flash.geom.Rectangle;
-
import flash.media.Video;
-
import flash.net.NetConnection;
-
import flash.net.NetStream;
-
import flash.utils.getTimer;
-
import flash.display.BlendMode;
-
import flash.utils.Timer;
-
-
public class Main extends Sprite
-
{
-
-
private var graphic1:Shape;
-
private var graphic2:Shape;
-
private var graphic3:Shape;
-
private var vect:Vector.<Vector.<Number>> ;
-
private var bmd:BitmapData;
-
private var video_mc:MovieClip;
-
-
private var rect:Rectangle;
-
-
-
public function Main():void
-
{
-
graphic1 = new Shape();
-
graphic2 = new Shape();
-
graphic3 = new Shape();
-
-
stage.scaleMode = "noScale";
-
perspectiveDemo();
-
-
bmd = new BitmapData(video_mc.width, video_mc.height);
-
-
addChild(graphic1);
-
addChild(graphic2);
-
addChild(graphic3);
-
-
graphic1.blendMode = BlendMode.SCREEN;
-
graphic1.x = 30;
-
graphic1.y = 200;
-
//graphic1.scaleY = .15;
-
-
graphic2.blendMode =BlendMode.SCREEN;
-
graphic2.x = 30;
-
graphic2.y = 200;
-
//graphic2.scaleY = .15;
-
-
graphic3.blendMode = BlendMode.SCREEN;
-
graphic3.x = 30;
-
graphic3.y = 200;
-
///graphic3.scaleY = .15;
-
-
}
-
-
-
private function perspectiveDemo():void
-
{
-
-
video_mc = new MovieClip();
-
addChild(video_mc);
-
video_mc.x = 30;
-
video_mc.y = 30;
-
-
var video:Video = new Video(320, 140);
-
var nc:NetConnection = new NetConnection();
-
nc.connect(null);
-
var ns:NetStream = new NetStream(nc);
-
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, handleFakeError);
-
-
-
video_mc.addChild(video);
-
video_mc.x = 400;
-
video.attachNetStream(ns);
-
ns.play("http://gfxcomplex.com/labs/wall-e-tlr3_h320.mov");
-
-
rect = new Rectangle(0, 0, 140, 300)
-
-
var timer:Timer = new Timer(100);
-
timer.addEventListener(TimerEvent.TIMER, checkColor3);
-
timer.start();
-
-
}
-
-
private function handleFakeError(e:AsyncErrorEvent):void
-
{
-
//
-
}
-
-
-
private function checkColor3(e:TimerEvent):void {
-
-
bmd.draw(video_mc);
-
-
vect = bmd.histogram(rect);
-
-
-
for (var i:int = 0; i <256; i++)
-
{
-
-
-
graphic1.graphics.lineStyle(.25, 0xff0000);
-
graphic1.graphics.moveTo(i, 0);
-
graphic1.graphics.lineTo(i, -(vect[0][i]));
-
-
graphic2.graphics.lineStyle(.25, 0x00ff00);
-
graphic2.graphics.moveTo(i, 0);
-
graphic2.graphics.lineTo(i, -(vect[1][i]));
-
-
graphic3.graphics.lineStyle(.25, 0x0000ff);
-
graphic3.graphics.moveTo(i, 0);
-
graphic3.graphics.lineTo(i, -(vect[2][i]));
-
-
}
-
graphic1.graphics.clear();
-
graphic1.graphics.clear();
-
graphic1.graphics.clear();
-
}
-
}
-
}
Today's meeting will be a great day to get better acquainted with each other and talk about ways we can make this user group more efficient. I am currently looking for a second in command to help with the user group.
see you there
- Josh Chernoff.
PS. join the forums!!!!
I'm at kayaks coffee house right now till about 9 pm to host the first ever AS3 Apex user group for st.Louis. At about 6:30 I will begin a presentation on Tools of the trade and talk about a few other as3 things. Even if you can't make it down right now you can still view it from the front page as we are broadcasting live from kayaks coffee house located at
276 North Skinker Blvd, Saint Louis, MO 63130 http://www.google.com/search?q=kayaks+coffee+house&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#
Hope to see you there and if you could please post your thoughts of the quality of the streaming view right now as we are testing and would like your opinions.
thanks - Josh Chernoff.
If you would like to attend tomorrows first AS3 user group meeting for st.Louis at 6pm please go to this link for more information.
http://www.as3apex.com/meeting/first-as3-user-group-meeting-in-stlouis-07-12-08-tools-of-the-trade/







