Hi Hi
I’m using swfaddress 2.0 (because later versions were giving me trouble with loading external swfs that were initiated by url changes…) in my flash website. All works great… but the url address is adding a backslash at the end of the url address that is displayed after certain buttons are clicked “www.yourdomain.com/main.html#/Regulars**/" or "www.yourdomain.com/main.html/#Specials/**”
However, the “regulars” page only shows up when you enter this into the url address bar: “www.yourdomain.com/main.html#/Regulars” – without the backslash at the end. Weirder still, when you direct your browser to go to the page w/o the backslash, it will automatically add a backslash for you and go to the correct page and end up showing the url “www.yourdomain.com/main.html#/Regulars**/**” What gives?
Anyone see any problems here?
import com.asual.swfaddress.SWFAddress;
import com.asual.swfaddress.SWFAddressEvent;
import flash.events.MouseEvent;
import flash.events.Event;
SWFAddress.addEventListener(SWFAddressEvent.CHANGE, onChange);
function onChange(e:SWFAddressEvent):void
{
if(e.value != "/")
SWFAddress.setTitle("Public Alley - " + e.value.substring(1,e.value.length-1));
else
SWFAddress.setTitle("Public Alley - Home");
switch(e.value)
{
case "/Home":
homeClick(null);
break;
case "/Specials":
specialsClick(null);
loadSpecials("specials.swf");
break;
case "/Regulars":
regularsClick(null);
loadRegulars("reguars.swf");
break;
}
}
var Xpos:Number = 0;
var Ypos:Number = 0;
var swfs:MovieClip;
var loader:Loader = new Loader();
function loadSpecials(swf:String):void{
SWFAddress.setValue("Specials");
loader.x = Xpos;
loader.y = Ypos;
holder.addChild(loader);
holder.removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("specials.swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
holder.addChild(loader);
}
var Xpos2:Number = 0;
var Ypos2:Number = 0;
var swfs2:MovieClip;
var loader2:Loader = new Loader();
function loadRegulars(swf:String):void{
SWFAddress.setValue("Regulars");
loader2.x = Xpos;
loader2.y = Ypos;
holder.addChild(loader2);
holder.removeChild(loader2);
var newSWFRequest2:URLRequest = new URLRequest("regulars.swf");
loader.load(newSWFRequest2);
loader.x = Xpos2;
loader.y = Ypos2;
holder.addChild(loader2);
}
specials.buttonMode = true;
specials.addEventListener(MouseEvent.CLICK, loadSpecials, false, 0, true);
regulars.buttonMode = true;
regulars.addEventListener(MouseEvent.CLICK, loadRegulars, false, 0, true);
function homeClick(e:Event):void{
SWFAddress.setValue("Home");
}
function specialsClick(e:Event):void{
SWFAddress.setValue("Specials");
}
function regularsClick(e:Event):void{
SWFAddress.setValue("Regulars");
}
Thanks for taking a peek.