| Author |
Message |
robertaussie
Joined: 13 Jun 2007 Posts: 2
|
Posted: Wed Jun 13, 2007 8:49 am Post subject: how to stop using the ! @ # $ % ^ charactors in flash |
|
|
i downloaded the random text from this site and have found that it uses all the charators acroos the to above the numbers like this ! @ # $ %
i have found they work on my computer fine , maybe because i have all languages installed , but as soon as some one else looks at it they get the square boxes where those symbols should come up and if i embed the punctuation list into the swf file they see it .. but it also makes it jurky looking going through the script. So what i was wondering is what do i have to put in this code so it does not use it , I know the ! is the start but if i try and change that to a i get all sorts of errors in the script telling me that there is an ) unexpected error
| Code: |
desiredText = "CambodiaXP Flash!";
dt.text = "";
i = 0;
j = 0;
function randomizer() {
(i<desiredText.length) ? go() : clr();
function go() {
if (dt.text.charAt(i) != desiredText.charAt(i)) {
j++;
dt.replaceText(i, i+1, String.fromCharCode(j));
} else {
i++;
j = 0;
}
}
function clr() {
clearInterval(intID);
}
}
intID = setInterval(randomizer, 10);
|
|
|
| Back to top |
|
 |
guitarman fourth grade
Joined: 04 Nov 2005 Posts: 724
|
Posted: Wed Jun 13, 2007 12:09 pm Post subject: |
|
|
Replace the following code
| Code: |
if (dt.text.charAt(i) != desiredText.charAt(i)) {
j++;
dt.replaceText(i, i+1, String.fromCharCode(j)); |
with
| Code: |
if (dt.text.charAt(i) != desiredText.charAt(i)) {
j++;
if ((j>64 and j<91) or j==32 or (j>96 and j<123))
dt.replaceText(i, i+1, String.fromCharCode(j)); |
what happen is that you only replace the character if it is a Capitalize character, or a space or a small cap letter.
Check the character code here>> http://www.w3schools.com/tags/ref_ascii.asp
|
|
| Back to top |
|
 |
guitarman fourth grade
Joined: 04 Nov 2005 Posts: 724
|
Posted: Wed Jun 13, 2007 12:22 pm Post subject: |
|
|
also noted that i did not include the ! (exclaimation mark) in the code provided earlier. If you try to run, you will basically run into an increasing number and eventually hit a run time error.
To fix this, just add one more OR statement into the if statement above i.e.
if (....... or ..... or.....or j=33)
Again, 33 is a character code for ! (check the link above for the number)
|
|
| Back to top |
|
 |
robertaussie
Joined: 13 Jun 2007 Posts: 2
|
Posted: Wed Jun 13, 2007 12:36 pm Post subject: |
|
|
wow thanks a lot .. that works great .. and i have edited it to all some that i did want aswell .. it was mainly the top symbols that was causing trouble.. thanks again
|
|
| Back to top |
|
 |
guitarman fourth grade
Joined: 04 Nov 2005 Posts: 724
|
Posted: Wed Jun 13, 2007 12:38 pm Post subject: |
|
|
you are welcome mate (right? Aussie people likes to use Mate) hehe coz i am in Canberra as well for now.
Cheers,
|
|
| Back to top |
|
 |
axisoverdrive
Joined: 27 Mar 2008 Posts: 2
|
Posted: Thu Mar 27, 2008 8:46 am Post subject: Simultaneous randomize? |
|
|
(reposting here after accidentally posting a question in the blog comments)
This is a great script. Thanks so much for making it available to us.
I was wondering if the code can be edited to have the entire text in 'desiredTEXT' to randomize, but start randomizing the next character in the string BEFORE the character before it locks on to the desired character.
So, for example, if the string was "cat", 'C' would start. Then, before 'C' finishes, 'A' would start. Similarly, 'T' would follow afterwards, as both C and A are randomizing. Eventually all of C, A and T will lock on, but they'll be randomizing at the same time, one after another.
Can this work? Thanks!!
|
|
| Back to top |
|
 |
axisoverdrive
Joined: 27 Mar 2008 Posts: 2
|
Posted: Thu Mar 27, 2008 9:00 am Post subject: |
|
|
Also, the script doesn't seem to acknowledge my kerning settings. no matter what i set the kerning level to, the text will still display at "0" (however, font size and weight are still acknowledged)
|
|
| Back to top |
|
 |
|