Mailing List
Home
Flash Pro
Extending Flash
Flash Macromedia Developer
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Class help

Class help

2004-02-23       - By Darko Bulatovic COX

 Back
Reply:     1     2     3     4     5     6  

I trying to learn about classes in xm2004.

I am trying to make a class that create a textField, and from variable
insert text into textfield.
Can enyone help me ?

Thanks in advance

vijesti.as
-- ---- ---- ---- ---- ------
class vijesti extends MovieClip {
// ========= declare class variables
var naslov:TextField;
var sadrzaj:TextField;
var formNaslovi:TextFormat;
var formSadrzaj:TextFormat;
var loadNaslov:String;
var loadNaslov1:String;
var lNtmp:String;
var lStmp:String;


// constructor
public function vijesti(lNtmp:String,lStmp:String){
trace( 'uspjelo je ');
loadNaslov=lNtmp;
loadNaslov1=lStmp;
}
// implement interface methods
function title(){
trace( 'uspjelo je title '+ loadNaslov );

this.createTextField( "naslov ",11,10,70,200,50);
naslov.text=loadNaslov;
naslov.multiline =false;
formNaslovi = new TextFormat();
formNaslovi.color = 0xffffff;
formNaslovi.font = "BriemAkaMM ";

naslov.setTextFormat(formNaslovi);

}

function content(){
trace( 'uspjelo je '+ loadNaslov1);
this.createTextField( "sadrzaj ",12,10,90,200,300);
sadrzaj.text=loadNaslov1;
sadrzaj.multiline =true;
sadrzaj.wordWrap = true;
formSadrzaj = new TextFormat();
formSadrzaj.color = 0xFF9933;
formSadrzaj.font = "BriemAkaMM ";
formSadrzaj.size = 10;
sadrzaj.setTextFormat(formSadrzaj);
}
}
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----

the flash script
-- ---- ---- ---- ---- ---- ---- ---- ----
var loadNaslov:String= 'Ako razish nacicesh ';
var loadSadrzaj:String= 'Ako trazish nacicesh. Ljubav je sve. Za ovaj omijeh
vrijedi stvarati. I stvarno je lijepo stvarati. covjek se osjeca
ispunjeno. ';

var vijest = new vijesti(loadNaslov,loadSadrzaj);
vijest.title();
vijest.content();
-- ---- ---- ---- ---- ---- ---- ---- --






=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104993
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)