Phone Cards | Offshore Company | Car Hifi Audio | Acer Aspire Laptops | Thermal Imaging | International Domain Names | Register Domains | Micron RAM Memory DDR Memory Upgrades | Fudousan | Aoyama | Offshore Company | Used Cars, New Cars and Contract Hire | Tool Sensor | .COM.SG Domain Registration | Tents | Office Computer Supplies | Tractor Parts |

Calendar

July 2009
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
262728293031  

Tag Cloud

Categories

Archives

Recent Posts

Recent Comments

Deep Linking in Flex and Flash SEO

By Rich Tretola | July 7, 2009894 views

How many of you are building your applications using deep linking with mx.managers.BrowserManager, or one of the deep linking libraries (URLKit, SWFAddress, etc)? Are you building your applications with SEO in mind or is this something that you see on the horizon but haven’t committed to yet? I have been experimenting with mx.managers.BrowserManager and find it very intuitive and easy to integrate into my applications. For example, here is a simple tab navigation example:

Run the example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo"
               minWidth="1024" minHeight="768" applicationComplete="init()">

    <fx:Script>
        <![CDATA[
            import mx.events.BrowserChangeEvent;
            import mx.managers.IBrowserManager;
            import mx.utils.URLUtil;
            import mx.managers.BrowserManager;
           
            public var browserManager:IBrowserManager;
           
            private function init():void {
                browserManager = BrowserManager.getInstance();
                browserManager.init();
                browserManager.addEventListener(BrowserChangeEvent.BROWSER_URL_CHANGE, parseURL);
                callLater(parseURL);
            }

            private function parseURL(event:Event = null):void {
                var o:Object = URLUtil.stringToObject(browserManager.fragment);
                if (o.tabId == undefined)
                    o.tabId = 0;
                tabs.selectedIndex = o.tabId;
                setPageTitle();
            }
           
            private function updateURL():void {
                callLater(doUpdateURL);
            }

            private function doUpdateURL():void {
                var title:String = "";
                var fragments:String = "";
                var o:Object = {};
                o.tabId = tabs.selectedIndex;
                fragments = URLUtil.objectToString(o);
                browserManager.setFragment(fragments);
                setPageTitle();
            }
           
            private function setPageTitle():void{
                var title:String = Canvas(tabs.getChildAt(tabs.selectedIndex)).label;
                browserManager.setTitle(title);
            }
        ]]>
    </fx:Script>
    <mx:TabNavigator id="tabs"
                     width="100%"
                     height="100%"
                     change="updateURL()">
        <mx:Canvas label="Tab 1"
                   width="100%"
                   height="100%"
                   backgroundColor="0xFF0000">
            <mx:Label text="Tab 1"
                      fontSize="48"
                      horizontalCenter="0"
                      verticalCenter="0"/>
        </mx:Canvas>
        <mx:Canvas label="Tab 2"
                   width="100%"
                   height="100%"
                   backgroundColor="0xCCCCCC">
            <mx:Label text="Tab 2"
                      fontSize="48"
                      horizontalCenter="0"
                      verticalCenter="0"/>
        </mx:Canvas>
        <mx:Canvas label="Tab 3"
                   width="100%"
                   height="100%"
                   backgroundColor="0x000066">
            <mx:Label text="Tab 3"
                      fontSize="48"
                      horizontalCenter="0"
                      verticalCenter="0"/>
        </mx:Canvas>
    </mx:TabNavigator>
</s:Application>

To read more about Deep Linking check out this great article in the Flex Cookbook.
Deep Linking in Flex

Please let me know your experiences with deep linking and Flash SEO.

Share this Post


Topics: Flex, Flex 4 | 14 Comments »

Free Flex Builder 3 Professional

By Rich Tretola | July 5, 20091,550 views

While I was home over the past 2 weeks with my new daughter, I stumbled across a shrink wrapped Flex Builder 3 in my office that I am not using. Since, I don’t currently need this extra copy I would like to give it away to one of my Twitter followers.

If you would like to qualify for this free license, simply Tweet the following anytime this week. “#freeflexbuilder3 from @richtretola http://bit.ly/ABhLO

or just click here to Tweet this.

Contest ends Friday 7/12 and midnight eastern time. I will announce the winner on Saturday at http://www.twitter.com/richtretola. You can enter as often as you wish.

If the winner is from the U.S., I will ship out the boxed version, if not from the U.S., I’ll just send over the serial number or you can choose to pay the shipping.

Share this Post


Topics: Adobe AIR, Announcements, Flex, Flex Builder | 5 Comments »

Finally! Flash Player 10 coming to mobile (Android)!

By Rich Tretola | June 24, 2009666 views

As an Android user, I am very happy to hear the news of Android joining the Open Screen Project and the announcement that Flash Player 10 will be coming to Android very soon.

Share this Post


Topics: Announcements, Flash Player, Flex | 4 Comments »

Online Office Wars Continue Ajax vs Flash

By Rich Tretola | June 15, 20091,014 views

Google Docs includes Documents, Presentations and SpreadSheet for onlne collabortation in an office type envoronment in a very intuitive and easy to use AJAX powered interface.

It provides a safe online space to work with your Microsoft Office Style documents including Microsoft Word, Microsoft Excel, and Microsoft Powerpoint document types.

It has become the standard for me in my collaboration needs as it easily allows the creation and storage of documents that I use often which require interactions with others.

Well, in addition to Adobe Buzzword (Word) and Adobe Presentations (Powerpoint), Adobe now adds Adobe Tables (Excel) to their online suite of Microsoft Office document editing and collaboration. Not surprisingly, Adobes online services are powered by the Adobe Flash Player. You can check out Adobe Tables beta here.

So, the only question that now remains is, will you do your Office document editing with AJAX, the Flash Player, or stay old school with desktop software?

Share this Post


Topics: Announcements, Flash Player, Flex | 1 Comment »

Open an AIR application from a 2nd AIR application

By Rich Tretola | June 8, 20091,531 views

In my 360Flex Indianapolis presentation, I demonstrated how to launch an Adobe AIR application from within a second AIR application. I have extracted the code used and will demonstrate how to do this within this post. There are a few ways to do this.

You can install my LauncherSample application to test the code to follow.

Download LauncherSample

No matter which method you choose, the one thing that is required by both is that the application you are attempting to launch has the allowBrowserInvocation property within the AIR configuration file set to true and the application installed on your system.

1
2
3
<!-- Whether the application can be launched when the user clicks a link in a web browser.
    Optional. Default false. -->
<allowBrowserInvocation>true</allowBrowserInvocation>

You must also know the application’s id and publisher’s id. For example within my LauncherSample, the application id defined in the AIR configuration file is:

1
2
<!-- The application identifier string, unique to this application. Required. -->
<id>LauncherSample</id>

To find the publisher id, you can drill into the installation folder for the application and find the publisherid file within Contents/Resources/META-INF/AIR. If you find this file within the LauncherSample, you will see that my publisherid is 130A080AFCC69239D6F9896EEBED2327BC93ED43.1

Now that we have the 2 required items we can get started. As I previously mentioned, there are a few ways to launch an AIR application from an AIR application.

The first uses an undocumented class adobe.utils.ProductManager. To launch the application using this method you can simply use the code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
                        layout="absolute" width="300" height="100">
    <mx:Script>
        <![CDATA[
            import adobe.utils.ProductManager;
            private var pm:ProductManager;

            private var appID:String = "LauncherSample";
            private var pubID:String = "130A080AFCC69239D6F9896EEBED2327BC93ED43.1";

            private function launchApp():void{
                var mgr:ProductManager = new ProductManager("airappinstaller");
                mgr.launch("-launch " + appID + " " + pubID);
            }
        ]]>
    </mx:Script>
    <mx:Button horizontalCenter="0" verticalCenter="0"
               label="Launch App" click="launchApp()"/>
</mx:WindowedApplication>

This works great, however there is one problem with this method and that is that if the AIR application does not exist on the system, nothing will ever happen and you will not get any feedback alerting you of a problem.

So, we have one other option. We can load in the same swf file that is used by the badge installer and now we will not only be able to launch an AIR application, but we can also test for the existence of the application on the machine.

Upon creationComplete of the application, the code below loads the air.swf file from http://airdownload.adobe.com/air/browserapi/air.swf. Once the air.swf is loaded, the getApplicationVersion method is called against the air.swf and the appId, pubId, and call back method versionDetectCallback are passed in. Within the versionDetectCallback method the version is passed in. If the version is null, we know that the application is not installed on the machine and we offer a download button. If the version is not null, we instead will offer a launch button.

If the user clicks on the install button, we can call the installApplication method on the air.swf passing in the application’s URL and required AIR version.

If the user clicks on the launch button, we can call the launchApplication method on the air.swf passing in the application’s appId and pubId and the application will be launched.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
                        creationComplete="loadAIR()"
                        width="300" height="100"
                        layout="absolute">
    <mx:Script>
        <![CDATA[
            private var _air:Object;
            private var _loader:Loader;

            private var appID:String = "LauncherSample";
            private var pubID:String = "130A080AFCC69239D6F9896EEBED2327BC93ED43.1";
            private var appURL:String = "http://blog.everythingflex.com/wp-content/uploads/2009/06/launchersample.air";
            private var runtimeVersion:String = "1.5";

            // load in the air.swf file
            private function loadAIR():void{
                _loader = new Loader();
                var loaderContext:LoaderContext = new LoaderContext();
                loaderContext.applicationDomain = ApplicationDomain.currentDomain;
                _loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
                _loader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"), loaderContext);

            }
            // handle init of the _loader
            private function onInit(e:Event):void {
                _air = e.target.content;
                // test to see if appplication is installed
                _air.getApplicationVersion(appID, pubID, versionDetectCallback);
            }

            // handle callback from getApplicationVersion
            private function versionDetectCallback(version:String):void {
                // if version found show launch button, if not show install button
                if (version == null) {
                    install.visible = true;
                    launch.visible = false;
                } else {
                    install.visible = false;
                    launch.visible = true;
                }
            }

            // install application from remote server
            private function installApp():void{
                _air.installApplication(appURL, runtimeVersion);
            }

            // launch the application
            private function launchApp():void{
                _air.launchApplication(appID, pubID);
            }
        ]]>
    </mx:Script>
    <mx:Button click="installApp()" label="Install Application"
               horizontalCenter="0" verticalCenter="0" width="150"
               height="22" id="install" visible="false"/>
    <mx:Button click="launchApp()" label="Launch Application"
               horizontalCenter="0" verticalCenter="0" width="150"
               height="22" id="launch" visible="false"/>
</mx:WindowedApplication>

To review, if you know the application you wish to launch is installed, you can use the ProductManager class to launch it, if not, you really don;t have a choice but to load in an external swf. All works well with the second method of launching an AIR application expect for the obvious limitation of the air.swf needing to be downloaded from Adobe. Unfortunately, short of altering the users host file, there is no way around this as if the air.swf is not downloaded from the airdownload.adobe.com domain, it will not work.

Hopefully, AIR 2.0 will be less restrictive and allow for the launching of applications natively.

Share this Post


Topics: Adobe AIR, Flex | 7 Comments »


« Previous Entries