Archive
Trackometer at Google IO 2010
I’ve been working with the AIR for Android SDK for a bunch of weeks now and Adobe loved my prototype of Trackometer (info on the iphone version) so much they were going to include it in the Day 2 keynote demos at Google IO. I guess Google put serious time constraints on things and the demos did not happen on the main stage. However, Trackometer was demonstrated in the Adobe booth and the AIR team featured it in their blog. Ted Patrick also included it in his demo in the video below (see 2:00). Adobe also used the Trackometer source code with Flash Builder to do a live demonstration of compiling and moving the application to a device.
Work continues on the Trackometer app. It will have more features than the iPhone version currently has.
Adobe’s recognition is a huge thrill for me and a nod to independent developers. My inclusion in the private prerelease group was a direct result of the 360Flex presentation I gave in San Jose this past March. I have to pass on a big THANK YOU to Andrew Westberg for asking me to co-present a topic and to Tom Ortega/John Wilker for accepting our presentation proposal. This proves that sometimes you just need to get away from your computer, get on a plane, and go and talk to people in the industry. Face to face.
Trackometer: made with AIR for ANDROID
Adobe loves choice. They believe you should be able to develop once and deploy across multiple screens. Or devices. RunningMap Trackometer is a real example of this happening. To the right is a swf that is a proof of concept for an app that is being developed to run on Android-powered devices using Adobe’s AIR for Android runtime. To make the point clear, this swf was compiled from the same source (minus some device specific calls) that is used to compile the app that runs on Android mobile phones.
I have developed apps for the iPhone – one of them award nominated. RunningMap Trackometer for the iPhone was accepted for sale October 2009. I think it is a great platform to develop for and has tons of potential. But, learning Objective-c and Cocoa was and is tough for me. It’s pretty foreign and it still sometimes takes a long time to solve simple things. I have no doubt that will get easier over time and I love to learn new things. Once you get into it Objective-c has an oop-elegance about it. The real barrier in my mind to creating apps for the iPhone is the torturous process you need to go through to test, provision and submit your app so that you have maximized your chances at Apple blessing it and allowing it to be sold on the App Store. Anyone who has been there knows what I am talking about so I will stop there.
Trackometer for Android is not so much a port of the iPhone app as it is a port of the RunningMap.com application itself, with far fewer features. I’ve been developing for the Flash platform for 10 years and, unlike when I program in Objective-c, problems are solved very quickly. The workflow is like butter. And this is full blown Flash. While developing using the AIR for Android SDK, I did not need to change my well-honed workflow in any way, shape or form. RobotLegs is there. GTween is there. Flash Builder goodness. The API is only limited by the new paradigm; MOUSE_OVER, for example, is not possible with a touch interface. In fact there are a host of new APIs. Geolocation for example. And Trackometer uses that. Try to take your laptop for a run and see how fun that is.
So far I am amazed by how well AIR for Android performs on my Motorola Droid.
Getting the app on your phone is SO MUCH EASIER than with iPhone apps. No provisioning etc. Android phones could install Trackometer directly from this blog post if I placed the package here. But I can’t be cause a) Trackometer is not finished and b) the AIR for Android runtime is not released yet. I’m not sure when but I hope to know soon. I can’t wait.
RobotLegs, mediators and memory leaks
An important lesson I learned today: the onRegister() method of a Mediator in the RobotLegs framework get’s fired when it’s view is added to the stage. This means that the event mappings and event listeners that you place in the onRegister() method will get invoked each time and (assuming you are adding and removing the view multiple times) unless you use the onRemove() method to un-map and remove the event listeners, you will most certainly get a memory leak. Good to know!
This is a little inconvenient because I was hoping that I could use the mediator event handlers to update a view while it is not on the display list. As it turns out, the mediator will not respond to event mappings when it’s view is removed from the stage. Also good to know.
Any input on this appreciated!
The first 360|Flex
It was Ted Patrick‘s fault. He dared to come to Edmonton in January and I was so impressed with his presentation at EFUG that I registered for the first 360Flex conference which was being held at EBay HQ in SJ. Never been there before. Didn’t know anyone there. Friend and fellow Edmontonian Grant Skinner was going (and presenting) and that gave me confidence that at least I would know someone there (as it turned out, he was quite busy with the Adobe peeps and I didn’t see him much).
Leading up to the conference the buzz on the 360Flex website was to sign up on Twitter. I signed up under the name of “brando”. Remember, this is February 2007. NO ONE knew what Twitter was. Seemed like a useless service to me but it gave me a bunch of new Flex-knowing friends and maybe it would help me connect with some people when I got there. Through twitter I met PolyGeek and told him I was going to hunt him down and say hi.
On the flight to San Jose I met another Edmontonian who was going to the conference: Victor Rubba. Great guy. Now I have another friend to hang out with at the conference.
The morning of the first day I walked from my hotel to EBay and in the main entrance and I couldn’t believe my eyes. Thousands of miles from home, feeling like I was not in Kansas anymore, a guy was standing there with an Edmonton Oilers jersey on. (turns out he was from Calgary, which is ironic to the extreme). I met Tom and John for the first time and they offered me Chocolate cake that Tom’s wife made (nice!). They asked me what my Twitter sig was. They said in unison “Ah, Brando”. While waiting for the keynote I was chatting with some guy who looked really familiar to me. I asked him where he was from and he said San Diego. I shrugged and walked away. Sorry, Josh Tynjala, I was out of touch.
After the first session I was getting Danny Patterson to sign his book on Design Patterns for me when I looked up and saw two smiling faces in front of me. Zach Graves and Aaron King were developers on the Y! Maps team. Because RunningMap.com makes good use of Yahoo! Maps, I was pretty active in the maps online group. I had told them I was coming to the event. They found me first. Now I knew I had someone to hang with. GREAT GUYS. Aaron even gave me his staff issued Y! backpack (at Max 2008 Allen Rabinovich asked me where I got it because they are exclusive to Y! employees).
The food was amazing considering what I paid for the event ($150). I phoned my wife while sitting on the green grass by the ponds of coy and she was extremely jealous. Back home it was -15C˚ with snow up your waist. While chatting with Grant and some other guys I did a double take. “Phillip Kerman?” His was the first Actionscript book I have ever read. Chris Cantrell. Can’t miss Mike Chambers. Victor introduced me to Peter McKiernan who showed up on day two with the same shirt as me. LOL. I did in fact find Dan “PolyGeek” Florio and introduce myself. I didn’t chat with him long because I had to run and pee. Er. RunPee.com.
The presentations were amazing. Ely Greenfield’s was my favourite. Deepa Subramaniam. Mike Chambers. They were all great. I went to a presentation on ANT and the speaker, Joe Berkovitz, asked the audience if they were not using version control. I raised my hand then looked behind me. I was the only one with my hand up. Heh. Still don’t. Just kidding. Maybe not.
Ok, this post has gone on too long already and I think you got the point. Sign up for 360|Flex, San Jose, you will meet a ton of people and have your head filled up until it explodes. It’s the best Flex conference out there so sign up!
This OSMF has RobotLegs
For ActionScript 3 development I have just begun exploring the Open Source Media Framework (OSMF) and the MVC based framework called RobotLegs. What better way than to use them together? The best way to learn this stuff is to dive in and apply it to real solutions. PLEASE leave a comment if I have gone astray.
You can download the source code here (based on OSMF sprint 8 and RobotLegs 1.0.2).
Here is the working proof of concept with video served by Castfire.com:
Project goals:
- Build a production ready video player
- Learn OSMF
- AS3 only compiled with mxmlc
- Keep things organized
1. Build a video player
This is a longer term goal. The video player presented here is only a proof of concept. Video on the web continues to evolve and now seems like a good time to re-factor some key video player projects to bring them up to date and address new requirements.
2. Learn OSMF
Strobe Open Source Media Framework is an Adobe initiative to bring some standards to video player development. I have been itching to get my hands dirty with this new framework to decide for myself if it is worth buying into.
Some may think it is inevitable that OMSF will be over-architechted and therefore full of bloat. I can't really answer that yet. But I can say that I REALLY like the convenience methods that come with the MediaPlayer class. This build is 90k which includes RobotLegs ... acceptable.
Sure, you can build a video player that comes in at 15k. However, as soon as you start adding modern day requirements (CDN services, advert engines, analytics, chapters, xml lists etc) things quickly get complicated. The promise of OSMF is that all these things can be integrated into your video using a plug-in architecture which will greatly ease the burden of development.
3. ActionScript 3 only
Every video player I have worked on to date (other than a few Flex experiments) have been made with Flash Professional which means they need to be compiled from the Flash IDE. Using Flash Builder to compile the application de-couples the workflow from the Flash IDE which makes possible all sorts of interesting ideas.
This does not preclude the use of Flash Professional made libraries that can be used for things like the control bar. After all, the Flash IDE is still really good at some things.
4. Keep things organized
I have made probably a dozen or so custom video players to date. When building one from scratch it does not take tong before it gets complicated: video players are the mothers of all things asynchronous. I have my own particular way of using design patterns and structure but have never took the time to think through a solid framework and ultimately my projects get big enough that they no longer feel like they are on solid ground.
Someone else has thought it through and this is where RobotLegs comes in. I have had a pretty good experience with Cairngorm over the last couple years but it requires the Flex framework. Dependency Injection seems to be the hot topic recently and I have read some good things about RobotLegs so I thought I would give it a try. This video tutorial from John Lindquist helped me to put together this first implementation.
The thought here is that there are other views to manage than just the video player and control bar. RobotLegs will help make these views and OSMF plugins manageable and modular.
Some code
Here are a few classes to show how video player events flow through RobotLegs to the DetailsView so that bytes loaded and playback time can get updated. Download the source for the full meal deal.
-
/**
-
* author: Randy Troppmann January 17, 2010
-
* http://www.randytroppmann.com
-
*
-
* Permission is hereby granted, free of charge, to any person
-
* obtaining a copy of this software (the "Software"),
-
* to use the Software without restriction,
-
* including without limitation the rights to use,
-
* copy, modify, merge, publish, distribute, sublicense, and/or sell
-
* copies of the Software, and to permit persons to whom the
-
* Software is furnished to do so.
-
*
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-
* OTHER DEALINGS IN THE SOFTWARE.
-
**/
-
-
package org.osmf.experiments.view{
-
import flash.display.Sprite;
-
import flash.events.Event;
-
import org.osmf.media.URLResource;
-
import org.osmf.net.NetLoader;
-
import org.osmf.utils.URL;
-
import org.osmf.video.VideoElement;
-
import org.osmf.display.MediaPlayerSprite;
-
import org.osmf.events.*;
-
import org.osmf.experiments.controller.MediaPlayerEvent;
-
import flash.text.TextField;
-
import flash.events.MouseEvent;
-
-
public class MediaPlayerView extends Sprite{
-
-
public static const TEST_PROGRESSIVE_URL:String = "http://serve.castfire.com/s:pre_post_M9Ow2/video/50082/50082_2009-01-14-235108.flv";
-
protected var media:MediaPlayerSprite;
-
protected var totalBytes:Number;
-
protected var duration:Number;
-
protected var currentTime:Number;
-
protected var playButton:PlayButton;
-
protected var isPlaying:Boolean = false;
-
-
public function MediaPlayerView(){
-
media = new MediaPlayerSprite();
-
media.setAvailableSize(320, 240);
-
media.mediaPlayer.autoPlay = false;
-
media.mediaPlayer.addEventListener(LoadEvent.BYTES_LOADED_CHANGE, onBytesLoadedChange, false, 0, true);
-
media.mediaPlayer.addEventListener(LoadEvent.BYTES_TOTAL_CHANGE, onBytesTotalChange, false, 0, true);
-
media.mediaPlayer.addEventListener( TimeEvent.DURATION_CHANGE, onDurationChange, false, 0, true );
-
media.mediaPlayer.addEventListener(TimeEvent.CURRENT_TIME_CHANGE, onPlayheadChange, false, 0, true);
-
addChild(media);
-
//// ADD PLAY BUTTON
-
playButton = new PlayButton();
-
addChild(playButton);
-
playButton.x = playButton.y = 5;
-
-
playButton.addEventListener(MouseEvent.CLICK, handlePlayClick, false, 0, true);
-
-
}
-
-
public function testProgressive():void{
-
media.element = new VideoElement(new NetLoader(), new URLResource(new URL(TEST_PROGRESSIVE_URL)));
-
}
-
-
protected function handlePlayClick(evt:MouseEvent):void{
-
isPlaying = !isPlaying;
-
if (isPlaying){
-
media.mediaPlayer.play();
-
playButton.label.text = "pause";
-
}
-
else{
-
media.mediaPlayer.pause();
-
playButton.label.text = "play";
-
}
-
}
-
-
//// OSMF event methods
-
protected function onBytesLoadedChange(evt:LoadEvent):void{
-
var mediaEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.BYTES_LOADED_CHANGE);
-
mediaEvent.bytes = evt.bytes;
-
dispatchEvent(mediaEvent);
-
}
-
-
protected function onBytesTotalChange(evt:LoadEvent):void{
-
totalBytes = evt.bytes;
-
var mediaEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.PLAYER_SENDS_SIZE_CHANGE);
-
mediaEvent.bytes = evt.bytes;
-
dispatchEvent(mediaEvent);
-
}
-
-
protected function onDurationChange(evt:TimeEvent):void{
-
duration = evt.time;
-
var mediaEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.PLAYER_SENDS_DURATION_CHANGE);
-
mediaEvent.time = evt.time;
-
dispatchEvent(mediaEvent);
-
}
-
-
protected function onPlayheadChange(evt:TimeEvent):void{
-
currentTime = evt.time;
-
var mediaEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.PLAYER_SENDS_PLAYHEAD_TIME_CHANGE);
-
mediaEvent.time = evt.time;
-
dispatchEvent(mediaEvent);
-
}
-
-
}
-
}
The MediaPlayerViewMediator class captures the events from MediaPlayerView which sets a property in the model.
-
package org.osmf.experiments.view{
-
import org.robotlegs.mvcs.Mediator;
-
import org.osmf.experiments.model.PlayerModel;
-
import org.osmf.events.TimeEvent;
-
import org.osmf.experiments.controller.MediaPlayerEvent;
-
-
public class MediaPlayerViewMediator extends Mediator{
-
[Inject]
-
public var mediaPlayerView:MediaPlayerView;
-
[Inject]
-
public var model:PlayerModel;
-
-
override public function onRegister():void{
-
mediaPlayerView.addEventListener(MediaPlayerEvent.PLAYER_SENDS_DURATION_CHANGE, handleDurationChange);
-
mediaPlayerView.addEventListener(MediaPlayerEvent.PLAYER_SENDS_PLAYHEAD_TIME_CHANGE, handlePlayheadTimeChange);
-
mediaPlayerView.addEventListener(MediaPlayerEvent.PLAYER_SENDS_SIZE_CHANGE, handleTotalBytesChange);
-
mediaPlayerView.addEventListener(MediaPlayerEvent.BYTES_LOADED_CHANGE, handleBytesLoaded);
-
}
-
-
protected function handleDurationChange(p_evt:MediaPlayerEvent):void{
-
model.duration = p_evt.time;
-
}
-
-
protected function handlePlayheadTimeChange(p_evt:MediaPlayerEvent):void{
-
model.currentTime = p_evt.time;
-
}
-
-
protected function handleTotalBytesChange(p_evt:MediaPlayerEvent):void{
-
model.totalBytes = p_evt.bytes;
-
}
-
-
protected function handleBytesLoaded(p_evt:MediaPlayerEvent):void{
-
model.bytesLoaded = p_evt.bytes;
-
}
-
}
-
}
The model extends the RobotLegs Actor class can use the RobotLegs dispatch() method so that the event can be listened for from anywhere within the RobotLegs ecosystem.
-
package org.osmf.experiments.model{
-
import org.robotlegs.mvcs.Actor;
-
import org.osmf.experiments.controller.MediaPlayerEvent;
-
-
public class PlayerModel extends Actor{
-
-
public var _totalBytes:Number;
-
public var _bytesLoaded:Number;
-
public var _duration:Number;
-
public var _currentTime:Number;
-
-
public function PlayerModel(){
-
}
-
-
public function get duration():Number{
-
return _duration;
-
}
-
-
public function set duration(value:Number):void{
-
_duration = value;
-
var durationEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.DURATION_CHANGE);
-
durationEvent.time = duration;
-
dispatch(durationEvent);
-
}
-
-
public function get currentTime():Number{
-
return _currentTime;
-
}
-
-
public function set currentTime(value:Number):void{
-
_currentTime = value;
-
var timeEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.PLAYHEAD_TIME_CHANGE);
-
timeEvent.time = value;
-
dispatch(timeEvent);
-
}
-
-
public function get totalBytes():Number{
-
return _totalBytes;
-
}
-
-
public function set totalBytes(value:Number):void{
-
_totalBytes = value;
-
var mediaEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.SIZE_CHANGE);
-
mediaEvent.bytes = value;
-
dispatch(mediaEvent);
-
}
-
-
public function get bytesLoaded():Number{
-
return _bytesLoaded;
-
}
-
-
public function set bytesLoaded(value:Number):void{
-
_bytesLoaded = value;
-
var mediaEvent:MediaPlayerEvent = new MediaPlayerEvent(MediaPlayerEvent.BYTES_LOADED_CHANGE);
-
mediaEvent.bytes = value;
-
dispatch(mediaEvent);
-
}
-
}
-
}
In this experiment, DetailsViewMonitor listens for the events from the model. Since it is injected with the DetailsView instance, it can hit its property setters with new data.
-
package org.osmf.experiments.view{
-
import org.robotlegs.mvcs.Mediator;
-
import org.osmf.experiments.controller.MediaPlayerEvent;
-
-
public class DetailsViewMediator extends Mediator {
-
-
[Inject]
-
public var detailsView:DetailsView;
-
-
override public function onRegister():void{
-
eventMap.mapListener(eventDispatcher, MediaPlayerEvent.DURATION_CHANGE, onDurationChange);
-
eventMap.mapListener(eventDispatcher, MediaPlayerEvent.PLAYHEAD_TIME_CHANGE, onPlayheadTimeChange);
-
eventMap.mapListener(eventDispatcher, MediaPlayerEvent.SIZE_CHANGE, onTotalBytesChange);
-
eventMap.mapListener(eventDispatcher, MediaPlayerEvent.BYTES_LOADED_CHANGE, onBytesLoadedChange);
-
}
-
-
//// EVENT handlers
-
protected function onDurationChange(evt:MediaPlayerEvent):void{
-
detailsView.duration = evt.time;
-
}
-
-
protected function onPlayheadTimeChange(evt:MediaPlayerEvent):void{
-
detailsView.currentTime = evt.time;
-
}
-
-
protected function onTotalBytesChange(evt:MediaPlayerEvent):void{
-
detailsView.size = evt.bytes;
-
}
-
-
protected function onBytesLoadedChange(evt:MediaPlayerEvent):void{
-
detailsView.bytesLoaded = evt.bytes;
-
}
-
}
-
}
Conclusion
Reading framework documentation makes my eyes bleed. The only way I can really intrinsically understand how they fit into how I build applications is to use them. RobotLegs is a winner. I have not worked with OSMF enough to have an opinion one way or the other ... it has not reached a dot oh release yet.
FITC Edmonton discount code
FITC Edmonton is rolling into town on October 17-18, 2009. If you live anywhere near Edmonton you would be crazy not to attend. The presenter list is stellar: Grant Skinner, Mike Chambers, Erik Natzke, Charles "Chuck" Freeman, Lee Brimelow, Mario Klingermann just to name a few.
Chuck Freeman (Director of Developer Platform at Ribbit) was the lead developer for Maps at Yahoo! back in 2005 and I am hugely in his debt since Runningmap.com uses this API to this day. Mike "Mesh" Chambers. In the Flash world it doesn't get any bigger than that (I am positive that his Halo toon bleeds movieclips when he is shot). I will be seeing if Stacey Mulcahy deserves her self-assigned moniker "bitchwhocodes". Mario and I will discuss the difficulties we suffer in life over having two n's at the end of our last name.
I am a speaker too. Because of that and since you have gotten this far in the post, I can offer you a discount code. Use the code randy20 and you will get 20% off! See you there!!
AS3 casting String to Number?
Converting FlashVars parameters to properties is an example where you are forced to deal with strings and sometimes these values need to be numbers. I have been annoyed with with my own inconsistencies with how I test to see if the FlashVar casts correctly or should be rejected (because it had a character other than a number in the string). I was discovering that some techniques were giving false negatives. So I spent some time of trying to establish a best practice.
I considered these four techniques for casting a string to a Number:
- parseInt("1234");
- new Number("1234");
- "1234" as Number;
- Number("1234");
Below is the AS3 code and the trace results which I used to base my conclusions here.
Results:
Using "as Number" to cast a string to a Number looks like bad news to me. All other techniques preformed as expected. Casting a string such as "foo" using "as Number" to cast is to a strongly typed variable results with a false value when isNaN() is applied to it. This is the false negative I mentioned before. Even casting the string "1337" using "as Number" results in the value 0 which not only fails the falsies ternary test but is wrong.
Conclusions
- don't use "as Number" to cast a string to a Number.
- Using a "falsies ternary test" is not a great approach for string to number validation since "0" is a valid number and will correctly fail this test. Maybe that works well for your logic anyhow.
Discussion
Casting is perhaps the wrong term since I am converting a primitive to an object which isn't true polymorphism, but perhaps string is being treated as an object.
I talked to Ryan Frishberg at the recent 360|Flex in Indianapolis about this. Ryan works on the Flex SDK team at Adobe. He said that "new Number('foo')" make use of conversion methods that are not available to the technique "'foo' as Number" which will evaluate to null since this casting is not possible. String can't be a Number. Ok, that is the d'oh moment for me. Should know better.
It's problematic though, because it fails to report a run-time or compile-time error.
-
var n1a:Number = parseInt("foo");
-
var n2a:Number = new Number("foo");
-
var n3a:Number = "foo" as Number;
-
var n4a:Number = Number("foo");
-
-
var n1b = parseInt("foo");
-
var n2b = new Number("foo");
-
var n3b = "foo" as Number;
-
var n4b = Number("foo");
-
-
var n1c:Number = parseInt("1337");
-
var n2c:Number = new Number("1337");
-
var n3c:Number = "1337" as Number;
-
var n4c:Number = Number("1337");
-
-
trace (".............. strong typed 'foo'");
-
trace ("n1a: " + n1a);
-
trace ("n2a: " + n2a);
-
trace ("n3a: " + n3a);
-
trace ("n4a: " + n4a);
-
trace (".............. not strong typed 'foo'");
-
trace ("n1b: " + n1b);
-
trace ("n2b: " + n2b);
-
trace ("n3b: " + n3b);
-
trace ("n4b: " + n4b);
-
trace (".............. Strong typed '1337'");
-
trace ("n1c: " + n1c);
-
trace ("n2c: " + n2c);
-
trace ("n3c: " + n3c);
-
trace ("n4c: " + n4c);
-
trace (".............. isNaN n1");
-
trace ("n1a: " + isNaN(n1a));
-
trace ("n1b: " + isNaN(n1b));
-
trace ("n1c: " + isNaN(n1c));
-
-
trace (".............. isNaN n2");
-
trace ("n2a: " + isNaN(n2a));
-
trace ("n2b: " + isNaN(n2b));
-
trace ("n2c: " + isNaN(n2c));
-
-
trace (".............. isNaN n3");
-
trace ("n3a: " + isNaN(n3a));
-
trace ("n3b: " + isNaN(n3b));
-
trace ("n3c: " + isNaN(n3c));
-
-
trace (".............. isNaN n4");
-
trace ("n4a: " + isNaN(n4a));
-
trace ("n4b: " + isNaN(n4b));
-
trace ("n4c: " + isNaN(n4c));
-
-
trace (".............. falsies ternary test");
-
(n1a)?trace("n1a: true"):trace("n1a: false");
-
(n2a)?trace("n2a: true"):trace("n2a: false");
-
(n3a)?trace("n3a: true"):trace("n3a: false");
-
(n4a)?trace("n4a: true"):trace("n4a: false");
-
-
(n1b)?trace("n1b: true"):trace("n1b: false");
-
(n2b)?trace("n2b: true"):trace("n2b: false");
-
(n3b)?trace("n3b: true"):trace("n3b: false");
-
(n4b)?trace("n4b: true"):trace("n4b: false");
-
-
(n1c)?trace("n1c: true"):trace("n1c: false");
-
(n2c)?trace("n2c: true"):trace("n2c: false");
-
(n3c)?trace("n3c: true"):trace("n3c: false");
-
(n4c)?trace("n4c: true"):trace("n4c: false");
-
.............. strong typed 'foo'
-
n1a: NaN
-
n2a: NaN
-
n3a: 0 //unexpected
-
n4a: NaN
-
.............. not strong typed 'foo'
-
n1b: NaN
-
n2b: NaN
-
n3b: null //unexpected
-
n4b: NaN
-
.............. Strong typed '1337'
-
n1c: 1337
-
n2c: 1337
-
n3c: 0 //unexpected
-
n4c: 1337
-
.............. isNaN test
-
n1a: true
-
n2a: true
-
n3a: false //unexpected
-
n4a: true
-
n1b: true
-
n2b: true
-
n3b: false //unexpected
-
n4b: true
-
n1c: false
-
n2c: false
-
n3c: false
-
n4c: false
-
.............. falsies ternary test
-
n1a: false
-
n2a: false
-
n3a: false
-
n4a: false
-
n1b: false
-
n2b: false
-
n3b: false
-
n4b: false
-
n1c: true
-
n2c: true
-
n3c: false //unexpected
-
n4c: true
YouTube as HTML5. The end of Flash dominance of video?
Google has posted a proof of concept showing YouTube using HTML 5.
I was able to view this with Safari. You will note that there is no Flash on this page. Apparently the video tag uses system video resources so if you previously installed a h.264 codec, it should just work. The controls are all HTML. Does this mean the end to dominance of Flash delivered video on the web?
Encryption and licensing with Nitro-LM
I recently attended a 3-day "entrepreneur bootcamp" where angel investors taught how to pitch an idea to angel investors for investment capital. One of the first things they will want to know is how you protect your intellectual property. In the case of software, protection of algorithms is key and in the case of Flex your software secrets are protected from a right click "view source" since the application is contained within a compiled swf. Tools are available, however, that allow you to easily decompile the swf and look at the goodies inside.
Simplified Logic Inc has a product that uses a private key encryption method that stops decompilation of the swf. They also have developed a backend system that can manage licenses to your application. I have been developing a Flex application for use in teaching anatomy to students at the technical institute I work at. It has proven to be a powerful tool and there is opportunity to license this application to other institutions, but there is no infrastructure to do this. I have built a proof of concept using Nitro-LM to show that we can deploy this application on the web using a Software as a Service model without creating much of a deployment infrastructure on our end beyond what we already have in place.
The NitroAdmin AIR app is used to set up and manage the encryption and licenses. Videos and examples show how to integrate the system into your Flex app but I think they need to do a bit more work around this ... perhaps a "wizard" or video that shows from start to finish the basic setup. It still took a bit of handholding to get me up and running (thanks Andrew). The proof of concept is doing its job of proving this works in a way that is unobtrusive to users. Now all that is left is the easy part: to build a business model around my application and then go out and sell it. That is someone else's job.
Simplified Logic was a major sponsor of the recent 360 Flex conference in Indianapolis. I want to say thanks to them for supporting this event. It was a good one and I enjoyed the environs.

