Feed aggregator |
Loading Modules in AIR application
We had the task-force of loading Flex modules in AIR application at runtime. All our flex modules are developed already and they can run well in our website; but loading the Flex modules and make them run in AIR is the different story, the problem comes from the different security mechanism between AIR and Web Flex application. Finally, we find the solution for this issue after several hours searching solutions on internet
TWiFx - Episode 7
Hey Hey,
Here are links for this week's video...
Top 10 Flex/AIR apps for Students
http://www.adobe.com/devnet/flex/articles/apps_students.html?devcon=f2
Ted Patrick's blog
http://onflex.org
Mike Martin's presentation on Poetic Declaration
www.teknision.com/presentations/flexcamp
Author: adobeflextv
Keywords: 360Flex Adobe AIR declaration Flex mediamaster poetic RIA
Added: September 5, 2008
TWiFx - Episode 7
Hey Hey,
Here are links for this week's video...
Top 10 Flex/AIR apps for Students
http://www.adobe.com/devnet/flex/articles/apps_students.html?devcon=f2
Ted Patrick's blog
http://onflex.org
Mike Martin's presentation on Poetic Declaration
www.teknision.com/presentations/flexcamp
Author: adobeflextv
Keywords: 360Flex Adobe AIR declaration Flex mediamaster poetic RIA
Added: September 5, 2008
TWiFx - Episode 7
Hey Hey,
Here are links for this week's video...
Top 10 Flex/AIR apps for Students
http://www.adobe.com/devnet/flex/articles/apps_students.html?devcon=f2
Ted Patrick's blog
http://onflex.org
Mike Martin's presentation on Poetic Declaration
www.teknision.com/presentations/flexcamp
Author: adobeflextv
Keywords: 360Flex Adobe AIR declaration Flex mediamaster poetic RIA
Added: September 5, 2008
How To Make Money With Your RIA
This presentation from David Heinemeier Hansson is a great presentation for people who want to make money from their rich Internet application.
Share and annotate your videos with Omnisio!Implimenting Offline Web Content with Gears LocalServer API
I spent the afternoon playing around with Google Gears in order to get a basic feel for how it works. Specifically, I wanted to see how much work it would take to add support for offline viewing for tostring.org (an online book site).
I used the Gears LocalServer API which “allows a web application to cache and serve its HTTP resources locally, without a network connection”. The implementation can be though of as a small web server that intercepts requests for remote resources and serves them (seamlessly) from a local cache. This has a couple of advantages:
- Can access content offline
- Even when online, content is pulled from cache, so access is very fast
The main disadvantages are related to #2. Since content is pulled from the local cache, even when online, users may view stale content. This can also make it a bit of a hassle to develop, as you have to remember to clear the Gears cache of the content when trying to view changes.
Gears will periodically check for updated content and sync anything that is updated. It also provides an API to allow developers to force checks for new content, as well as fine grained control over what content is cached / synced locally.
It took me most of the afternoon to implement the functionality, but the vast majority of that time was spent writing python and Django code (which I was a little rusty on), and learning some of the jQuery JavaScript library which I used to provide visual feedback while the syncing was occurring. The actual Gears implementation was pretty trivial and took maybe a total of 30 minutes (which included learning the APIs and implementing them).
Here is the complete JavaScript code (half of which provides feedback to the user while the pages are being synced).
function hasGears() { return (window.google && google.gears); } function updateProgressField(msg) { $('#progress').text(msg); } function onSyncProgress(event) { updateProgressField(Math.ceil(((event.filesComplete / event.filesTotal) * 100)) + "%"); } function onSyncComplete() { updateProgressField("Sync Complete."); } function onSyncError(event) { updateProgressField("Error Syncing."); } function storeForOffline() { var localServer = google.gears.factory.create('beta.localserver'); var store = localServer.createManagedStore('tostring-store'); store.manifestUrl = '/gearsmanifest'; store.onerror = onSyncError; store.oncomplete = onSyncComplete; store.onprogress = onSyncProgress store.checkForUpdate(); } function onStoreClick(event) { event.preventDefault(); storeForOffline(); } function onReady() { if(hasGears()) { $("#offline_span").css("visibility", "visible"); $("#offline_span").click(onStoreClick); } } $(document).ready(onReady);When a user who has Gears installed visits the site they are be presented with a link titled “Save Offline” (top right). Users who do not have Gears will not see this link. If the user clicks the link, they are presented with a Gears dialog asking for permission (I can customize this, but did not). If they allow the action, then the Gears library loads a JSON based manifest file with information on how the site should be synced (including which specific resources should be included).
You can view the full manifest for tostring.org at:
http://www.tostring.org/gearsmanifest
Here is a snippet:
{"betaManifestVersion": 1, "version": "2008-08-27 14:18:04", "entries": [ {"url":"/"}, {"url":"/translating/"}, {"url":"/about/"}, {"url":"/dmedia/books/scripts/grids-min.css"}, {"url":"/dmedia/books/css/styles.css"}, {"url":"/dmedia/books/scripts/jquery.min.js"}, { "url": "/books/adobe-air-for-javascript-developers-pocketguide/1.0/sv/introduktion-till-adobe-air/"}, ]}Gears remembers the version string, and periodically checks to see if it has changed. If it has, it will resync the content (you can do some more advanced stuff with server responses to tell Gears that a particular piece of content has not been updated).
While the content is syncing, I present a small progress indicator to the user.
Once the sync is complete, the content is viewed from the cache, regardless of whether the user is online or offline. You can test this in Firefox via File > Work Offline.
All in all, it was very easy to implement and I am impressed with the results.
Couple of issues:
- There does not appear to be a way to detect whether the page is running online or offline, and it doesnt look like Google plans to add it. It is definitely a tricky problem, but I think that Adobe AIR handles it well, and at least makes it easier for the develop.
- There is not a way to detect whether content has already been cached (at least not without prompting another security dialog)
- There is no indication or UI indicating whether you are viewing “live” content or cached content.
- You can only cache / sync pages from the same domain that the web page originated from. This means is you are loading any remote libraries or resources (such as remote JavaScript libraries), you will need to start hosting them yourself if you want them to be synced with your content.
It seems that calling any of the APIs will result in a security / permission dialog being raised (even though some of the docs suggest otherwise). Which ist the best experience when using multiple APIs.
One interesting thing about the API is that it can be used for more than just making web content available offline. You could also use to to cache frequently used assets to:
- Speed of loading of web pages and applications
- Reduce load and bandwith on the server
Indeed, Wordpress is using Gears to help make their admin application more responsive.
The next step will be to add a desktop shortcut for the application using the Desktop API. This also looks to be pretty trivial although I am concerned that the user might be presented with two permission dialogs.
If you have Gears installed, you can see this example in action at tostring.org.
If you have any questions or suggestions, or find any errors in my code (likely), then post them in the comments.
Using an embedded font with the LinkButton control in Flex
The following example shows how you can use an embedded font with the Flex LinkButton control by setting the fontFamily and fontWeight styles.
The LinkButton control uses a bold font weight by default, so you need to either embed the bold font weight, or set the LinkButton control’s fontWeight style to normal.
Full code after the jump.
(more…)
Using an embedded font with the LinkButton control in Flex
The following example shows how you can use an embedded font with the Flex LinkButton control by setting the fontFamily and fontWeight styles.
The LinkButton control uses a bold font weight by default, so you need to either embed the bold font weight, or set the LinkButton control’s fontWeight style to normal.
Full code after the jump.
Pixel Bender: AIF_FLASH_TARGET
Something nice that recently appeared in the Pixel Bender spec is the preprocessor symbol AIF_FLASH_TARGET. When testing under normal conditions, AIF_FLASH_TARGET is set to a value of 0. With Flash warnings enabled, AIF_FLASH_TARGET is set to a value of 1. Testing against this allows you to use methods that are not currently supported by Flash Player while testing in the Toolkit, but still produce a shader that is Flash compatible.
as3corelib Tutorial:How to Use DateUtil Class in Flex
DateUtil class contains static utility methods for manipulating and working with Dates. This is a useful class to simplify the date processing for programmers. For example, I want to know the day name of date August 10, 1983. What should we do with DateUtil? As we know, DateFiled provide a static method named stringToDate(). So, I get the day name of August 10, 1983 like this: DateUtil. getFullDayName (DateField. stringToDate(“08/10/1983”,”MM/DD/YYYY”)). What should we do without DateUtil?
Flex and Fuse the Arch - Intro to Cairngorm
Intro to Cairngorm - by Don Tinsley
The intent of this presentation is to familiarize participants with the Cairngorm micro architecture and the Model Locator design pattern. Ever wondered how in the world large scale Flex applications are put together? Ever wondered how multiple mxmls, custom components and scripts should tallk to each other? Enter Cairngorm!
Philadelphia Flex Users Group
Comparing Flex Frameworks:
The goal of any framework is to make the process of software
development and maintenance easier. There are different ways of
achieving this goal. Some people prefer working with frameworks that
are based on the Model-View-Controller pattern, while other like
dealing with class libraries of components. Each approach has its pros
and cons. During this session we’ll go over the same application that
was built using architectural frameworks Cairngorm, PureMVC and Mate
frameworks. If time permits, we’ll cover a CRUD code generator called
Clear Data Builder.
About the speaker:
Yakov Fain works as Flex and Java architect at Farata Systems, a
company that provides consulting and training services in the
metropolitan New York area. He authored several Java books, dozens of
technical articles. Recently he co-authored book , “Rich Internet
Applications with Adobe Flex and Java: Secrets of the Masters” in
Spring 2007 that was shipped to over 60 countries. Sun Microsystems
has nominated and awarded Yakov with the title Java Champion. He leads
the Princeton Java Users Group. Yakov teaches Java and Flex part time
at New York University.He hold MS in Applied Math. He’s a co-author of
the upcoming OReilly book “Enterprise Application Development with
Flex”

