How Does Flash MX Work In This Conditions?
Here's a simple example.
Main timeline: Layer 1 has AS: box.box2.onRelease = function() { trace("It works"); } Layer 2 has the mc instance box1 named "box1", in which there is, on the:
Box mc timeline is 20f: Layer 1 has on frame 20: stop(); Layer 2 on frame 20 an instance of box2 named "box2".
The only way I got the button to work, was to move box2 mc, to the first frame in the box1 mc, but that's not what I want. box2 _must_ be on the last frame which is stopped.
Here's the example.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 08-02-2005, 10:37 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
My Conditions Don't Work
Flash5:
Alright, here goes. I am a self taught newbie and the world of actionscripts is still over my head. What I am trying to accomplish is to establish conditions. I have two tweens and the first (frames5-20) has a gotoandstop(frame2) and the second tween (frames21-30) has a gotoandstop(frame3). By the way the first frame has a stop in it.
This is my actionscript:
on (rollOver) {if (frame=1) {gotoAndPlay (5)}
else if (frame=2) {gotoAndPlay (21)}
}
The result is: on first rollover, the first tween gets played. Then, the movie stops on frame 2. Yeay! Then the button (if frame=2) should trigger the second tween on rollover; but instead plays the first again. I have tried different fun little variations, but I guess in some way I am not speakin' the same language. Please help. Thanks in advance.
Why Do These Conditions Only Work On Goto?
Okay so I have a button that has this code on it:
on (release) {
section = "part1";
}
and on the main timeline I have this actionscript:
if (section == "part1") {
mask.menu = 1;
} else if (section == "part2") {
mask.menu = 2;
}
stop();
When the button is clicked with section="part1"; attached to it, nothing happens. But if I tell it onclick to go to the timeframe in the maintimeline with the If's on it it will play. What can I do to make this work without having to make it directly go to a timeframe on the timeline to execute the code?
Flash Conditions...very Easy But Not Working
hi,
i have this contact form in flash with various sections in it to fill.
after filling all the sections i have a Send button with this action script on it:
on (release) {
if (nom eq "" or prenom eq "" or adresse eq "" or codepostal eq "" or ville eq "" or telephone eq "" or email eq "" or message eq "") {
stop();
} else {
loadVariablesNum("form.php", 0, "POST");
gotoAndStop(2);
}
}
the problem is that the condition if is not working and its directly going to the gotoAndStop(2) !
is there anything wrong in my code ?
Conditions?
I have a file that I am trying to work out. I have a ball (movie clip with a drag button in it- so that you can click and hold and it drags wherever you what) and a black hole ( movie clip). What I want is, when you drag the ball onto the co-ordinates of hole, it triggers the loading of the next scene.
i guessed that it was the if and else actionscript but i can't figure it out.
if someone could help...
Thanks
Jay
If Conditions
hi, i was wondering if there is a shorter way to code this:
if ((prevTrack == "LD") || (prevTrack == "AD") || (prevTrack == "SD"))
gotoAndPlay(5);
It seems too inefficient to repeat e variable so many times...
thx
Conditions?
hi...this is probably a dumb question, but I've been searching the web forever trying to figure it out and have had no luck, so I'm hoping someone here can help me...
I'm am working on my portfolio website. I have the main movie stage, within which is a movie clip called "current_mc" that is to hold whatever content of my portfolio the viewer wishes to see. I've broken the website into several movies, with different swf files being different parts of my portfolio. The navigation of the website exists as buttons on the main movie stage. When someone releases a button, I want whatever swf file is within "current_mc" clip to close and for a new .swf file to attach and play. My problem is that I have some code within "current_mc" (I want each clip to always close in a certain way) that I want to play whenever someone pushes one of the navigation buttons BEFORE I want the new swf file to load. Does that make sense? What kind of code would I have to write to tell a button on the main stage to play frames 2-10 within "current_mc" before unloading whatever .swf file was there before and loading the new .swf file into "current_mc" and playing? This is some code that someone suggested to me, but I haven't gotten it to work properly yet. For whatever reason the function automatically executes rather than executing only when I click on the button. Any suggestions? Better ideas? Any help would be really appreciated.
// in the movie loaded into "current_mc"
// frame 1:
function playOut() {
gotoAndPlay(2);
}
// frame 10:
stop();
_parent.loadNextFile();
// in the root timeline:
var nextFile_str;
function loadFile(filename_str) {
nextFile_str = filename_str;
if (typeof current_mc.playOut == "function") {
current_mc.playOut();
} else {
loadNextFile();
}
}
function loadNextFile() {
current_mc.loadMovie(nextFile_str);
}
// on the button
on (release) {
loadFile("whatever.swf");
Thanks so much. Feel free to ask me to clarify. I'll do as best as I can.
If Conditions
gud day to you..
i am creating dis memory game...
i put this code on the 1ST FRAME
Code:
stop();
var id:String; //value of card
var selCard1:String; //index for first selected card
var selCard2:String; //index for first selected card
var clickCount:Number = 0; //count number of clicks
i put this inside my 2 MOVIECLIP CARD
CARD1
Code:
on (press) {
id = 'onethird';
_root.clickCount++;
this.gotoAndStop(2);
//check if 2 cards are clicked
if (_root.clickCount == 1) {
selCard1 = id;
trace(selCard1);
} else if (_root.clickCount == 2) {
selCard2 = id;
trace(selCard2);
//check cards
if ((selCard1 == 'onethird') && (selCard2 == 'onethirdPic')) {
trace("MATCH");
} else {
trace("no");
}
}
}
CARD2
Code:
on (press) {
id = 'onethirdPic';
_root.clickCount++;
this.gotoAndStop(2);
//check if 2 cards are clicked
if (_root.clickCount == 1) {
selCard1 = id;
trace( selCard1);
} else if (_root.clickCount == 2) {
selCard2 = id;
trace( selCard2);
//check cards
if ((selCard1 == onethird) && (selCard2 == onethirdPic)) {
trace("MATCH");
} else {
trace("no");
}
}
}
can anyone help me? this codes are working but it can't detect if my selCard1 and selCard2 is Matched.
i'L try to upload my .fla file
thank you in advance...
cheers!
If And Else Conditions
Simple answer i'm sure
I'm writing a function to register which state has been clicked and to do something accordingly using a combo box. I want to add other states behind Wisconsin and Alaska ie "Wisconsin" , "Wyoming" but flash doesn't like this. Is there a easy way to do this or do i have to write else if's for all states?
Thanks in advance.
Here's an ex of the code
function dropdown_check() {
if (drop_down.getValue() == "Wisconsin") {
trace(drop_down.getValue());
_root.p ="stillwagon";
_root.panel.gotoAndPlay("logic1");
} else if (drop_down.getValue() == "Alaska"){
_root.p ="lim";
_root.panel.gotoAndPlay("logic1");
}
}
// Check the status of the dropdown every 10 miliseconds.
setInterval(dropdown_check, 100);
Conditions
iv put in a test to my work which works fine, it makes sure there is a value in each box of an input form, using
if(_root.inputfname.length>0)
and another test which makes sure two boxes are the same text
if(_root.inputpassword==_root.inputconfirm)
does anyone know how i can test that a field contains a certain character using similar code to the above?
[F8] If Conditions
I am wanting to piece together a game i am making using action scripts. I think the best thing to do would be to use IF conditions however am open to suggestions. My problem is i am unsure if what i want to do will work. Hopefully i can explain this well and you might be able to help me out.
My example:
if button 1 & button 2 & button 5 have been hit
go to and stop frame 44
else
go to and stop frame 45
I know this is not worded properly but i feel is easier to explain if anyone can help that will be great.
Thank you
Conditions
I hope someone could help me with this. It seems simple enough, but I'm probably not writing the script properly. I have two timelines:
1. In the first timeline ("actions") there are two keyframes.
The first keyframe:
quote:stop();
x=0
This keyframe just declares the value of x.
The second keyframe:
quote:stop();
if (x=1) {
gotoAndPlay("Poem1",1);
}
else if (x=2) {
gotoAndPlay("Poem2",1);
}
This keyframe is responsible for checking the value of "x" to see which scene it should go to next.
2. In the second timeline ("buttons") there is one keyframes, with two buttons.
The keyframe:
quote:Poem1.onRelease = function() {
x=1;
this.gotoAndPlay(3);
}
Poem2.onRelease = function() {
x=2
this.gotoAndPlay(3);
}
Basically these buttons are responsible for changing the value of x. And once a buttons is chosen, the movie skips to the third frame where it runs it's course until the final frame. The final frame checks the value of x to determine which scene to go to.
Could anyone explain what is wrong with this code? I use Flash MX 2004 version.
Conditions
hi,
can u please tell me what's wrong in the below script:
enter.onRelease = function() {
if (_root.productcode.text == "mining" or "agriculture" or "industry" or "chemical") {
loadMovieNum("test.swf", 0);
} else {
_root.productcode.text = "Enter the proper product code";
}
}
enter is the instance name of the button and product code is the instance name of the text field.
I am able to check with the only first condition, that is mining, when I enter agriculture or industry or chemical, its not checking the condition.
bye,
prathap
Wazzup With My Conditions
Flash5:
Alright, here goes. What I am trying to accomplish is to establish conditions. My first frame has a stop to allow for the button to control my movie. I have two tweens and the first (frames5-20) has a gotoandstop(frame2) and the second tween (frames21-30) has a gotoandstop(frame3).
This is my button's actionscript:
on (rollOver) {if (frame=1) {gotoAndPlay (5)}
else if (frame=2) {gotoAndPlay (21)}
}
The result is: on first rollover, the first tween gets played. Then, the movie stops on frame 2. Yeay! Then the button (if frame=2) should trigger the second tween on rollover; but instead plays the first again. I have tried different fun little variations, but I guess in some way I am not speakin' the same language. Please help. Thanks in advance.
(If needed I can e-mail my fla file)
Variables & Conditions
This is what I got
A simple four shape drag&drop puzzle for the kids
It all works fine I just cant remember how to detect if all DragMC`s are in place
So, when all pieces are placed, the movie will goto the finished seen with ballons, ribbons ,ect ,ect.
Hope I explained this well enuff.
The simple things one forgets
Multiple Conditions - Is This Possible?
Is it possible to have more than one condition on an if statement?
eg. if something is black and if it is 40cm then do the following....
both conditions must be fulfilled before the action can occur.
Can anyone give me the code for this?
Need Conditions For Certain Actions...HELP
here's the deal:
got this rollover thing happening with buttons in my flash movie for a web site. normally, there's a slideshow displaying a few pics, when you rollover the "products" button, the slideshow goes to a pic of products. rollout, and the slideshow continues. when you click it, a menu appears over the image. i want the image and the slideshow to stop when the menu (a separate swf) is open. any ideas??
Trouble With Conditions
Hello All,
I am writing actionscript in Flash MX and have come across a dilemma. I have written the following code:
if(x=upper_bound AND NoLoad=False){}
However, Flash highlights the condition in red which is bad. But if I write the code like this
if(x=upper_boundANDNoLoad=False){}
then Flash likes it but does not work. I believe the problem may be with the "AND" condition. I could not find it anywhere in Flash's script library so I just wrote it in there. Any help on how to incorporate "AND" into conditions would be appreciated.
Thank you,
Steve
MC That Checks Conditions Of Other MCs
I have created three windows that can open horizontally covering the other windows (bluebox0, bluebox1, bluebox2). There are movieclips above them and when you press the movieclip it checks to see if other windows are open or closed (ie if state1 = 0 then bluebox1 is closed, if state1 = 1 bluebox1 is open), and if the window is open it closes the other window, and opens the corisponding window below.
My problem is I want the window to wait until the other window is closed before opening. I tryed to change the code to what I have below, and I quickly found that it locked up the player then repeatedly open and closed the window. I know I am doing something wrong. How can I make this work? Am I approaching this the right way?
Code:
//This part of the code works fine
on (press) {
if (_root.bluebox1.state1 == 1) {
_root.bluebox1.play();
} else {
_root.bluebox1.stop();
}
if (_root.bluebox2.state2 == 1) {
_root.bluebox2.play();
} else {
_root.bluebox2.stop();
}
//This part crashes the player
for (i=0; i<2; i++) {
if (_root.bluebox1.state1 == 0) {
if (_root.bluebox2.state2 == 0) {
_root.bluebox0.swapDepths(2);
_root.bluebox0.play();
i=2
} else {
//still keep going
i=0
}
} else {
i=0
//keep working
}
}
}
RadioButtons And Conditions?
hi, everyone,
I'm fairly new to this, so, please forgive my lack of better terms to describe my question...
I am making a simple game where the viewer goes to talk to 3 individuals(in 3 dif MCs). With each person you talk to, you have to make 1 choice from 2 options (via radioButtons) After the viewer has made the 3 choices, they are taken back to the main stage and they can click on a "GO" button and a movie will be played according to their selections.
According to my calculation, when this baby hits 88 miles per hr, we will see some serious sh%t, no, i am kidding....according to my calculation, there will be nine different outcomes/story lines. So, my question is, how do I do this? Someone told me I gotta use the switch function, which I've never even heard of (and I've never used any flash components neither)...but to give you a better idea of what I'm talking about, here is an example:
If person A says YES, B says YES, C says YES, play movie#1
If Person A says NO, B says YES, C says YES, play movie#2
and so on...
Any help on this will be really great, thanks in advance
Al
Unloading On 2 Conditions
i basic need to unload a movie off of level5, based on two conditions. the first condition i working, but the second condition isn't working for me...here is the setup
i have a window open( which has an 'open' stage and a 'close' stage )on level5. when a button is pressed it unloads and starts whatever that button contains. my script works for when the window is in its 'open' stage but i cannot get it to work when it is in its 'close' stage, which is on frame 27.
my script looks like this:
code:
stop();
_level4.current_selection = "links";
if (_level4.current_selection == "links") {
unloadMovie(5);
} else {
gotoAndStop(27);
_level4.current_selection = "links";
}
this part above works beautifully!!
now i need a script that says:
if on this frame ( which is 27 ), and the links button has been pressed, unload level5. i tried making a variable for this but for some reason my script failed. check it below:
code:
//my variable
_level5.aboutmovie.current_frame = "27";
if (_level5.aboutmovie.current_frame == "27") {
//i guess i should re-address the initial variable about the button
} else if (_level4.current_selection == "links") {
unloadMovie(5);
_level5.aboutmovie.current_frame = "27";
}
please help. thanks
Multiple Conditions
I'm trying to do something only if the mouse is within a certain rectangle area (100x150 area at x,y of 50, 300). Basically if all of the following conditions are true: -
code:
if (_xmouse<200 AND _xmouse>50 AND _ymouse<400 AND _ymouse>300){
//do this
}
But I am well aware this is mere pseudo code and will not work, can anyone offer me the correct syntax to do this?
Thanks
Dan
Multiple Conditions (if And If?)
I need to carry out an action upon three things being true. I am unsure of how to write this code.
The closest i have gotten is as follows:
if (var10 == 1, var3 == 4,7){
_root.sketch.gotoAndPlay(6);
}
if var10 is exactly equal to 1 and var3 is exactly equal to either 4 or 7 I need it to play the sixth frame in movie "sketch."
Can anyone help me? I would greatly appreciate your wisdom.
thanks,
Matthew Praetzel
mpraetzel@rcn.com
Swf Load Conditions Help.
I am a creaive designer for a small company. I need some help with some conditional action script for a site that I will be showing a big client next week.
I am loading swfs into empty MC in my index swf. My question is, is there a way to tell my content swf (or target MC) to load only after the buttons swf & backrounds swf are completed?
When all the animation occurs at once, my concern is it will lack in smoothness.
Any help is greatly appreciated, & thanks
-pk
Conditions Problem
Hi everyone,
I'm trying to set a variable "click"
When the variable click = 0 then goto Frame(x) and play
if click = 1 then goto Frame(y) and play
Just trying to open and close a menu
It doesn't work
Please take a look at the .fla
Thanks
HELP Outputs With Conditions...
i've been having some problems scripting a part of my video game....
It's a Drag and Drop exercise....
You have 5 objects to drop on 5 other pictures... You have 5 dynamic boxes on top of each picture...
if you drop one of the objects on the correct picture... the dynamic box on top of that pic will show "correct"
if you drop one of the objects on the wrong picture... the dynamic box on top of that pic will show "wrong"
i want to script it in a way that if the 5 outputs, the dynamic boxes, show "correct"... i want it to jump to another frame (53)...
I tried to scipted many times ... it didn't work.... the thing works perfectly, but when the 5 outputs show "correct", nothing happens!
Can you please tell me how to scipt it based on these tries? :
if(_root.output1 == "correct", _root.output2 == "correct", _root.output3 == "correct", _root.output4 == "correct", _root.output5 == "correct"){
_root.gotoAndStop(53);
}
OR
if(
_root.output1 == "correct";
_root.output2 == "correct";
_root.output3 == "correct";
_root.output4 == "correct";
_root.output5 == "correct";
){
_root.gotoAndStop(53);
}
OR
if((_root.output1 == "correct")and(_root.output2 == "correct")and(_root.output3 == "correct")and(_root.output4 == "correct")and(_root.output5 == "correct")){
gotoAndStop(53);
}
OR
if((_root.output1 == "correct")|(_root.output2 == "correct")|(_root.output3 == "correct")|(_root.output4 == "correct")|(_root.output5 == "correct")){
_root.gotoAndStop(53);
}
Thanks a lot,
Marc
ps: i never used the command >>AND... didn't know if we represent it with "," or "|" or...
Not When ONLY BOTH Conditions Are True?
Hey,
I was wondering if the folowing is possible with just a normal if-action:
Code:
1. if(Key.isDown(Key.SPACE)){
2. if(varOne == 4 && varTwo == 6){
3. } else {
4. //--Perform code---
5. }
6. }
As you can see, in line 2, I'mn first testing if both conditions are true. If this is the case it does nothing. When one of the conditions is false it will execute the code starting at line 4.
Why don't you just use an != (not equal) you're thinking? Well, this is why:
Code:
1. if(Key.isDown(Key.SPACE)){
2. if(varOne != 4 && varTwo != 6){
3. //--Perform code---
4. }
5. }
This will ONLY perform the code when BOTH conditions are true. But I want to execute the code when ONE or NONE are true.
So, now my question, is there a code that can fix this?
Multiple Conditions
what code do i need if i have multiple conditions? i've tried
if (condition1, condition2, condition3)
but if condition3 is met before condition1 or 2, it completes the statement anyway. is there another way?
Help Using Double Conditions?
Hi all,
I'm building a form with required fields using the if else statements. But now i have arrived at a part that needs a double statement. This is the script i'm using:
Code:
else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1)
{
this.error = "Vul een geldig email adres in.";
}
else if (this.Bedrijf.getSelectedItem().label == "Anders, namelijk..."){
if (!this.AndersBranche.length){
this.error = "Vul uw branche in.";
}
}
else
{
versturen();
}
}
OK, the first part is to check if the email adres is ok. No problems there.
this.Bedrijf.getSelectedItem().label == "Anders, namelijk..." is refering to the combobox called Bedrijf which has a label "Anders, namelijk...".
What i want to do is when they select this label the input field below it, called "AndersBranche", is required to fill in.
Because i'm using a double if statement it seems AS get stuck there and does not continue to the rest of my script.
When i fill in everything correctly the script works fine. When i forgot to fill in the input field "AndersBranche" after selecting the label "Anders, namelijk" i get the error message but stays there even if i fill in something.
versturen(); is refering to a function containing the send script.
Are there any ways to make this work?
If you need the full code let me know, i'll post it. I posted it before but because my code is sooo long nobody takes the time to take a look at it.
Thanx in advance!
[F8] Multiple Conditions?
Is it possible to put more than one condition in a conditional statement? I have tried and failed with an "if" statement, but I need something similar; only with two conditions. Any help would be much appreciated.
[F8] Conditions Check
Hello to everyone!
I am learning now and trying to react that mc(button) in this way:
on MouseDown it loads external swf into dum and plays.
Then when it down it load it again. This is not what I intend it to do. I do realize ther should be some condition check but I cannot find any clear sample to learn from.
please any ideas.
piktograf
code now:
this.cl1.onRollOver = function() {
cl1.gotoAndPlay("_over");
}
this.cl1.onRollOut = function() {
cl1.gotoAndPlay("_out");
cl1.onRelease = function(){
loadMovie("top_1.swf", _parent.dum);
}
Multiple Conditions
is there anyway that i can check for two multiple conditions, such as a hitTest and a varbile equaling a certain number?
Help With Time Conditions
Hello everybody...
I found this count down on the web and I would like to tell the count down that when count down get to second X, to show/visible a hidden movie clip on the stage...
Can anybody help me?
Here's the code I found:
There are 2 dynamic texts on the stage "count" and "countdown"
start_time = getTimer();
countdown = 3600000;
onEnterFrame = function () {
elapsed_time = getTimer()-start_time;
_root.count.text = time_to_string(elapsed_time);
_root.count_down.text = time_to_string(_root.countdown-elapsed_time);
};
function time_to_string(time_to_convert) {
elapsed_hours = Math.floor(time_to_convert/3600000);
remaining = time_to_convert-(elapsed_hours*3600000);
elapsed_minutes = Math.floor(remaining/60000);
remaining = remaining-(elapsed_minutes*60000);
elapsed_seconds = Math.floor(remaining/1000);
remaining = remaining-(elapsed_seconds*1000);
elapsed_fs = Math.floor(remaining/10);
if (elapsed_hours<10) {
hours = "0"+elapsed_hours.toString();
} else {
hours = elapsed_hours.toString();
}
if (elapsed_minutes<10) {
minutes = "0"+elapsed_minutes.toString();
} else {
minutes = elapsed_minutes.toString();
}
if (elapsed_seconds<10) {
seconds = "0"+elapsed_seconds.toString();
} else {
seconds = elapsed_seconds.toString();
}
if (elapsed_fs<10) {
hundredths = "0"+elapsed_fs.toString();
} else {
hundredths = elapsed_fs.toString();
}
return hours+":"+minutes+":"+seconds+":"+hundredths;
}
If Then With Multiple Conditions
I'm making a flash game. This code does not work for me. Does anyone know what is wrong?
onClipEvent (enterFrame) {
if ((key.isdown(key.LEFT)) || (key.isdown(key.RIGHT))) {
this._visible = false;
} else {
this._visible = true;
}
}
Combining Two Conditions With The &&
Hello! I am trying to create a loop that checks to see if two conditions are being met at the same time ... if they are being met at the same time ... then I want it to send a particular MC to a particular frame.
Here is the AS I am currently using ... is this sufficient for what I want to do? As of right now ... I don't think it is checking for BOTH conditions to be true ... I think that if the first is true ... it just skips over the second and executes the following line ... but I want it to wait until BOTH conditions are true ... and THEN execute. I hope this is clear enough! Thanks so much for your patience and time with this!
Code:
onClipEvent (enterFrame) {
if ((_root.iPod_mc.CONTENT_mc.TRACKS_mc._currentframe == 4) && (_global.isPlaying == 1)) {
_root.iPod_mc.CONTENT_mc.iPod_CNTRL_BTNS_mc.iPod_PLAY_4_mc.gotoAndStop(2);
} else {
if ((_root.iPod_mc.CONTENT_mc.TRACKS_mc._currentframe == 4) && (_global.isPlaying == 2)) {
_root.iPod_mc.CONTENT_mc.iPod_CNTRL_BTNS_mc.iPod_PLAY_4_mc.gotoAndStop(3);
}
}
}
Sincerely,
Brian Griffith
Two Conditions In A Function
what is the syntax to write?
and how can i structure the code if there're two conditions to fultil in a function?
i've got this , but it don't seem to work.
PHP Code:
function theFunction() {
xxx.onEnterFrame = function() {
a?b:c;
d?e:f;
};
}
Double Conditions
In plain English please...
I need the coding for multiple conditions in the expressions. This is what I mean.
onClipEvent(enterFrame){
if(Key.isdown(Key.SPACE)) (this._x=_example._x) {this._y=example._y}
The underlined part is what I need help with. How do I put the two first parts together for the second part to be true for both part one and two......HELP!
Check For Two Conditions
Major brain-fart here.... been doing a bunch of .net stuff lately and am forgetting syntax...
If I want to check 2 conditions, how do I string them together? This obviously doesn't work...
------
if (my_label1.text == ('Aetna Open Access 1.0')) & (my_label2.text >= Number(1) {
my_label3.text = true;
--------
thanks!
Unloading On 2 Conditions
i basic need to unload a movie off of level5, based on two conditions. the first condition i working, but the second condition isn't working for me...here is the setup
i have a window open( which has an 'open' stage and a 'close' stage )on level5. when a button is pressed it unloads and starts whatever that button contains. my script works for when the window is in its 'open' stage but i cannot get it to work when it is in its 'close' stage, which is on frame 27.
my script looks like this:
ActionScript Code:
stop();_level4.current_selection = "links";if (_level4.current_selection == "links") {unloadMovie(5);} else {gotoAndStop(27);_level4.current_selection = "links";}
this part above works beautifully!!
now i need a script that says:
if on this frame ( which is 27 ), and the links button has been pressed, unload level5. i tried making a variable for this but for some reason my script failed. check it below:
ActionScript Code:
//my variable_level5.aboutmovie.current_frame = "27";if (_level5.aboutmovie.current_frame == "27") {//i guess i should re-address the initial variable about the button} else if (_level4.current_selection == "links") {unloadMovie(5);_level5.aboutmovie.current_frame = "27";}
please help. thanks
Multiple Conditions
Ok, I am new to Flash and this is my first big project at work:
I am creating a training to test meter readers. As the assessment part, there will be an 4 input boxes where the user puts in the reading they got (1 digit per box). When they hit a button on the bottom (or hit "Enter") it checks to see if they got the right reading. If they did, a text box will show "Correct." If they didn't, the text box will show "Incorrect" and the correct number will appear above the ones they got wrong.
My problem is:
1) I am not sure how to make it so when they hit the button, it will check all the input boxes to see if they are right, thus showing a Correct or Incorrect.
2) I am not sure how to have the correct number appear, if they missed just that particular one.
Suggestions?? No fla for this one, just trying to plan out the AS so when I build it, I do it right.
If (multiple Conditions?) {
I've got a zoomable map within a frame, and of course I don't want it to be dragged out of view, right?
So, how do I set the startDrag (L,T,R,B) parameters when it's a different size when it's enlarged (zoomed)?
Would it be advisable to somehow set multiple conditions to do something like this? (if so, how would I do it?)
if ( between Size>100 AND Size<200) {
startDrag(this, false,400,150,600,250);
}
if ( between Size>200 AND Size<400) {
startDrag(this, false,500,250,500,150);
}
Would it be advisable to do something like that? If so, how would I code it?
If not, what would be a better idea?
...I swear, adding this zoom feature added a whole level of complexity to this map that I've never imagined. PLEASE HELP!
ThanX!
How To Add More Conditions To A If Then... Ill Explain... HELP
Ok here is the problem... I have this code:
ActionScript Code:
onClipEvent (enterFrame) { if (this.hitTest(_root._xmouse, _root._ymouse, true)) { } else { this.gotoAndStop(1); _root.SUB.gotoAndStop(1); }}
The thing is I want to make it so it checks to see if my mouse is over the button (which the code i have already does) and ALSO checks to make sure a movieclip is on frame one.
So it would be something like:
ActionScript Code:
onClipEvent (enterFrame) { if (this.hitTest(_root._xmouse, _root._ymouse, true) and MovieClip is on Frame 1) { } else { this.gotoAndStop(1); _root.SUB.gotoAndStop(1); }}
of course that isn't proper action script but i am tyring to get my question across... THank you very much.
Mike
Working With Conditions.. Please HELP
Hello guys,
Can anybody here who can help me out on how to figure out this problem. I'm really on the state of "saturated brain" right now.. huhuhu... please help.
Okay here's the problem:
Say for example I have 4 label names namely "label_01", "label_02", "label_03", and "label_04". What should be the the easiest way to do if I will only play "lable_01" and "label_03"? or "label_01", "label_03", and "label_04"? or all the 4 labels?
Any ideas? I need you help guys...
If Statement With Two Conditions
if(description_1 = "HELLO" && date_1 = 1981){
do Crap()
}else{
your crap
}
does any one know the correct syntax/method for this type of statement?
if( A=a & B=b) we are in business
cheers
Stupid Me (If Conditions)
In my If Conditions
testvar >= 1800 && <= 2000 (testvar is larger than 1800 but smaller than 2000) is not working in my condition how do i write this correct ??
I am a bit blocked in my head today ... sorry for this but i need it
cheers
ChromeD
HELP : Problems With Conditions?
Hello,
I learned a few AS a week ago which involves variables, but this one I have in mind is too much for my little knowledge I guess.
In this example: http://www.allanrestauro.com/downloa.../interface.swf
I wanted that when you hover on the 1st photo, that details would show (current state) and when you hover on the next photo, it will first return the original state of the first photo before showing the details for the 2nd photo. So as for the 3rd photo.
Any actionscript for this one?
Thanks,
Allan
Multiple Conditions
Hi,
does anyone know how to do an if statement that will only work if all conditions are met?
for example, I have been using this code
if ((condition1) || (condition2) ){
} else {
}
in this case it only checks to see if one or the other is fulfilled. Is there a way to make it check that both condition1 and condition2 are fulfilled before it does it's stuff?
Any help would be greatly appreciated.
Thanks
Unloading On 2 Conditions
i basic need to unload a movie off of level5, based on two conditions. the first condition i working, but the second condition isn't working for me...here is the setup
i have a window open( which has an 'open' stage and a 'close' stage )on level5. when a button is pressed it unloads and starts whatever that button contains. my script works for when the window is in its 'open' stage but i cannot get it to work when it is in its 'close' stage, which is on frame 27.
my script looks like this:
ActionScript Code:
stop();_level4.current_selection = "links";if (_level4.current_selection == "links") {unloadMovie(5);} else {gotoAndStop(27);_level4.current_selection = "links";}
this part above works beautifully!!
now i need a script that says:
if on this frame ( which is 27 ), and the links button has been pressed, unload level5. i tried making a variable for this but for some reason my script failed. check it below:
ActionScript Code:
//my variable_level5.aboutmovie.current_frame = "27";if (_level5.aboutmovie.current_frame == "27") {//i guess i should re-address the initial variable about the button} else if (_level4.current_selection == "links") {unloadMovie(5);_level5.aboutmovie.current_frame = "27";}
please help. thanks
|