Thursday,
18 Dec 2008
SWFAddress 2.2
The new SWFAddress has just arrived after seven months of active development, various contributions and lots of positive feedback from the community. The list of changes includes the following:
- Refactored JavaScript implementation
- New SWFAddress.swc AS3 component
- New CS4 based Splash screen sample
- New Digg API sample
- New up() method for easier deep linking path navigation
- New XSS protection that doesn't affect special characters
- Support for Internet Explorer 8
- Support for custom HTTP status messages in the SEO sample
- Improved title handling
- Improved unload event handling for IE
- Updated Rails sample
- Fixed getBaseURL() for AS3
- Fixed Safari 2.0-2.0.3 support
- Build-in fix for the Firefox 3/Mac OSX blinking effect
- Additional onLoad fix for application/xml content type
- Fixed optional options parameter for the popup method
- Cross platform build script
- Various optimizations
I believe that this new version is pretty stable and won't require an update soon. There are two known Safari bugs (19202 and 20355) that currently affect the project and we can only hope that they will make it's way into the next major release of the browser.
SWFAddress has grown significantly in the last two years and it's very likely that we're going to provide a lite version for users who need just the basic functionality. Very soon the same API will become available for Silverlight and we're also scheduling the development of a jQuery plugin.
Comments:
I'll update my latest mini-site: http://toki-woki.net/kwot/
But many thanks for the hard work, I'll have to do my part now. :)
The FF3/Mac fix requires a valid movie ID which is also needed in order to have the browser Back/Forward buttons working.
http://www.flashforum.de/forum/showthread.php?t=263578
I like MooTools and it depends on the time that I will have available. Such plugins will very likely target only Ajax.
You can use SFWObject 1.3-2.x, UFO, AC_RunActiveContent or swfIN. If you want to embed your SWF differently then you just need to call SWFAddress.addId(movieId) in order to register it.
This was valid for 2.1 but should be fine in 2.2.
Last version was refreshing the html to my home if i had some characters in the url like: '!&()"
Does this version behave the same? i see on deezer.com wich also uses swfaddress that does not have this problem, maybe they have a modified version.
Btw, just wanted to let you know that i'm maintaining the port for haXe: http://lib.haxe.org/p/SWFAddress , i should upgrate it soon, i just heard about 2.2
I never realy figured it out how to use the SEO with it, but i'll try harder with this version. last time i got a nice 250Gb trafic for a site that normaly have only few Gb
http://la-luna.ro/website.php#/news/
and then modify the url to have an ' like:
http://la-luna.ro/website.php#/news'/
Thanks!
In order to prevent an XSS issue we restricted the number of allowed characters in version 2.1. Now it's implemented differently and you just need to upgrade your swfaddress.js.
Thanks for doing a haXe port! If you need support, please contact me directly.
can someone help me? i´m trying to use swfaddress, i´m using de adobe example (as 2.0), but the fact is i don´t like build pages based on frame navigation, i like build single frame sites, i change the "gotoAndStop('$' + value);" to a function , but back button does´t recognize the history.
here de code:
var value2:String = '';
SWFAddress.setStrict(false);
SWFAddress.onChange = function() {
var value = SWFAddress.getValue();
var path = SWFAddress.getPath();
var id = SWFAddress.getParameter('id');
// this is the function that i swapped
navegar ();
//<
var title = 'SWFAddress Website';
var names = SWFAddress.getPathNames();
for (var i = 0; i < names.length; i++) {
title += ' / ' + names[i].substr(0,1).toUpperCase() + names[i].substr(1);
}
var id = SWFAddress.getParameter('id');
if (id != '') {
title += ' / ' + id;
}
SWFAddress.setTitle(title);
}
/////////////////////////////////////////////////////
function about () {
b1_mc.gotoAndStop (2);
textos_mc.gotoAndStop(2);
}
function work () {
b2_mc.gotoAndStop (2);
textos_mc.gotoAndStop(3);
}
function contact () {
b3_mc.gotoAndStop (2);
textos_mc.gotoAndStop(4);
}
function home () {
textos_mc.gotoAndStop(1);
}
function navegar (){
switch (value2) {
case 'about' :
about ();
break;
case 'work' :
work();
break;
case 'contact' :
contact ();
break;
}
}
b1_mc.onRelease = function () {
value2 = 'about' ;
SWFAddress.setValue('about');
}
b1_mc.onRollOver = function () {
value2 = 'about' ;
SWFAddress.setStatus('about');
}
b1_mc.onRollOut = function () {
SWFAddress.resetStatus();
}
//////<
b2_mc.onRelease = function () {
value2 = 'work' ;
SWFAddress.setValue('work');
}
b2_mc.onRollOver = function () {
value2 = 'work' ;
SWFAddress.setStatus('work');
}
b2_mc.onRollOut = function () {
SWFAddress.resetStatus();
}
//////<
b3_mc.onRelease = function () {
value2 = 'contact' ;
SWFAddress.setValue('contact');
}
b3_mc.onRollOver = function () {
value2 = 'contact' ;
SWFAddress.setStatus('contact');
}
b3_mc.onRollOut = function () {
SWFAddress.resetStatus();
}
//////<
thanks in advance and thanks to asual for this great tool
I am trying to use the SEO example with my own flash project and am experimenting two problems:
1) The stage-size of my project is 900px*968px and I want to have the browsers scrollbar active. BUT for some reason the scrollbar does NOT appear although I changed the parameters from percentage to pixels.... (see below)
2) I would like to have the flash centered on the screen and don't quite know how to achieve that. When using the SEO Code it is aligned to left. I tried using my standard table layout, but for some reason it does not work.... (see below).
Is there a forum you would recommend for SWFAddress? How come this page does not have one?
-------------------------------------------------
this is my index.php
<style>
div.theflash {
width:900px;
height:968px;
margin:0px;
padding:0px;
padding:0px;
padding:0px;
vertical-align:top;
text-align:center;
display:inline;
overflow : scroll;
}
</style>
<body bgcolor="#ffffff">
<div id="content">
<div>
<h1>">SWFAddress Website</h1>
<ul>
<li>SWFAddress Website / About</li>
<li>
SWFAddress Website / Portfolio
<ul>
<li>SWFAddress Website / Portfolio / 1</li>
<li>SWFAddress Website / Portfolio / 2</li>
<li>SWFAddress Website / Portfolio / 3</li>
</ul>
</li>
<li>SWFAddress Website / Contact</li>
</ul>
</div>
<div><?php swfaddress_content(); ?></div>
</div>
<div class="theflash">
<script type="text/javascript">
// <![CDATA[
(new SWFObject('<?php swfaddress_resource('/website.swf?datasource=datasource.php'); ?>', 'website', '968px', '900px', '8', '#ffffff', 'high')).write('content');
// ]]>
</script>
</div>
</body>
Thanks for your support!
Kind regards
Ras
Please, ask questions like these in the SWFAddress forums.
I've been examining SWFaddress samples and their source files for a long time and yet can't understand why in the example with AS2 preloader doesn't works. It just waits until the whole .swf loads and then shows content.
For example: http://www.asual.com/swfaddress/samples/adobe/#portfolio?id=1
Please help.
What I shoud do to have a working preloader on each page?
And thanks in advance!
Working with swfaddress 2.2, coherence sample.
I'm trying to rework at previous site that has some calls to a mysql database:
Ex:
Q1: Is there a way to execute/parse php in the xml files containg the "content"?
Q2: If not, is there a way to call these functions in the xml file it self? That is, make mysql calls in xml files?
here a sample of the code I use in php:
<?php
$query= mysql_query("SELECT * FROM plugin_news WHERE id = '".$id."' AND public = '1'") or die(mysql_error());
while($row=mysql_fetch_array($query)) { ?>
<h1><?php echo $row["topic"]; ?></h1><p><?php echo $row["txt"]; ?>
<p>
<?php } ?>
<?php } elseif ($action == "old") { ?>
<?php
$query= mysql_query("SELECT * FROM plugin_news WHERE public = '2' ORDER BY pubdate ") or die(mysql_error());
while($row=mysql_fetch_array($query)) { ?>
<h1><?php echo $row["topic"]; ?></h1>
"><?php echo strip_tags(substr($row["txt"], 0, 150)); ?>...
<p>
<?php } ?>
<p>
<?php } else { ?>
<?php
$query= mysql_query("SELECT * FROM plugin_news WHERE public = '1' ORDER BY pubdate ") or die(mysql_error());
while($row=mysql_fetch_array($query)) { ?>
<h1><?php echo $row["topic"]; ?></h1>
"><?php echo strip_tags(substr($row["txt"], 0, 150)); ?>...
<p>
<?php } ?>
<?php } ?>
I'm using SWFAddress 2.2 with SWFObject 2.1
It works with Firefox 2 and Safari 3 but with IE8, I can go backwards -- just not forwards.
Here are links to my example:
This one is using SWFObject 2.1 Here
This one is using SWFObject 1.5 Here
I'm finally using SWFAddress and absolutely LOVE it. But I've run into an issue.
Is it required to have the SWF file and the HTML file embedding SWF to be on the same domain?
I have a project where the SWF is on a different domain from the HTML embedding it. The problem is SWFAddress is not changing the back/forward browser history, but is still changing the Title. When I have both the SWF and the HTML are on the same domain, everything works fine.
I dug through the SWFAddress.js, placing in alerts, and found the failure to occur at:
this.dispatchEvent(new _31.WEBAddressEvent(_60));
If I replace that with:
var test = this.dispatchEvent(new _31.WEBAddressEvent(_60));
alert(test);
...I get no alert box when the SWF and HTML are not on the same domain. I get an alert true if the SWF and HTML are on the same domain.
Any help would be much appreciated.
I'm guessing that I'm doing something wrong, or there is already a work around for this I don't know about. If there is a solution/work around in any of the documentation or online anywhere I would love to be pointed in it's direction.
Thanks,
T
Most of the samples use a small c.swf which fixes the preloading. The Adobe sample just misses this workaround.
@IzB
Few comments above I asked you to use the forums which are much more appropriate for code samples and discussions. Your problem is not that related to SWFAddress anyway.
@Matty B
I will have to check the IE8 support again. Someone previosly reported problems because of a lacking DOCTYPE declaration but this doesn't seem to be the case with your tests.
@CG
I hope I have helped you in the forums.
@t416
Check the MTASC sample for an AS2 popup test case. It works here and I don't rememeber if there was anything specific. The WMODE parameter was used to enable Firefox support.
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
See
http://blogs.msdn.com/synergist/archive/2008/07/10/how-ie8-will-enables-silverlight-deep-linking-and-browser-back-forward-navigation.aspx
Can you tell me the address for the forums? I can't find it anywhere :(
Thanks
The link to the forums is on the main SWFAddress page:
http://sourceforge.net/forum/?group_id=181584
I am having trouble with SWFAddress by Asual, I am using as2
The thing is if you use
SWFAddress.setValue("/about/");
then when people type URL :
www.site.com/#/about/
However what if when people just type www.site.com/#/about --> without the slash
I want them to keep referring the about sections of the site.
is it something we have to do in the logic of the event handler:
SWFAddress.onChange = function() {
}
Can somebody show me how to turn this trick? I am a noob.
Thanks
public static function setValue(value:String,isDispatchEvent:Boolean=true):void {
...
if(isDispatchEvent) _dispatchEvent(SWFAddressEvent.CHANGE);
}
why..makes it easier to change the URL without it dispatching an event so i don't need to put extra logic in the event listener and i can make the call any time i wan to dispatch or not an event for change if i'm working internally lowering the need for extra logic in the change event ...
its really not that what i do is a better way just another way that for me seams more simple ;) any ways its nice to have that option for users that don't want the swfAddress to be the hub.
good job, great code! ;)
Thanks for sharing your tweak. This topic has been discussed before and my vision for the implementation can be found in the forums. Unfortunately it will probably become a part of the next major release because the upcoming 2.3 is almost ready.
on(release){
SWFAddress.href("http://www.somedomain.com","_blank");
}
Any idea?
Can you please check if this issue is reproducible in every browser? You can also test it in the MTASC sample (AS2) and CS3 sample (AS3). For some browsers you have to use the problematic WMODE in order to bypass the popup blocker.
My site is based on code from http://chakramedia.com/blog/2007/11/17/swfaddress-design-template-20/
BTW I'm using wmode transparent.
It does not matter whether I use getURL or SWFAddress.href or even ExternallInterface.call It does not work in IE7 when i set second parameter to "_blank", "_parent" always works.
I just tested the samples I mentioned earlier in two different copies of IE7 and they work as they should. Don't use getURL together with ExternalInterface (SWFAddress) because it causes bad issues especially with IE.
I know that the code is working, because if I remove any piece of it, the Title no longer changes. But having the Title change with no functionality of the Back button or address bar is pointless.
I have the SWFObject and SWFAddress in the correct order, and an id:name attribute. I know those are common errors I have seen.
Any ideas what I'm missing?
i have noticed that if you try to set the value from a child of the mc/timeline in which you've imported swfaddress, it doesnt change, so could be it
you're sure you told it to .SetValue()?
you can download a working sample and just change that to whatever you like
I'm using swfaddress but i don't understand why the swf file is called liket this:
SWFObject('movie.swf?datasource=datasource.php'
and not a simple
SWFObject('movie.swf'
the datasource.php seems to be processed in the main index.php, so why do we need to make a call from the swf?
Thanks for your help
The datasource.php needs to be processed both by the index.php and the movie.swf. The datasource parameter that movie.swf accepts just externalizes the datasource.php reference that otherwise needs to be hard coded in the movie.fla.