Jump to content
Search Community

Scrambling multiple letters in one textfield using ScrambleText

BakerShoeMaker test
Moderator Tag

Recommended Posts

I have a 1 text field that displays a number sentence, i.e. 1 + 3 = ?. I would like to scramble the first and second number using the  scrambleText plugin.  I can accomplish this with multiple text fields, i.e, one for "1", one for "+", one for "3" and one for "= ?".

 

However, that approach is cumbersome so I put everything into 1 text field. Is there a way to scramble some of the text in a text field or is there another way to do this?

 

In this approach I only get one text item to display:

 

//I want to scramble these two variables in on textfield
var temp_c:String = c.toString();
var temp_d:String = d.toString();

//numberSentence.text = c.toString() +" + " + d.toString() +" = ?";
numberSentence.text = temp_c +" + " + temp_d +" = ?"; //this line displays the text.
TweenLite.to(numberSentence, 1, {scrambleText:{ text: temp_c, chars:"09", speed:2}}); //This only displays temp_c.
//I would like to get scramble temp_c and temp_d, where temp_c = 1 and temp_d=3, 1 + 3 = ?

 

I'm using actionScript.

Link to comment
Share on other sites

No, sorry, there isn't an easy way to accomplish that. I suppose you could use a hidden TextField that you scramble and then you just use an onUpdate to copy only the pieces that you need into the text of the other TextField. Just a thought. 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...