Flex's interactive operations class for browsers

Source: Internet
Author: User

Flex through the unique characteristics of the browser can be related to the communication, specifically demonstrated the relevant operation of the packaging category

Package Com.shine.framework.Browser {Import Com.shine.framework.core.util.ArrayMap;
	Import Flash.net.URLRequest;
	
	Import Flash.net.navigateToURL;
	Import Mx.managers.BrowserManager;
	Import Mx.managers.IBrowserManager;
	
	Import Mx.utils.URLUtil; public class Browserutils {public Function browserutils () {}//Set browser title public static function Setbrowserti
		Tle (value:string): void{browsermanager.getinstance (). Settitle (value); //Get all URLs of the browser public static function Getbrowserfullurl (): string{var bm:ibrowsermanager = Browsermanager.getin
			Stance ();
			Bm.init ();
		return bm.url; //Get browser without parameter URL public static function Getbrowserbaseurl (): string{var bm:ibrowsermanager = Browsermanager.get
			Instance ();
			Bm.init ();
		return bm.base; //Get current browser URL protocol public static function Getbrowserprotocol (): string{var bm:ibrowsermanager = Browsermanager.get
			Instance ();
			Bm.init ();
		Return Urlutil.getprotocol (Bm.url);
		}//Get current browser URL portpublic static function Getbrowserport (): int{var bm:ibrowsermanager = browsermanager.getinstance ();
			Bm.init ();
		Return Urlutil.getport (Bm.url); //Get current browser URL server name public static function Getbrowserservername (): string{var bm:ibrowsermanager = browsermanage
			R.getinstance ();
			Bm.init ();
		Return Urlutil.getservername (Bm.url); ///modify current URL public static function Updatebrowserurl (VALUE:ARRAYMAP): void{var bm:ibrowsermanager = browsermanage
			R.getinstance ();
			Bm.init ();
			var o:object = Urlutil.stringtoobject (bm.fragment);
			var num:int=value.getlength ();
			for (Var i:int=0;i<num;i++) {O[value.getkeybyindex (i)]=value.getvaluebyindex (i);
		} bm.setfragment (Urlutil.objecttostring (o)); //Get current browser URL server name and port public static function Getbrowserserverwithport (): string{var bm:ibrowsermanager = Browse
			Rmanager.getinstance ();
			Bm.init ();
		Return Urlutil.getservernamewithport (Bm.url); //Refresh Browser public static function Refreshbrowser(): void{Navigatetourl (New URLRequest ("Javascript:location.reload ();"), "_self"); //Close Browser public static function CloseBrowser (): void{Navigatetourl (New URLRequest ("Javascript:window.close ()"),
		"_self"); }
	}
}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.