Your SlideShare is downloading. ×
ARTDM 170, Week 12:  Flash Text Elements <ul><li>Gilbert Guerrero  [email_address] </li></ul><ul><li>gilbertguerrero.com/b...
Text in Flash <ul><li>There are several ways to add text to your Flash movies </li></ul><ul><ul><li>Using ActionScript </l...
Text with ActionScript <ul><li>gameScore = new TextField(); gameScore.x = 10; gameScore.y = stage.stageHeight -30; gameSco...
Placing text on the stage <ul><li>Use the text tool to add text to the stage </li></ul>
Placing text on the stage  <ul><li>Select dynamic text and give the text box and instance name </li></ul><ul><li>In your A...
Updating the score <ul><li>In our jumping brick game, each time a collision is detected with the myBalloon object, we can ...
Homework, due Nov 11  <ul><li>Work on your  final projects </li></ul><ul><li>Next week: Processing </li></ul>
Upcoming SlideShare
Loading in...5
×

ARTDM 170, Week 12: Flash Text Elements

302

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
302
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "ARTDM 170, Week 12: Flash Text Elements"

  1. 1. ARTDM 170, Week 12: Flash Text Elements <ul><li>Gilbert Guerrero [email_address] </li></ul><ul><li>gilbertguerrero.com/blog/artdm-170/ </li></ul>
  2. 2. Text in Flash <ul><li>There are several ways to add text to your Flash movies </li></ul><ul><ul><li>Using ActionScript </li></ul></ul><ul><ul><li>Placing text on the stage </li></ul></ul>
  3. 3. Text with ActionScript <ul><li>gameScore = new TextField(); gameScore.x = 10; gameScore.y = stage.stageHeight -30; gameScore.width = 300; var myTextFormat:TextFormat = new TextFormat(&quot;Arial&quot;, 18, 0x006600, true, false, false, null, null, &quot;left&quot;); gameScore.defaultTextFormat = myTextFormat; gameScore.selectable = false; gameScore.multiline = true; gameScore.wordWrap = true; gameScore.autoSize = TextFieldAutoSize.LEFT; gameScore.text = &quot;Your Score: 0”; addChild(gameScore); </li></ul>
  4. 4. Placing text on the stage <ul><li>Use the text tool to add text to the stage </li></ul>
  5. 5. Placing text on the stage <ul><li>Select dynamic text and give the text box and instance name </li></ul><ul><li>In your ActionScript refer to the instance name to update the text value </li></ul><ul><li>myScore.text = &quot;Your Score: &quot;+ numScore; </li></ul>
  6. 6. Updating the score <ul><li>In our jumping brick game, each time a collision is detected with the myBalloon object, we can update the score and pop (remove) the balloon </li></ul><ul><ul><li>if( myBrick.hitTestObject(myBalloon) ) { removeChild(myBalloon); numScore++; myScore.text = &quot;Your Score: &quot;+ numScore; } </li></ul></ul>
  7. 7. Homework, due Nov 11 <ul><li>Work on your final projects </li></ul><ul><li>Next week: Processing </li></ul>

×