# Need some help

**URL:** <https://forum.kirupa.com/t/need-some-help/309204>\
**Category:** Uncategorized\
**Created:** [May 9, 2010, 7:33pm UTC](https://forum.kirupa.com/t/need-some-help/309204 "2010-05-09T19:33:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![steffikeh](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@steffikeh](https://forum.kirupa.com/u/steffikeh)\
**Post date:** [May 9, 2010, 7:33pm UTC](https://forum.kirupa.com/t/need-some-help/309204/1 "2010-05-09T19:33:46Z")

</div>

Hii

I’m making a shootergame but I’m stuck. I have a crossbow in a separate as file but I need to call it from my main file. But i just don’t know how to do that… can anybody help me?

this is the code of the main:

package  
{  
import flash.display._;  
import flash.text.TextField;  
import flash.utils.Timer;  
import flash.events._;

```
public class main extends MovieClip
{
    private var aantal_rozen:uint = 2;
    private var gameLevel:uint = 0;
    private var score:uint = 0;
    private var roosSnelheid:uint = 2;
    
    public function main()
    {
        stop();            
    }
    
    public function scoreVerhogen():void
    {
        score++;
        score_txt.text = score.toString();
    }
    
    private function initLevel():void
    {
        gameLevel++;
        //aantal_rozen++;
        
        var timer:Timer = new Timer(2000, 1);
        timer.addEventListener(TimerEvent.TIMER, gaNaarGame);
        timer.start();
        
        level_txt.text = gameLevel.toString();
        stop();
    }
    
    private function gaNaarLevel():void
    {
        gotoAndStop("level");
    }
    
    private function gaNaarGame(evt:TimerEvent):void
    {
        gotoAndStop("game");
    }
    
    private function gaNaarGameOver():void
    {
        gotoAndStop("gameOver");
    }
    
    private function initGame():void
    {            
        for(var i:uint = 1; i&lt;=aantal_rozen; i++)
        {
            var Roos:MovieClip = new mc_roos(gameLevel);
            Roos.name = "mc_roos" + i;
            addChild(Roos);
        }
        
        stage.addEventListener(Event.ENTER_FRAME, controle);
        score_txt.text = score.toString();
    }
    
    private function initGameOver():void
    {
        stop();
        
        score_txt.text = score.toString();
    }
    
    public function controle(evt:Event):void
    {
        if (score &gt;= gameLevel*15)
        {
            verwijder_rozen();
            gaNaarLevel();
        }
    }
    
    public function verwijder_rozen():void
    {
        for(var i:uint=0; i&lt;aantal_rozen; i++)
        {
            if(!(getChildByName("roos"+i) == null))
            {
                mc_roos(getChildByName("roos"+ i)).destroy();
            }
        }
    }
}

```

}

And this is the code of my crossbow:

package  
{  
import flash.display._;  
import flash.events._;  
import flash.utils.\*;

```
public class mc_boog extends MovieClip
{
    
    private var links:Boolean=false;
    private var rechts:Boolean=false;
        
    private var speed:uint=15;
    
    private var tijd:int=0;
    private var limiet:int=12;
    private var schietenAllow:Boolean=true;
    
    
    public function mc_boog():void
    {
        this.addEventListener(Event.ENTER_FRAME, beweging);

        this.addEventListener(KeyboardEvent.KEY_DOWN, controlDown);

        this.addEventListener(KeyboardEvent.KEY_UP, controlUp);
    }
    
    public function beweging(evt:Event):void
    {
        if(links)
        {
            this.x-=speed;
        }
        
        if(rechts)
        {
            this.x+=speed;
        }
        
        if(this.x&lt;45)
        {
            this.x = this.x+=speed;
        }
        
        if(this.x&gt;655)
        {
            this.x = this.x-=speed;
        }
        
        if(tijd&lt;limiet)
        {
            tijd++;
        }
        else
        {
            schietenAllow=true;
            tijd=0;
        }
    }
    
    private function controlDown(evt:KeyboardEvent):void
    {
        // booleans true als de toets ingedrukt is
        if(evt.keyCode == 37 || evt.keyCode == 65)
        {
            links = true;
        }
        
        if(evt.keyCode == 39 || evt.keyCode == 68)
        {
            rechts = true;
        }
    }
    
    private function controlUp(evt:KeyboardEvent):void
    {
        if(evt.keyCode == 37 || evt.keyCode == 65)
        {
            links = false;
        }

        if(evt.keyCode == 39 || evt.keyCode == 68)
        {
            rechts = false;
        }
    }
}

```

}

Thanks!
