Your SlideShare is downloading. ×
0
ARTDM 170, Week 12: Flash Text Elements
ARTDM 170, Week 12: Flash Text Elements
ARTDM 170, Week 12: Flash Text Elements
ARTDM 170, Week 12: Flash Text Elements
ARTDM 170, Week 12: Flash Text Elements
ARTDM 170, Week 12: Flash Text Elements
ARTDM 170, Week 12: Flash Text Elements
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

ARTDM 170, Week 12: Flash Text Elements

291

Published on

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

  • Be the first to like this

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×