5 Replies Latest reply on Jul 11, 2006 9:00 AM by Tekkaman_Cypher

    HTML Scrollbar manip from within Flash

      Hey guys, so here's what I'm trying to do. I'm trying to duplicate page jumping in Flash the same way you would in HTML.

      For instance if you were doing HTML page, the way you would code it is to place a link to another part of the page and then put a "A NAME" there. Example <a href="#test">test</a> somewhere else on the page <a name="test"><a/> And the page would scroll down to that section.

      So my question, how do I do that with Flash? Your still using the HTML scrollbar, but the instrctions are done in Flash. I used keywords here at Adobe.com and Google.com and couldn't find it anywhere.
        • 2. Re: HTML Scrollbar manip from within Flash
          Wolf_van_Ween Level 1
          Just to see whether I get you:
          You want to make a button in a Flash movie do the same thing a HTML link to an anchor does, so you want the HTML page to scroll to another place (probably scrolling away your Flash movie), right?
          You don't want to scroll inside the Flash movie, right?

          Ok, if that's the case you do the same thing as in HTML, just embed that link into a getURL call, i.e. let's say you have a HTML anchor called "test", your HTML page is called "www.site.com/index.html", then you would simply write the following actionscript on your button:
          on(Release) {
          • 3. Re: HTML Scrollbar manip from within Flash
            Tekkaman_Cypher Level 1
            Wolf, thanks for hitting me up.

            Um after researching it more I used the wrong terminoligy to explain what I wanted to do. Sorry. What I want to do is to make Flashesque type Anchors. The whole window would will be flash, but how do I get the IE scrollbar to react accordingly? Here's an example of someone who already has done it. I've emailed and then haven't written back. http://www.fantasy-interactive.com In the bottom right hand corner of the boxes there's a return arrow that shoots you back up to the top of the screen like a HTML Anchor. How would I go about duplicating that kind of effect?
            • 4. HTML Scrollbar manip from within Flash
              Wolf_van_Ween Level 1
              Ok, now it's clear what you want.
              It can't be done from inside flash, but you can easily do it in javascript:
              window.scrollTo(0,0); for instance moves the content to the top right corner again.
              You can even put that into a simple link, for instance, if you use the text below, your browser window will scroll back by 600 points (a little less than a page full) if you click:
              <a href=javascript:window.scrollBy(0,-600)>Click here</a>

              How to use this in Flash -- you could either use a link like the above in a HTML-formatted textfield or use getURL or call a javascript function via fscommand.

              As to the site you give, it really doesn't scroll that way, it moves to a different page INSIDE the flash movie.
              The browser's default behaviour is to scroll back to 0,0 when a new page is loaded, and this site uses this automatic behaviour. Normally the browser doesn't recognize when Flash changes the "page", and therefore normally this doesn't happen. That's why normally you also can't use the browser's back and forward buttons.

              But this site uses Flash anchors that "inform" the browser of the "page change", you see if you click one of the buttons and then use the browser's back button.

              Flash anchors are a difficult subject, I can shed a little bit of light on it, because I've used them myself, but never got to work them flawlessly. It doesn't work on that site either. Just try to bookmark one of the sub-pages, then close and re-open the browser window and try to return to your bookmark.

              Interesting subject though...
              Cheers, Wolf
              • 5. Re: HTML Scrollbar manip from within Flash
                Tekkaman_Cypher Level 1
                Thanks Wolf. I'll put what you said in to action and I'll let you know how I make out.