Custom class dependencies: QueryParameters
This class is an attempt to have an object that will automatically parse any string representing a URL. Similar to the way the JavaScript object window.location parses the window’s URL. The URL string is supplied either through the constructor, or through setting the ‘href’ property. What is important to note is that all properties are read and write, and affect the values of all the other respective properties. Here is a list of all the URL properties:
- href – Specifies the entire URL.
- protocol – Specifies the beginning of the URL, including the colon.
- host – Specifies the host and domain name, or IP address, of a network host.
- hostname – Specifies the host of the hostname:port portion of the URL.
- port – Specifies the communications port that the server uses.
- pathname – Specifies the URL-path portion of the URL.
- search – Specifies a query.
- hash – Specifies an anchor in the URL.
Please play around with the example below to get an idea of how this class works:
[swfobj src=”https://jidd.jimisaacs.com/files/2008/08/example-URL.swf” width=”500″ height=”200″ align=”center” required_player_version=”10.0.0″]
AS3 URL Example
Now here is the source of the class itself. Please make sure to review the QueryParameters class for additional information on this class.
com.jimisaacs.data.URL
Comment if you have any questions, or suggestions.
Leave a Reply