# AS3 Beginner syntax errors, help!

**URL:** <https://forum.kirupa.com/t/as3-beginner-syntax-errors-help/254922>\
**Category:** flash\
**Created:** [March 17, 2008, 12:06pm UTC](https://forum.kirupa.com/t/as3-beginner-syntax-errors-help/254922 "2008-03-17T12:06:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![willgoldstone7](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/willgoldstone7/32/2251_2.png) [@willgoldstone7](https://forum.kirupa.com/u/willgoldstone7)\
**Post date:** [March 17, 2008, 12:06pm UTC](https://forum.kirupa.com/t/as3-beginner-syntax-errors-help/254922/1 "2008-03-17T12:06:50Z")

</div>

Hi everyone,

```
       I'm new to as3, so I started off with some of adobe's tutorials on OOP with as3 and i've started writing a basic button creating script, saved as 'Mybtn.as' in a folder called 'tutorials', within 'willgoldstone' folder thats within a folder called 'com'. It looks like the below -

```

```auto
package com.willgoldstone.tutorials {
    public class Mybtn{
        
        public var btnWidth:uint;
          public var btnHeight:uint;
        public var btnName:String;
  
     public function Mybtn(w:uint, h:uint, n:String) {
       btnWidth = w;
       btnHeight = h;
       btnName = n;
       create();
     }
    
    private function create(){
        trace("new button that is "+btnWidth+" wide and " +btnHeight+" Tall, named" +btnName+ "has been made, thank you");
    }
    }
}

```

I get the following errors -

![](http://www.willgoldstone.com/errors1.gif)

Unless! I restart Flash, then it’ll decide its fine, its almost like its when I start working with the FLA that uses this .as file, where I have this code on a frame -

```auto
import com.willgoldstone.tutorials.Mybtn;

var button1:Mybtn = new Mybtn(80,30,"Widget");

```

Then flash decides that the as file itself is full of the errors above. What am I doing wrong!? I can’t understand how Flash thinks that EVEN my first line has a syntax error. I’m really confused and annoyed with the inconsistency.

```
       Thanks in advance people!

                    Cheers

                            Will
```
