패키지 | mx.utils |
클래스 | public class URLUtil |
상속 | URLUtil Object |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
기타 예제
관련 API 요소
메서드 | 정의 주체 | ||
---|---|---|---|
[정적]
Converts a potentially relative URL to a fully-qualified URL. | URLUtil | ||
[정적]
Returns the port number from the specified URL. | URLUtil | ||
[정적]
Returns the protocol section of the specified URL. | URLUtil | ||
[정적]
Returns the server name from the specified URL. | URLUtil | ||
[정적]
Returns the domain and port information from the specified URL. | URLUtil | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
[정적]
Given a url, determines whether the url contains the server.name and
server.port tokens. | URLUtil | ||
[정적]
If the LoaderConfig.url property is not available, the replaceTokens() method will not
replace the server name and port properties properly. | URLUtil | ||
[정적]
Determines if the URL uses the secure HTTPS protocol. | URLUtil | ||
[정적]
Determines if the URL uses the HTTP, HTTPS, or RTMP protocol. | URLUtil | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
[정적]
Enumerates an object's dynamic properties (by using a for..in loop)
and returns a String. | URLUtil | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
[정적]
Returns a new String with the port replaced with the specified port. | URLUtil | ||
[정적]
Replaces the protocol of the
specified URI with the given protocol. | URLUtil | ||
[정적]
Returns a new String with the port and server tokens replaced with
the port and server from the currently running application. | URLUtil | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
[정적]
Returns an object from a String. | URLUtil | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
[정적]
Tests whether two URI Strings are equivalent, ignoring case and
differences in trailing slashes. | URLUtil | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object |
상수 | 정의 주체 | ||
---|---|---|---|
SERVER_NAME_TOKEN : String = "{server.name}" [정적]
The pattern in the String that is passed to the replaceTokens() method that
is replaced by the application's server name. | URLUtil | ||
SERVER_PORT_TOKEN : String = "{server.port}" [정적]
The pattern in the String that is passed to the replaceTokens() method that
is replaced by the application's port. | URLUtil |
getFullURL | () | 메서드 |
public static function getFullURL(rootURL:String, url:String):String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Converts a potentially relative URL to a fully-qualified URL. If the URL is not relative, it is returned as is. If the URL starts with a slash, the host and port from the root URL are prepended. Otherwise, the host, port, and path are prepended.
매개 변수
rootURL:String — URL used to resolve the URL specified by the url parameter, if url is relative.
| |
url:String — URL to convert.
|
String — Fully-qualified URL.
|
getPort | () | 메서드 |
getProtocol | () | 메서드 |
public static function getProtocol(url:String):String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns the protocol section of the specified URL. The following examples show what is returned based on different URLs:
getProtocol("https://localhost:2700/") returns "https" getProtocol("rtmp://www.myCompany.com/myMainDirectory/groupChatApp/HelpDesk") returns "rtmp" getProtocol("rtmpt:/sharedWhiteboardApp/June2002") returns "rtmpt" getProtocol("rtmp::1234/chatApp/room_name") returns "rtmp"
매개 변수
url:String — String containing the URL to parse.
|
String — The protocol or an empty String if no protocol is specified.
|
getServerName | () | 메서드 |
getServerNameWithPort | () | 메서드 |
hasTokens | () | 메서드 |
public static function hasTokens(url:String):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Given a url, determines whether the url contains the server.name and server.port tokens.
매개 변수
url:String — A url string.
|
Boolean — true if the url contains server.name and server.port tokens.
|
hasUnresolvableTokens | () | 메서드 |
public static function hasUnresolvableTokens():Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
If the LoaderConfig.url
property is not available, the replaceTokens()
method will not
replace the server name and port properties properly.
Boolean — true if the LoaderConfig.url property is not available. Otherwise, false .
|
isHttpsURL | () | 메서드 |
isHttpURL | () | 메서드 |
objectToString | () | 메서드 |
public static function objectToString(object:Object, separator:String = "", encodeURL:Boolean):String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Enumerates an object's dynamic properties (by using a for..in
loop)
and returns a String. You typically use this method to convert an ActionScript object to a String that you then append to the end of a URL.
By default, invalid URL characters are URL-encoded (converted to the %XX
format).
For example:
var o:Object = { name: "Alex", age: 21 }; var s:String = URLUtil.objectToString(o,";",true); trace(s);Prints "name=Alex;age=21" to the trace log.
매개 변수
object:Object — The object to convert to a String.
| |
separator:String (default = " ") — The character that separates each of the object's property:value pair in the String.
| |
encodeURL:Boolean — Whether or not to URL-encode the String.
|
String — The object that was passed to the method.
|
replacePort | () | 메서드 |
public static function replacePort(uri:String, newPort:uint):String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns a new String with the port replaced with the specified port. If there is no port in the specified URI, the port is inserted. This method expects that a protocol has been specified within the URI.
매개 변수
uri:String — String containing the URI in which the port is replaced.
| |
newPort:uint — uint containing the new port to subsitute.
|
String — The URI with the new port.
|
replaceProtocol | () | 메서드 |
public static function replaceProtocol(uri:String, newProtocol:String):String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Replaces the protocol of the specified URI with the given protocol.
매개 변수
uri:String — String containing the URI in which the protocol
needs to be replaced.
| |
newProtocol:String — String containing the new protocol to use.
|
String — The URI with the protocol replaced,
or an empty String if the URI does not contain a protocol.
|
replaceTokens | () | 메서드 |
public static function replaceTokens(url:String):String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns a new String with the port and server tokens replaced with the port and server from the currently running application.
매개 변수
url:String — String containing the SERVER_NAME_TOKEN and/or SERVER_NAME_PORT
which should be replaced by the port and server from the application.
|
String — The URI with the port and server replaced.
|
stringToObject | () | 메서드 |
public static function stringToObject(string:String, separator:String = "", decodeURL:Boolean):Object
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns an object from a String. The String contains name=value
pairs, which become dynamic properties
of the returned object. These property pairs are separated by the specified separator
.
This method converts Numbers and Booleans, Arrays (defined by "[]"),
and sub-objects (defined by "{}"). By default, URL patterns of the format %XX
are converted
to the appropriate String character.
For example:
var s:String = "name=Alex;age=21"; var o:Object = URLUtil.stringToObject(s, ";", true);Returns the object:
{ name: "Alex", age: 21 }
.
매개 변수
string:String — The String to convert to an object.
| |
separator:String (default = " ") — The character that separates name=value pairs in the String.
| |
decodeURL:Boolean — Whether or not to decode URL-encoded characters in the String.
|
Object — The object containing properties and values extracted from the String passed to this method.
|
urisEqual | () | 메서드 |
public static function urisEqual(uri1:String, uri2:String):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Tests whether two URI Strings are equivalent, ignoring case and differences in trailing slashes.
매개 변수
uri1:String — The first URI to compare.
| |
uri2:String — The second URI to compare.
|
Boolean — true if the URIs are equal. Otherwise, false .
|
SERVER_NAME_TOKEN | 상수 |
public static const SERVER_NAME_TOKEN:String = "{server.name}"
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
The pattern in the String that is passed to the replaceTokens()
method that
is replaced by the application's server name.
SERVER_PORT_TOKEN | 상수 |
public static const SERVER_PORT_TOKEN:String = "{server.port}"
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
The pattern in the String that is passed to the replaceTokens()
method that
is replaced by the application's port.
Tue Jun 12 2018, 03:17 PM Z