Ramblings

June 30, 2008

How to add duration info to a FLV file with the flvtool2 command

Filed under: cool, flash, flex, flv, linux, one-liner, python, shell, tip, tool — michaelangela @ 1:37 am

Very useful. Sometimes some flv conversion tools don’t include info that is vital for playback. In this case, the seekbar wouldn’t show up in the player until after playback finished. I’ll be testing to see if this resolves it but either way, this is good to know. The first hint was this post stating that the duration metadata probably wasn’t present in the file. A quick test with flvtool2 showed that indeed there was NO metadata. Using the command shown here, the data was added. I might either wrap this up in a python wrapper to batch a directory with it, or just bite the bullet and learn more shell programming to loop through all matching files in a directory.

[edit] I guess looping in shell programming isn’t so bad:

ls -1 *.flv | while read file; do cat "$file" | flvtool2 -U stdin "$file" ; done

Add duration metadata into flv movie – Shell Script (Bash) – flv, movie, flash, duration, metadata, flvtool2

By default an flv movie doesn’t contain the duration metadata. Using the flvtool2 program it is injected like this into the movie file.

cat mymovie.flv | flvtool2 -U stdin mymovie.flv

Advertisements

June 26, 2008

Free DNS report tools

Filed under: cool, dns, education, tip, tool — michaelangela @ 6:38 pm

Excellent comparison and info on free DNS reporting tools which come in handy when DNS is doing what it shouldn’t… at least not what you think it should! In the end I used intoDNS, CheckDNS.net, and pingability.

Free DNS Report alternatives

Everyone that runs a web server or even a site needs to run a DNS
check from time to time. For a long time I have been a happy user of a
site DNSstuff.com. But couple of months ago they started charging for their main check called DNSReport.

For few queries a month I’m not willing to subscribe for $80 a year, and I’m certainly not alone.

Finally
I have done some research and tried to find alternatives. Here are the
results with ratings, where 10/10 is what DNSReport gave us.

June 15, 2008

Enums, Objects and the joys of being typesafe

Filed under: as2, as3, education, flex, tip — michaelangela @ 1:51 pm

I like autocomplete. I also like it when the compiler (or IDE) tells me I am doing something wrong BEFORE I compile. Flexbuilder is my AS3 compiler of choice. Although FlashDevelop 3 has come a really long way. It’s PC only though. 😦

Anyway, just did some reading about Enums in AS2. This bit of reading below came courtesy of a link here about creating typesafe enums in AS3. I really like this. I particularly like the idea of the “Month” class given in the comments on the page below. In addition to being typesafe, by attaching an ordinal to each value, you can compare your values. So in that case Month.JAN would be less than Month.MARCH. (There is also a discussion about “SCREAMING_CAPS” that was enlightening. I digress…)

blog-j: Symbolizing, Coding, Objectifying, Processing » Code. Code. Code.

I’m in the middle of reading Code Complete, Second Edition by Steve McConnell
(a book which I can’t recommend highly enough). One of the key points
of the book is that just because your language doesn’t natively support
a certain implementation ideal (for example, private field members or
classes), you should work around those limitations by ‘programming into the language, not in the language.’ One example he gives of this is Enumerated types.

The definition of an Enumerated type is this: “A list of named
values used as the range of a particular attribute type. For example,
Color = {Red, Green, Blue} (source).”

This can be useful in limiting possible values for a methods
arguments (and more). For example, by using an Enumeration of
SearchTypes, you can ensure that the searchType argument falls into the
valid values for a SearchType.

Enums, Objects and the joys of being typesafe

Filed under: as2, as3, education, flex, tip — michaelangela @ 5:16 am

I like autocomplete. I also like it when the compiler (or IDE) tells me I am doing something wrong BEFORE I compile. Flexbuilder is my AS3 compiler of choice. Although FlashDevelop 3 has come a really long way. It’s PC only though. 😦

Anyway, just did some reading about Enums in AS2. This bit of reading below came courtesy of a link here about creating typesafe enums in AS3. I really like this. I particularly like the idea of the “Month” class given in the comments on the page below. In addition to being typesafe, by attaching an ordinal to each value, you can compare your values. So in that case Month.JAN would be less than Month.MARCH. (There is also a discussion about “SCREAMING_CAPS” that was enlightening. I digress…)

blog-j: Symbolizing, Coding, Objectifying, Processing » Code. Code. Code.

I’m in the middle of reading Code Complete, Second Edition by Steve McConnell
(a book which I can’t recommend highly enough). One of the key points
of the book is that just because your language doesn’t natively support
a certain implementation ideal (for example, private field members or
classes), you should work around those limitations by ‘programming into the language, not in the language.’ One example he gives of this is Enumerated types.

The definition of an Enumerated type is this: “A list of named
values used as the range of a particular attribute type. For example,
Color = {Red, Green, Blue} (source).”

This can be useful in limiting possible values for a methods
arguments (and more). For example, by using an Enumeration of
SearchTypes, you can ensure that the searchType argument falls into the
valid values for a SearchType.

Pure AS3 preloader

Filed under: as3, dev, flash, flashdevelop, flex, tip — michaelangela @ 12:09 am

Well I wasn’t making a game but I just went through what the author describes: finishing up the app, gotta set up the preloader. I did a manual version of this but I like this idea. However I am not using FlashDevelop. 😦 I am in the Flash IDE for compiling. I have thought of being able to just embed assets from Flash CS3 into a Flexbuilder / Flashdevelop AS3 project. And it seems to be becoming a popular thing to do.

gamepoetry » The Last Preloader You’ll Ever Need

Zero Effort Preloading

Based on the fundamentals established in the bit-101 article, I have
provided an AbstractPreloader class. You must subclass this class in
order to create a meaningful preloader for your game. These are the
steps required to get your preloader working:

  1. Extend the provided AbstractPreloader class.

  2. Override the following protected functions: beginLoading,
    updateLoading( percent ), endLoading. If your Main class is not called
    “Main”, then override the mainClassName function too.

  3. Embed the preloader with a single line of code.

  4. Be mindful of gotchas.

That’s it, really.

List all symbols and their linkages in a Flash file

Filed under: as3, flash, flex, functional testing — michaelangela @ 12:02 am

I am just wondering out loud… is this possible? Is there a way to list all the symbols in a Flash file and the classes linkages defined for them? Ah, perhaps better still, if the symbols are the same name as the class they are to link to, scan all the symbols and scan all the classes in the project and see if they are all linked appropriately.

It’s not so bad though. If you miss the linkage, you get a runtime error. It would be nice to catch it earlier though.

I suppose with a custom Flash panel it would be possible though. Seeing what some do, like the very cool and have-not-yet-had-time-to-try-out Gaia framework, it looks like something like this would really be possible.

June 10, 2008

Howto: Flexbuilder 3 to debug Flash CS3 projects?!

Filed under: as3, dev, flash, puremvc, tip, tool — michaelangela @ 7:50 am

I have to say… if you EVER have to code in AS3 for Flash, using Flexbuilder is just downright awesome. Code completion (that ignore case unlike the Flash IDE), refactoring support, all kinds of goodness in general. Man… even things like searching for references to a particular function throughout the code base of the project.  I used this while working on a data-heavy Flash project aided by PureMVC. Sweet indeed.

The Morphic Group » Blog Archive » Using FlexBuilder 3 to debug & edit Flash CS3 projects

Recently I was working on a project that due to a requirement had to be compiled in Flash CS3. Having spent the last few years exclusively using FlexBuilder I was shocked at the HORRIBLE AS3 editor and debugger in Flash CS3. I quickly tried to figure out how to edit and debug from FlexBuilder 3. I got some help along the way, and wanted to share the process.

June 7, 2008

Photoshop color shift when doing save for web

Filed under: cool, photoshop cs3, tip — michaelangela @ 11:53 pm

Some very helpful and good steps on getting consistent color out of your photoshop setup. Uncheck that convert to sRGB before you save as well! We’ll try it out and see.

The Mysterious “Save For Web” Color Shift | Web Design Blog: Web Design & Innovation in web standards : Viget Labs

What we’re doing here won’t make your colors look the same on all monitors or machines. Macs will display lighter (by default, at least), and monitors themselves will experience crazy color shifts based on age and settings. Reassure yourself: This is not your fault. The key is to calibrate your monitor as close to the center as possible, use Proof Colors (we’ll get to that) to make sure details aren’t getting blown out on other platforms, and be prepared to gently explain to clients why your green looks like aqua on their friend’s 1992 Trinitron.

Blog at WordPress.com.