A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: flash link to specific place, on an html page

  1. #1
    Senior Member
    Join Date
    Oct 2004
    Posts
    165

    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?

  2. #2

  3. #3
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    thanx but i have no idea how this "named anchor" works

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    search the web, i'm sure there will be tutorials on how
    to write named anchors in html pages

  5. #5
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    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)

  6. #6
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    wow thanx but and how do i put the anchor name on the html page?

  7. #7
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    (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");
    }

  8. #8
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    Quote Originally Posted by whispers
    (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");
    }

    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?

  9. #9

  10. #10
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    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?

  11. #11
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    whispers can u plz be more specific/detailed on the correct way of typing
    Quote Originally Posted by whispers
    on(press){
    getURL("/somepage.html#anchor1");
    }
    as far as the path is concerned?

  12. #12
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    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.

  13. #13
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    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

  14. #14
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    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?

  15. #15
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    about the "several things" u think i want to do i think u got them all
    about your questions
    1. im attaching it
    2. also u will see them, they are not something specific, in the attached i think u can figure it out!
    3. im trying to navigate from the index page (using flash buttons) to another html page, at a specific point to its middle

    anyhow i think its clearer if u take a look at my draft.
    so ive attached the draft of what im trying to do

    plz note that on the flash buttons on my index page (indexToAnchor.html) only the last of the four is partially working. Use the first popout button thats the only set to work with the anchors bla bla.
    now by clicking on that fourth/first popout btn i want to navigate to another html page (GoHere.html) to the "right here" text almost at the middle of the page!
    I think this about covers it.

    Many many thanx for taking your free time and helping me, im deeply obligated!

    p.s. anything u need to ******** plz dont try to find it yourself, ill help u so it get easyer and u dont get lost into my sites "labyrinthic" way of design (im a damn newby)
    Attached Files Attached Files

  16. #16
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    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.

  17. #17
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    i messed up my copy, can u send me the one that works for you plz?

  18. #18
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    anyone managed to get it working? whispers?

  19. #19
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    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.

  20. #20
    Senior Member
    Join Date
    Oct 2004
    Posts
    165
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center