USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 1/31/09 06:28 PM
Sign-Up: 09/22/07
Posts: 174
I need something that defines "anything" so i can make like
if(var1 == "example"+ANY){ BLAH }
So if it was "example4424" it would work or even "examplefas1233234sffs".
Understand what i mean?
thank you! :D
click here!
Posted at: 1/31/09 06:32 PM
Sign-Up: 09/17/08
Posts: 2,233
var i=Math.ceil(Math.random()*500); if(testText == returnText+i) { //actions }
That a example, but i could be anything.
Flash Help? AIM Me | New to Flash? Bookmark the following:
Posted at: 1/31/09 06:34 PM
Sign-Up: 03/16/02
Posts: 2,354
Flash doesn't have wildcards so it's not easily possible.
Visit my website: Kenney.nl
Posted at: 1/31/09 06:35 PM
Then I didnt understand what he meant :P
Posted at: 1/31/09 06:40 PM
Sign-Up: 02/06/06
Posts: 211
I'm sure there's probably a better way and this is a bit clunky, but its the only thing that comes to mind.
var testWord1:String = "Test"; var testWord2:String = "TistTest"; var sameWord:Boolean = false; for(var i:int = 0; i<testWord1.length; i++) { if(testWord1.charAt(i)!=testWord2.charAt(i)) { sameWord = false; break; } else { sameWord = true; } } if(sameWord == true) //Your actions here
Posted at: 1/31/09 06:46 PM
Sign-Up: 02/12/05
Posts: 1,473
You could truncate everything after example by doing something like this:
var blah:String = "example12345FUCK YOU!!!! TEST SHIT"; trace(blah.substr(0,7)); //traces 'example'
http://help.adobe.com/en_US/AS2LCR/Flash _10.0/help.html?content=00001557.html
Move on to ActionScript 3.0 already! The third post below this one is a lie.
Posted at: 1/31/09 06:52 PM
Yeah, definitely a better way.
var test1:String = "test"; var test2:String = "test2"; if(test2.substr(0, test1.length) == test1) //Your code here
All times are Eastern Standard Time (GMT -5) | Current Time: 10:46 AM
<< Back