[RESOLVED] Browse from root directory... (Flash buttons)
Hi,
I am creating a website that uses flash buttons and I am having problems with the root directory. The problem is the index page in the root directory does not recognize all the files in sites directory.
It will recognize the css folder, java script folder, images folder and files but not the html nor media folders.
Now I know using text links the code would be:
Code:
<a href="html/prod.html" title="Products">Products</a>
If I was on the homepage (index) and wanting to go to say products. However, that path does not work for the flash buttons.
I am assuming I need to put "../" in fort of the path in in the file! Except I do not know how many I need to put. While:
Works for the css, images, javascript folders in does not work for the html and media folders.
Here is the code the flash buttons use:
Code:
btn.addEventListener(MouseEvent.CLICK,callurl);
function callurl(event:MouseEvent):void
{
var prod:URLRequest = new URLRequest("../html/prod.html");
navigateToURL(prod, "_self");
}
Any help would be grateful,
Nightwalker
Re: Browse from root directory... (Flash buttons)
/ takes you back to the root.
So if you're on the following page:
http://vbforums.com/SubDirectory/AnotherDir/Images/Style/Css.aspx
And you reference a style sheet in the following manner:
/Style/MyCss.css
You'll essentially look at
http://vbforums.com/Style/MyCss.css
../ takes you back a level from where you currently are
Re: Browse from root directory... (Flash buttons)
Thanks kasracer!
I have figured out which code I need to use in th flash buttons on the index page.
Code:
btn.addEventListener(MouseEvent.CLICK,callurl);
function callurl(event:MouseEvent):void
{
var about:URLRequest = new URLRequest("html/about.html");
navigateToURL(about, "_self");
}
I also need to copy all the buttons to the root directory as well.
Edit:
I needed to make sure the following code was set to:
Code:
<script language="JavaScript" src="javascript/AC_RunActiveContent.js" type="text/javascript"></script>
and
Code:
<param name="movie" value="index.swf" /> <!--Value being the location of the movie file.-->
Edit:
Forgot to mention to make sure the code in the html file refering to "javascript/AC_RunActiveContent.js" had the movie line set the same as above except without the extension on the end.
Re: [RESOLVED] Browse from root directory... (Flash buttons)
The url for index.html (root directory) will be:
Quote:
function callurl(event:MouseEvent):void
{
var index:URLRequest = new URLRequest("index.html");
navigateToURL(index, "_self");
}
instead of:
Quote:
function callurl(event:MouseEvent):void
{
var index:URLRequest = new URLRequest("../index.html");
navigateToURL(index, "_self");
}
Note: If you use "../" for links on the home page the link will take you outside of your website to the folder where the root directory is stored.