Archive for the 'Flash' Category

Flash Player 10 - Beta

UPDATE on “_blank” / navigateToURL() issue

Well, this week provided a fair amount of activity on the bug. The is technically a Flash Player bug (Reference #225434). [For those looking for an interim fix, see my blog post here.]

Well, the good news, Adobe’s recent 9.0.124 release fixes this issue for most browsers.

Safari 2, Safari 3, and Opera were all fine on Mac.
IE6, Firefox, Safari 3 were all fine on Windows XP.

The issue does remain for Firefox on OS X & Linux (Unix code versions). Hopefully they’ll fix it in 9.0.25, but it’s nice to know it’s being worked on.

Note - in Firefox on Mac, the first click worked for me, the second click would be blocked. And eventually all clicks were blocked.

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

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.

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

Adobe re-designs site

Adobe has recently launched a site re-design. A fair amount of chatter as to what features individuals view as improvements and which are viewed as cumbersome. (ie: Home page has nearly half the page taken up by an animation. Nice animation…but 1/2 the site area is gone to an ad.)

That said, what I find most interesting to note is that nearly all the links point to folders rather than files. I can see a number of advantages with this sort of design implementation. First and foremost being that if you change back end server technology you do not need to change your paths.  It’s no longer page.html, .cfm, .php, etc. Now it’s simply www.domain.com/page/

You can change your whole backend and people’s book marks would remain valid. There is a lot to be said for such a design implementation.

Downside? Well, for Adobe, considering they sell Coldfusion (a back end server), it now reduces the presence of the .cfm pages.  So there could be a marketing loss.

Butterflies - Flash CS3/Flex 2 Integration by Jim Robson

My friend Jim Robson has posted an insightful blog regarding the use of Flash CS3 integration with Flex 2.

http://jimrobson.wordpress.com/2007/09/05/flash-cs3-flex-2-butterflies-part-two/

Besides, there are butterflies!

- Saj

Creating a simple class in a package - not so simple?

ENVIRONMENT: Flash CS3, ActionScript 3.0/2.0
TOPIC: packages & classes

“There are 10 types of people in this world. Those who understand binary, and those who do not.”

This is one of those little insightful jokes that truly express many of the struggles in the programming world. Most people will be confused by the above statement wondering who the other 8 people are. A few, who speak binary, will have read it naturally as dealing with two individuals. And a fair number of us geeks will have deduced from the context the twist in the words. An equally fair number of us geeks are probably still clueless. Doesn’t mean you’re stupid - just means you probably don’t deal with binary code that often.

For those entering the world of classes and packages, you might feel very akin to those wondering who the other 8 people are. If you’ve never dealt with classes (not uncommon for many web designers and programmers of older non-classed based languages - or both as the case may be for Flash developers who haven’t worked with the newer ActionScript methodologies).

Trying to understand new concepts while at the same time trying to deduce proper syntax can result in a great amount of frustration. You can have the concept understood and be unable to implement it because of a syntax issue.

A good case in point is the different implementations of packages and classes in ActionScript 2.0 versus 3.0.

For Comparison, the following defines a class in a package in AS2, where the pathname defines the package the class is a part of:

class path.classname{}

Where as in AS3, the package is designated separately from the class as shown below:

package path{
public class classname{}
}

This doesn’t even address the systems end of having your Flash application configured to look in the proper location of your computing platform to access the classes.

What is likely second nature and seemingly intuitive to one who has been working with packages and classes for years can in fact be a frustrating stumbling block for one entering this world for the first time. Many examples out there, and most of the official documentation, make the assumption that you already have all your pieces together. If this is not the case, (and it’s often not for someone who is new to this and thus in need of documentation), then the provided examples fail to run - breaking and leaving the programmer with little insight into the error of his or her ways.

I have attempted to provide an example from start to finish of creating and using a class in a package. Addressing both the syntactical differences between AS3 & AS2 as well as instructing the user how to configure Flash to properly look for the the classes. It is my hope that these examples will provide some useful insight to those trying to get the ball rolling.

Example 1:
http://www.easternstorm.net/sassie/example1/sassie_example1.zip

(NOTE: These examples require Adobe Flash CS3)