5/27/2008

Belated blog from last week

Ok, so all in all today wasn't a bust. I think I walked away from each session with at least a couple new things to ponder about. Not so bad. ReflexUtil was one of those things. Looks to be a great debug utility.  Check it out yourself.

5/21/2008

Flexmaniacs

Ok so I'm in the first seminar for flex maniacs conference. While the keynote was pretty sweet, this skinning seminar is kind of lame. Let's hope I get at least something out of it.

5/16/2008

Utilizing FireFox Firebug

FireBug, for those that don't know about it, is a great little tool for debugging your apps online.  One of the many things you can do is use it as a logger. This is excellent for flash development debugging on the server as you can easliy utilize the console.log, console.debug, console.error, console.warn, and console.info. The following is a quick class I wrote up to use this:

package com.mylibrary.log

{
 import flash.external.ExternalInterface;
 public class FireBugLogger
 {
  public static function log(s:String):void{
   ExternalInterface.call("console.log", s)
  }
  public static function debug(s:String):void{
   ExternalInterface.call("console.debug", s)
  }
  public static function info(s:String):void{
   ExternalInterface.call("console.info", s)
  }
  public static function warn(s:String):void{
   ExternalInterface.call("console.warn", s)
  }
  public static function error(s:String):void{
   ExternalInterface.call("console.error", s)
  }
 }
}
So now you just import your FireBugLogger package and call FireBugLogger.log('HI THERE'), et voila!

5/14/2008

oh the randomness

private function randomSort(a:*, b:*):Number
{
            return Math.random()>.5 ? -1 : 1;
}
private function myFunc():void
{
             var myArrayToSort = [1,2,3,4,5];
            myArrayToSort.sort(randomSort);
             trace(MY ARRAY SORTED IS '+myArrayToSort)
}
Awesome way to randomly sort an array. I'm using this with the sliver movie to randomly place the clips in various positions so every time you watch the movie it's different. Pretty damned cool.

5/13/2008

oh man sweet

So a little update with the video project. I've got things importing into the Sliver clips and tweening open yada yada.  Mostly all of the tweaks are externalized, i.e. the reavling time, duration, text x and y on the clip, but the most fascinating thing was what I just discovered.  I was aware of being able to use the Tweener class to move, set alpha, etc. but I was not aware that there are some default props that you can set that are Numerical. Colors for instance. An example (assume your text is curently set at black text):

Tweener.addTween(myTextField, {_color:0xFFFFFF, time:1})

thats it! Also, blurs are there as well.
Tweener.addTween(myClip, {_blur_blurX:15, _blur_blurY:15, time:2})

and you have a blur. I love running into new stuff that I never needed before but is quite handy.

5/10/2008

Where I am now...

So for this project since I need all the text that will show up in the video to be externalized for language conversion, I have to load everything streaming. This will also cut down on loads times tremendously.  My first idea is to make this nice and quick and simple. I've got 2 classes that I determined I need. I have a "SliverMain" class and a "Sliver" class. I don't want to get too complex with this since I've only got a week and I'm working on other things on top of this. (ugh) my main class will basically Load my sound clip and the sliver elements that I have. I've stored the info for these in an array in a css file that I'm accessing. (Mayeb I'll talk about that later). So since I can pass the url links for those clips in my css, I loop through that creating those clips and storing a reference point to them in an array I aptly named "clipArr". And that's about where I am for my SliverMain class. My sliver class will basically perform the loading of the clips via NetConnection, NetStream, and the Video class. Once the object has been added to the stage it loads it's url that was set in my SliverMain class and sits on the video loading it. So now that I haev this working I'm going to work on masking these clips which has a minWidth (to determine my mask width when closed), and I may need a bgImage to view while the video is stopped and masked (bascially setting my vids alpha to 0 to view my bg for the sliver. Then I also need to grab the length of my audio in my SliverMain class and set a timer based on how many videos are being pulled in and divide that by the length of the audio to determine when my clips should show. I think there may also need to be a buffer time for while the videos are playing, so I'll grab the duration of each video, divide that by two and subrtact that number from each point I got from that. So: (audioDur/numOfClips) - (durationOfClip/2) Doing this is really handy for me as then I kind of pseudo code out what I'm doing while I write. good times.

latest work

So lately I've been working a lot on the flash for the Luxury Collection brand site. This latest piece I'm finding interesting though. I have a week to complete a video in flash. Normally, I would jsut say "screw it" and be lazy with the tweening. Not this time though. Mainly, because the video needs to have all of it's text externalized, and since we already have a good set up that I've been working with, I decided to programatically create this video. It will contain a collage of about 8 videos within the video along with a music track. Along the line throughout the flash, the videos will be masked out and once it's their time to show the  mask is expanded and the video plays.  I'll keep this up to date as I go. I wanna chronicle my voyage through this minor project jsut for the hell of it. 

5/02/2008

Adding Component Usability from Flex to Your Actionscript Project

Today I was in need of a quick alert box but realized the mx.controls.Alert is not included in the accessible packages when creating an Actionscript project. Well, after a bit of searching I found it was really quite easy. Though I imagine it bloats your app due to the component libraries added. Here it goes: 1. Right click on your project>properties 2. Select Actionscript> Build Path> Library Path 3. Add an swc, within this box you can either browse to your respective framework folder or type the following

${PROJECT_FRAMEWORKS}/libs/framework.swc
4. Repeat step 3 but with
${PROJECT_FRAMEWORKS}/locale/{locale}
Now you should be able to access things like mx.controls.Alert if ${PROJECT_FRAMEWORKS) doesn't work you can try ${FRAMEWORKS} and that should work. Otherwise just browse to your framework folder in the sdk folder
::Edit:: So it looks like in theory this would have worked, except that Adobe made their swc files very dependent upon a bunch of other things so unfortunately this just gives errors. I'll be looking into it more and seeing what I can find to fix this.

5/01/2008

More info

I was intrigued by yesterdays talk on this AS3 physics engine so I went looking for stuff. Apparently, on top of the APE engine for 2d there's a 3d engine called the Wow Engine. http://seraf.mediabox.fr/wow-engine/as3-3d-physics-engine-wow-engine/ I'm still in the process of checking out the APE engine but we'll see how that pans out and this WOW engine as well.