You can try using variables in the link addresses. This means just add something like ?lang=eng
at the end of your linked URL. Flash can read that address (only from HTML embed) and have code that does something depending on what comes after the lang=
part.
There's better ways to do this including real variable parsing but I just went with a simple converting browser address to String and then extract the last (language) bit. Just to see if that works too.
For testing only you need an MC and two textfields on stage with these instance names:
txt_url
shows the full browser address
txt_lang
shows the final 3 letter language code
MC_lang
is (your) movieclip that changes frames according to txt_lang
customising: you can customise your variable with these two lines:
var Index_one:int = 5 + int( tempSTR.indexOf("lang=") );
Here 5
is because lang=
has five characters. When you change the word you must change the number to match word/symbols length also.
case "eng"
must match the language code you choose (eg: if you go with ?lang=english_UK
then in code it becomes case "english_UK"
import flash.display.MovieClip;
import flash.external.ExternalInterface;
var str_url :String = "";
get_Language();
function get_Language () : void
{
// GET LANGUAGE
var url:String = ExternalInterface.call("window.location.href.toString");
if (url != null) //if is not null
{ txt_url.text = url; txt_lang.text = get_lang_URL(url); }
//SET BY LANGUAGE
if (txt_lang.length > 0) //if is not null
{
switch(txt_lang.text)
{
case "eng": MC_lang.gotoAndStop(1); break;
case "jap": MC_lang.gotoAndStop(2); break;
case "bra": MC_lang.gotoAndStop(3); break;
}
}
}
//EXTRACT LANGUAGE VARIABLE FROM ADDRESS
function get_lang_URL (input_str:String):String
{
var tempSTR:String = input_str;
var finalSTR:String = "";
var Index_one:int = 5 + int( tempSTR.indexOf("lang=") );
var Index_two = input_str.length - Index_one;
finalSTR = tempSTR.substr(Index_one, Index_two );
return finalSTR;
}