FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Actionscript Help





brokenadvice
I am trying to code a riddle game in Flash MX. You are given a list of clues and you can ask yes/no questions from the game.

The action script would search the input text for specific keywords and then output a sentence based on the keyword. I have no idea how exactly this could be done, but I know of similar things like the subservient chicken.

If anyone knows what I am talking about please help, or at least send me in the right direction.
makli
I'm not sure, if I understand you right, but I can show you, how to find keywords in strings. Look at this code:

function searchKeyWord(pKeyword){
if(myString.indexOf(pKeyword)!=-1){
//the keyword exists in myString
} else {
//no keyword in myString
}
}

HTH

Makli
brokenadvice
Thanks! I ended up with something like

Code:
 
if(myString.indexOf("Bob")!=-1){
_root.MyMovie.gotoAndPlay(23);
} else if(myString.indexOf("Joe")!=-1){
_root.MyMovie.gotoAndPlay(94);
} else if(myString.indexOf("Sam")!=-1){
_root.MyMovie.gotoAndPlay(43);
} else {
_root.MyMovie.gotoAndStop(1);
}


Only im stacking them a bit longer Wink
Related topics
Flash - Photo Gallery - need help please.
CALLING ALL ACTIONSCRIPTERS, NEED HELP ASAP (IM SERIOUS)
Flash Help
Flash 8 actionscript help - FIXED
Need vb.net or Flash ActionScript Help!
ActionScript Pro's?
Need help with Actionscript 2.0
Actionscript 2.0 - How do I make a clip move in a circle?
Help! Actionscript---loading an image
Opera anomaly, Flash Gallery+XML, Problem, HELP?! [SOLVED]
Mousescroller function. How?
Need help loading an external .swf into an empty movieclip
Flash ActionScript 2.0 Verical Animated Menu Problem
need help with flash actionscript and xml!
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.