Asual

Tuesday,
29 Sep 2009

SWFAddress 2.4

I'm happy to announce the availability of SWFAddress 2.4 which appears to be the most stable and feature-full version up to date. It fixes some nasty issues that appeared in the previous release and introduces a few interesting additions. Here is the changelog:

  • New INTERNAL_CHANGE and EXTERNAL_CHANGE events.
  • Support for parameter arrays.
  • Improved IE8 support.
  • Fixed IE initialization issues.
  • Fixed browser communication issues with AS2/AVM2 on Mac.
  • Fixed URL decoding for AS1 and AS2.
  • Fixed handling of swfobject.createSWF.
  • Workaround for WebKit bug 20355.
  • Frameset support and corresponding sample.
  • All methods dealing with parameters and query strings no longer return empty strings.

The project became pretty mature but we'll continue to consider interesting ideas and requests. More open source goodness is coming soon.

« Previous Post | Next Post »

Comments:

Left by Fede Rivas at Tue, 29 Sep 2:40 PM
Congratulations for the great work, and thank you very much for the effort maded. :)
Left by Nicolas at Tue, 29 Sep 3:05 PM
I think most demand feature is NTERNAL_CHANGE and EXTERNAL_CHANGE events. Thanks for this improvement.
Left by Cay at Tue, 29 Sep 3:31 PM
Great, thank you!
One question though... is the flashvars bug with swfobject in IE fixed?
http://code.google.com/p/swfobject/issues/detail?id=338
Left by Rostislav at Tue, 29 Sep 3:39 PM
@Cay

Yes!
Left by LutinCapuche at Tue, 29 Sep 4:03 PM
Thanks, great work!!
Left by JonCole at Tue, 29 Sep 5:20 PM
I'm having trouble opening the example files in Flash CS3. The 2.3 version worked fine (save the files that were specifically for CS4 obviously).

Also, is there some more comprehensive documentation somewhere I'm missing? The list of functions/methods/etc isn't enough for someone who's just getting into this type of programming. I have to rely heavily on example code to learn how some of this works.

Thanks.
Left by Fred at Wed, 30 Sep 6:50 PM
Hello, I have problems making it work under ie8. The flex sample available in the zip wouldn't work as well on my computer.
I am not using swfObject to embed my flash but i am using the flex template. I read the badpractice doc and i don't see what i am making wrong with ie.
Appart from my problems with IE, congratulations for the good work as swfaddress is really usefull.
Left by Charlie at Fri, 2 Oct 2:48 PM
Hi,

Now that we have the two new change events to work with, does this mean there is a change in best-practice? Previously you have said that all rellevant changes from within the flash should pass through SWFAddress and be handled from its change event, but has this now changed? Given that we can easily tell if it is an external or internal change, should internal changes be handled before they are passed to SWFAddress, then the ensuing INTERNAL_CHANGE event ignored?
Left by Rostislav at Fri, 2 Oct 3:05 PM
@JonCole

Thanks for reporting this. I updated the download package and now most of the FLA files can be opened with CS3.


@Charlie

Thanks for the good question! These new events are result of many user requests. I still believe that the behavior and the code used should always be the same no matter what the CHANGE event is but there are cases where the new events may help. For example, a highly animated website may execute heavy transition effects only on INTERNAL_CHANGE and skip them on EXTERNAL_CHANGE.
Left by Mike D at Fri, 2 Oct 8:02 PM
Doesn't work with ie8, javascript error message'Object doesn't support this property or method'
Left by Rostislav at Sat, 3 Oct 9:46 AM
@Charlie and Mike D

It works great on my IE8 so please provide some more info:

- the exact OS/browser version
- do you have other IE versions installed on the same OS
- can you reproduce the problem with the provided samples
- do you use a web server for testing
Left by Fireball70 at Sat, 3 Oct 2:17 PM
Намям думи. Върха. Браво Ростислав.
Left by gilles at Sun, 4 Oct 8:09 PM
version 2.4 is causing a problem on ie6 that get stuck on the opposite of version 2.3 that is running ie6 ok. One trick to visualise the problem is to look into google analytics the bounce rate with a segment based on ie6 , u should see IE6 bounce rate 3 time higher than the other browsers.
Left by Fred at Mon, 5 Oct 5:29 PM
Hello, yes for the IE8 problem, I have the same thing as MikeD. I have tried on vista and XP and even the flex sample would do the same thing.
IE outputs an error line8 character 5145, and a weird details mesage as i am using explorer not mozilla:
User Agent : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)

my explorer version is 8.0.6001.18702
So that would be a problem for the flex template but would work fine with swfobject. (and i tried online and localy).
I hope those infos will help you, IE is really a pain in the a..
thank you for your work.
Left by Rostislav at Tue, 6 Oct 6:05 PM
@gilles
I don't see anything disturbing in the stats for asual.com. You can monitor the requests sent by the browser to http://www.google-analytics.com/__utm.gif and report any specific issue that you find.

@Fred
Thank you for the detailed information. I found the problem which applies only to IE8 Quirks Mode. I will probably update the download files later today.
Left by Alain at Tue, 6 Oct 7:59 PM
Is there a reason why in the AS2 version of the SWFAddress Class, in the private static function _call (line 147) there is a conditional to detect Mac systems ? In the case of a Mac another function is called wich uses getUrl("javascript ...")

This caused the situation where the browser address never changed. It all worked internally tho. (Firefox 3.5.3, Flash MAC 10,0,32,18, OSX 10.5.8)

It works on Safari 4.0.3 but so does ExternalInterface.call (tested) but the getUrl fails in Firefox

Otherwise everything is peachy ! :)
Left by Rostislav at Tue, 6 Oct 8:55 PM
@Alain
For some time there are serious flickering issues with ExternalInterface on Firefox/Mac and there are various articles available on this topic. The code you're citing is a workaround for this problem which usually experienced with heavier Flash websites. How do you experience the situation where the browser never changes?
Left by Jesse at Wed, 7 Oct 8:38 PM
We had the same problem as Fred but it was solved by making sure our website was properly doctyped (which put IE8 into
Left by Ben at Mon, 12 Oct 9:56 AM
Thanks a lot !
Left by Fred at Mon, 12 Oct 12:16 PM
Hi eveybody, I am not really used to html stuff and i would be glad if you could indicate me a good article about doctype stuff.
I am still stuck with my problemes under IE. Or could you give more explanations Jesse ?!, thanks a lot. swfaddress rules :)
Left by Rostislav at Mon, 12 Oct 1:40 PM
@Fred
I updated the download bundle few days ago to include a small fix which should solve your DOCTYPE issues.
Left by Ben at Wed, 14 Oct 10:32 AM
Hello,

I'd like to know if there is any way to use "usual" anchors with SWFAddress ? I'd like to scroll vertically in my page while using SWFAddress. For example, is there any possibility to make this kind of URL "working" :

http://www.my-site.com/index.php#swfaddress_reference#my-anchor

Of course, i tested that and of course it doesn't work, it why i post here ;)
Thank you all, bye.
Left by Mark Cassar at Mon, 19 Oct 12:52 PM
Great thanks for this amazing class you have built! It really enhances the user experience of Flash websites / web applications!

Mark Cassar
CasaSoft
http://www.casasoft.com.mt
Left by ryan at Mon, 19 Oct 7:46 PM
anyone having problems with the back buttons on the browser window working? how do i fix that

thanks for any help
Left by Felix at Mon, 19 Oct 9:08 PM
If anybody experience problems in IE8 (url not updating).
Then use this doctype, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Rostislav, thx for a fantastic library!!

Flex
Left by neo at Thu, 22 Oct 4:56 PM
When I call SWFAddress.setValue(), SWFAddress dispatch EXTERNAL_CHANGE event in mac safari & firefox.
It's not always, but offten occured.
I want to reload when user click back button.
But in mac, when call SWFAddress.setValue(), browser reloaded.
How do I fix that?

thank you for your work.
Left by Cristi Baluta at Fri, 23 Oct 12:39 PM
On localhost webserver on mac(MAMP), at least, some of the examples are not loading in browser: SEO, ajax, rewriteless....
Any idea? 2.3 had the same issue, 2.2 worked. Uploaded to a webserver is working.
Left by Bradley at Mon, 26 Oct 1:34 AM
There still isn't robust documentation on much of this stuff still, but I'm trying to make sense of EXTERNAL_CHANGE and INTERNAL_CHANGE. I would think EXTERNAL_CHANGE would be for when the address bar is altered by the user or the browser navigation buttons are clicked. Then INTERNAL_CHANGE would be for when flash app is implementing the change. That's not what's happening, so either I'm confused or there is something broken. EXTERNAL_CHANGE is firing every time CHANGE is firing. INTERNAL_CHANGE never fires. I've had the same results in IE 8, Safari Mac, and Firefox Mac. I'm using AS3 version 2.4.
Left by Fernando at Mon, 26 Oct 4:48 AM
Wow wow, thanks!!! If I had any hair I would have lost it already... I was using SWFAddress 2.3 to find that when reloading my site everything got sort of screwy, this update fixed it all!!! Thanks for your hard work man... Thank you. Now one little question (feel free to direct me to the right forum).

Is there any way to pass parameters without using a query string?

Thanks again!!!
Left by paravara1 at Wed, 28 Oct 2:55 PM
If I add an EventListener in AS3 for INTERNAL_CHANGE, it works every time, but the EXTERNAL_CHANGE event doesn't run when I change the address in the browser or click the back button... EXTERNAL_CHANGE only runs at the beginning.
I'd like to handle both change events, just like in the previous version 2.3
Can you help me what could be the problem?

Thanks a lot, and thanks for this great stuff!
Left by Nick Polet at Mon, 2 Nov 7:40 PM
Just added SWFAddress to a new project for the first time just there. Had it going in about 4mins. It fits in so nicely with the PureMVC framework, can see flash projects becoming very powerful with these two as a core.

Just thought I`d post my appreciation to you for your efforts, I'm defintately going to be donating to see this project go further.

Regards and many thanks
Left by Ant. at Tue, 3 Nov 4:51 PM
I'm using SWFAddress 2.4 for AS3 and it's not updating the URL nor title on neither IE or Firefox! The flash events seem to work fine.

Is anyone having the same problem? Where can I get an older version? The 2.3 download link seems to be pointing to 2.4 version!
Left by Patrick Lemiuex at Tue, 3 Nov 8:31 PM
Yeah having same problem, doesn't work, the url doesn't change in the url-bar
Left by Almog Koren at Tue, 3 Nov 10:40 PM
Is it just me or is EXTERNAL_CHANGE firing when it wants to to, is anyone else having this issue? Also does anyone know how to identify when a user hits the browser back button or browser foward button?
Left by sam at Thu, 5 Nov 7:03 AM
hi all

i have a problem when using the direct link on the url ex: http://www.domain_name.com/#aboutus
the first frame not loading when the # was included at the url for the first time swf load, and preloader not shown,

thanks
Left by paravara1 at Sun, 8 Nov 7:52 PM
yeaah, my problem is solved :)
make sure, you call the swfobject before the swfaddress js...

it may help in some case
Left by Dan at Wed, 18 Nov 5:18 PM
Thanks for the awesome library! Works great except in IE8 standards mode. I understand the fact that you can fix it by changing the doctype or forcing into IE7 mode but the library is being used on a lot of sites where we don't have control over the doctype.

Any thoughts on a fix or what the underlying issue is? I've tried debugging a bit but not having any luck. It's just not firing the EXTERNAL_CHANGE event when it should. If you can throw out any clues about the issue, I could continue trying to debug.
Left by PistonHonda at Thu, 19 Nov 5:39 PM
I'm having the same problem as Almog Koren about posts above. All I'm adding are both the External and Internal Events and they both fire on render. Not in browser. Any ideas?

thanks
Left by Simon at Wed, 25 Nov 3:03 PM
Hi,

Many thanks for SWFAddress, hands down its a fantastic resource. One piece of advise would be appreciated, I am trying to completely clear the Address Bar of all URL history as it seems on browser refresh that url's are still showing, after trying all relevant methods from the API I still find nothing quite works, any tips?

Cheers,

S
Left by MItchell at Thu, 26 Nov 5:50 AM
SWFAddress is a really great tool, thanks! Can anyone point me to an example that uses SWFAddress to bookmark pages in Flash. I can't seem to get this to work.
Left by Ignacio Alles at Fri, 27 Nov 2:12 AM
Hi,
Excelent work with this tool! Thank you very much.

It would be great to disable automatic tracking that happens on page load.

thanks,
Left by burak özdelice at Mon, 30 Nov 7:36 PM
hi,

I could not find documentation about new events. I've recently needed them but I have some knowledge lacks . Is there any documentation about external or internal change events?

regards
Left by Thaylin Burns at Mon, 30 Nov 9:42 PM
I'm trying to implement 2.4 but finding it on the tricky side. It's looking as if the js for some reason isn't creating your asual object and henceforth preventing the url change events from being fired. Everything on the flash side is stored but the urls aren't changed in the address bar. Any quick way to fix this?
Left by Thaylin Burns at Mon, 30 Nov 9:44 PM
Actually, wow, just figured it out. On the js side, it looks like you're doing a typeof check for asual and then creating it new but safari doesn't seem to like this. I changed it to " if(!asual){var asual={}} " and that worked like a charm.
Left by Thaylin Burns at Mon, 30 Nov 10:48 PM
Strange but now it works fine without the fix. Sheesh. strange. Pay no mind to my blabbering then. :)
Left by Phil Rabin at Tue, 1 Dec 7:11 PM
Has anyone figured out how to get the EXTERNAL_CHANGE event to fire in IE8 for the frameset? This example: http://www.asual.com/swfaddress/samples/frameset/ only changes the anchor on click, but doesn't reflect the change when you alter the anchor manually.
Left by Arkkimaagi at Thu, 3 Dec 1:59 PM
Is it just me, or does this for-loop seem like an potential endless-loop?

for (var i = 0, e; e = _cache[i]; i++) {
if (e.o == obj && e.t == type && e.l == listener) {
_cache.splice(i, 1);
break;
}
}


Personally I'd go for something like:

var cacheLenght = _cache.length
for (var i = 0, e; i < cacheLenght; i++) {
e = _cache[i];
if (e.o == obj && e.t == type && e.l == listener) {
_cache.splice(i, 1);
break;
}
}


Also this seems to have an error, altho I'm not 100% sure.

if (el.childNodes[i].src)
_url = String(el.childNodes[i].src);
if (s = _searchScript(el.childNodes[i]))
return s;

I always try to avoid this kind of structure:
if(s=5)
To me that looks like an typo.

My aptana with jslint complained about these rows, so I wanted to let you know about these potential problems.
Left by Arkkimaagi at Thu, 3 Dec 2:00 PM
Btw, your commenting system leaks html code badly :)
Left by hurby at Thu, 17 Dec 6:37 PM
Does anybody know a way to get rit of the "#" swfadress places in the adress?
I found that in google analytics it doesn’t take “#” to the link it tracks. So when u click “view this page”, it will go to the wrong page, Probebly a Google thing but the generated "#" is unnecessary and it is ugly in the url's to.

Grtz
Hurby
Left by Rostislav at Sat, 19 Dec 12:10 PM
The SVN copy of the project now contains a patch for all your EXTERNAL_CHANGE troubles. There is also a brand new sample that demonstrates all the SWFAddress events.
Left by Krister at Wed, 6 Jan 1:55 PM
Encountered SWFAddress 2.2 at the site http://www.mitsubishimotors.se/ and noted that various calls were made to read and write the title of the enclosing Iframe. The only problem was that it assumed that this Iframe always belongs to its own site which is not the case if the site is opened by another site in an Iframe which it generated.

Sincerely, Krister.
Left by Andrei at Sun, 10 Jan 9:39 PM
Hello guys.

I was just wondering if someone could clear this for me.
I have seen people stating on several blogs that SWFAdress would help in ajax SEO.

Now - I have always considered that javascript generated content is not bot crawlable period.
So - SWFAdress looks like a great tool for links and bookmarking - but I don't understand how it
would help in indexing JavaScript generated content.

Am I missing something?
Do bots index ajax/javascript content?
Left by michael keating at Wed, 20 Jan 4:29 PM
Hi, have loved swfaddress for .. ever. TY asual!

I was always a bit frustrated that the examples of swfaddress only showed an extremely simple flash site structure using the main timeline, so as we recently completed a simple micro site using the technology we decided to share the code with the community.

The example has 5 pages inside a structure that allows for innys and outys, all the code is available via a zip file. I am sure it will be of help to newbies.

http://www.succinct-tools.net/
Left by Eerk at Fri, 5 Feb 11:56 AM
Just a simple question: doesn't the swfAddress AS3 code create an infinite loop?

When the change event is fired, you call a function. In this function you change the swfaddress value, which fires the event again.

I'm literally copying lee brimelow's video tutorial and I just don't see how this is supposed to work.

Also, when I'm doing nothing in my app (just pressing CTRL+ENTER the event already gets fired! why is that?

Some documentation would indeed be handy!
Left by Nicolas at Fri, 5 Feb 12:06 PM
Only one suggestion.
Can you organise as3 classes with package. Let say : com.asual.SWFAddress
THanks.
Left by Rostislav at Fri, 5 Feb 1:22 PM
@Eerk
You can always create an infinite loop if you want to. Overall I don't recommend the approach used in the Lee's tutorial but many people find it useful. Please, check the rest of the available samples and tutorials. The change event is fired when the movie starts because you need to know the deep link value in order to initialize correctly.

@Nicolas
The files in the src folder don't use packages, but the ones in the dist folder are in the com.asual.swfaddress package.
Left by Eerk at Fri, 5 Feb 1:37 PM
My point was that the Video tutorial actually creates an infinite loop. Not a very good example right?

Now that I've read this website a bit better I understand that there is now an "EXTERNAL_CHANGE" event which makes sure the event doesn't fire when the change comes from within the SWF. This fixes the infinite loop that the video example creates.

Thanks!
Left by Rostislav at Fri, 5 Feb 1:41 PM
@Eerk
The sample works well which means that it doesn't create an infinite loop. The change event is not fired more than once for the same value.
Left by Ross Sclafni at Thu, 11 Feb 11:23 PM
HI, i love the prospects provided by EXTERNAL_CHANGE, so i updated to the new version.
this means that SWFAddress no longer has to be 'wedged' into my application's internal workings, right?
my goal is to be able to set a bookmark for browser navigation and sharing while i do all of my usual logic in as3.
then, if the browser does change or a link is used, i have a special parser handling EXTERNAL_CHANGE events.
much better than the old 'funnel' method, in my opinion.
although, i can't get it to work correctly. whenever i setValue, i get the following error:

ArgumentError: Error #1063: Argument count mismatch on com.asual.swfaddress::SWFAddress$/_setValue(). Expected 2, got 1.
at Function/http://adobe.com/AS3/2006/builtin::apply()
at flash.external::ExternalInterface$/_callIn()
at <anonymous>()

looks like the 'internal' argument is missing. any insight?

great addition in concept, please advise how to proceed or if ive misinterpreted the use case for the new event structure...
Left by Rostislav at Thu, 11 Feb 11:30 PM
@Ross
Can you please try getting the SVN copy of the upcoming 2.5 version and check the Events sample. I haven't seen such an error before. Please, provide a simple test case if you still can reproduce it.
Left by Curt at Mon, 22 Feb 7:48 PM
My Flash website www.killerbadger.com uses SWFAddress 2.4. The forward / back buttons work, but if I try to navigate to a specific URL using the bookmarked page or by typing the URL in my browser, I always get the home page. You can see for yoursef:

http://www.killerbadger.com/#/Culture
http://www.killerbadger.com/#/Gallery
http://www.killerbadger.com/#/Contact

No matter which one I try, it just jumps to the home page (http://www.killerbadger.com/#/Badger%20Illustration%20Studio). Is this a common problem, or am implementing incorrectly?

I'm using Firefox 3.5.8.
Left by Michael G at Wed, 24 Feb 9:41 PM
AS2 project. Only the URL won't change. Everything else seems to be working well. The title of the page is changing correctly via the navigation logic, but the URL is not updating. Works fine in IE7 and Windows Safari, but not Mac Firefox or Safari.

Don't know where to start. Because the URL isn't updating, no history items are being generated, but if I type a URL, the SWFAddress.CHANGE listener works appropriately and goes to the right page. Tried several combinations of swfobject and swfaddress distributions. An old swf compile still works correctly on the testing server, suggesting it must be something in the Actionscript. Any help would be greatly appreciated.
Left by Ryan at Sun, 28 Feb 9:57 PM
So, this is very strange:

IE: 8
Browser buttons work fine while first visit to website, browser buttons go forward and back as planned...
Go to another URL after clicking through the flash file...
Go back to your SWFAddress site, using the browser buttons...

No SWFAddress functionality, like the code doesnt run when trying to access it.

I am using a .visible based on what the page id is, and its not recognizing it.

Anyone else running into this, or better yet, DO YOU HAVE A FIX? :)
Left by Christine at Wed, 3 Mar 11:49 PM
i'm using this with the latest version of swfobject and swffit, the weird thing is that the CHANGE event doesnt get called when i click on the back button in firefox 3.6, but it's working in chrome... how to solve this? or i should use an older version of swfaddress?
Left by discopop at Thu, 4 Mar 8:34 PM
hi all!
Rostislav, is this version compatible with swfobject 2.2?
Left by Rostislav at Thu, 4 Mar 9:16 PM
@discopop
Yes, it is!

Everyone else please report problems in the proper place and first try to reproduce them with the provided samples.
Left by Nami at Sun, 7 Mar 1:51 PM
Hi,

I have a persistant problem with SwfAddress.

It appears that when my flex application is loaded directly to my navigator, change event is transmited to my application. But if it's embedded in an html page, event is only transmitted on page loading, and that's all.

I can change URL, nothing appear..

Could you help me ? I spent already 2 days on the problem and didn't find any solution :(

Thanks a lot

P.S. I post the same problem in 2.3 section, I tried both and nothing change. Thanks !
Left by Rostislav at Mon, 8 Mar 9:59 AM
@Nami
I don't understand what do you mean by "navigator". It sounds like you have a problem with the script initialization. Please, look how this is accomplished in the provided Flex samples (Flex, Family, Tomcat).

Your comment:

Security Code

Live Comment Preview:

 

Projects

Syndication

Blog Search

Blog Categories

Blog posts

Recommended sites