View Full Version : Controlling browser's top of page from flash
march
12-02-2006, 04:50 PM
This is probably a relatively easy question. I created a long vertical page in a swf and when I button to a new frame or mc, the browser's scroll position is in the same place as the previous frame (i.e. if I am looking a the bottom of the first page, then advance to a new frame/ or mc, the browser is still looking at the bottom of the new page). Is there a way to control the browser's window position so when I go to a new frame in the swf the browser resets to view the top of page?
Thanks in advance for any help.
anonymous
12-02-2006, 06:26 PM
Yes.
Add this between the <head> & </head> tags in your html...
...
<script language="javascript">
function jumpToTop(){
location.href="#top";
}
</script>
...
And call it from your buttons, with...
on(release){
getURL("javascript:jumpToTop()");
// other actions... Change frame, etc...
}
march
12-03-2006, 03:25 PM
Thanks!!
anonymous
12-03-2006, 04:18 PM
Ÿou're welcome. ;)
march
12-05-2006, 03:18 AM
I get a strange result from the script you gave me. On every third click of that button the page goes blank. If you would like to see my unfinished page go to www.materialscript.com/alpha . The box with the pink fuzz has the script. Once on the new page the green and black arrows are the back button for now. Doing this sequence 3 times (pink fuzz + green arrows) for some reason freezes the swf. Any suggestions?
anonymous
12-05-2006, 03:37 AM
Ummmmmmmh! Yeah, the script seems to be working fine on FF, but fails as you've described on IE... That wouldn't be the first time IE would be acting up!
Maybe the EOLAS problem, which you haven't solved (having to click to activate the page in IE...) has something to do with the problem.
Maybe try this first... And see if it still acts up!
http://blog.deconcept.com/swfobject/
march
12-06-2006, 03:37 PM
I installed IE7 and this resolved the issue. Thanks for your help anonymous!
anonymous
12-06-2006, 03:51 PM
Ÿou're welcome. ;)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.