Category: Code

1172: Definition fl.video:VideoEvent could not be found.

May 12th, 2008

I came across this error and am blogging about it so I won’t forget the solution and maybe it will help someone else.

1172: Definition fl.video:VideoEvent could not be found.

In order to access a number of the “fl” packages you need to have a component in your library. In this case I added the FLVPlayback component and all was well. Apparently you can use flash.utils.getDefinitionByName as well.

Adobe’s Video UI Components… sigh

May 9th, 2008

I am in the process of creating a common interface to control media players whether it be Adobe’s VideoPlayer or exanimo’s SoundPlayer. My initial desire was to have it accept Adobe’s own Video Components like PlayPauseButton and SeekBar as well as my own custom controls, but I have run into an issue. Adobe’s Video UI Components do not work on their own but require UIControls.

So if I want a PlayPauseButton to work with SoundPlayer I need to roll my own. If I want a BufferingBar to work, I need to roll my own.

Hopefully in the next version of Flash they will resolve this and give us components that would accept an interface for a target.

IE7 Floats Not Clearing?

March 23rd, 2008

I ran into an issue this weekend with IE7 not clearing my floats correctly. I had a wrapper with a background applied to it and then a content div with floated elements in it. The background was not repeating all the way down the page, and was ending before the content div. I was using my normal methods of clearing floats and of course the page worked fine in Firefox and Safari on the Mac.

After some searching around looking for why this was happening I discovered an article at Position Is Everything that introduced me to a new clearing method which is far more elegant than the solution I was using previously.

You apply the .clearfix class to any div containing a float and its cleared!


.clearfix:after {
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix { display:inline-block; }
/* Hide from IE Mac */
.clearfix {display:block;}
/* End hide from IE Mac */

Roger Johansson also suggests adding the following code to a <=IE6 specific CSS file in order to make sure it works in earlier browsers.


clearfix {height:1px;}

My Favorite ActionScript 3 Events

March 13th, 2008

So far my favorite events are Event.ADDEDTOSTAGE and Event.REMOVEDFROMSTAGE, they just makes things that much easier.

For instance, I have a SimpleToolTip class that all you have to do is addChild and removeChild to manage it. When its added to the stage, I initialize everything that I need to turn on, when I remove it I turn everything back off.

Its just nice and clean.

77e new Music Weekly

March 6th, 2008

Something that I worked on and finished up before leaving sunKING is AE’s 77e New Music Weekly. It showcases a lot of really great bands and provides a few free mp3s each week.

markdown :(

March 2nd, 2008

My Markdown plugin is not processing on the homepage and archives.

WordPress on the iPhone

February 12th, 2008

These guys have created a iPhone version of the WordPress interface. Well done.

ActionScript 3 Menu class

October 28th, 2007

If you build just about any Flash application you will need a menu that will manage button states and let you know when something has been clicked. This class will do that and can be implemented in projects big and small. Below is a very basic example on how it can be used, on the Mall World page it is implemented six times. Can you guess where?

A very basic implementation

Flash 8 is required to view this content. Please download and install the Flash 8 plugin.

Creating a Menu Object can be as simple as this


var menu = new Menu();
menu.addItem({clip: buttonOne, id: 1});
menu.addItem({clip: buttonTwo, id: 2});
menu.addEventListener(MenuEvent.NAVIGATE, this.menuNavigateHandler);

This code is released under the MIT License with just one request. If you improve it in some way that could benefit other users leave a comment.

Download the code & example files

edt-Embed

September 30th, 2006

edt-Embed is a WordPress plugin for embedding content into your posts. As of right now it only supports SWF content using Geoff Stearns’ SWFObject, but I hope to extend it to also embed QuickTime, WMV and any other media that may need to be embeded into a post.

The original concept and code for the plugin came from Ross Gerbasi’s plugin for embeding Google Video. After looking at the code that ended up being embeded on every page, I decided to make my own version that would be a little cleaner and easier on your bandwidth. Ross has a newer version of his plugin that is worth checking it out as an alternative to this.

Download edt-Embed

Syntax

You can embed content with just a src attribute based on what the content is. swf, flv, smil, mp3, yt (YouTube), gv (Google Video) and gmv (GameVideos.com). The flv, smil and mp3 file types require a swf on your server with it’s constant set in the plugin ready to accept a variable of the same name (flv=”myFlv.flv”). Example files coming soon.

YouTube

[embed youTube=“YouTubeVideo.swf”][/embed]

Google Video

[embed googleVideo=“GoolgeVideo.swf”][/embed]

GameVideos.com

[embed gameVideo=“GameVideos.com.swf”][/embed]

FLV

[embed flv=“MyFLV.flv”][/embed]

MP3

[embed mp3=“MyFLV.flv”][/embed]

Or you can add any or all the attributes of the video.

[embed yt=“YouTubeVideo.swf” width=“320” height=“240” version=“9”][/embed]
[embed yt=“YouTubeVideo.swf” version=“9”][/embed]

Constants

You need to edit the plugin’s constants to set default width, height and version numbers for all the content types. I have some defaults set already for YourTube, Google Video and GameVideos.com. Also, if you are doing an FLV, MP3, or SMIL player, you need to have the variables set in the plugin for the swf path to those players.

Bugs, issues and future development

  • Closing tag for CDATA is being encoded to “// ]]&gt”;
  • Add admin panel to edit constants like FLVPLAYER, SMILPLAYER etc
  • Embed javascript file automatically?
  • Category/archive view not displaying the videos.

Version Info

1.2

  • Added support for a new syntax for embedding Google Video, You Tube and GameVideos.com