Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Frame Position Question AS2

Guest
Feb 10, 2013 Feb 10, 2013

I'm testing a simple Flash project made up of two frames. 1st frame has a nextFrame button at the top and the 2nd frame has a prevFrame button at the bottom.

My document is long measuring 1000 pixels. I'm then inserting the published. swf into a html document in Dreaweaver.

When I preview the html page in a browser the nextFrame button takes me to frame 2, I then scroll down (with the browser window) to find the prevFrame button to go back.

My problem is when the prevFrame button sends the swf back to frame 1, it's in the lower scrolled position. What I would like to achieve is when I go back to frame 1 it returns back to the top.

Not sure if this is AS2 code to add in flash to resolve this or if its something to add in Dreamweaver with html or css.

Any advice would be greatly appreciated.

TOPICS
ActionScript
559
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 10, 2013 Feb 10, 2013

If you are scrolling the browser window then you need to make the browser window return to the top.  You could probably do this by placing a named anchor in the html at the beginning and have the prevFrame button link to it.  This would be refreshing the page.

If you didn't want to have the Flash file tell the html page to adjust the window scroll position using javascript  you would need to make use of the ExternalInterface class.  Search Google using "javascript scroll page" for the javascriot

...
Translate
LEGEND ,
Feb 10, 2013 Feb 10, 2013
LATEST

If you are scrolling the browser window then you need to make the browser window return to the top.  You could probably do this by placing a named anchor in the html at the beginning and have the prevFrame button link to it.  This would be refreshing the page.

If you didn't want to have the Flash file tell the html page to adjust the window scroll position using javascript  you would need to make use of the ExternalInterface class.  Search Google using "javascript scroll page" for the javascriot end of things.  Here's one link from that search: http://www.mediacollege.com/internet/javascript/page/scroll.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines