PDA

View Full Version : [AS3] Menu bar set up for local files


Insitebuilders
03-19-2009, 03:59 PM
I have a series of 8 related pages on a website and have set up an identical menu bar for ea page with 8 buttons to navigate from page to page and between pages using variations of this code, (CS4).

function openWebPage(evt:Event):void {
navigateToURL(new URLRequest("http://insitebuilders.com/page00"));
}

index_btn.addEventListener("click",openWebPage/page00);


All works well on the server with absolute URL addresses, but I can't seem to find the code I need that would allow me to navigate from local HTML page to page on a self contained CD (IOW w/o the Web).

Is there a way to make the URL request relative to its folders...? Or do I use a totally different approach...? Probably obvious, but I can't see it....

Appreciate any help. Thx

/Dennis

-Ev-
03-19-2009, 04:10 PM
I assume page00 is a folder with an index.html file inside? Active web servers have default rules to look for index.html when no file is specified. Local filesystems don't do this, and need the index.html file specified in the URL.

Also, is the /page00 on this line a typo?
index_btn.addEventListener("click",openWebPage/page00);

Insitebuilders
03-19-2009, 04:27 PM
Sorry, yes, I deleted the total address of the absolute reference for this post b/c it was a webpage.

What I'd like to do is to delete the entire URL so that the button on the menu bar looks for a file in another folder (or even the same folder) within the local context of the CD (rather than the web..)

IOW, no URL at all, everythg relative and self contained.

Thx

/D

-Ev-
03-19-2009, 06:37 PM
Well you need a URL of some sort to refer to a file. Relative URLs should work just fine both online and on a CD.

Insitebuilders
03-19-2009, 07:00 PM
EV

OK, thx much, if a relative path will work for the CD I must have somethg wrong in the code for the buttons.

I'll focus on that, thx again

/D