Archive for the 'Uncategorized' Category

Do us all a favor and go update your flash player to 10.0.12.36

The new version of flash is now 10.0.12.36 go keep the web freash!  http://get.adobe.com/flashplayer/

How to create and load fontSwf files and use the loaded swf’s embedded font at runtime.

I just made a video tutorial that shows you how to:

  1. Create a swf with an embedded font.
  2. Create an application and loads that swf and pulls the embedded font from the loaded swf.

This is really simple and really smart if you need to have multiple fonts in your application.

FYI: once again for best video quality use the fullscreen button.

Kulers intergration on Flash CS4.

Some of you may not know that you can get all the benefits of Kuler right from your flash CS4.
Here is a simple video showing just that.

FYI: you will get better quality if you us the fullscreen mode button.

Flash 10’s BitmapData.histogram is really slow?

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.

Actionscript:
  1. package
  2. {
  3.     import flash.display.BitmapData;
  4.     import flash.display.MovieClip;
  5.     import flash.display.Shape;
  6.     import flash.display.Sprite;
  7.     import flash.events.AsyncErrorEvent;
  8.     import flash.events.Event;
  9.     import flash.events.TimerEvent;
  10.     import flash.geom.Rectangle;
  11.     import flash.media.Video;
  12.     import flash.net.NetConnection;
  13.     import flash.net.NetStream;
  14.     import flash.utils.getTimer;
  15.     import flash.display.BlendMode;
  16.     import flash.utils.Timer;
  17.    
  18.     public class Main extends Sprite
  19.     {
  20.        
  21.         private var graphic1:Shape;
  22.         private var graphic2:Shape;
  23.         private var graphic3:Shape;
  24.         private var vect:Vector.<Vector.<Number>> ;     
  25.         private var bmd:BitmapData;
  26.         private var video_mc:MovieClip;
  27.        
  28.         private var rect:Rectangle;
  29.        
  30.        
  31.         public function Main():void
  32.         {
  33.             graphic1 = new Shape();
  34.             graphic2 = new Shape();
  35.             graphic3 = new Shape();
  36.            
  37.             stage.scaleMode = "noScale";
  38.             perspectiveDemo();
  39.  
  40.             bmd = new BitmapData(video_mc.width, video_mc.height);
  41.            
  42.             addChild(graphic1);
  43.             addChild(graphic2);
  44.             addChild(graphic3);
  45.            
  46.             graphic1.blendMode = BlendMode.SCREEN;
  47.             graphic1.x = 30;
  48.             graphic1.y = 200;
  49.             //graphic1.scaleY = .15;       
  50.            
  51.             graphic2.blendMode =BlendMode.SCREEN;
  52.             graphic2.x = 30;
  53.             graphic2.y = 200;
  54.             //graphic2.scaleY = .15;       
  55.            
  56.             graphic3.blendMode = BlendMode.SCREEN;
  57.             graphic3.x = 30;
  58.             graphic3.y = 200;
  59.             ///graphic3.scaleY = .15;
  60.            
  61.         }
  62.  
  63.        
  64.         private function perspectiveDemo():void
  65.         {
  66.            
  67.             video_mc = new MovieClip();
  68.             addChild(video_mc);
  69.             video_mc.x = 30;
  70.             video_mc.y = 30;
  71.            
  72.             var video:Video = new Video(320, 140);
  73.             var nc:NetConnection = new NetConnection();
  74.             nc.connect(null);
  75.             var ns:NetStream = new NetStream(nc);
  76.             ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, handleFakeError);
  77.            
  78.            
  79.             video_mc.addChild(video);
  80.             video_mc.x = 400;
  81.             video.attachNetStream(ns);
  82.             ns.play("http://gfxcomplex.com/labs/wall-e-tlr3_h320.mov");
  83.            
  84.             rect = new Rectangle(0, 0, 140, 300)
  85.            
  86.             var timer:Timer = new Timer(100);
  87.             timer.addEventListener(TimerEvent.TIMER, checkColor3);
  88.             timer.start();
  89.    
  90.         }
  91.        
  92.         private function handleFakeError(e:AsyncErrorEvent):void
  93.         {
  94.                 //
  95.         }
  96.        
  97.        
  98.         private function checkColor3(e:TimerEvent):void {
  99.  
  100.             bmd.draw(video_mc);
  101.            
  102.             vect = bmd.histogram(rect);
  103.            
  104.            
  105.             for (var i:int = 0; i <256; i++)
  106.             {         
  107.                
  108.                
  109.                 graphic1.graphics.lineStyle(.25, 0xff0000);
  110.                 graphic1.graphics.moveTo(i, 0);
  111.                 graphic1.graphics.lineTo(i, -(vect[0][i]));
  112.                
  113.                 graphic2.graphics.lineStyle(.25, 0x00ff00);
  114.                 graphic2.graphics.moveTo(i, 0);
  115.                 graphic2.graphics.lineTo(i, -(vect[1][i]));
  116.                
  117.                 graphic3.graphics.lineStyle(.25, 0x0000ff);
  118.                 graphic3.graphics.moveTo(i, 0);
  119.                 graphic3.graphics.lineTo(i, -(vect[2][i]));
  120.  
  121.             }
  122.             graphic1.graphics.clear();
  123.             graphic1.graphics.clear();
  124.             graphic1.graphics.clear();
  125.         }
  126.     }
  127. }

Meeting today at 6:pm @ Kayaks Coffee house.

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!!!!

Come on down now to the First Adobe AS3 user group meeting in st.louis

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.

Just a friendly reminder about tomorrows meeting

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/