What's Wrong With This Code (search Feature)
Hi the code that doesn´t works is this: __________
on (release, keyPress "<Enter>") { if (searchinput=123456) { gotoAndPlay("Scene 2", 1); } else { gotoAndPlay("Scene 3", 1); } } __________
This is the code of the button that should trigger a search feature to reach a specific scene and frame by entering a number, in this case the number that should be entered to reach scene 2 frame 1 is "123456" and "searchinput" stands for the instance name of the input text field of the form. If other number or no number is entered in the input field you should be taken to scene 3, frame 1.
what's wrong with this code and how I can fix it?
Please help,
daghost
Pd: Previos message about what type of search I want to create:
Imagine scene 1 frame 1 of my movie has a search box (which I don't know how to do) and I have a picture in scene 2 frame 14, another in scene 3 frame 10 and another in scene 4 frame 17.
I want to be able to do a search, let's say, for the number 532 and as a result be taken to the scene and frame where my first picture is (scene 2 frame 14), then if I do a search for the number 568, as a result, be taken to the scene and frame where my second picture is (scene 3 frame 10) and if I do a search for the number 599, as a result, be taken to the scene and frame where my third picture is (scene 4 frame 17). As an addition to this, let's say that I write a number that doesn't exist, I should be taken to an error screen, let's say that this error screen is at scene 5 frame 1.
This way it will work as a search feature to reach a specific scene-frame quickly by doing a search for a specific term (number).
What I need is to know how to create the search box and it's trigger button (including the actions that should be applied)
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 03-28-2003, 04:24 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help Please, Need To Fix A Code For A Search Feature
Hi
What I need is something like a search feature that works like a shortcut to a specifict scene and frame. When I type a number in the input field and the number is related to a specific scene and frame in the code of the button I should be taken to that specific frame in that specific scene.
This is not a database based search.
The wrong code I have is the following (it is the code of the button that triggers the search):
---------------
on (release) {
if (searchinput=123456) {
gotoAndPlay("Scene 2", 1);
} else {
gotoAndPlay("Scene 3", 1);
}
}
---------------
*"searchinput" is the instance name of the input text box
What I'm trying to state with this code is:
On release of the mouse button
if the value entered in the input text box is equal to 123456
go to and play scene 2 frame 1,
else (other value or no value)
go to and play scene 3 frame 1
I think the error is the line that says: if (searchinput=123456) { because I don't know exactly how to state the relation between the value entered in the input text field and the number 123456.
I'm including a file called TestSearchForm.fla, it have what I have done and it may help you figure what I mean.
If you can help me please reply, I really need someone to help me, thanks for your time, bye.
daghost
Search Feature
Does anybody know anything about building a search function in Flash (MX)? is there another/better forum I should ask in?
Search Feature
Helo,
I just discoversdd the serach feature does not work if a text field is in the library. It only workss on fields located on the main stage. Is there a work around?
Ike
Search Feature
Hi
I am going to start on a new Flash web site of more then 1000 products.
My client want search bar where they can search for products.
i have never done this before. Can any one please show me the door to that way.
Appreciate your help
Search Feature And XML List
Hi there,
Ok I have an XML page that contains a ton of links. That list loads into a scroll menu in Flash MX.
Is there a script/way to have a search feature and have the box display only results to that search.
For instance:
User types "Networking", and the text box list filters down to links only containing the word networking?
Thanks
Search Feature Question.
Good day fellows, is it possible in flash that search field will display relevant data in search. Like in google. Every time you type word in the field it will give some sort of pull down menu that is related to your tag. I have attached file for clarify of what im trying to describe.. thanks a lot..
How To Create A Search Feature
Hi, is there anybody that can tell me how to create a search feature to search within a movie.
What I need is how to create the search box and the go button and in what the actions should be for the button.
The action for the go button may be something that means the following: "on release or press the enter key if the value equals to x (value in the search box) go to and play scene y frame y, if value equals to z (value in the search box) go to and play scene w frame w, else go to and play scene v frame v".
I don't know how to do this, please help me, thanks in advance, bye.
daghost
How To Create A SEARCH Feature?
Hi, is there anybody that can tell me how to create a search feature to search within a movie.
What I need is how to create the search box and the go button and in what the actions should be for the button.
The action for the go button may be something that means the following: "on release or press the enter key if the value equals to x (value in the search box) go to and play scene y frame y, if value equals to z (value in the search box) go to and play scene w frame w, else go to and play scene v frame v".
I don't know how to do this, please help me, thanks in advance, bye.
daghost
How Can I Create A SEARCH Feature? Help Please
Hi, is there anybody that can tell me how to create a search feature to search within a movie.
Imagine scene 1 frame 1 of my movie has a search box (which I don't know how to do) and I have a picture in scene 2 frame 14, another in scene 3 frame 10 and another in scene 4 frame 17.
I want to be able to do a search, let's say, for the number 532 and as a result be taken to the scene and frame where my first picture is (scene 2 frame 14), then if I do a search for the number 568, as a result, be taken to the scene and frame where my second picture is (scene 3 frame 10) and if I do a search for the number 599, as a result, be taken to the scene and frame where my third picture is ( scene 4 frame 17). As an addition to this, let's say that I write a number that doesn't exist, I should be taken to an error screen, let's say that this error screen is at scene 5 frame 1.
This way it will work as a search feature to reach a specific scene-frame quickly by doing a search for a specific term (number).
What I need is to know how to create the search box and it's trigger button (including the actions that should be applied)
Hope I explain myself well since I really need the help.
Thanks for your time and I hope I can get help from you.
daghost
How Can I Create A SEARCH Feature? Help Please
Hi, is there anybody that can tell me how to create a search feature to search within a movie?
Imagine scene 1 frame 1 of my movie has a search box (which I don't know how to do) and I have a picture in scene 2 frame 14, another in scene 3 frame 10 and another in scene 4 frame 17.
I want to be able to do a search, let's say, for the number 532 and as a result be taken to the scene and frame where my first picture is (scene 2 frame 14), then if I do a search for the number 568, as a result, be taken to the scene and frame where my second picture is (scene 3 frame 10) and if I do a search for the number 599, as a result, be taken to the scene and frame where my third picture is (scene 4 frame 17). As an addition to this, let's say that I write a number that doesn't exist, I should be taken to an error screen, let's say that this error screen is at scene 5 frame 1.
This way it will work as a search feature to reach a specific scene-frame quickly by doing a search for a specific term (number).
What I need is to know how to create the search box and it's trigger button (including the actions that should be applied)
Hope I explain myself well since I really need the help.
Thanks for your time and I hope I can get help from you.
daghost
How Can I Create A SEARCH Feature? PLEASE HELP ME
Hi, is there anybody that can tell me how to create a search feature to search within a movie?
Imagine scene 1 frame 1 of my movie has a search box (which I don't know how to do) and I have a picture in scene 2 frame 14, another in scene 3 frame 10 and another in scene 4 frame 17.
I want to be able to do a search, let's say, for the number 532 and as a result be taken to the scene and frame where my first picture is (scene 2 frame 14), then if I do a search for the number 568, as a result, be taken to the scene and frame where my second picture is (scene 3 frame 10) and if I do a search for the number 599, as a result, be taken to the scene and frame where my third picture is (scene 4 frame 17). As an addition to this, let's say that I write a number that doesn't exist, I should be taken to an error screen, let's say that this error screen is at scene 5 frame 1.
This way it will work as a search feature to reach a specific scene-frame quickly by doing a search for a specific term (number).
What I need is to know how to create the search box and it's trigger button (including the actions that should be applied)
Iammontoya told me about a book called: The Friends of Ed book for PHP and flash but I don't know how to get it and I need the help the sooner it is possible.
Hope I explain myself well since I really need the help.
Thanks for your time and I hope I can get help from you.
daghost
Creating A SEARCH Feature HELP
Hey guys just wondering if there is a way of setting out a text input box and a go button and using an EXCEL Sheet FULL of data (uk postal codes) to create a search application??? please help ta...
Newly Discovered Search And Replace Feature
I stumbled on this by pure accident. It is also NOT listed anywhere in the manuals or anywhere in the software itself. If you are inside your Actions window and press Ctrl+H a box will appear that does Search and Replace on Actionscript. This comes in handy big time when trying to change alot of Actionscript. Also if you press Ctrl+F it will bring up just a plain Find box. Hope this helps.
Scott Kaczynski
http://www.Bargain-Matinee.com
[F8] Flash Image Gallery With XML And Search Feature
Hello everyone,
Here is my issue: How can i make an image gallery that will give user the ability to search for images based on the info stored in an XML document. This gallery i want to make is to be distributed on cd, so i cannot use php or anything like that. It has to be standalone. I have a script that allows the creation of a dynamic gallery based on data given in a XML document but it does not support search and extended search feature.
Any ideas or suggestions? All answers are highly appreciated.
Thanks for your time,
Best regards,
A.
Text Search Engine With ANDOR Feature
Hi , every body
I want write app with flash the receive string of user and
search string into dynamic/static textbox
but i want search with AND/OR feature,
now How to write this app???
please help to Me
Creating A A Search Feature In A Flash Site.
Anybody know where I should start to look for ideas on how to build a search feature in flash? It will search an xml file for products and display matching results.
Any thoughts>
Zip Code Search
Does any body know how to create a zip code searcher? I want to have a list of addresses in a external text file that can be searched via text box in flash which then displays the appropriate address or addresses in another text box. I don't even know where to begin with the actionscripting of that so If anyone has seen a sample of this, a point in the right direction would be greatly appreciated. Thanks!
Search Code
I'm making a helpfile, I would like to add a search text box where user could type a keyword and it will automatically searches for that word. I'm a newbie in flash, any suggestion on how I can achieve this
Zip Code Search From SWF To ASP Page
Im using Flash MX 2004 and I need help
I have a swf movie with a input text field for a zip code search that results are shown in asp page and sql database
<form method="POST" action="usa/ZipSearchAll.asp">
How do I do this please help
Thank You so much for Help
Zip Code Radius Search
I need help creating a zip code radius search for my friend finder website. I've searched the web and this seems to be the only site that can possible help. I found you last night and guess what 7 hours later I'm still reading...great work my friend. So far I've learned that most of the work is done on the results page and that I need to get a listing of every zip code. I have my search page almost built and I'd love to incorporate this feature. Any help please I am new to macromedia and php but I think I have found the light with you.
Thanx in advance
Search Engine Code
another thing.....
is there any source code where i can embed a stock quotes search engine into my web page using flash 2004? i want it to function like the one on MSN home page. If anyone has any info, let me know. thanx
Search For The Nearest Location By ZIP CODE
Greetings,
I am posting this to find suggestions for creating a flash script that will allow the user to enter their zip code and a potential radius to bring up results of the closest locations...
Thoughts, Suggestions, Rebukes welcome please and Thank You.
JH
Creating A Simple Zip Code Search
Hi all,
I'm not sure where to begin... I want to create a dealer locator for a site I am working on. I was thinking the data could be in an xml file and somehow flash could retreaive the data and display it nicely .....
when a user types a zip code range.
is there something already created, a component, code I could buy/get?
thanks
How To Search For Stage Childs By Code?
Hi,
I have this code:
stage.addChild(m1);
stage.addChild(m2);
stage.addChild(m3);
for each (var j:MovieClip in stage) {
trace(j.name);
}
but it dose not do anything, (I know I must do an if statement but it must trace first then I can search).
anybody can make this code work.
Thanks a lot.
How To Search For Stage Childs By Code?
Hi,
I have this code:
stage.addChild(m1);
stage.addChild(m2);
stage.addChild(m3);
for each (var j:MovieClip in stage) {
trace(j.name);
}
but it dose not do anything, (I know I must do an if statement but it must trace first then I can search).
anybody can make this code work.
Thanks a lot.
Atomz Search - Finding Your Sp-a Code
I think Atomz has made this a little easier since the tutorial on this was written. To get your sp-a code, login to your Atomz account and go to 'Update Search Account Profiel". The sp-a is listed there and can be copied and pasted into your action script as suggested in the tutorial.
Google Code Project Search (AIR App)
Little AIR application that lets you search/browse through Google hosted code projects (Tweener, Popforge, etc. etc.) from the comfort of your desktop..
http://www.onebyonedesign.com/downlo...jectSearch.zip
What Is Wrong With This Code (NaN?)
I am using this code to animate an icon based on the amount of movie downloaded:
tellTarget ("icon") {
frameVar = Math.round((bytesLoaded/bytesTotal)*100);
Trace(frameVar);
gotoAndPlay (frameVar);
The trace command brings back NaN when I use the (frameVar = Math.round((bytesLoaded/bytesTotal)*100) in tell target.
What is this?
What's Wrong With This Code?
This is a preloader I've used time and time again when producing games in Flash 5. This game is made in Flash MX but exports and only uses Flash 5 action scripting.
The first time you go to the URL, when the movie is 100% loaded the movie goes blank. The next time you load it, it successfully goes to the game on the second frame. You can see what I mean at:
http://www.flasharcadia.com/chariot
Here's my code, placed on top of an mc on the first frame of a 2 frame movie:
onClipEvent (enterFrame) {
totalKB = _parent.getBytesTotal()/1024;
loadedKB = _parent.getBytesLoaded()/1024;
exactpercent = (loadedKB/totalKB)*100;
percent = Math.ceil (exactpercent);
perc = percent+"% loaded";
bar._xscale = percent;
if (percent == 100) {
_parent.gotoAndStop ("gameStart");
}
}
Cheers
PS: I'm on a Mac
What Wrong With This Code
here is the code the button 1
on (press, release) {
if (Number(test) == 1) {
test = 0;
} else {
test = 1;
}
}
the MC named test
code
onClipEvent (load) {
if (Number(_root.test) == 1) {
gotoAndPlay("go");
}
}
onClipEvent (enterFrame) {
if (Number(_root.test) == 1) {
gotoAndPlay ("loopframe1");
}
}
What's Wrong With This Code?
When I enter this:
onClipEvent (load){
daTextBox = ".....text.....";
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
}
onClipEvent (enterFrame){
if( frameCounter % speedFactor == 0){
if( scrolling == "up" && daTextBox.scroll > 1){
daTextBox.scroll--;
}
else if( scrolling == "down" && daTextBox.scroll < daTextBox.maxscroll){
daTextBox.scroll++;
}
frameCounter = 0;
}
frameCounter++;
}
What's Wrong With My Code?
Ok. I'm developing a product review section on my site, and ive got a listbox for the products, a dynamic text field for the review, and two pushbuttons (one supposedly opens the product site and the other downloads it.) Right now i am trying to give items in the listbox a url so when u click the "product site" button it opens up the site.
This is the code for the PushButton:
on (release) {
site = list.getSelectedItem().Object;
address = "http://www."+site+".com"
getURL(address)}
For a test I used this code on one of my list entries:
list.addItem("Sample Review", new Object("yahoo"));
Whenever I press the button, it goes to http://www..com and completely ignores the site code.I am a newbie at coding in actionscript and am frustrated, please help.
What's Wrong With This Code?
Hi...i cant subtract the score....anyone?
onClipEvent (enterFrame) {
setProperty ("", _rotation, _rotation + 2);
if (_root.sprayer.launcher.hittest(_root.cursor._x, _root.cursor._y, true)) {
setProperty ("_root.cursor", _x, 130);
setProperty ("_root.cursor", _y, 310);
tellTarget ("_root") {
score = score - 10;
}
}
}
it just makes teh score go "010", "01010" etc.
thanks in advance, sean.
Is There Something Wrong With This Code?
loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
if (loadedBytes >=totalBytes) {
gotoAndPlay("home");
}else{
gotoAndPlay("preloader");
}
It goes to the movie without being fully preloaded.
Am I Using The Wrong Code?
I am having problems with a image scroller i've adapted. It worked ok on it's own on the main timeline, but as soon as I put it within a movie it doesn't run properly. It could be something quite simple that i'm missing.
I'd appreciate it if somebody could take a look.
What's Wrong With This Code?
Code:
for (i=0; i<numOptions-1; i++) {
duplicateMovieClip("_level0.newmenu.buttonMC", "subMenu"+i, i);
menuna = sub[i].attributes.title;
set("_level0.newmenu.subMenu"+i+".menuname", menuna);
subMenu[i].onRollOver = function() {
_level0.isay = sub[i].attributes.over;
setProperty("_level0.imcbaloon", _visible, true);
};
_level0.newmenu[subMenu[i]].onRollOut = function() {
_level0.isay = "";
setProperty("_level0.imcbaloon", _visible, false);
};
_level0.newmenu[subMenu[i]].onPress = function() {
actionscript(sub[i].attributes.click);
};
setProperty("_level0.newmenu.subMenu"+i, _y, optiony);
setProperty("_level0.newmenu.subMenu"+i, _x, optionx);
optiony = optiony+18;
}
the on funcions do not work. everything else seems fine.
What's Wrong With This Code? ---->
Hey guys.
I have my root.swf. I have another clip, pb.swf, that I load into level 2 from the root. I have a button in the root:
Code:
on (release) {
tellTarget ("level_2") {
play();
}
}
Can anyone tell me why this isn't working for me?
Thanks....
Nevermind....got it
Something Wrong With This Code
Hi Guys, Happy New Year!
Need your guys help...there must be something wrong with this code, coz it doesnot work
function onClick(btn) {
calcMonthlyStar = plotMonthly_box.getValue();
checkError();
if (btn == submit_btn) {
if (calcMonthlyStar == true) {
if (gotError == 1) {
gotoAndStop(2);
} else {
gotoAndPlay(3);
}
} else if (calcMonthlyStar == false) {
if (gotError == 1) {
gotoAndStop(2);
} else {
gotoAndPlay("display");
}
} else {
}
} else if (btn == reCalculate_btn) {
initValues();
gotoAndStop("input");
}
}
// check for error
function checkError() {
period = period_box.getSelectedItem().data;
selectedPeriod = period_box.getSelectedIndex();
degree = direction_box.getSelectedItem().data;
selectedDirection = direction_box.getSelectedIndex();
if (period == 0) {
gotError = "1";
}
if (degree == 0) {
gotError = "1";
}
}
period_box and direction_box are ListBox component. plotMonthly_box are CheckBox componet.
Thanks, Niisa
What's Wrong With My Code?
Hi.
I have an XML presentation which needs to work with a menu. Thanks to Jack Frost I'm almost there, but I've hit (another) wall! Here is an overview of my code...
This code is attached to a button, within a movie clip called 'menu':
on (release) {
var /:id = 1;
_root.gotoSlide(/:id);
}
This code is in the root, the function is called by the button above:
function gotoSlide(id) {
for (var a = 0; a<complianceXML.firstChild.childNodes[1].childNodes.length; a++) {
if (complianceXML.firstChild.childNodes[1].childNodes[a].attributes["id"] == id) {
currentTemplate = complianceXML.firstChild.childNodes[1].childNodes[a].childNodes;
trace(complianceXML.firstChild.childNodes[1].childNodes[a].childNodes);
showSlide(currentTemplate);
}
}
}
This is also in the root, called by the function above:
function showSlide(templateNode) {
type = templateNode.attributes.type;
switch (type) {
case "0" :
hideTemplates();
showTemplate1(templateNode);
break;
case "1" :
hideTemplates();
showTemplate2(templateNode);
break;
case "2" :
hideTemplates();
showTemplate3(templateNode);
break;
}
}
Now, when I click my button, the template that I wish to display (referenced by 'id') traces well in the output window, but doesn't display in the player. I have used a similar, allbeit more simpler version of the 'gotoSlide' function called 'gotoNextSlide' which works fine, by changing the variable 'currentTempate' to 'currentTemplate.nextSibling' - I'm sure you Flash genious's out there will know in miliseconds the answer ;-)
Cheers, gryllsie
What Is Wrong With This Code?
it is one frame code and it should preload some swf, but it doesn't
why?? it just go to label "igra" what to do?
stop();
for (i=0;i<_parent.brojKarti;i+=2)
{
_parent.punjenje.b=i;
this.createEmptyMovieClip('konjT'+i,i);
this['konjT'+i].loadMovie('znakovi\'+_parent.poljeGlavno[i]+'.swf','');
this['konjT'+i]._x=i*10;
this['konjT'+i]._alpha=0;
}
_parent.gotoAndStop("igra");
What's Wrong With My Code?
on (release) {
tellTarget ("sdii.swf") {
secondarySP.loadScrollContent("david-picture.swf");
}
}
can any one tell what's wrong here.. it pops up and says can not find target= "sdii.swf".
thanks in advance
What's Wrong With My Code?
Hi I have a problem somewhere in my code here:
I have a movie with 5 Layers and 2 Frames.
In the Actions Layer I have:
myLoop = new Sound(myLoopMc);
myLoop.attachSound("myLoop01");
myLoop.setVolume(myLoopVolume);
myLoopVolume += 10;
MyLoop.start (0,999);
In the Sound Object Layer I have:
this.onEnterFrame = function() {
if(fadeIn01 = 1) {
_root.myLoop.setVolume(myLoopVolume);
myLoopVolume += 10;
if(myLoopVolume > 99) {
fadeIn01 = 0;
_root.myLoop.setVolume(myLoopVolume);
myLoopVolume = 100;
}
}
if(fadeOut01 == 1) {
_root.myLoop.setVolume(myLoopVolume);
myLoopVolume -= 10;
if(myLoopVolume < 5) {
_root.myLoop.stop("myLoop01");
fadeOut01 = 0;
}
}
}
Also in Frame 1 I have a layer called Mute with a button that has this code:
on (press) {
gotoAndPlay(2);
}
on (press) {
fadeOut01 = 1;
}
...and the Frame itself has a stop(); because in Frame 2 I have a UnMute Button with the code:
on (press) {
gotoAndPlay(1);
}
on (press) {
fadeIn01 = 1
}
...and Frame 2 also has a stop(); so that it doesn't go right back to Frame 1.
NOW, the problem is is that when I go to test this myLoop plays and fades in correctly, but for some reason my buttons are not working to fade the music in and out. I actually think only my Mute button is not working because when I click the unmute button it adds myLoop again, which is what it is suppose to do if Mute would have worked correctly in the first place.
Maybe it is the way I started the loop in the first place? I try just using this:
myLoop = new Sound(myLoopMc);
myLoop.attachSound("myLoop01");
myLoop.setVolume(myLoopVolume);
myLoopVolume = 0;
fadeIn01 = 1;
or this:
myLoop = new Sound(myLoopMc);
myLoop.attachSound("myLoop01");
fadeIn01 = 1;
but they don't seem to work either! I am sure that I should be able to set that fadeIn01 = 1; at the first frame and have it work but it is not working.
HELP PLEASE, VERY URGENT!!!
Thanks a lot!
What's Wrong With My Code?
I've got music playing in the first frame of my main timeline. It's linkage is set to "musicloop".
I have an MC, on another layer which is a pop-up menu ("navigation") and within this is a button. On clicking this button I want to set the volume of the music on the first frame of the timeline to "0". Then on the clicking of another button set it to 100.
Here's what I've got, but it's not working:
on (release) {
_root.musicloop.setVolume(0);
}
I'm a TOTAL novice at Actionscript so any help would be great.
Thanks
Wrong Code?
I have two movies communicating with each other. One of them is the main swf and the other loads into a container within the main swf. Okay, the actions I have on the buttons within the "To Be Loaded" movie do not function or work and the movie does nothing when it is cale dinto this container in the main movie? I thought the reason may be that I had a _root call on the buttons function in the "To-Be-Loaded" ovie, and changed it to _parent and even _this, but still nothing works. If anyone can help me out I will provide you with the fla for you to see what I am talking about.
My email is: craigmu@bgnet.bgsu.edu
Thanks
What's Wrong In My Code?
Hi all,
I hope someone sees what I'm not seeing... I am still a bit new to ActionScript, so I can imagin that my code is a bit silly, but even with my simple code, flash gives me a hard time...
I have an external php-script giving back a 2 variables, lowbasket and oldbasketvalue. In lowbasket is which one of my 20 baskets in the lowest, and php automaytically clears that one. I want to animate this clearing-proces, and so I want to countdown the number of items in the basket.
Now in frame 4 I have a line that calls a shim-movie,
loadMovieNum("http://www.mydomain.com/shim.swf?action=emptybasket", 1);
which loads the variables from flash, the variables arrive at level1. After the shimmovie is loaded, I've put a gotoAndPlay(18); and frame 18 is empty, so it can be used to loop from frame 18 to frame 19. In frame 19 is the code below, but every time I click the button in my movie, I see 1 countdown (or sometimes even nothing), and my movie entirely restarts(at frame1... the pre-loader)...
Does anybody see what I'm doing wrong???
if(_level1.oldbasketvalue<>""){
if(_level1.waitvar==""){
_level1[_level1.lowbasket]=_level1.oldbasketvalue;
_level1.waitvar = 1;
}
if(_level1.waitvar=="1"){
_level1.oldbasketvalue--;
_level1[_level1.lowbasket]--;
_level1.outofbasket++;
if(Number(_level1.oldbasketvalue)<1){
_level1.oldbasketvalue="";
_level1.waitvar = 2;
} else {
gotoAndPlay(18);
}
}
} else if((_level1.oldbasketvalue=="")and(Number(_level1. waitvar)==2)){
_level1.waitvar="";
gotoAndPlay(15);
} else {
gotoAndPlay(18);
}
What's Wrong With This Code?
Hello. I've been attempting to create a basic multi-user environment with flash, using at text file and a for loop to check passwords and users. I know it's not very efficient, I just want to see if I can do it. what I'm wondering is, why can't this code tell me that the password is correct, if it is?
code: on (release) {
for (i=1; i<=users.usercount; i++) {
if (field1 == [users.user]+i) {
if (field2 == [users.pass]+i) {
trace("stuff correct");
}
} else {
trace("stuff incorrect");
}
}
}
"users" is the loadvar I'm using.
"usercount" is the max number of users.
field1 is the username field
field2 is the password field
users.pass is the password var(pass1,pass2, etc.)
users.user is the username var(user1,user2, etc.)
Thanks for the help,
Spidy
What's Wrong With My Code?
var n = Math.round(Math.random()*24+1);
var i = 0;
for(i=1; i<25; i++) {
_root["box"+i].onPress = function() {
if (i == n) {
gotoAndPlay(2);
} else {
gotoAndPlay(3);
};
};
};
stop();
Why do I get the 'wrong page' even if it's right? pls compare with the more longwinded version.
What's Wrong With This Code?
Can somebody tell me what is wrong with this code? It just won't work:
if (page == menu0) {
_root.pics.gotoAndPlay("0");
} else if (page == menu1) {
_root.pics.gotoAndPlay("1");
} else if (page == menu2) {
_root.pics.gotoAndPlay("2");
}
the obvious:
- the MC pics IS indeed called/assigned "pics" and IS indeed on the root/level 0
- 0, 1 and 2 are labels (hence the quotes) and the labels exist inside the pics MC
- the variable page exists (I am displaying it inside a dynamic text box showing the value of the page var to make sure it exists)
- menu0 menu1 and menu2 do have variables assigned and one of them is always of same value of the var page
even after all of this it just won't do what it's supposed to do!
the pics MC always stays on the 1st frame (which has a stop in it) and never goes to the other frames...
help please I am pulling my hair out for 3 hours now
|