# as2 - code from frame 2 running on anchor frame 3?

**URL:** <https://forum.kirupa.com/t/as2-code-from-frame-2-running-on-anchor-frame-3/294073>\
**Category:** flash\
**Created:** [August 7, 2009, 9:01pm UTC](https://forum.kirupa.com/t/as2-code-from-frame-2-running-on-anchor-frame-3/294073 "2009-08-07T21:01:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hondo311](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@hondo311](https://forum.kirupa.com/u/hondo311)\
**Post date:** [August 7, 2009, 9:01pm UTC](https://forum.kirupa.com/t/as2-code-from-frame-2-running-on-anchor-frame-3/294073/1 "2009-08-07T21:01:40Z")

</div>

Hi,

I have a timeline with a bunch of frames. At the beginning of my timeline (frame 2) I have actionscript that makes movieclips that are transparent (alpha 0) visible, and also some rollover and link/button code using a tween class. On frame 3 I have other movies that are visible etc. Frame 3 has stop code, and a frame anchor named “page2”.

For instance for the moviedclip “page\_1” I have this code:

```auto

#include "lmc_tween.as"	

page_1.alphaTo(100, .5, "easeoutregular", 1.7);

_root.page_1.onRelease = function() {
	gotoAndPlay(7);
}
}

```

The idea is that my movie clips fade in and stop on frame 3. This works great when I test the embedded flash file in my browser.

Now, I want to access frame 3 directly in my browser (by adding “#page2” after the url) and skip the alpha fading stuff.

The issue is that when I go to this url in my browser, everything loads, but the transparent movieclips are not visible. The only thing I can figure is that the alpha fade actionscript is not running because I skipped the frame it’s on (frame 2) and went directly to frame 3?

So finally to my question: is there a way to access or reference frame 2’s code on frame 3 without physically copying all the code I have on frame 1 onto frame 2 (I’ll probably be changing the code and adding to it anyway and using the same stuff in multiple places, so this could quickly get messy!!!? i don’t know enough about actionscript to do this easily.

Any thoughts or suggestions are appreciated!

Thanks!

Hondo311
