beginner - array/list/format text

  • hokiepokie
  • Born
  • Born
  • hokiepokie
  • Posts: 1

Post 3+ Months Ago

Hi. I'm a beginner. The following example of code randomly generates words from two lists and joins them together.
Question. How do I randomly change the size, aplha, color of the text? By the way I have no idea how to write it.

(display=dynamic text field)
---------------------
Code: [ Select ]
var list = new Array();
// list = []
list.push("fish");
list.push("dog");
list.push("cat");
list.push("monkey");
list.push("pig");
list.push("bird");
list.push("frog");
//
var join = ["of", "and", "the", "or"];
//
var s = "";
//
_root.onEnterFrame = function() {
var ranNum = random(list.length);
var rWord = list[ranNum];
s += " "+rWord;
//
var ranNum2 = random(join.length);
var rWord2 = join[ranNum2];
s += " "+rWord2;
display.text = s;
};
  1. var list = new Array();
  2. // list = []
  3. list.push("fish");
  4. list.push("dog");
  5. list.push("cat");
  6. list.push("monkey");
  7. list.push("pig");
  8. list.push("bird");
  9. list.push("frog");
  10. //
  11. var join = ["of", "and", "the", "or"];
  12. //
  13. var s = "";
  14. //
  15. _root.onEnterFrame = function() {
  16. var ranNum = random(list.length);
  17. var rWord = list[ranNum];
  18. s += " "+rWord;
  19. //
  20. var ranNum2 = random(join.length);
  21. var rWord2 = join[ranNum2];
  22. s += " "+rWord2;
  23. display.text = s;
  24. };
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.