Notes to Lesson 5

$firstText->moveTo((460/2-($myText->getWidth(" My First Flash!"))/2)+10,50);

The above line is actually the same as: $firstText->moveTo(x,y);

A value of 10 was added to the x parameter in order to center the text over the circle with the word "First," but when compared to the background, the words are not actually centered on the banner.

Fonts too, can be put into a function, which saves on scripting when using several lines of text, as there are only 2 lines of code to add for each line of text.

function font($font,$r,$g,$b,$a,$pointsize,$label){
$Font=new SWFFont("$font");
$Text=new SWFText();
return $Text;

Then you would call the function as follows:

$First=$myMovie->add(font('Park_Avenue_BT.fdb',255,200,0,255,70,'My First Word'));

Font Function Sample:


Font Function Sample: