SEO Techniques for Flash

SEO (search engine optimization) refers to the tailoring of web based content so that search engines like Google can traverse it and index it more efficiently. Flash content on the web has typically been difficult to index. However, if you understand the underlying methodologies of SEO indexing, you can understand how to index your Flash content.

Whether you are indexing just a site or a specific application, SEO is important because it let’s people find your content. At Dreamsocket, we have advised clients with some of the highest trafficked Flash content in the world on how to accomplish this. And though we found write ups on specific techniques, we figured that a more comprehensive break down of the subject and techniques was needed. To address this, we have published an article and example files on our site that break down different techniques that we have used or seen over the years. In the article we compare and contrast the techniques by showing their benefits and drawbacks, as well as how to accomplish them.

Check and comment on the article when you get a chance. The more information on this subject the better!

No Comments

Introducing the Dreamsocket Media Framework for the Adobe Flash Player

home-bg

I am pleased to announce the release of the Dreamsocket Media Framework for the Adobe Flash Player. The framework consist of a suite of native components and source code for Flash and Flex written in both Actionscript 2 and 3. That equates to 3 code bases, 3 suites of components, all wrapped into 1 product.


FLEXIBILITY

The framework has been built with flexibility in mind. So whether you need a robust low level video stream object, or you would like to use a drag and drop component, there is something for you. It is a enterprise level code library. You can build video players, image galleries, mp3 players, and more. Why is this type of framework important? Previously, building enterprise video players and media applications hasn’t been a straight forward process. The existing components are difficult to extend, the Flash APIs aren’t simple to use, the Flash player doesn’t always work correctly and quite simply an enterprise framework or toolkit for developers to create these type of applications didn’t exist.


ENTERPRISE-BATTLE TESTED

Since 2003, Dreamsocket has grown a business by fulfilling this niche. We have built an enterprise media framework that companies including Disney, Cartoon Network, TBS, PGA, NASCAR, Super Deluxe, and others use at the core of their custom video players. We have had to deal with so many CDNs, advertising vendors, backend services, and requirements, that sometimes it made our heads spin. Yet, at the same time, it has given us unparalleled experience. Our knowledge base on building video players has grown tremendously over the past 6 years. We know all the quirks, needs and elements that go into building enterprise media applications. Creating playbacks that work, ad engines, closed captioning and more our framework has been solidified over time.


IMPROVED FROM EXPERIENCE

Despite our confidence in adding to and refactoring our existing code base, we made a bold decision to refactor from the ground up seven months ago. Our goal was simple: To create the best framework for building enterprise media applications. Not only were we looking to simplify our own work tasks and address the emerging changes in the video landscape, but we also wanted to enable others to do what we do. It just seemed like a natural progression and the right thing to do.


To start this project, we went back and researched all of the dominant media technologies over the past nine years. We did this in hopes of finding common threads in all of them and pulling out the superior elements from of some of them.


We examined the APIs for Silverlight, Windows Media, QuickTime, Real Player, Android, Flash, HTML 5 Video, VLC, and Move. In addition, we reinvestigated the specifications around subtitles (Timed Text, SRT, RealText, SMI, QText, 3gpp Time Text), playlists (SMIL, XSPF, MediaRSS, ASX, ATOM), and ads (VAST). Needless to say, we did a lot of reading and thinking, and it more than paid off, because it allowed us to see things from different perceptions and deliver an API that is extremely easy to use. Now, you simply code to an API without worrying about content type (FLV, JPEG, MP3, etc) or content delivery (live, DVR, progressive, range request, and ondemand streaming) in your application logic.


Though we were looking at everything from a high level, we also dug our heels into the details. We listed every issue that we’ve encountered over the years, and sought to fix them all. From writing our own sound buffering algorithms to time syncing seeks for ondemand streams, you now have a media API that behaves how you expect it should.


Last but not least, we focused on creating a common framework across platforms. It was obvious to us, that people choose to develop Flash applications in many different ways. So we mirrored all of our development efforts in both Actionscript 2 and 3, as well as Flash and Flex. As much as we could, we made every API exactly the same. We even went as far as rewriting AS2 to mimic AS3. Yes, there is an AS3 style event framework in AS2, along with AS3 emulated native objects like NetStream. No matter what your programming environment affinity for the Flash player is, we have you covered.


THE RESULTS AND THE FUTURE

All said and done and seven exhausting months later, our new release is here. With years of battle testing our code base, we now present a remodeled version that stands on solid ground and looks to the future. With the primary focus on the base level architecture and playbacks, we have laid an extremely solid foundation for everything moving forward. In the months to come, the framework will grow to include all of the elements that we have developed over the years. It is an unbelievable offering, and we can’t wait to start using it ourselves.


So why hesitate? Go and grab the Dreamsocket Media Framework today. We can’t wait to see what you do with it .

Many thanks to class mate and buddy Trevor Vanbeater, of FlyGuy fame, for the awesome icons.

No Comments

Dreamsocket Website

After years without a website, today Dreamsocket is finally launching its online presence. The reason: we have always wanted a platform to give back to the community and launch our ideas from. Of course, we threw in common info about us, our clients and what we are doing for those who want to get to know us. However, our focus was to build a site robust enough to share all of our knowledge, tools and future plans to enable those around us. We accomplished this by creating three comprehensive elements on the site: support, products and a user accounts.

SUPPORT

documentation

A lot of our work with clients and the community involves education, where we are trying to explain technologies, concepts or our own tools. This is because when you deal with specialized subjects without a knowledge base around it, you can’t come up with a proper solution. The more specialized a subject is, the harder to move the overall space forward. Our support section aims at creating a point of reference for ourselves, our clients and the community in general to address this. Whether you are building enterprise video applications with integrated ad systems or you want to understand Flash SEO, we want to help.

The support section covers both subject and tool specific information and is broken down into articles, forums, documentation with commenting, a bug tracker, and release notes. Everything is publicly available and will grow significantly over time as we along with the community add to it.

PRODUCTS

file-downloads

In the product section you can expect to find all our commercial and open source tools, frameworks and applications. Here we provide any general information you need to know before making a decision to use a product, including overviews, road maps, featured solutions, software requirements, licensing information and more. If you feel you want to know even more about a product or need a reference on how to use it, there is detailed documentation in our support section for every release.

For those purchasing commercial products, we have an integrated store and user account system. Within this system, purchases can be made with credit card or pay pal and are immediately available in your account for download along with all prior releases. Whether we are putting out open source or commercial products, you are using a professional software site that has the support you need.

USER ACCOUNTS

Since the site has so many user driven features, accounts play a big role. Whether you are using forums or downloading software, every single action you take is covered under a single login. You only need to login once to access any user based task on our site.

THANKS

Everyone involved with creating the site deserve a digital round of applause for all their hard work. Kudos to John Ferguson, who created the initial design during a lot of late night and Saturday sessions. Big thanks to Eric Strohl, who took the art direction, added a bit of twist and carried it out for the entire site. Finally and most importantly, Chad Fuller who programmed everything. The site really is his baby and wouldn’t have happened without him.

CHECK US OUT at http://dreamsocket.com!

No Comments

What is Dreamsocket?

Dreamsocket is a software company located in Atlanta, GA, focused on media and entertainment industry solutions for the web, desktop and mobile platforms.

We have built ground breaking software for clients including CNN, Disney, Cartoon Network, Adult Swim, NBA, PGA, Scripps Networks, SonyBMG, Rolling Stone, NASCAR, CBS, Barnes and Noble, Motorola and IBM. Our award-winning work has been featured in the New York Times and various web publications.

We are a group of diverse individuals, but together we share one dream. We wish to do great things and push our talents as far as they will take us.

WHO IS BEHIND DREAMSOCKET?
I guess it is best to start with letting you know who I am. My name is Kenny Bunch. I am a programmer, dreamer and founder of Dreamsocket. Growing up, I created my own GI Joe vehicles out of scrap cardboard, started a snowboard clothing company at 15 years old, traveled the US with a skateboard and had a lot of fun just enjoying life. I never would have guessed that I would end up as a programmer. Yet, it has always been part of my story.

If you had come to me when I was an 8 years old playing on an Adam personal computer, I would have shown you some crazy BASIC games that I wrote with my older brother. In college, I would have tried to persuade you to test out the latest and greatest media applications I was programming in order to edit some skateboard videos. Come to me now and I’m essentially showing and saying the same thing. Fate has given me direction, and I’ve followed with a smile.

So yes, I have been extremely lucky to have been able to make a career out of something I love. Coming from a small town where factory jobs were the norm, my life is all a dream. The fact that I started out as a developer at some of the biggest companies in the world — CNN, Cartoon Network and Bell South– blows my mind. I cherished each of those opportunities. But, when a dream calls, you have to keep moving towards it. When the time came to start a company, I questioned if I was crazy, doubted what I was doing and was scared out of my mind when I left. My decision was always based on the fact that I had dreams that I wanted to accomplish, and I had to follow them.

Why am I telling you all of this? Quite simply, because that is the foundation of Dreamsocket . Even though we’ve legally been a software company for over three years, we don’t view what we have as a company. Everyone here views it as a destiny and a gateway to our dreams. I know those are strong words, but Dreamsocket really is a place built from the heart. We have great respect for those around us and treat every opportunity as a gift. We want to do great things in our work and in our actions.

DREAMSOCKET’s PHILANTHROPIC PLEDGE
Dreamsocket was founded with the aid and support of a great number of generous individuals. We have been fortunate enough to have a community that has allowed us to thrive and become who we were meant to be. We want to provide the same opportunities to others and genuinely make the world a better place. We view our employees, vendors and customers as partners in our dreams. Therefore, we want to offer them the opportunity to participate in our vision of a better future for all humankind. Through our philanthropic program, for every service contract we enter, we will make a donation to a nonprofit charity of our partner’s choosing that they feel will make a positive impact in the lives of others.

No Comments

Importance of Event.clone

In Actionscript 3, the Event object has a method called clone.  This method does exactly what it says, it clones or duplicates the Event object, returning an entire new instance with the same values for all properties. The importance of this method comes into play not when you call it directly, but when the player calls it behind the scenes. As stated in the docs,

“When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event.”

After yesterday I feel like I don’t pay attention well, because for some reason I was thinking that clone only got called by the player when bubbling an event in the display list. Yet as clear as it is stated in the docs, this occurs in non display objects which subscribe to an event, then redispatch it using their own dispatchEvent method.  In these cases, if you don’t implement clone, then your custom event will cast to the base Event class and will not contain any of it’s properties. This will in turn throw runtime errors.

I always implement the clone method in my Event sub classes, but somehow missed it in one and was wondering why it was casting to Event. Though it confused me for a minute, at least it opened my eyes to a simple concept I overlooked. Hopefully this post opens anyone else’s who didn’t realize the player’s behavior with clone.

No Comments

BUG: AS3 Sound.isBuffering

It never shocks me when I run into bugs in the Flash player, even though it distresses me. On that note and for anyone in the know, the Sound object (flash.media.Sound) is riddled with bugs. The one I ran into most recently has to do with Sound's isBuffering property.

DEFINING THE FUNCTIONALITY

So what is buffer? Simply defined it is a cushion. In the case of Sound, it is a specified time span cushion that you want to have loaded before playing. If you set the buffer to 5 seconds, no data is loaded, the Sound will only start once 5 seconds has loaded (isBuffering is true).  This can happen at any point while playing and will cause playback to pause while buffering. In the case where you are 30 seconds in and have completely played out all data that has been loaded but are still loading data, the buffer is said to be empty and you begin buffering again (isBuffering is true). However, if you seek back to 0 seconds at this point, 0 to 5 is already cached so you return to a playing state (isBuffering is false)

To provide a little history, in AS2, the player's way with dealing with Sound buffer was to provide a global property _soundbuftime. This implementation was somewhat comedic, in that it did not actually buffer the data for the Sound, it just buffered the time before play. If you were loading a Sound, set the _soundbuftime to 10, loaded 2 seconds into the buffer in the span of 10 seconds, it would play whatever it had loaded in that 10 seconds (in this case 2 seconds). Fun right?

AS3 actually creates a true data buffer for loaded Sounds via the SoundLoaderContext. In the example script below, the MP3 is loaded from a remote server with a buffer of 3 seconds (NOTE: SoundLoaderContext is specified in milliseconds, the default is 1 second)

Actionscript:
  1. snd.load(new URLRequest("http://server.com/test.mp3", new SoundLoaderContext(3000, false));

Since this actually provides the true data buffer, the new isBuffering property of the Sound object returns a Boolean (true or false). This is great and a large improvement from what we were previously provided in terms of an API.

THE BUG

So where is the BUG you ask? Well there are actually 2.

  1. The first bug's use case is : if you have loaded a Sound partially or completely to cache, upon reloading it, the isBuffering property will incorrectly report true. This is the case even though it may have 30 seconds in the buffer when only a 1 second buffer is set.  This isn't to big of a deal, though it means you could be showing buffering states when not needed.
  2. The second bug's use case is : if you are loading a Sound, it has enough data to play, and plays to a point where it starts buffering, and then you seek to a cached position. For example, my buffer is set to 5 seconds, I've loaded and played 10 seconds, I've started buffering at 10 seconds, and seek back to 0. At this point I should be able to play through to 10 seconds again and isBuffering should report false until I reach that point where I don't have enough data to play again. Unfortunately, this is not the case. isBuffering continues to report true, playback is paused, and only until the 10-15 second span is loaded will the Sound start playing from 0.

SUMMARY

As you can see the isBuffering property is a great addition to the API, but you can't actually rely on it. In essence, it makes it useless and I wouldn't rely on it for determining buffer. Sorry kids :(

No Comments

Event type naming: Tense

I tend to be a real stickler when it comes to naming elements of code that I know are going to be part of a widely used API. It's odd to me that there is not, or I have just not been privileged to find, a good resource on the subject.

Events are a programming paradigm that exist in several different languages. However, even though the concept is exactly the same, the naming tends to differ in tense a lot. In many languages you see things with past tense like Closed versus Flash which has a present or transient tense like Close (Event.CLOSE).

Which is right?

Well neither is right or wrong, but I do believe one is better. If you take the example Close, there are actually different event states, Closing and Closed. By using just Close you have no idea of what state that truly represents.

What impact does this tense have?

If you look at the function that is creating the Close event, where does it emmit it? Is it at the top of the function or at the bottom? If the event is cancellable and that cancel has effects (like it stops executing the rest of the function), then tense is very important to know. For example, you may have a dialog closing, but if you haven't saved information in it yet you want to stop it from closing.  If it is ok to close, then you may want to allow it to close, but clean up information on close. In this case you want detailed information of the Event breakdown. The present tense Close does not denote that. Therefore, it is better to use Closing, which gives you the option of an additional Closed to represent the same event in a latter state. This holds true with all Event types.

There is a lot of power in just how you name things, so give it a little thought.

No Comments

Apple IPhone Revolution

MARKET HISTORY

For years we've been hearing that mobile was going to be an enormous market that completely dwarfed what we see with desktops. I can't tell you how many write ups, presentations, key notes, and conversations I've seen on this. It completely made sense in terms of numbers. Just a little reflection of how often people get new phones in contrast to computers, or how many phones exist in a household versus traditional computers, and one can see this. Yet at the same time you hear the numbers, they haven't made sense. Why? FRAGMENTATION and APPROACHABILITY. The mobile market has been a fragmented and unapproachable mess when it comes to the masses. For this very reason, I shelved it, watched, thought about,  and counted the days until I would actually start really devoting time to it. That is.. UNTIL NOW.

FRAGMENTATION

There have been thousands upon thousands of different models of phones, systems, programming models, distribution models, and more. It has been a nightmare for developers and consumers alike. What we needed was a uniform platform. Java attempted to redeem itself in the market, while Google Android and Flash have also staked their claims. These technologies, all try to be the "Windows" or software glue that can tie the long list of devices together. Now I'd say that is a great idea if you can get all of the devices manufacturers on board.  That "glue" is what you have to have in market without device attraction.  What is device attraction? A particular device that all consumers must have which puts up blinders to and outsells all others. With that type of device, it becomes the standard physical item and whatever environment it possesses becomes the standard platform. Despite all the highend phones like Nokia, Sidekicks, Razors, and others, we have never seen one that completely swept the market. Thus, a market of many devices requires one system to rule them all to be truly revolutionary. As anyone knows where corporations and competition come into play this is a very daunting and hard to reach task.

APPROACHABILITY

Even if a "Windows-Esque" model for phones became a reality, you still would have to have a very easy distribution model for deploying and purchasing applications. We have seen attempts, but ask the average consumer about them and they would not have a clue what you were talking about. Whats worse is ask your average developer and they would probably echo the same response. There has been nothing known to the average consumer or developer that has seen any global movement. Note the word global there. In places like Asia and to an extent in Europe, there has been some success in consumption and distribution even with the broken phone market. One could say that the success in segments of these markets is directly linked to the evolved technology infrastructure, technology awareness, and consumer "travel time".  The consumers have better services, are more technologically savvy, and have free time while traveling on public transporation to consume these things. Tokyo is a gleaming example of this. Yet anyone who has been to Tokyo will tell you it's like stepping into a different world. To be a true success we need something that touches say a construction worker in Alabama. Until that point, I deem it unapproachable.

ENTER THE IPHONE "ATTRACTION"

Anyone who attended some of my presentations 2 years ago, heard me spouting off about what ifs with the IPod and the culture adoption phenomenons it could elicit. At the time there was no IPhone or ITouch, but it seemed obvious of the possibilities and potential direction. With Apple making smaller and smaller computers like the Mac Mini, it only seemed like the logical next step to make the IPod a mini computer. In those presentations, I also talked about platforms. Although it was in the context of the living room, I noted that you really had to have a device with "attraction" like a new XBox, Wii, etc that could bring consumers to A) purchase  and B) consume through new distribution models. This same case holds true with the phone market.

In constrast to the uniform platform for all devices, the IPhone has become the mobile device with "attraction". It has brought consumers to buy a new phone or switch plans just to have it. The initial draw was with the Apple lovers, who lined up in mass, which we all know isn't a good indicator since at times the lovers can be compared to kool aid drinkers. Given this fact, my take at launch was don't drink so much kool aid and watch the market. Any new technology doesn't have an impact until it starts to seep out to the masses. To know when this takes place, you have to look for indicators of the shift. Mine was quite clear. A friend, who is not the least bit tech savy, called me up and started raving about his new phone and how he "got email" now. Though he had an email account for 5 years, he had never checked or bothered with it. With this new phone, he was apparently sending and receiving emails everyday. Not only had he entered into the email age, he was downloading and using several apps from the app store. With this observation and with several similar ones, I knew the shift was definite. A HUGE point here is that, not only was the device attracting consumers, it was providing such a pleasurable experience that it annihilated all cognitive dissonance and created promotion through positive experience relays. In essence, every IPhone owner is becoming a walking promotional billboard for the device. I can't name another phone I have ever had someone sing praises to me about.

UNIFORM and APPROACHABLE IPHONE PLATFORM

So here we sit with the IPhone becoming the must have phone. Unlike having to unify a billion different devices, you just have to focus on looking at the one that everyone wants. This is a big game changer. However, it only changes the game if there is a market to consume what you develop. Apple has done a tremendous job at breaking down this wall. Just turn on the TV and they will let you know that you can download an application in a few seconds that will listen to a song and tell you what it is. There is a mass wow factor and education that is going on which is opening up and creating the market.  No other device manufacturer has been able to pull this off to date.  We now have a solid market and uniform platform to target. Develop an app today, sell it tomorrow. Apple has created the environment that many have dreamed.

WHAT ABOUT THE OTHERS

Apple has taken heat for being a closed environment and having a weak feature set. Those drenched in the mobile industry will argue that Apple will have to bend to competition. If that is the case, let's break down some of the competition factors.

Are other devices' capabilities better?

One could make a long list of features where the IPhone falls short in relation to the competition. It's camera is horrid,there is no video camera, and the list goes on. Yet, despite this weak feature set and long list of phones the surpass it in these areas, none compete. It is not a single feature set where the IPhone wins, it is the overall experience, from software to hardware. The IPhone has the complete attractive package. Where it falls short, anyone that watches a Steve Job's keynote, or walks into an Apple store twice a year will tell you that the IPhone's feature set is going to evolve dramatically.

It's a closed platform

This is the biggest complaint from developers and from creators of development tools. The thought here is that if other devices allow for open types of development like Flash, Java, Python, Javascript, etc then they will bring in more developers and create larger markets that put competition on Apple. The point that is missing here is that you have to have a market first. One could go and use Android or Flash and develop for a phone today, but there is no "universal" market there yet.  There is not a distribution model or awareness of one on other devices that constitutes a competing market for the IPhone. You are actually seeing an inverse of this argument. Developers are learning the environment because they know a market exists on the IPhone.

So are we going to see competition?  I think you will see attempts, but it is starting to move over the hill at this point. Apple is already starting to offer lower price points, hitting even larger mass markets. Just ask yourself, how can a 600 dollar phone compete with a 99 dollar one? Also, when the AT&T deal expires and the IPhone is available across carriers, you'll see a mass flock of those who weren't converted primarily because they didn't want to switch their service provider. Apple's marketing machine can reach the masses like no other device manufacturer can. Do you know of any other that carry Apple's power of culture branding?

FLASH ON THE IPHONE

For a lot of my readers, I'm sure having Flash on the IPhone is the first thing they want to discuss when talking about the subject.  It's quite obvious from the days of Macromedia that they want to be in the mobile market. Further, one can deduce from all the public annoucements from Adobe, they have Flash running on the IPhone. In what form is unknown, but a lot of discussions revolve around the "REAL WEB" and point to the browser. If this is the case, anyone looking at this from a experience or business standpoint will tell you that's the wrong angle.

There is a TON of Flash content on the web, almost all of which was not developed with a device in mind. What that means is that a lot of Flash content on the web will flat out fail. Not only will it fail, it will cause the browser to fail. In terms of the IPhone, that means that the user will perceive that the browser failed, and thus the device failed. The thought will be that the device is buggy. In a world where image is everything, Apple would kill 5 people for that. Standalone applications are different. If an app dowloaded from the App store fails and is isolated, the reaction is #$@#$@ app! The unpleasant experience is reflected on the app and not the device.

From a development perspective, a standalone application requires the developer to focus on targeting whatever environment that standalone is hosted in. This means that the developer is (or at least should be) consciously thinking and working towards making their application look, perform, and take advantage of the targeted device. Developing for a web browser on the IPhone has it's perks, but it isn't as powerful and can't enforce quality standards like a standalone app can. Truly the real power comes into play with an app that has online/offline capabilities, is tied into the phone feature set, and is designed for the device.

Experience aside, the only place Flash could make sense on the IPhone for Apple would be the App store. Since Flash is a rapid development environment with a large developer and existing code base, it could mean more applications, which in turn could relate to more money. Apple could preserve it's "environment" image and cash in on new Apps. The web browser equates to no financial return and really only boils down to a kind gesture that could have experience backlash.

Personally, as a developer, a consumer, and a business owner, Flash in the browser holds no appeal to me on the IPhone. Adobe has to put it's focus on the App store with Apple. If that is a losing battle, they and every other company in the mobile space have to create both the "attractive" deterrent and the competitive market to play on that side of the field. The only other option would be modifying their tools to create native compiled applications. This would be similar to  what Unity does, but that starts branching their overall goals since it is no longer a player mentality.

The main issue here, as previously noted, is that the IPhone market is converting developers into Apple developers. Without a strong case of how Apple can benefit from Flash being on the device, there is no driver for it. It boils down to business.

CLOSING THOUGHTS

The mobile market is finally here in my opinion. Anyone with half a brain should be gearing up to develop for it or they are missing out on a huge opportunity. Don't let learning a new development environment be a deterrent, because that is like buying cassette tapes instead of CDs. You don't want to be stubborn and not evolve. To that point, you aren't just learning to develop for the IPhone, you are learning to develop for the APPLE PLATFORM. It's definitely strategic on Apple's part and probably a large reason they close off the development. They have the market as a side effect of the IPhone and with that power are able to convert developers in mass. Right now that conversion means IPhones and Apple computers. What does that mean tomorrow? Only time and Apple will tell. I believe if Apple still has some fight and innovation in them, I'm still guessing the living room as a target. They have fallen considerably short in that area, with the ITV becoming a weak element in their box. The XBox partnership with NetFlix is really just nailing their coffin, but I think there is hope. Blockbuster could chime in, subscriptions could exist, DVR can come into play, and all the Apple devices could work together as one, we shall see. Regardless the IPhone IS MOBILE, and I'm happy to see it coming to life.

No Comments

Aligning Videos in FLVPlayback (AS2 version)

Though we don't use the FLVPlayback, someone asked me how to align video in the AS2 version. If you want to do alignment, here's a simple hack done by extending the FLVPlayback class which centers the videos.

Actionscript:
  1. import mx.video.FLVPlayback;
  2. import mx.video.VideoPlayer;
  3.  
  4. class CenteredFLVPlayback extends FLVPlayback
  5. {
  6.     private var m_sizedW:Number;
  7.     private var m_sizedH:Number;
  8.    
  9.     public function CenteredFLVPlayback()
  10.     {
  11.         super();
  12.         this.m_sizedW = this.width;
  13.         this.m_sizedH = this.height;
  14.     }
  15.    
  16.    
  17.     public function setSize(p_w:Number, p_h:Number):Void
  18.     {
  19.         super.setSize(p_w, p_h)
  20.        
  21.         this.m_sizedW = p_w;
  22.         this.m_sizedH = p_h;
  23.         // align content
  24.         var i:Number = _vp.length;
  25.         while (i--)
  26.         {
  27.             if (_vp[i] != undefined)
  28.             {
  29.                 this.alignPlayer(_vp[i], p_w, p_h)
  30.             }
  31.         }
  32.     }
  33.    
  34.     private function alignPlayer(p_vid:VideoPlayer, p_w:Number, p_h:Number):Void
  35.     {
  36.         p_vid.x = (p_w/2) - (p_vid.width/2);
  37.         p_vid.y = (p_h/2) - (p_vid.height/2);   
  38.     }
  39.    
  40.    
  41.     private function showFirstStream():Void
  42.     {
  43.         super.showFirstStream();
  44.         this.alignPlayer(VideoPlayer(this._vp[this._visibleVP]), this.m_sizedW, this.m_sizedH);
  45.     }
  46. }

No Comments

FDT linked libraries vs changing the FDT core lib

To follow up on my previous post about defining core libraries with FDT, I have found it better to add individual linked libraries on a project basis that changing the existing core lib to include multiple libs. Part of the reasoning here is that if you have a ton of projects with Flash Nature assigned to them, when you reassign the core lib, all of the projects have to rebind/rebuild based on the new lib. Eclipse is not a happy camper with this and will eventually choke up on you. By assigning linked libs on a per project basis, the bind only happens for that project at that time. AKA, your machine does it freeze and wave its digital fist at you.

To add a linked library for a project
1. Right click the project in the Explorer pane of Eclipse
2. Click the FDT Source Folder
3. Click Add Linked Libraries
4. Add away and get a sandwich from Healthy CA

No Comments