|
||||||
|
||||||
Flash Tutorial - Hyperlinks
Free
Flash Tutorial
Step Three: Adding the ActionScript URL
A relative address is where you don't put the full URL, just the file
name. The relative address of this page would be:
hyperlink.htm
If I used this in my Flash example above, it would open this page,
but only if the Flash movie is in the same location as the page you
are trying to open. If you don't specify the full URL, just the name
of the HTML page, the browser will look for it in the same directory
(folder) and at the same address as the one you are currently viewing.
You use relative links to pages on your own site. There are two reasons
for this.
One: When you test you work on your hard drive a
relative link will find the relative file on your hard drive. If
you place the full URL the browser will look on-line for the page,
which gets confusing, and may give you incorrect results.
Two: You can move your entire site from one server
to another or to an Intranet or local hard drive or even to a CD
or Floppy disk and the site will still work. If you don't do this
you would have to up-date every link and that's no fun!
Relative Links: Folders
For a relative link to work you do not have to have all your files in the same folder. The location of this page is:
http://www.webwasp.co.uk/ - The root directory for the site.
tutorials/ - The folder for all the tutorials on this site.
a15-hyperlink/ - The folder for all the files for this tutorial.
03.php - This HTML file that is this web page.
Note: I do not use index.html or index.htm but index.php The reason is not important to this tutorial and in truth they are all very similar. They are all web page files. If you wish to learn about PHP see the tutorial: PHP
If I want to link from the Home page to this page, the relative link would be:
tutorials/a15-hyperlink/MX/03.php
The other way around - a link from this page to the home page would be:
../../../index.php
../ makes the page go up hill or to the folder one level up. The home page is three levels from this point. Remember the location of this file is:
tutorials / a15-hyperlink / MX
Thus the home page is up three levels. After this there is no where to go as you will be in the root directory and that is the end of a relative links possibility.
If you find this folder business confusing just place all your files in one folder or location. Relative links will then work.
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
65608 visitors to this page since Jan 04 |
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|