Hi, I have done a lot of research of DeepLinking in Flash and currently modifying my site to support it. But I’m having some problems getting it to work 100%. I hope someone can help me out. Thanks in advance!
It works when the site is already loaded, but when I paste the deep link (not home) into an other browser, it shows the homepage instead of the page I want. I think it has something to do with SWFAddress.getValue(); being it cannot find the value /mypage/ because it has not been set by a mouse event.
If you want to see the online example, it’s here:
http://www.dualbrain.nl/_test/
This is my code in the first frame:
import com.asual.swfaddress.SWFAddress;
import com.asual.swfaddress.SWFAddressEvent;
var isLoaded:Boolean = false;
SWFAddress.onChange = mx.utils.Delegate.create(this, action_SWFAddress_onChanged);
function action_SWFAddress_onChanged():Void {
trace("changed");
var sGoToDeepLink:String = SWFAddress.getValue();
var nGoToID:Number;
if (sGoToDeepLink == "/") nGoToID = 0;
else if (sGoToDeepLink == "/about/") nGoToID = 1;
else if (sGoToDeepLink == "/work/") nGoToID = 2;
else if (sGoToDeepLink == "/contact/") nGoToID = 3;
else nGoToID = 0;
_root.sActiveMainCategory = nGoToID;
if (isLoaded) {
var mMainMenu:MovieClip = _root.grp_header.grp_MainMenu.holder_MainMenu;
mMainMenu.goto();
}
}
When clicked on main menu button it sets this:
SWFAddress.setValue(s);
SWFAddress.setStatus(s);
s is a variable passed through a function with the correct deep link.
/home/ or /about/ or /work/ etc