AS3 OOP and 1 SWF - Deep linking

Hi everyone,

I’m reaching a final stage of my project and I need to implement deep linking on it.

So let’s say I have www.mysite.com, when I click the button “one”, the URL should be www.mysite.com/one

For that, I’m using swfaddress and swfobject and I was already able to change the URL.

I’m already able to use the back and forward button and if I write www.mysite.com/#/one on the browser, it works but ONLY if I was already on that subpage.

I have just one swf fully on OOP (no frames, no timeline).

My questions are: How to make www.mysite.com/one work at the first time without having being there before? and how to remove the “#” from the URL ?

My code have more than 1500 lines of code, regarding the swfaddress I have this:


function stage_ready(){
	SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleSWFAddress);

if(page == "one"){
	link = "one";
	newurl = "5.jpg";
        remove_stage();
	initOne();
}

function formatTitle(newTitle:String):String {
    var updatedTitle:String = newTitle;
    return updatedTitle;
}
		
function handleSWFAddress(event:SWFAddressEvent):void {	
        if(link == "one"){
		newurl = "5.jpg";
		page = "one";
		remove_stage();
		initOne();
	}	

        var newAddress:String = "/" + link + "/";
	SWFAddress.setValue(newAddress);
			
	SWFAddress.setHistory(true);
	SWFAddress.setTitle(formatTitle(link));
}

Thank you in advance.