-
flash link to specific place, on an html page
i have a flash button and by pressing it i want it to link me to a specific place on an html page, not just the page but say link me to the text in the middle of the page, is that possible and how?
-
FK'n_dog
-
thanx but i have no idea how this "named anchor" works
-
FK'n_dog
search the web, i'm sure there will be tutorials on how
to write named anchors in html pages
-
Senior Member
thisis more of an HTML question..than a flash question..
flash:
Code:
getURL("http://www.site.com/page.html#anchor");
should work for you...
(moved to html, CSS forums)
-
wow thanx but and how do i put the anchor name on the html page?
-
Senior Member
(why did I even move it?)
http://www.w3schools.com/html/html_links.asp
http://www.htmlcodetutorial.com/linking/_A_NAME.html
http://www.utoronto.ca/webdocs/HTMLd...L/anchors.html
all good reads for you.. its very simple..
just like a LINK tag.. the NAME tage works the same
LINK:
<a href="http://www.somesite.com">text here</a>
NAME:
<a name="anchor1">text here</a>
your flash code:
on(press){
getURL("#anchor1");
}
or
on(press){
getURL("/somepage.html#anchor1");
}
-
Originally Posted by whispers
1. if theres no text but only pics what do i do?
2. can i also disguise text painting it white (so its camouflaged withthe background) and just use the name tag?
-
Senior Member
1.) huh? put an image tag inside the <a> </a> anchor tags....
2.) you can..but why?
-
Is there a chance when testing all this locally on my pc might give me faults? Must i do all this testing by installing a webserver on my machine for testing locally or not?
-
whispers can u plz be more specific/detailed on the correct way of typing
Originally Posted by whispers
on(press){
getURL("/somepage.html#anchor1");
}
as far as the path is concerned?
-
Senior Member
how can I be more specific? You have given us absolutely ZERO information to go on. And we have still try to provide help.
You have not given us the code you have tried....nor even the page names or the named anchors you want to jump to.
on(press){
getURL("#anchor1");
}
is all you should need if you want to jump to an anchor in the same page the link is sitting in.
you of course need the HTML anchor in your page:
<a name="anchor1"></a>
when you click the FLASH button/link with the above code on it..it will jump to that named anchor in the page. If you need to also change the page and then jump to an anchor..
on(press){
getURL("newpage.html#anchor1");
}
if the new file in a different directory:
on(press){
getURL("directory/newpage.html#anchor1");
}
is what you would need.
Last edited by whispers; 05-07-2007 at 01:03 PM.
-
sorry for not giving info, i wasnt asked, by my self im too new to know what is needed.
anyway my main question i guess is whether testing all this locally on my hd is ok or not. thats for starters.
as far as the path is concerned i ask cause u write me
on(press){
getURL("newpage/page.html#anchor1");
}
and im testing locally on my hd, so i guess i need a path to be submitted there, but in what way? is
on(press){
getURL("C:\newpage\page.html#anchor1");
}
correct or should i use diff path? (supposing my files are in here C:\newpage\page.htm
-
Senior Member
1.) testing locally shouldnt matter.
2.) you have 1 file.. the file with the FLASH HEADER embeded into it (right?) this HTML page with the FLASH embeded into it is in a folder... what is this folder?
Everything to do with this website should be in this folder...correct?
so lets recap.
you have a folder.. we'll call it MAIN folder.. inside this MAIN folder...
you have several things:
1.) your MAIN/INDEX html
2.) the .swf that goes along with the MAIN/INDEX html page cause its embeded into it
3.) you may your OTHER pages for the web site (ieL contact, about, gallery..etc) in here as well.. OR you may have each page in its OWN folder (for organization purposes if you desired).
all links/paths will be relative to the MAIN HTML page.. or the PAGE that is currently loaded..
couple questions:
1.) how is your website directory set up?
2.) what are the anchor names your trying to call?
3.) and in what pages are these anchors you are trying to jump located in?
are you trying to jump to a named anchor in the SAME page? like just further down the page?
or are you trying to LOAD A NEW page..and then jump to a named anchor on the newly loaded page?
-
-
Senior Member
man.. your making it HARDER (more work) for me to help you..
would be easier if you just posted the names..LOL
but I'll take a look. form your paragraphc.. it seems any button/link that you want to use for this jumping to an anchor point to page GoHere.html
should have the code of:
on(press){
getURL("GoHere.html#rightHere");
}
this assumes (of course) that in the GoHere.html page you put this:
<a name="rightHere"></a> in front of the RIght Here paragraph/position you want to jump to.
I just checked... and if you open the INDEX.html and embed the correct.swf into it.. it works fine. I didnt even change the GoHere.html at all...
just changed the flash code to be:
Code:
on (rollOver) {
pressed.gotoAndPlay(2);
}
on (release) {
getURL("GoHere.html#anchor1", "_self"); //_self was extra
}
as stated above.
-
i messed up my copy, can u send me the one that works for you plz?
-
anyone managed to get it working? whispers?
-
Senior Member
yeah it works.. "AND" I sent you the working files to your email address..
all you need to do is follow the steps provided for you her.. you have everything you need.
PLUS the working files in your email from yesterday.
-
Ok finally, i managed to get some webspace to check it out there. There seems to be no problem when the site is run on the web. Problems appear when i try yo test it locally on my hd. Can anyone explain to me why? And why only me, cuase whispers tested it locally and had no problems! Can it be some settings on my pc?
Either way i must say a LARGE thank you to everybody in this thread that did everything possible to help me, most of all whispers!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|