?
Solved

flash button links to HTML anchor

Posted on 2007-03-29
6
Medium Priority
?
570 Views
Last Modified: 2008-02-01
I have a button in flash that i want to link to an HTML anchor. My swf is 1125 px high and when you click on this button i want it to move the page to the top of the window without reloading the page.

i have tried:

on (press) {
      getURL("javascript:window.location.href=\"#top\"");
}

which kinda works in safari but it never stops loading the page and it freezes up, and tyhis doesnt work in firefox

i have also tried:

on (press) {
      getURL("#top"");
}

which reloads the page

Thanks

Peter
0
Comment
Question by:CosmicKoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:secondv
ID: 18820700
Try this.

In your documents <head> section:

<script language="JavaScript">
function newWin(url, name, options)
{
      return window.open(url, name, options);
}
</script>


then in flash:

on (press) {
      getURL("javascript:openNewWindow('page.html#top','_parent')");
}
0
 
LVL 4

Expert Comment

by:secondv
ID: 18820704
My apologies, I hadn't fully edited the code before posting (need an edit..)

use the following:


In your documents <head> section:

<script language="JavaScript">
function newWin(url, name, options)
{
      return window.open(url, name, options);
}
</script>


then in flash:

on (press) {
      getURL("javascript:newWin('page.html#top','_parent')");
}
0
 

Author Comment

by:CosmicKoder
ID: 18820754
tried it and it doesnt work in safari and in firefox it loads this in the address bar "javascript:href="#top""

you can see an example of the page at:

http://www.fieldstonecommunity.com/review/

click on team and than on builders. Scroll to the botton, the button next to woodridge homes that says photos has the actionscript code that you gave me.

Thanks

Peter
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:CosmicKoder
ID: 18820768
i had made a mistake in my last post. I pasted the actionscript you gave me on the wrong button. I redid and retested. It works sort of, but it reloads the whole page so now i am back at the home page.

you can test here

you can see an example of the page at:

http://www.fieldstonecommunity.com/review/

click on team and than on builders. Scroll to the botton, the button next to woodridge homes that says photos has the actionscript code that you gave me.

Thanks
0
 
LVL 4

Accepted Solution

by:
secondv earned 2000 total points
ID: 18822509
Try changing it to:

on (press)
{
      getURL('javascript:self.scrollTo(0, 0)');
}

which works.  http://scriptgod.com/anchortest.html  (scroll to the very bottom click either "Anchor" or "Test")

0
 

Author Comment

by:CosmicKoder
ID: 18824867
thast is so awesome! thank you so much!!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question