# Linking .as to .fla

**URL:** https://forum.kirupa.com/t/linking-as-to-fla/321998
**Category:** flash
**Created:** [May 6, 2011, 7:09pm UTC](https://forum.kirupa.com/t/linking-as-to-fla/321998 "2011-05-06T19:09:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kubi](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@kubi](https://forum.kirupa.com/u/kubi)
#### Post date: [May 6, 2011, 7:09pm UTC](https://forum.kirupa.com/t/linking-as-to-fla/321998/1 "2011-05-06T19:09:48Z")

</div>

Hi, I’m trying to link an actionscript to my main .fla file and it’s not really working out for me. In the .as file I’ve got a code for circular motion linked to a class in the fla file.  
So the circular motion is to be carried out within the movieclip.  
The movieclip consists of a mid point and four smaller objects around it.

```auto

      &#65279;package circular_as {
        
      import flash.events.*;
      import flash.display.*;
      public dynamic class MainTimeline extends movieclip {
      public var nucleus:movieclip;
      public var r1:movieclip;
      public var r2:movieclip;
      public var r3:movieclip;
      public var r4:movieclip;
      public function MainTimeline(){
      addFrameScript(0, frame1);
      }
      function frame1(){
      orbit(nucleus, r1, 110, 2);
      orbit(nucleus, r2, 110, 2);
      orbit(nucleus, r3, 110, 2);
      orbit(nucleus, r4, 110, 2);
  
      }
      public function orbit(_arg1:movieclip, _arg2:movieclip, _arg3:number, _arg4:number):void{
      var currentDegrees:* = nan;
      var doEveryFrame:* = null;
      var getRadians:* = null;
      var nucleus:* = _arg1;
      var electron:* = _arg2;
      var radius:* = _arg3;
      var speed:* = _arg4;
      doEveryFrame = function (_arg1:Event):void{
      var _local2:number;
      var _local3:number;
      var _local4:number;
      currentDegrees = (currentDegrees + speed);
      _local2 = getRadians(currentDegrees);
      _local3 = (nucleus.x + (math.sin(_local2) * radius));
      _local4 = (nucleus.y + (math.cos(_local2) * radius));
      electron.x = _local3;
      electron.y = _local4;
      };
      getRadians = function (_arg1:number):number{
      return (((_arg1 * math.pi) / 180));
      };

```

I’ve double checked the link between the two, **they are identical.**  
No errors show, so can anyone identify the problem? (if it exists in the code).  
Any help to solve this or if there’s a simpler way to do this, I’d love to know  
thx in advance.
