A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Dynamic text with several variables?

  1. #1
    I have a game that has 5 movie clips which are dragged and dropped over 5 target movie clips. I want a message displayed in the same space on my stage each time. Actually, two messages; a "Good Job!" and "Keep trying" would suffice. In other words, when the user drags the first clip it would say keep trying and when the collision is detected, good job.

    So far, my code is convoluted and I'm looking for an easy way to unload the first message (after a few seconds, or the user starts dragging the next color clip) and start detecting the next collision--giving the status of that.

    It would seem that using one variable would be nice but I can't figure out how to do it, to get 5 target movie clips to track that. I tried making the text messages movie clips, too, and setting their visibility to zero but that seemed cumbersome.

    Any ideas, examples would be most appreciated!!

    Thanks,

    Rick

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Posts
    475
    I'd use a dynamic text field. just set its variable to the text you want to display like:

    textfield = "keep tryin'";
    if (hittest(blabla))
    textfield = "Good boy";

    Well this is pseudo code but i think you can figure out what this means

    Yours
    HTD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center