Sep

5

Microsoft is still using Flash and not Silverlight.

By scott

Well it says a lot about Silverlight when Microsoft is still rolling out Flash sites (only targeting Flash Player 8, AS3 must be too tough for them ;) . I know Silverlight is still in beta and obviously not ready for primetime, but I still find it a some what humorous, maybe you will too, maybe not. I am sure I will get flamed for this post, but isn’t that part of the fun of having a blog? http://www.syncmyride.com

I will admit they have almost implemented a nice SEO (Search Engine Optimized) Flash site. If you view the source you will notice all of the content is written in xhtml, the swf then parses that same xhtml and uses it as its datasource. I said “almost implemented a nice SEO’d Flash site” because if you turn off javascript the content is not displayed. Certain Search Engines will still parse the mark-up but others won’t. They should of made the site fail more gracefully and display the raw XHTML for those Search Engines who ignore javascript like Google.

As a side note, another thing I found interesting is they show an image of an iPod on the site next to their (crappy) Zune player. Understandable I guess since iPod is the number one portable music player. Microsoft isn’t going to deny that.

Jun

29

Yahoo! is hiring, come work with me

By scott

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.

Mar

28

MovieClipLoader onLoadError event does not fire in Firefox when a non-existent domain is targeted

By scott

Today at work we ran into another flash player / browser inconsistency. When using MovieClipLoader to load an external asset, the onLoadError event doesn’t fire in Firefox when trying to load an asset from a non-existent domain. In fact, the onLoadStart event doesn’t even fire. The other MovieClipLoader events don’t fire but they shouldn’t, there isn’t any progress and the load never reaches completion or initialization.If you attempt to load a non-existent asset from a valid domain the onLoadError event fires fine in Firefox. In IE and Safari the onLoadError event fires in both scenarios. These are the only browsers I tested but I would be interested in seeing what happens in the others.

So let me break it down. This code doesn’t fire the onLoadError event in Firefox. It just fails silently:

var mLoader:MovieClipLoader = new MovieClipLoader();
var mObj:Object = new Object();
mObj.onLoadError = function(ev:Object):Void {
     getURL('javascript:alert("onLoadError")');
}
mLoader.addListener(mObj);
mLoader.loadClip('http://kaljdflkasjdf.com/image.jpg', this);

However, this code and domain do fire the onLoadError event.

var mLoader:MovieClipLoader = new MovieClipLoader();
var mObj:Object = new Object();
mObj.onLoadError = function(ev:Object):Void {
     getURL('javascript:alert("onLoadError")');
}
mLoader.addListener(mObj);
mLoader.loadClip('http://www.scottgmorgan.com/image.jpg', this);

Thought I would share this knowledge with the world. Last thing I want is others pulling out as much hair as I do :)

Mar

7

Pipes.yahoo.com opens up for the flash community!

By scott

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.

Mar

5

Yahoo! Actionscript 3 API Library launched today.

By scott

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!

Nov

25

Live from FITC in Winnipeg, Manitoba

By scott

Here I sit in cold Winnipeg Manitoba, my hometown. I am here for the FITC conference, wearing my Jets jersey (of course). Why Winnipeg you ask? I was asking the same question myself until I got here. There are approximately 175 people here, doesn’t sound like a lot, but for Winnipeg it is. And a lot of the people seem to be very passionate about new media here. There are a few small shops, a couple larger ones, and a bunch of students who seem to be very interested in new media. Critical Mass, the company I work for, is the gold sponsor here and we are also presenting. Being a gold sponsor means we get a big booth, we stand there, and we answer the same questions over and over again all day. Don’t get me wrong, I love it. I like talking to other developers or other people interested in new media. I have met a couple very interesting people, and who knows, maybe I will work with them one day. Afterall, the flash community is pretty small even with it’s astronomical growth in the past while.

Anyway, I am going to sign out now, almost lunch time here in the ‘peg. If you’re here, stop by and say hi. If not, go stand with your freezer door open and you will soon feel like you are here.

Aug

14

Get sloppy and see how your site runs at 28k

By scott

Our friends at www.dallaway.com have created one of the best QA tools since VMWare. Sloppy deliberately slows the transfer of data between the client and the server. Essentially, Sloppy is a proxy and purposely bottle necks your connection to simulate a selected modem speed. Sure you and all of your friends have high speed connections, but there are still 25 to 30 percent of the (North American) population that connect to the internet through traditional phone lines 30 percent is a large portion of potential hits on your site so you better make sure it isn’t painfully slow and that it works on dial-up. Sloppy is the perfect tool for this. Make sure you download it and add it to your web development tool belt.

Aug

9

The Tween class is not just for bouncy balls

By scott

People don’t always realize that the Macromedia Tween Classes does more than just move MovieClips or fade MovieClips in and out. I wish I got a nickel for everytime I heard someone say I didn’t know you could do “that” with the Tween class. Most people do not realize you can tween filters (blur, dropshadow, glows, bevel, etc). And even more people don’t realize you can use the tween class to control volume on a sound object or change the font size of a text field. Basically you can blur any property. Here is an example of text being blured via the tween class.

import flash.filters.BlurFilter;
import mx.transitions.easing.Regular;
import mx.transitions.Tween; 

var template_mc:MovieClip = this;
var textHolder:MovieClip = template_mc.createEmptyMovieClip('textHolder_mc',
 template_mc.getNextHighestDepth());

var tf:TextFormat = new TextFormat();
tf.font = '_serif';
tf.color = 0x000000;
tf.size = 18;

textHolder.createTextField('text_txt', 1, 0, 0, 200, 50);
textHolder.text_txt.text = 'This is my device font uber blur test';
textHolder.text_txt.autoSize = 'left';
textHolder.text_txt.setTextFormat(tf);

textHolder._x = (Stage.width/2) - (textHolder._width/2);
textHolder._y = (Stage.height/2) - (textHolder._height/2);

var blurText = new Tween(textHolder, "blur", Regular.easeOut, 0, 16, 3, true);
blurText.onMotionChanged = function(ev:Object) {
     ev.obj.filters = [new BlurFilter(ev.obj.blur, ev.obj.blur, 3)];
}
blurText.onMotionFinished = function() {
     this.yoyo();
}

Here is an example using the tween class to change the font size of a text field.

import flash.filters.BlurFilter;
import mx.transitions.easing.Elastic;
import mx.transitions.Tween; 

var template_mc:MovieClip = this;
var textHolder:MovieClip = template_mc.createEmptyMovieClip('textHolder_mc',
 template_mc.getNextHighestDepth());

var tf:TextFormat = new TextFormat();
tf.font = '_serif';
tf.color = 0x000000;
tf.size = 18;

textHolder.createTextField('text_txt', 1, 0, 0, 200, 50);
textHolder.text_txt.text = 'This is my device font test uber size test';
textHolder.text_txt.autoSize = 'center';
textHolder.text_txt.setTextFormat(tf);

textHolder._x = (Stage.width/2) - (textHolder._width/2);
textHolder._y = (Stage.height/2) - (textHolder._height/2);

var stretchText = new Tween(textHolder.text_txt, "size", Elastic.easeOut, 18, 75, 2, true);
stretchText.onMotionChanged = function(ev:Object) {
     var newSize = Math.round(ev._pos);
     var tf:TextFormat = new TextFormat();
     tf.size = newSize;
     ev.obj.setTextFormat(tf);
}
stretchText.onMotionFinished = function() {
     this.yoyo();
}

Any numeric value can be “tweened”, try it out yourself, it is a very useful class.

Jul

10

I heart E4X, the Actionscript 3.0 new XML Object

By scott

I finally got around to really playing with Actionscript 3 and two words come to mind LOVE IT. Especially the new XML Class which is based on E4X, or true integration of XML in Actionscript. Gordon Smith said it best “Compared with the current XML support in the Flash Player, E4X allows you to write less code and execute it faster because more processing can be done at the native speed of C++.”

After playing with it and doing a few benchmark tests I noticed it wasn’t any faster than the XML object of AS 2.0. Maybe the E4X support isn’t fully optimized in the Flash 9 beta, really this shouldn’t matter because Flash Player 9 is final. But really, who cares, we’re talking milliseconds here, it’s like trying to figure out if you or your friend blink faster. The real bonus of E4X is its simplicity and query like abilities. No longer will we have to depend on an XPath implementation in Actionscript to query xml data. XPath was very slow and very processor intensive with it’s multitude of nested loops. I have seen XPath take down many of browser in my day.

Enough reminiscing, lets get back to E4X. XML nodes can now be drilled down using dot notation, just like a regular object in actionscript. There is also an attribute identifier operator (@). Take a look at the following simple example:

var myXML:XML =
<items>
     <item id="RedButtons" width="300">
          <label>My Red Label</label>
     </item>
     <item id="BlueButtons" width="200">
          <label>My Blue Label</label>
     </item>
     <item id="GreenButtons" width="250">
          <label>My Green Label</label>
     </item>
     <item id="RedButtons" width="400">
          <label>My Other Red Label</label>
     </item>
</items>;

//an XMLList is a subset of XML data
var myList:XMLList = myXML.item.(@id == "RedButtons");

//the new way of writing for each loops
var count:int = 0;
for each (p in myList) {
     trace(' - ' + myList[count].@width);
     count++;
}

//or a standard for loop
var len:Number = myList.length();
for (var i:int = 0; i<len; i++) {
     trace(myList[i].label + ' - ' + myList[i].@width);
}

So, what’s the first thing you noticed. That’s right, no more firstChild.childNodes, etc. Thank goodness! Finally an XML object is treated like a regular object.

As you can see the new XML class is called XML, the AS 1/2 XML class is now called XMLDocument. If you attempt to use legacy code and you compile to AS 3.0 make sure you update the class name first.

In the real world you would probably load in dynamic XML, but you will notice I simply typed in a simple snippet of XML and the compiler didn’t puke. Handy! So my first query which returns an XMLList (another new class) which contains only the item nodes with an id attribute that equals RedButtons. Very similar to XPath. But much quicker because it is native to the player now. Using my XMLList, that I so creativly named myList, I perform two seperate loops. A for each loop and a standard for loop. A couple things here you’ll notice, the syntax on the for each loop has changed slightly. Previously you simply wrote:

for (p in myList) {
     trace(p + ':'  + myList[p]);
}

With AS 3.0 you now have to add in the word each.

In my standard loop you will notice I have typed my index (i) as an int. It is good to use an int when you don’t need a floating point number such as a loop index. You would think this would increase performance, but really it doesn’t. You will also notice my len var equals myList.length(). length is a method so make sure you remember the brackets.

Inside both loops all I am doing is tracing out data. The only thing special here is how I access the attributes using the @ operator.

Well there you have it. Very simple example I know. I’m not sure which I am more excited about, this or the Regular Expression support in AS 3.0. Either way, I can’t wait for my clients to start letting me use it!

Jul

9

My blog, now with comments…finally.

By scott

In my quest to make things more difficult for myself and roll my own blog using php, sql, and my flash CMS, I have finally finished the comments functionality. Not bad for a Flash Developer ;) Let me know what you think.