Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizWeb Technologies Web Development 2 years ago
Posted on 16 Aug 2022, this text provides information on Web Development related to Web Technologies. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Web Technologies 0 Answers
Web Technologies 0 Answers
Web Technologies 0 Answers
Web Technologies 0 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
manpreet
Best Answer
2 years ago
_x000D_ 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; }