How to restore lost files in Flex Builder 3…

Today I was working on a Degrafa based skin. When I hit some unknown accidental key combination and discovered the file I was working on had been closed. This closure was followed by my problems window suddenly displaying about a dozen errors.

Moments later I discovered, why! The file, along with it’s two counterpart skins were “gone”, *poof*, DELETED, gone to the digital Gehenna. Needless to say, I was quite distraught. And while you might chime in with criticism on how I should have had copies of the file stored in an SVN or similar repository; let me add in my defense that this file was less than 10 minutes old.

But I had an idea…!!!!

I created a new copy of the file with the same filename. I then used Eclipse’s version compare tool to do a comparison of the current version against older versions. Thankfully, Eclipse retained this information. I was able to easily grab my old code and copy it to the new file instance

UPDATED: Dan Wilson chimed in that you can restore files from local history as well. (Found right below “Compare with”).

Thanks Dan!

- Jason The Saj

PS - If you are unfamiliar with Eclipse’s version compare tool. You need to familiarize yourself with it. You can find more info in my Flex Builder tips’n'tricks post here:

antiAssassin - an experiment in Flex/AIR utilization of webcams

My employer Nxtbook Media recently had a corporate office game/fundraiser event. It was a week of the game “Assassin”. In this case, fellow office workers try to assassinate each other by the careful unnoticed placement of the all-lethal “clothespin”.

I created this tool as a little experiment in utilization of the webcam and motion detection. I was first made aware of this possibility by Doug McCune’s “TiileUI” experiment. (Who in fact used a different methodology which he has now posted to his blog.)

UPDATE: For whatever reason, my host server seems to have problems delivering the .air file. So I’ve encapsulated it into a .zip file and uploaded that instead. Just open the zip, and you should get the .air file. Sorry about the hassle. If anyone knows WHY this is happening. Please enlighten me. I also tried my work’s host environment and it tried to deliver raw code. So I presume it’s a server setting.

I published antiAssassin as an AIR application, which you can download here. There is also a Flex version, with the option to view source here. I’ve endeavored to document the code.

Enjoy!!!!

- The Dark Lord of the SWF

Adobe Online Office Productivity Suite - Beta

Adobe’s Online Office Productivity Suite:

Photoshop Express (Photo Editor)
https://www.photoshop.com/express

Buzzword (Word Processor)
http://www.buzzword.com

Sliderocket (Presentation Software)
http://www.sliderocket.com/

idubee (Spreadsheet)
http://www.idubee.com

Blist (Spreadsheet)
http://www.blist.com/

A lot of these are still betas, some much rougher than others…

NOTE - Just to clarify, Adobe hasn’t acquired Blist or Sliderocket. But they don’t need too… their technology is beginning to provide almost a full online ‘light office productivity’ platform.

Flex Builder 3 - free to education (students/staff)

Here’s where to register:

http://flexregistration.com/

DISCUSSION: Flash + Google Indexing

Today, I am reviewing methods of including content for Google indexing. As well as my thoughts of where this should be going in the future:

Current Trends:

  • SWFObject style - division filled with content re-populated if Flash player exists.

    •  First, potential of code to be seen briefly before the Flash content is loaded on slower machines.
    • Question over whether Google respects such code and what risks of Googlebot viewing such methods as code hiding.

  • Dual HTML/Flash content sites, using Flash only for animations, videos and other media.

    • Not suitable for all Flash based sites, especially those that more so full fledged applications or RIAs
    • Once again limiting the web to the age old, over-extended cumbersome HTML
    • Lose out on the full power of the Flash environment

  • Limited garnering by Googlebot via Adobe’s swf2html SDK

  • No Flash (obviously not an acceptable option for RIA developers like myself)

Are there other means being implemented? Please chime in….

***

Where should we be going? Sadly, this is a ship that is stranded in a sargasso sea of the doldrums with little us mere sailers are able to do to free her.

The solution requires joint work on the part of Adobe and Google. And while such is not within my power to make happen. I do have a thought about how to do it, but not being involved in the nitty-gritty inner workings of Flash itself these thoughts are not much more than whimsical - but I’ll share anyways.

Flash recently went to a very event listener based model. I believe this should be leveraged for Flash/Flex apps. My thought is to have a listener that can be defined as active or not call echobot.

If echobot is active, it gives a hook for a spider to listen. Obviously, Adobe would have to work very closely with Google so that their spiderbot would be modified to listen. The echobot listener would essentially receive a simple collection of the current content in an XML structure most likely. Delivering text content along with basic formatting (ie: font size, weight, etc) which would allow google to weigh the content a bit. Also, would receive tabular info via data grid which would include row content and global content (ie: # records, number of fields, etc). Perhaps the means to define “alt” values for graphics/animations/effects/etc.

Of course, there is another aspect which is necessary. As is often brought up, the issue of tracking location within a Flash application. And this would tie in to a URL/state definition. So that a spider could go thru various states similar to loading pages. And the echobot listener would deliver the bot the content result of the given state. (Or in a traditional Flash app, the current stopped frame.)

Now, clearly this would require some logistical changes both internally to Flash and with Google’s bot. Adobe would need to devise the internal and then put forth the workings as an API for Google (or any other indexer) to utilize.

Of course there is a performance hit, you’re listening and delivering said content at all these event points. However, firstly, the echobot listener would be able to be specified as disabled. Second, even if enabled, it should not be active unless passed a signal by the spider-bot saying “I’m here, I want to listen”. Only then should the listener be active.

This would enable Flash sites to be indexed, even to sub states. As well as encouraging much more internal state existence for purposes of URL bookmarking, etc.

Adobe AIR - “Opens a sea of possibilities!” (30onair)

If you haven’t heard… Adobe launched Flex 3 & AIR this past week.

Here is a short video I did for the 30onair. (Don’t know what that is, go to YouTube.com and search for 30onair.) ;-)

http://www.youtube.com/watch?v=l1aAnj7haDU

360Flex “Atlanta”

I will be in Atlanta, Georgia next week attending the 360Flex Developer Conference.

http://www.360conferences.com/360flex/

If any of my readers are attending, be sure to grab ahold of me and say “Hello”. This year I will be graced with the presence of my beautiful wife, and darling little girl.

- The Saj

PS - For those unfamiliar with the 360Flex conference. It is a developer conference that is very community driven. There’s no big $$$ corps behind it. It’s focus is on Flex development and related technologies. It tends to have a very intimate feel, where you can find yourself bumping into numerous recognizable names (albeit perhaps not faces), such as Doug McCune, Jeffry Houser (The Flex Show). But more importantly, good seminars and hands-on sessions!

SWFObject 2.0 not returning userAgent in IE6 (anyone else encounter this?)

UPDATE: The new SWFObject 2.0 (Release Candidate 2) resolved this issue. The examples below should now give you the browser agent info when using IE6…

The one caveat, Firefox on XP needs wmode to be set to either “transparent” or “opaque”, otherwise a pop-up occurs.

******

Screenshot…
http://www.easternstorm.net/sassie/useragenttest/versionresults.jpg
On the left side observe IE6 loading the same swf, embedded in
standard Flex 3, SWFO 1.5, SWFO 2.0. Please note that that in SWFO
2.0 we receive “null”.
Now, the left two columns shows several other browsers loading the 3rd
template:
http://www.easternstorm.net/sassie/useragenttest/useragenttestSWFO20….
Note that it is working fine on Firefox XP, Safari 3 XP, Opera XP,
Firefox OSX, Safari 3 OSX. The only other exception being Safari 2,
which has known issues with externalInterface as I recall.
So clearly there is something not quite right with SWFObject 2.0
running IE6
***
Here are the three embed templates:
http://www.easternstorm.net/sassie/useragenttest/useragenttest.html
http://www.easternstorm.net/sassie/useragenttest/useragenttestSWFO15….
http://www.easternstorm.net/sassie/useragenttest/useragenttestSWFO20….
***
Source code of example:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml
layout=”absolute” viewSourceURL=”srcview/index.html”>
<mx:Script>
<![CDATA[
private function Test():void{
Debug.text = "<<" + ExternalInterface.call("function getBrowser()
{varBrowser = ''+ navigator.userAgent;alert(varBrowser);return
varBrowser;}") + ">>";
}
]]>
</mx:Script>
<mx:VBox x=”10″ y=”10″>
<mx:Button id=”btnTest” label=”Click to View userAgent Info”
click=”Test()”/>
<mx:TextArea id=”Debug” width=”450″ color=”Navy” borderColor=”Red”/>
</mx:VBox>
</mx:Application>

The Nightmare that is “_blank”: Part II (resolved???)

UPDATE: I have found the issue with IE & pop-up blocking. It was not in fact the fault of SWFObject. Rather, the issue was a particular parameter entry: wmode=”transparent”

Yes, the simple removal of this entry caused IE’s pop-up blocking to cease. It appears I finally have a working solution - I tested on: XP (IE6, Firefox, Safari 3, Opera) & OSX (Firefox, Safari 3, Safari 2). The only caveat now being that the use of wmode=”transparent” causes IE to pop-up block.
Okay, I am putting this out to all of my readers…


I’ve almost got every browser working for my “_blank” clicks. The final exception is that on IE clicking is triggering a pop-up blocker. Surprisingly, it is not my code that appears to be the issue - or at least not directly - rather, it appears to be caused by the use of SWFObject to embed the .swf file. (We use SWFObject for our .swf embedding for a variety of reasons.)

Below are three links to my “Example 2″ , each using a different loading method. Standard as generated by Flex, SWFObject 1.5, & SWFObject 2

http://www.easternstorm.net/sassie/example2/example2.html

http://www.easternstorm.net/sassie/example2/example2-swfobject.html

http://www.easternstorm.net/sassie/example2/example2-swfobject2.html

If anyone can provide insight as to why the use of SWFObject is triggering the IE pop-up blocker, please, please let me know!

- The Saj

PS - Here are a few additional links on “_blank” issues. These demonstrate examples of using Callback, which I have not implemented but might consider incorporating.

Insideria

AssertTrue

The nightmare that is “_blank” & Flex

UPDATE: I believe the example will work in all common browsers (Firefox, Safari, IE, Opera) on both PC & Mac platforms.

NOTE - If you’re using SWFObject 2.0, you need to upgrade to RC2!

*******************

I created a bug tracker listing for this issue a while back at bugs.adobe.com. It was closed - I believe improperly so.

Please consider visiting the listing for this issue. While you cannot vote because it’s been closed. You can comment, and you can add the listing to those items you are watching.

http://bugs.adobe.com/jira/browse/SDK-12987


UPDATE: I revised the code to handle for Safari 2 (sort of). Essentialy, I was not getting a response from Safari 2 on the browserAgent request. My conditional was failing unexpectedly.I’ve revised the code, and confirmed that it now reaches the “Undefined” option. Which uses the standard navigateToURL(). And should work in Safari 2.Too those readers who still have access to Safari 2, if you could confirm that it is now working for you - much appreciated.- The Saj

PS - Special thanks to multi-Safari and to Subtlegradient for the fix that re-enables multi-safari. Which allowed me to install Safari 2 on my Mac for testing purposes. (Why Apple & Microsoft fail to see the need for us developers to run multiple browsers we will never know.)


One of the very first headaches I encountered with Flex was when I tried to pop-out a link using “_blank”. ActionScript 2.0 used _getURL(), in ActionScript 3.0 this was changed to navigateToURL().Imagine my horror when after uploading my new Flex app live to discover that clicking was caught by Firefox’s pop-up. The old _getURL() worked fine, but I really didn’t want to go back and re-write my app in Flash / AS 2.0A little research revealed a work-a-round using the externalInterface command to call out to the browser and pop open the window using the window.open command.However, I would more recently discover all of my Flex applications failing to work in the new Safari 3.0, Safari 2.0 works with the externalInterface work-a-round but for whatever reason Safari 3.0 does not. Further research led to another work-a-round to check the browser brand then use conditional if/else logic to enable the application to either use the externalInterface() method if Firefox or the navigateToURL() method if another browser.Now for my applications I have made these into two separate re-usable classes. However, so as not to confuse those new to Flex and still unfamiliar with classes, I have made a simple and stupid example that incorporates all of the code in one MXML file. Hopefully this example will help you if you’ve encountered this issue:

http://www.easternstorm.net/sassie/example2/example2.html
(right-click to view source)

- The Saj

Next Page »