Flash question for programming a website

Kaido

Elite Member & Kitchen Overlord
Feb 14, 2004
48,837
5,523
136
I have a problem. I am currently working on a website using Flash, although I'm not the one using Flash, I'm just coding it in. I'm running into a file structure problem. I want the website to run on both the company's web server AND our local computers, but I don't know how to do that with Flash.

For example, one of our navigational aids is a Flash header. We have Home, Products, Support, and Contact. Each file is in its own subdirectory and index file, like this:

www.mysite.com/index.php
www.mysite.com/products/index.php
www.mysite.com/support/index.php
www.mysite.com/contact/index.php

How do I make the Flash header link to the correct pages, no matter what subdirectory you are in? For example, if I'm in www.mysite.com/products/widget/details/configure.php and I click on the "Products" button in the Flash nav menu, I want it to go to www.mysite.com/products/index.php. I know that I can use absolute paths, but then it won't work on my local computer. Any ideas here?
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
you need to find the root, and then dot your way back to the path.
So use '_root._url' and substr out the www.mysite.com then you could figure out how deep you are by number of slashes after that and dot your way to the needed directory
 

Kaido

Elite Member & Kitchen Overlord
Feb 14, 2004
48,837
5,523
136
Originally posted by: Drakkon
you need to find the root, and then dot your way back to the path.
So use '_root._url' and substr out the www.mysite.com then you could figure out how deep you are by number of slashes after that and dot your way to the needed directory

Well, that's the problem. Each page is in a different directory; the Flash file is in it's own directory. I don't want to make a Flash header file for every page. I'm currently using absolute linking (the full path), but it makes it a pain because we have to upload files to the server to test anything rather than on our local machines. Plus it's being run on a temp server right now and we'll have to change the links when we launch to the actual domain.