# How do I "include" with as3.0?

**URL:** <https://forum.kirupa.com/t/how-do-i-include-with-as3-0/246570>\
**Category:** flash\
**Created:** [December 12, 2007, 1:45pm UTC](https://forum.kirupa.com/t/how-do-i-include-with-as3-0/246570 "2007-12-12T13:45:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomppalonen](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tomppalonen](https://forum.kirupa.com/u/tomppalonen)\
**Post date:** [December 12, 2007, 1:45pm UTC](https://forum.kirupa.com/t/how-do-i-include-with-as3-0/246570/1 "2007-12-12T13:45:23Z")

</div>

I’ve just jumped from as2 to as3 and it’s quite depressing to see I have lots to do to fix everything to work.

I have an as file containing loads of functions and commands and I used to link it to the flash file with #include in a frame. That obviously don’t work anymore.  
I tried to search and read about this and find myself puzzled with the class and package.  
So to replace the include, do I just write the frame:  
import myPackage.myCode;

and wrap my code inside:  
\*package myPackage{  
public class myCode {

```
code here...

```

}\*

Or how will I do the same thing I used to in as2?

I tested the example of the help file.  
In te as file i wrote:

_package samples  
{  
public class SampleCode  
{  
public var sampleGreeting:String;  
public function sampleFunction()  
{  
trace(sampleGreeting + " from sampleFunction()");  
}  
}  
}_

and in the main timeline I tried both:

_import samples._;  
import samples.SampleCode;\*

Both gave error:  
_1172: Definition samples could not be found.  
1172: Definition samples:SampleCode could not be found._

And I had one component button in the maintimeline (left from previous test) and when testing movie it flickered showing all the buttons states below each other??? :hangover:
