WEB开发网
开发学院图形图像Flash How to use an embedded text file in Flash 阅读

How to use an embedded text file in Flash

 2009-10-20 00:00:00 来源:WEB开发网   
核心提示:The opportunity to win up to $7000 with “Word Play” Flash Game Contest ends in 20 days, and I already showed you how to embed a text file in Flash.N

The opportunity to win up to $7000 with “Word Play” Flash Game Contest ends in 20 days, and I already showed you how to embed a text file in Flash.

Now it’s time to make something useful out of it.

In this script, you will learn something about dynamic text fields styling, input text fields and arrays.

All in one.

First, and seen in How to embed a text file in Flash post, you need to embed the text file… this time I am using a comma separated file, like this:

aa,aah,aahed,aahing,...,zymurgy,zyzzyva,zyzzyvas

and I am embedding it in the same old way:

package {
 import flash.utils.ByteArray;
 // assuming that words.txt is the name of your text file
 // and it's stored in the same directory of your flash file
 [Embed(source="words.txt",mimeType="application/octet-stream")]
 public class embedded_text extends ByteArray {
  public function embedded_text() {
  }
 }
}

1 2  下一页

Tags:How to use

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接