Scott Morgan

LA Flash and Flex Developer

Archive for the ‘Yahoo’ Category

Better late then never right? For about a year and a half, maybe even 2 years now, developers have been requesting an Actionscript 3 Yahoo Maps API. To cool the fires I wrote the Yahoo Maps Communication Kit, which was a hack that allowed you to use the Actionscript 2 Yahoo Maps component in an Actionscript 3 application. I am glad to say that the Maps communication kit is no longer needed. Head on over to the Yahoo Flash Developer center and download the real Yahoo AS3 Maps Component.

The component looks great, out of the gate I did notice one bug though. They didn’t account for the MOUSE_LEAVE event. You can see this bug in this example, start dragging the map and move the your cursor outside of the map, if you release your mouse while you are still outside of the map and move your cursor back into the map you will notice the map is still moving. A very minor bug. I can’t wait to use this component. I already have a few ideas where I can use it.

Thanks Yahoo! Let’s hope this doesn’t turn into the Microsoft Live Maps AS3 component ;)

Yahoo releases Astra v1.1.

My former peeps over at Yahoo just released 10 more components, 3 Flash and 5 Flex components. The also fixed some of the bugs that the community reported in the existing components.

For the Flash world Astra now contains an AlertManager, an AudioPlayback component, and a MenuBar component that works with the existing Menu component released in Astra 1.0.

For the Flex folk the kind gents on the Yahoo Flash Platform team have created an AutoCompleteManager, a few different ColorPickers, an IPV4AddressInput, a TimeInput component, and a TimeStepper component.

Nice work guys, and now that I am not part of the team and a user of Astra I say thank you for all your hard work.

Well it’s a new year and I have held off posting anything. I didn’t really have a lot to say and I am not one to blog about nothing. A TV show about nothing was a huge success, but I can’t see a blog about nothing doing as well.

The past year has been a roller coaster for me and my family to say the least. We moved twice (4 times if you count corporate housing stops), one move was into a completely different country, I started 2 new jobs (Yahoo! and now Disney), my son went to 2 different schools, and somehow my wife found the time to get pregnant with our third child. So that means we won’t be resting anytime soon.

Looking back I wouldn’t of changed a thing as crazy as everything was. I learned so much professionally and personally. Professionally I have grown, my coding has improved greatly, for the most part I have been strictly working in AS3 and have absolutely no desire to turn back, unfortunately legacy code exists and AS2 will never go away, not for a long time anyway.

One of the best things of last year was working with Papervision, it has opened up a whole new world (or dimension) to me. I am a developer but I do have a creative side and being able to merge both halves of my brain using something like Papervision is truly amazing. Introducing the third dimension into interface design improves user experience because as humans we are trained to work with objects in 3D space and building everyday metaphors into the UI of our apps will make them that much better. Now if we could just get rid of the keyboard and mouse it would make obtaining those metaphors a lot easier. I think we are going to see a lot more 3D in the RIA space in 2008.

Last year we were all introduced to the iPhone, I am not going to drone on about it, but it truly is a great piece of hardware and software. Sure it is missing a few key things, but it is only a first release. Early this year Apple is releasing the iPhone SDK, you know engineers will be all over this SDK and it will only be a matter of time before some really cool apps and extensions are released for the iPhone. There is already a GPS extension in the works, GPS is the only thing I miss about my old LG phone.

So what else do I see happening in 2008. This is not a political blog so I won’t go into how I see the global economy switching from the U.S. dollar to the Euro, and I won’t go into the recession that everyone seems to be poo pooing which personally I think has already started. I also won’t go into how the Big 3 American car companies are digging their own graves and how the auto Unions are holding the biggest shovel. My all Chrysler employed family may disown me if I talk down the unions, oh wait, I think I just did.

2008 should be an interesting year from an RIA standpoint. There is a lot coming down the pipe. AIR is the first thing that comes to mind. Adobe has done a great job with AIR, I am just not sure how well it is going to take off out of the gate. In its current state it is a cool toy. I don’t think it is going to flop, I just think it will take a little time to fly, and maybe another major release. Personally I don’t agree with the whole AIR run time. I have used both mProjector and Zinc in the past to wrap swfs and create desktop applications. Both of these products allow you to create cross platform (Mac and PC, no Linux love) stand-alone apps with the Flash player included in the executable (if need be). These products had more hooks into the OS and file system, what they didn’t have was an embedded version of Webkit and a JS API. They also didn’t have the ability to interact with PDFs. So yes, AIR has it’s advantages, I just don’t agree with the runtime, it just adds a level of unnecessary complexity and doesn’t easily allow for easy deployment. IMHO. The apps should be stand alone so you can burn them on a CD and have them just work.

I mentioned the iPhone SDK already, this will be huge, of course people are going to try and monetize off of this, why wouldn’t they. What I am really hoping, as are most who are reading this blog, is the iPhone Flash Player we’ve been all dreaming about. There are rumors, lots of them, unfortunately only one guy (and probably a few hundred others) know for sure, Mr. Jobs, please enlighten us. The Internet on your phone is still a little watered down, you promised me the real internet in your ads, where is it? I know there would be memory issues, let’s face it, there are some very heavy flash sites out there. Already I have seen Safari on the iPhone close/crash when an image heavy page is loaded. By now I am sure most of you have heard about QVM or tamarin-tracing, could this be the beginning of something huge?

What else, Flex 3, all I have to say is wow. If you haven’t played with the beta do so now. The profiling and refactoring alone will blow you away. Flex has taken off big time, the one thing that puzzles me though is the number of recruiters who contact me with Flex work yet I still don’t see a ton of it out there in the tubes. Some of the jobs are with Fortune 500 companies. Either they are taking their sweet time to launch their “next big thing” or they gave up on using Flex because they couldn’t find the talent.

This year we will also see the Flex framework fully open sourced. Thank you Adobe, this is really going to change the landscape. Maybe we’ll finally see an AS3 decompiler.

EcmaScript 4, this is going to be an interesting one to watch. There has been a lot of rumblings from a few of the big players. Microsoft doesn’t like it. Once again, Microsoft and Adobe will be at each others throats.

IE8 will be released, yawwwwwwn.

Thermo, Astro, Buzzword oh my. H.264, Google Gears, WPF, it’s shaping up to be a good year. I have even heard some rumblings from the Cold Fusion camp, sounds like there is going to be some cool stuff coming from them.

I am not one to make resolutions, I believe if you have to wait till the beginning of the year to make a resolution you’re not very motivated. But this year I want to expand my horizons. I want to get into other technologies, I have played with a lot of things but I want to go beyond playing. Things like Ruby, Gears, Python. I want to get dirty with SQLlite. I also want to contribute more to the Open Source community. I also don’t want to move, don’t want to start a new job and maybe want to take a vacation for the first time in 4 years. We’ll see how much of this list I get to, with a third child on the way it could be tricky.

In closing, Happy New Year to all, I hope you and your families have a great 2008.

Well this will probably be my last posting that announces something my team (Yahoo! Flash Platform) at Yahoo has launched. From now on it will be my former team as I am leaving to work for Disney on Friday. This week we launched three very exciting things. The new Yahoo! Flash Platform blog (http://www.yswfblog.com), the new and improved Yahoo! Flash Development Center (http://developer.yahoo.com/flash) and our new Astra Flash Components. The Astra Library is our collection of Flash and Flex components, libraries and toolkits. In this inaugural release, ASTRA contains five UI components that complement the existing set provided with Flash CS3. The new UI components are: Tree, Menu, TabBar, AutoComplete, and Charts. ASTRA is open-source under the BSD license, and follows an approach similar to the very popular YUI Library. Keep an eye on the ASTRA library, I know first hand that there are some very cool things to come.

Yahoo’s Flash Platform team is looking for another member. Below is the job description, if you’re inerested apply online and you may end up sitting next to me (literally). The Yahoo! Flash Platform team is looking for an exceptional engineer to join the team. We are looking for someone who is passionate about Flash platform technologies, someone who would debate design patterns and methodology just for sport and most of all someone that is best described as omniscient when it comes to Flash.

The Flash platform team is responsible for the Flash code library and component set that will serve Yahoo!’s wide array of applications. Members of the team will also provide training and development support, as well as shape the direction of the overall platform.

You will be responsible for designing and developing the code library that will make Flash development elegant, optimal, and a pleasure to use. You will collaborate with extremely talented engineers on this team and throughout Yahoo! to make the platform a reality, and encourage best development practices throughout the organization. You must comfortable with articulating and evangelizing the platform strategy to influencers and decision-makers.

The ideal candidate will be an expert with Flash platform technologies along with 5 to 8 years of development and leadership experience. A strong portfolio of applications, including large-scale/enterprise usage of Flash, and experience with systems-level development and foundation code development are expected.

As a senior engineer, you are expected to be well-versed in: - ActionScript 2 and 3 - Flex 2 - Flash Lite - Flash security model - Flash-to-JavaScript interactions - Server interactions (socket, remoting, FCS/FMS) - Development design patterns - QA and testing practices - Internationalization - Accessibility factors

Applied knowledge of PHP, JavaScript, HTML, CSS, and general Web development practices are highly desirable for this role.

  • 8 Comments
  • Filed under: My Work, Yahoo
  • Well, pulled a few more hairs out today. Hard to believe I have any left. I am working on a multi-lingual application that needs embeded fonts. As most of you know, loading every character in a given fontset equates to one big ass swf. For example, if you want to embed a regular and bold Japanese font you’re looking at approx. 13 megs, and depending on the quality of the font you could be close to 20 megs. That’s a lot of font. In an ideal world the Flash Player would allow for dynamic runtime shared font libraries that allow for only a subset of characters to be embeded.

    In AS2 there were a few ways (hacks) to load font libraries at runtime. Unfortunately none of the AS2 hacks work in Flash CS3 using AS3. However, there is an answer. In Flex you can embed fonts at compile time using the [Embed] metadata tag in your Actionscript. And the best part is you can use the unicodeRange attribute to define a subset of characters you want to embed. Below is a class I created that compiles a swf that contains all Latin I characters in the Arial font.

    package {
         import flash.display.Sprite;
         public class _Arial extends Sprite {
    
              [Embed(source='C:/WINDOWS/Fonts/ARIAL.TTF', fontName='_Arial', unicodeRange='U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E')]
    
              public static var _Arial:Class;
    
         }
    }

    A couple things to point out here. The fontName attribute value can not be the same name as a device font. If I were to change my code to use fontName=’Arial’ the compiler throws the following warning “the embedded font ‘Arial’ may shadow a device font of the same name. Use fontName to alias the font to a different name”. To get around this I simply added an underscore before the name. From this point on you must reference the _Arial in your TextFormats or CSS. Now if you compile that it will create a swf named _Arial.swf.

    Ok, great, now what? Well, now you have to load the font into the application. Here is a sample class that loads in the font and displays some rotated text just to prove that it is embeded.

    package {
         import flash.display.Loader;
         import flash.display.Sprite;
         import flash.events.Event;
         import flash.net.URLRequest;
         import flash.text.*;
    
         public class FontLoader extends Sprite {
    
              public function FontLoader() {
                   loadFont("_Arial.swf");
              }
    
              private function loadFont(url:String):void {
                   var loader:Loader = new Loader();
                   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fontLoaded);
                   loader.load(new URLRequest(url));
              }
    
              private function fontLoaded(event:Event):void {
                   var FontLibrary:Class = event.target.applicationDomain.getDefinition("_Arial") as Class;
                   Font.registerFont(FontLibrary._Arial);
                   drawText();
              }
    
              public function drawText():void {
                   var tf:TextField = new TextField();
                   tf.defaultTextFormat = new TextFormat("_Arial", 16, 0);
                   tf.embedFonts = true;
                   tf.antiAliasType = AntiAliasType.ADVANCED;
                   tf.autoSize = TextFieldAutoSize.LEFT;
                   tf.border = true;
                   tf.text = "Scott was here\nScott was here too\nblah scott...:;*&^% ";
                   tf.rotation = 15;
    
                   addChild(tf);
              }
         }
    }

    And there you have it. Run time embeded fonts. The key lines to look at here are

    var FontLibrary:Class = event.target.applicationDomain.getDefinition("_Arial") as Class;

    The getDefinition method returns a reference to the _Arial class loaded in through the swf (event.target). The next line:

    Font.registerFont(FontLibrary._Arial);

    registers the loaded in _Arial font in the global font list. If you were to trace out the results of Font.enumerateFonts() you will now see _Arial at the top of the list.

    Now lets say your site was in a few different languages you may add the following line to the FontLoader constructor to load language specific fonts at runtime.

    public function FontLoader() {
         var langManager:LanguageManager = LanguageManager.getInstance();
         var langID:String = langManager.getLanguageCode(); //returns jp
         loadFont(langID + "_Arial.swf");
    }

    Instead of loading in _Arial.swf the application will load in jp_Arial.swf. jp_Arial.swf would be another generated font swf like the _Arial example above but this time the unicodeRange would only include the Japanese fonts you need. All you have to do now is create a CSS file and fonts for each language, store the proper language code somewhere within the application and use that language code when loading your CSS files and fonts.

    You may not know this but Adobe has supplied us with sample unicodeRanges in the following file “\Applications\Adobe\Flex Builder 2\Flex SDK 2\frameworks\flash-unicode-table.xml”. You can either use one of the supplied ranges or create your own. You may only need to embed a few characters, if so just list the unicode values of the characters you want each seperated by a comma.

    Sounds pretty straight forward eh? Or is it????

    In doing this I ran into a huge bug using Flex Builder to generate the font swfs. When I was experimenting with the unicodeRanges my compiled versions did not contain the proper character ranges that I specified. For example I would define a range that only contained Uppercase characters. In my test font loading app I would only see numbers. Only if I removed the unicodeRange attribute would I see all my characters. This led me to believe that Adobe had documented something that really wasn’t part of the compiler. I tried deleting files, I was checking timestamps, nothing. Then I tried to clean my project before compiling (In FlexBuilder select Project > Clean). It worked! The subset of characters I defined in my unicodeRange only loaded into my test app. YAY! Then I tried switching the unicodeRange again. DOH! nothing. Cleaned project again and BINGO!

    Lesson learned: Whenever you change your unicodeRange clean your project before you compile or else your change may not be compiled properly.

    I haven’t tried this in Flex 3 yet to see if the bug has been addressed. I did look at the Flex 3 bug system and didn’t see it listed. Either it has been fixed or no one has run into this issue yet. It is pretty obscure I guess.

    So how’s this for enterprise level Flex applications. Yahoo! Messenger launched their beta version of it’s web-based Flex Messenger application today. Currently the beta is only available in select parts of the world, rest of the world check back soon. Congratulations to all involved.

     
    The Messenger desktop application already has hundreds of millions of users, not only is this a huge win for Flex but it is a huge win for increasing the penetration rates of Flash Player 9 which are already at 84%.

    This is just the beginning, stay tuned to see what else Yahoo! has up their sleeves.

    Take that Silverlight ;)

  • 0 Comments
  • Filed under: Flex, Yahoo
  • As I mentioned in my presentation on Tuesday at 360 Flex pipes.yahoo.com have launched a wide open crossdomain file today. Flash Community rejoice! This is huge news for us. Not only does it mean we can load in manipulated aggregated data feeds, it also means we can load in feeds that normally we do not have access to because there is no crossdomain policy. Before you could do this with a php or any server side based page proxy file. But now you don’t have to worry about that. Log in to pipes, do a simple fetch, save it, and load in your pipe through pipes.yahooapis.com. Simple! If needed, you can manipulate the feed, remove unnecessary data and output it. No one wants to parse irrelevant data, especially client side! As some have already said, pipes is the future of the Internet and if we didn’t know it already flash is too!

    One last thing, if you want to learn more about using pipes, there is a great video tutorial up on the Yahoo! Developer Network.

    Thanks a lot pipes from the entire flash development community.

    I am proud to announce the new Yahoo! AS3 Libraries that were released today on the Yahoo! Flash Developer Network. We timed this launch with the 360Flex conference in San Jose at the Ebay campus. I will be presenting the Yahoo! AS3 Maps Commuication Kit tomorrow morning. As a side note this is my first contribution to the Yahoo Developer Network since I started here a couple months ago. Let us know what you think, and what else you would like to see. We’re here to make your job easier. We don’t want you to worry about accessing all of our data, we want you to concentrating on creating the best application with our data.

    Happy Mashing!

    See you guys at 360Flex on Monday

    Not only will I be at 360Flex, I will be presenting there. Me and the team I work on at Yahoo! (Flash Platform) are presenting our new AS3 libraries. We will also be covering what we do at Yahoo!, our Flash Development Center, our future plans, and a few other suprises. Sorry, I can’t go into much detail or else you won’t show up :) We have so much to present we have two time slots - 4:00 on Monday, and 8:30 (yes A.M. ugh!) on Tuesday. We are also planning on doing something at the Monday evening event, again, can’t go into much detail, but I can tell you that you won’t want to miss it.

    If you are at the conference come by and say hi. I’m excited to present but I am even more excited to see/meet some of the other speakers and attendees. Lastly, Yahoo! is one of the conference sponsors so you are sure to see lots of purple and yellow floating around. Here is what you can expect to be wearing around your neck.

    Yahoo! 360Flex swag

    This is going to be a great conference and is proof that the Flex community is alive and well and poised to take over the world ;).

  • 0 Comments
  • Filed under: Conferences, Flex, Yahoo


  •