Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking file to a flash button: Beginner help?

Status
Not open for further replies.

kars01

MIS
Nov 3, 2006
7
US
I am trying to link a flash button (say button1) to a file saved in a particular folder.

This is the typical way I found:

on(release) {
getURL(" "_blank");
}

and it works...

In my case, I want to link this button to a file "sample.html" in the same folder... but when I say

getURL("sample.html", "_blank");

Nothing happens...!

Is there some simple way to handle this?

Thanks in advance.
 
Is your sample.html in the same directory as your .swf file? Make sure they are in the same folder, in the same section. And then on your button put:

Code:
on (release) {
	getURL("sample.html", "_blank");
}

That works for me.

Hope this helps,

nofx1728
 
Sorry,

Code:
on (release) {
	getURL("sample.html", _blank);
}
 
Thanks for the follow-up.

Yes, all the files (.swf, .fla and .html)are in the same folder. The button is actually an invisible button created over a flash movie clip.

I don't know what I am doing wrong, but even the solution you provided doesn't seem to work. Do I really need to load the files (sample.html, .swf etc) on the web server? Is it not possible to run this from my local machine without providing a http URL (within Macromedia 8 using Ctrl+Enter)?
 
Yes, I am testing it on my computer. I plan to upload it once I get access to the server.
 
Thanks,

This works. Is it not possible to give relative references (e.g. sample.htm) instead of absolute references (e.g. file://file/absolute_path/sample.htm)?

The reason for my question is that I have several buttons that need this functionality.

When I upload them all on to the web server once I get access to it and once again when the website gets relocated, I am worried that I will have to change all the references back to the form [].

If I am being too picky, sorry for the trouble.
 
Thanks a lot. This worked. I tried on another server and it did work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top