I need some help
hellow have create file on class. in class import other classes. have create fla file publilicate in air player, try test move write me class not exist. done wrong? plese me.
as file:
package
{
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.system.*;
public class temp1 extends sprite
{
public static var no_info:string="informacijos nera";
// private properties:
private var elementname:string;
private var elementpower:number;
private var elementinfo:string;
private var elementprint:string;
private var clickcount:int=new int(0);
// initialization:
public function temp1()
{
var inputnametext:textfield=new textfield ;
inputnametext.type=textfieldtype.input;
inputnametext.restrict="a-z"+"a-z";
inputnametext.width=120;
inputnametext.height=20;
inputnametext.multiline=false;
inputnametext.wordwrap=false;
inputnametext.border=true;
inputnametext.background=true;
inputnametext.x=50;
inputnametext.y=50;
inputnametext.selectable=true;
inputnametext.mousewheelenabled=false;
inputnametext.maxchars=20;
addchild(inputnametext);
var inputpowertext:textfield=new textfield ;
inputpowertext.type=textfieldtype.input;
inputpowertext.restrict="0-9";
inputpowertext.width=120;
inputpowertext.height=20;
inputpowertext.multiline=false;
inputpowertext.wordwrap=false;
inputpowertext.border=true;
inputpowertext.background=true;
inputpowertext.x=50;
inputpowertext.y=75;
inputpowertext.selectable=true;
inputpowertext.mousewheelenabled=false;
inputpowertext.maxchars=10;
addchild(inputpowertext);
var inputinfotext:textfield=new textfield ;
inputinfotext.type=textfieldtype.input;
inputinfotext.restrict="a-z"+"a-z"+"0-9";
inputinfotext.width=120;
inputinfotext.height=190;
inputinfotext.multiline=true;
inputinfotext.wordwrap=true;
inputinfotext.border=true;
inputinfotext.background=true;
inputinfotext.x=50;
inputinfotext.y=100;
inputinfotext.selectable=true;
inputinfotext.mousewheelenabled=false;
inputinfotext.maxchars=110;
addchild(inputinfotext);
var printtext:textfield=new textfield ;
printtext.type=textfieldtype.dynamic;
printtext.width=425;
printtext.height=400;
printtext.multiline=true;
printtext.wordwrap=true;
printtext.border=true;
printtext.background=true;
printtext.x=325;
printtext.y=50;
printtext.selectable=false;
printtext.mousewheelenabled=true;
addchild(printtext);
var enterbutton:textfield=new textfield ;
enterbutton.text="ivesti duomenis";
enterbutton.autosize=textfieldautosize.center;
enterbutton.border=true;
enterbutton.selectable=false;
enterbutton.addeventlistener(mouseevent.click,clicklistener);
enterbutton.x=70;
enterbutton.y=300;
addchild(enterbutton);
var exitbutton:textfield=new textfield ;
exitbutton.text="išeiti";
exitbutton.autosize=textfieldautosize.center;
exitbutton.border=true;
exitbutton.selectable=false;
exitbutton.x=98;
exitbutton.y=325;
addchild(exitbutton);
function clicklistener(event:mouseevent):void
{
clickcount=clickcount+1;
if (clickcount==5)
{
printtext.text="";
clickcount=0;
}
if (inputnametext.text==""||inputpowertext.text=="")
{
printtext.appendtext("\niveskite duomenis.\n");
inputnametext.text="";
inputpowertext.text="";
inputinfotext.text="";
}
else
{
if (inputinfotext.text=="")
{
elementinfo=temp1.no_info;
}
else
{
setelementinfo(inputinfotext.text);
}
setelementname(inputnametext.text);
setelementpower(new number(inputpowertext.text));
setprintelement();
printtext.appendtext(getprintelement());
inputnametext.text="";
inputpowertext.text="";
inputinfotext.text="";
}
}
}
public function setelementname(newname:string):void
{
elementname=newname;
}
public function getelementname():string
{
return elementname;
}
public function setelementpower(newpower:number):void
{
elementpower=newpower;
}
public function getelementpower():number
{
return elementpower;
}
public function setelementinfo(newinfo:string):void
{
elementinfo=newinfo;
}
public function getelementinfo():string
{
if (elementinfo=='')
{
elementinfo=temp1.no_info;
}
return elementinfo;
}
public function setprintelement():void
{
if (elementinfo=='')
{
elementinfo=temp1.no_info;
}
var powersting:string;
var temp:string="";
powersting=new string(elementpower);
temp+="\nelektro elemento pavadinimas: "+elementname;
temp+="\nelektro elemento galingumas: "+powersting+" w";
temp+="\nelektro elemento informacija: "+elementinfo+"\n";
elementprint=temp;
}
public function getprintelement():string
{
setprintelement();
return elementprint;
}
}
}
fla file publish in air
probably need setup actionscript publish settings (http://help.adobe.com/en_us/flash/cs5/using/ws3e7c64e37a1d85e1e229110db38dec34-7fa4a.html).
or set main document class property point actionscript file.
More discussions in Archived Spaces
adobe
Comments
Post a Comment