- Flash, Flex, AIR
- Android (Java Mobile Development)
- iPhone (yep, packing the market with apps)
- UX Design
If you are looking for RIA or Mobile Development, we've got a talented group of developers working with us. Get in touch.
Rantings & Ramblings on the Convergence of Code and Business
//inside command class
public var mediatorClass:Class;
public var viewLocation:String;
override public function execute( note:INotification ):void
{
var m:IMediator = new mediatorClass() as IMediator;
m.viewComponent = getViewComponent( note.getBody() );
Facade.getInstance().registerMediator( m );
}
protected function getViewComponent( app:Object ):Object
{
var result:Object = app;
for each( var subItem:Object in viewLocation.split(".") )
{
result = result[subItem];
}
return result;
}
Actually, duck beak would be a little more accurate. It had been prepared in a spicy red sauce. If you don't mind spending hours gnawing at your food, this is a perfect snack (very bony).
This is actually a tuber best known from Vietnam and Laos. Its the closest thing you get to a potato in Shanghai. A little sweet with just the right amount of starch. Delicious.
The overall effect is very pleasing. Think rice au gratin.

<mx:Grid dataProvider="{ModelLocator.getInstance().myDP}"/>
<mx:Button label="Click here" click="dispatchEvent(new Event('getDP'))" />
class SimpleController{
function SimpleController(){
Application.application.AboveViewHere.addEventListener('getDP', onGetDP );
}
private function onGetDP ( e:Event ):void{
var dpService:DPService= new DPService();
ModelLocator.getInstance().myDP= dpService.getDP();//binds ArrayCollection reference from service to ModelLocator
}
}
public class DPService(){
function DPService(){}
private var data:ArrayCollection;
public function getDP(){
var loader:URLLoader = new URLLoader();
loader.addEventListener("complete", onComplete);
loader.load(new URLRequest("someURL.aSweetExtension"));
data = new ArrayCollection();//create the ArrayCollection reference here
return data;//return the reference to the controller
}
private function onComplete( e:Event ):void{//get called when the service returns
var loader:URLLoader = e.target as URLLoader;
//loop over returned data and populate ArrayCollection
for each( var xml:XML in loader.data.items ){
data.addItem( xml.someProperty );//add data to ArrayCollection
}
//no need to return anything or dispatch an Event
}
}
Sprouts is an open-source, cross-platform project generation and configuration tool for ActionScript 2, ActionScript 3, Adobe AIR and Flex projects.
Not all these posts are mine but most of them are.
Cheers,
Todd
Basecamp intentionally allows HTML (and JavaScript) because many ofour
users find great value in being able to use that. We're fullyaware that this
allows for XSS attacks, but Basecamp is based on thenotion of trusted parties.
You should only allow people into thesystem that you believe won't hack your
system (just as you shouldonly invite people into your office that you don't
believe will stealfrom you). If your friend becomes a foe, you can revoke their
accountand change your login credentials. Just like you would simply not letthem
into your office.
If this was a public system, it would definitely be different. You can't
have a public forum today without carefully dealing with XSS issues.
In the 3+ years we've operated Basecamp, we've never had a single suchcase
occur, though. So it doesn't seem like it's a big problem. And I know many of
our customers would scream murder if we removed the option to use HTML in their
messages, as they've become accustomed toover the past 3+ years.
I'm not sure I total agree with the sentiment of leaving security up to your users but its certainly a refreshing change from the pervasive concept of the "low-trust" internet.
==>If you're into javascript...hack away!
var ErrorLogger = Class.create();
ErrorLogger.prototype = {
initialize: function(url, opts){
this.url = url;
this.active = true;
this.opts = opts;
window.onerror = this.onError.bind(this);
},
onError: function(msg, URI, line){
try{
if(this.active){
var body = 'URI=' + escape(URI) + '&line=' + line + '&msg=' + escape(msg) + '&brw=' + escape(Object.toJSON(Prototype.Browser)) + '&pv=' + escape(Prototype.Version);
if('onError' in this.opts)this.opts.onError.apply(this, arguments);
var opts = {
onSuccess : this.onSuccess.bind(this),
onFailure : this.onComplete,
postBody : body
};
new Ajax.Request(this.url, opts);
}
}catch(e){
this.onFailure();
}
return true;
},
onSuccess: function(){
if('onSuccess' in this.opts)this.opts.onSuccess.apply(this, arguments);
},
onFailure: function(){
this.active = false;
if('onFailure' in this.opts)this.opts.onFailure.apply(this, arguments);
}
};
When you click on the button labeled "Throw Error", the ErrorLogger class will gracefully handle the error and post some useful debug information to your server. From there you can do whatever you want. Personally, I just toss it in a log file that I monitor. All that in less than 1KB, not bad.
<html>
<head>
<title>Logger Test</title>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="ErrorLogger.js"></script>
<script type="text/javascript">
var er;
var init = function(){
er = new ErrorLogger('TestResult.html',
{
onSuccess : function()
{
$('btn').setStyle({'backgroundColor' : 'red'});
},
onError : function()
{
alert('An error occurred on the page. Run for your life!');
}
});
};
</script>
</head>
<body onload="init()">
<button id="btn" onclick="nonExistentFunction()">Throw Error</button>
</body>
</html>