A funny thing happened on our way to the Bar one day...
We discovered Flex 2 can be used to deliver Dynamic RIA Content once again.
Flex2 XML Reader Can Create UIComponents
Table of Contents
How Adobe Leveraged Reuse within Flex2
Dynamic RIA Content Delivery Using Flex2
Flex2 knows how to handle Dynamic RIA Content Delivery out of the box !
A funny thing happened to me the other day while I was working on some XML I intended to feed to my Flex2 App.
For some odd reason my Flex2 reported the following error message as a result of loading some XML:
Error #2070: Security sandbox violation: caller cannot access Stage owned by .
faultCode:Client.CouldNotDecode faultString:'Error #2070: Security sandbox violation: caller cannot access Stage owned by .' faultDetail:'null'
The solution became apparent to me after some number of frantic minutes along with some minor hair-pulling.
Let’s consider, for a moment, how Adobe might have chosen to leverage reuse within the Flex2 programming model.
Assuming the Adobe engineers did not want to have to recreate the wheel in terms of how to make Flex2 able to load normal non-GUI XML I would surmise they chose to simply reuse whatever code they wrote that was able to read MXML into a way to read XML.
As we know, MXML resembles XML rather closely. Heck, MXML is XML ! Yipee, now I can easily read MXML because it is essentially a form of XML.
We also know Flex2 knows how to read MXML at runtime because the compiler knows how to convert MXML into GUI Objects.
But what if we could trick Flex2 into dynamically loading MXML at runtime ?
We wrote an earlier Whitepaper on this topic some days ago.
We want to make it very clear that we have been doing research into this area for some time now.
Some time ago, let’s say this happened early in 2007, we became interested in how one might construct a Flash based Content Management System and we began to look for techniques one might use to accomplish this goal.
Then we became aware of Flex2 and we immediately knew at that point in time that Flex2 could easily be used to construct a Flash based Content Management System.
One might also think of a Flash based Content Management System as being a Dynamic Model for the Delivery of RIA Content.
Dynamic RIA Content Delivery using Flex2 is trivial once you begin to think about and understand the connection between XML and Objects from the Flex2 perspective.
The fact that we were able to stumble upon an odd-looking error message that should not have existed since the XML we wanted to load had nothing to do with the Flash Stage and should not have triggered a Security Sandbox Error Message as it did.
So what must be happening deep within Flex2 whenever it is asked to load XML at runtime ?
The answer seems obvious to us now.
Flex2 can be made to load MXML at runtime assuming one is able to trick Flex2 into handling the security issues at runtime.
In a previous Whitepaper we suggested this could be done using a number of techniques, one of which involved doing some kind of Object Translation from data objects to GUI objects however it seems more clear to us now that it should be possible to dynamically load MXML Objects without any such Object Translation.
We know of one Bay Area Start-Up company we shall not name here, who would like us to cease talking about this topic because they feel like they own this technique when in fact one can deduce the existence of this technique from the Flex2 Docs alone.
Even the casual reader of the published Flex2 Docs will discover the mx:Module Class.
What does the mx:Module Class do ?
It allows Flex2 code to be loaded dynamically at runtime.
What might one do with dynamically loaded code at runtime ?
Why, you might even use it to dynamically load RIA Content at runtime.
Imagine that !
This Bay Area Start-Up tried to tell us, “…not even Adobe knows about this…”.
Okay, we might not be the smartest Flex2 developers on the planet but even we can tell when someone is blowing nice colored smoke up our posteriors.
Trust us when we tell you, Adobe does know about this technique because they documented it in their Flex2 Docs for all to read and understand.
Sooner or later you too will get bored with constructing huge SWF files and you will then begin looking for a way to lighten the load, so to speak, and it will be at that time when you will begin reading about the mx:Module Class.
Now we can understand how a young start-up company might want to keep this technique under their hats, so to speak, but as a matter of fact since Flex2 is largely an Open Source product nobody can claim to own any part of Flex2 including but not limited to whatever anyone wishes to publish about Flex2 and especially not what Adobe has already published about Flex2 in their Online Docs.
This is the good news about Flex2.
Flex2 is good stuff.
Flex2 can be used to construct highly dynamic RIA Apps with varying levels of complexity.
Flex2 is another way of saying the word “Java”.
Flash has always been yet another way to say “Java” because Flash got its humble beginning s back in the day when some creative programmers were looking for ways to put Java in your browser and one day a company began to sell a product known as “The Future Splash Animator”. We know this because we have a vintage CDROM that says this to us when we read it.
Then along came Macromedia who bought the rights to “The Future Splash Animator” and it later became Flash – the rest is history.
These days Adobe, having bought Macromedia, is making Flash into the one standard we can all count on when it comes to Web Development and soon through the use of Apollo, we hope, Adobe will allow us to develop Flex for the desktop.
Flex2 can be used to deliver Dynamic RIA Content.
Even when Start-Up companies seem to think they have discovered the only cure for cancer, so to speak, along comes someone off the street who might know as much or more than they do about Flex2.
So get out there any use Flex2 to deliver your dynamic RIA Content now !