flash actionscript:
bocacio, You can do all this with a few methods of the String class. Fire up your ActionScript dictionary (F1 key) and look up "String class" for details. // Set original var sbMsg = "Happy new year to all, santaclause is comming again"; // Set string2 to what you're looking for // Use string2 to find the others var string2 = "santaclause"; var string1 = sbMsg.substring(0, sbMsg.indexOf(string2)); var string3 = sbMsg.substring(sbMsg.indexOf(string2) + string2.length); // Trace your strings trace(string1); trace(string2); trace(string3); David stiller (at) quip (dot) net "Luck is the residue of good design."
Hi, A HAPPY NEWYEAR TO ALL!!!!! i have a string sbMsg = "Happy new year to all, santaclause is comming again"; I want to search for santaclaus in that string and put all thats before santaclaus (Happy new year to all, ) and everything after santaclaus ( is comming again) in a new string. so, theres gonna be 3 new strings... string1. Happy new year to all, string2. santaclaus string3. is comming again i now there was somewhere a tutorial about this, but i cannot find it anymore. If someone of you knows a tutorial about this..then that would be great...i searched and googled all there is but cannot find what i need. thanks
sbMsg = "Happy new year to all, santaclause is comming again"; searchString = "santaclause"; string1 = sbMsg.substring(0, sbMsg.indexOf(searchString)); string2 = sbMsg.substring(sbMsg.indexOf(searchString), sbMsg.indexOf(searchString)+searchString.length); string3 = sbMsg.substring(sbMsg.indexOf(searchString)+searchString.length); p.s. i'm not sure why you'd use string2, but there it is.
my god and i doing things much to complicated!! thanks for the quick answers guys!!! string 2 i want to use for replacement...so i want to attach something from the library or load a jpg with the var in string 2.... so finally i got : string1(text) + string2 (attach something) + string3(text) and attach this all to a new mc.... sorry for my poor english, but try :-) thanks again
Don't see what you're looking for? Try a search.
|