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 -
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 -
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 -
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