Im new to as3 and flash in general
i have a 1000 frame flash file
each frame is labeled uniquely
ive managed to create a input text field searchbox in frame no1 which gets me to my desired frame
(when i enter the frame label inside the input text "search box")
my problem is that you have to enter the exact name of the frame label (case sensitive and tough to guess)
my question is how can i make this "search engine" offer me the closest result
(or to choose among two or three possible frame labels)
i appologise if this seem complicated, im just starting ( i hope to be answering this kind of questions after a while )
Alternatively you could put the frame names into an array and jump to the frame name you have entered into your search box.
if there is more than one name with the same letter begining then you could make a temporary array of the relevant words and offer all of those suggestions to the user.
you can use str.toLowerCase() or str.toUpperCase() if the case is necessary at all.
var frameArray:Array = new Array("Adder", "Antelope", "Bee", "Bear", "Buzzard", "Cat", "Dog"); var matchArray:Array = new Array();
function doMatches(arg:String):Void { matchArray = []; for (var a:Number = 0; a < frameArray.length; a++) { if (arg.toLowerCase() == frameArray[a].charAt(0).toLowerCase()) { matchArray.push(frameArray[a]); } } trace(matchArray); }
doMatches("B");
thats one way
another way would be like so uding the same arrays as above
PHP Code:
function goFrame(arg:String):Void { var lower:String = arg.toLowerCase(); for (var a:Number = 0; a < frameArray.length; a++) { if (lower == frameArray[a].toLowerCase()) { gotoAndStop(lower); trace(lower); } } }
goFrame("Bear");
I have tested and the frame name does not require case sensitivity, so a frame called "BEar" would accept bear.
Or as suggested before, you can just call each bit of data to frame 1 or 2 from external sources or from the library to save having a 1000 odd frames, although either way it seems you have a lot to do with so many.
Last edited by fruitbeard; 12-16-2016 at 04:38 AM.
Well put them to good use Alloy, no more of the bum stuff code.
What exactly doy ou mean by ABC anyway, do you know immense amounts of byte code stuff, if so then put up some mega stuff for us to see and utilise.
in your own thread though, don't want to occupy somebody elses too much.
Last edited by fruitbeard; 12-17-2016 at 05:46 AM.