# Using AS 2.0 like a named Anchor in an swf?

**URL:** <https://forum.kirupa.com/t/using-as-2-0-like-a-named-anchor-in-an-swf/280206>\
**Category:** Uncategorized\
**Created:** [January 24, 2009, 4:14am UTC](https://forum.kirupa.com/t/using-as-2-0-like-a-named-anchor-in-an-swf/280206 "2009-01-24T04:14:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphiedee](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@ralphiedee](https://forum.kirupa.com/u/ralphiedee)\
**Post date:** [January 24, 2009, 4:14am UTC](https://forum.kirupa.com/t/using-as-2-0-like-a-named-anchor-in-an-swf/280206/1 "2009-01-24T04:14:20Z")

</div>

I’m re doing a project that requires me to have a button in a mc that will make the swf scroll or move down to a certain area in the movie, I found the actions in the old page in a frame I cannot just copy the code as the original movie was cuilt differently.

All I need is for the button to move the viewing area of the stage (y) to a certain spot once the button is clicked. It actually works like an anchor in an html page. Never had to use this before but the previous designer did me a favor and left me something to learn, here is the code which was in a frame. I left the whole code just in case but the button instance is called joblink\_mc (don’t know why designer called a button mc?)

I’m sure the code I need to re do is between the dotted lines, can someone give me an idea of how I can modify the code to do the same thing?

import flash.external.ExternalInterface;

## \_root.currMovie = “banner-index”; container.loadMovie(\_root.currMovie+".swf");

jobsLink\_mc.onPress = function () {  
[//ExternalInterface.call](https://ExternalInterface.call)(“scrollPageY”);  
///getURL(“javascript:scrollPageY();”)  
getURL(“javascript: scrolling()”)  
}

* * *

ncLink\_mc.onPress = function () {  
num=3;  
if(\_root.link\<\>num and \_root.animation==1) {  
\_root.mainmenu.workLink\_mc.gotoAndStop(“15”);  
\_root.animation=0;  
\_root.link\_prev=\_root.link;  
\_parent[“item” + \_root.link].gotoAndPlay(“s2”);  
\_root.link=num;  
\_root.play();

```
    _root.scroller.scroller.gotoAndStop(3);
    _root.DY = stage.height+4
    _root.DX = stage.width+4

    _root.mainmenu.int_mc.gotoAndStop("1");        
}

```

}  
book1\_hl.onPress = function () {  
num=3;  
if(\_root.link\<\>num and \_root.animation==1) {  
\_root.mainmenu.workLink\_mc.gotoAndStop(“15”);  
\_root.animation=0;  
\_root.link\_prev=\_root.link;  
\_parent[“item” + \_root.link].gotoAndPlay(“s2”);  
\_root.link=num;  
\_root.play();

```
    _root.scroller.scroller.gotoAndStop(3);
    _root.DY = stage.height+4
    _root.DX = stage.width+4
    
    _root.mainmenu.int_mc.gotoAndStop("1");        

}

```

}
