simple if statement won't execute

FLASH

    Next

  • 1. DateField :: Restrict dates via ASP form :: PLEASE!
    Hi everybody: I need to know if there are a way to restrict the days displayed in a DateField via User interface in an ASP page. I mean, I'm developing a reservation page of an hotel and the client want restrict and unrestrict days related whit the hotel capacity, I think in a Form into an ASP page which some variables, but...... I dont know how to communicate whit the Datefield. Thanks in advance! GVH
  • 2. ?IF? question
    I have a graphic placed on the main stage. I have two buttons (button 1 and button 2). When you click on button 1 first a movie plays and the GRAPHIC changes position (to position B). and then? When you click on button 2 it will play a different movie and the GRAPHIC will stay in position B. I am trying to work it out which ever button you hit first will change the GRAPHIC position. I feel I need an IF statement giving a true or false on the position of the GRAPHIC. If it is true that the GRAPHIC is in position A, then gotoandplay frame2 If it is false that the GRAPHIC is in position A, then gotoandplay frame3
  • 3. change text i streaming MediaPlayBack component
    Hi, If you have worked with the MediaPlayBack, you have noticed that in the progress bar the text says STREAMING or PAUSED......is it possible to change that text?? And how? I have tried to change the "build in as" StreamingMediaConstants.as....but I havent quite understood how they work
  • 4. loading a web page when MC is complete
    Hi; I'm drawing a blank on what's probably a simple transition. I want to insert a small flash movie in a web page. When the movie is done, I want (1) the web page to close and (2) another one to open. How do I get the movie to do these 2 things ? Thanks; Pat
  • 5. Button Script with MX2004 Pro
    I moved up from MX to MX2004 Pro to get Video imports. I have had it one day and cannot code a button- good grief. I have been using flash for perhaps 5 years- even importing coded button from old version does not work right. Where is simple coding button tutorial for this new version. MX had normal and expert mode for coding. Can someone point me to some help here? thanks

simple if statement won't execute

Postby recif20002002@yahoo.fr » Thu, 13 Apr 2006 23:32:28 GMT

Hello

Using a few buttons, I m "creating" a variable of type string. When the
string is equal to 12 or 13 I want the if statement to execute. For
some really bizarre reason, it won't execute.
Thank you for your help

movieClip1_mc._visible = false;
reference_str = null;

firstButton_btn.onRelease = function() {
	if (reference_str == null) {
		reference_str = "1";
		sound.start();
	} else {
		reference_str += "1";
		sound.start();
		trace(reference_str);
	}
}

secondButton_btn.onRelease = function() {
	if (reference_str == null) {
		reference_str = "2";
		sound.start();
	} else {
		reference_str += "2";
		sound.start();
		trace(reference_str);
	}
}

thirdButton_btn.onRelease = function() {
	if (reference_str == null) {
		reference_str = "3";
		sound.start();
	} else {
		reference_str += "3";
		sound.start();
		trace(reference_str);
	}
}

if (reference_str == "12" || reference_str == "13" ) {
	sound2.start();
	trace("sound");
	movieClip1._visible = true;
	movieClip1.play();
}


Re: simple if statement won't execute

Postby recif20002002@yahoo.fr » Fri, 14 Apr 2006 08:09:27 GMT

no one has any idea?


Similar Threads:

1.HELP! Stop() action won't execute

I have a flash movie which plays video files with netstream. It plays the
first movie automatically and also users can click buttons to play the other
movies. The buttons send you to a set of frames which contain a message
telling the user to wait for the video to buffer. I have used the average
buffer time for these movies. After this there is a blank keyframe and then
another blank keyframe containing the "stop();" action. On the first video
the message disappears, yet on all of the other videos the message stays
there indefinitely. Using breakpoints and debug mode I have diagnosed that
the stop action has not executed and this means that this movie plays in the
foreground while the next movie's message is displayed.

Any help as to how I could get the stop() action to execute would be greatly
appreceated.


2.set.RGB and if statement won't work

Hello 

 I have two buttons on stage, and two black (0x000000) MCs. One is with the 
Instance name part1 and the other part2. 

 I want to test if part1 is black, then turn it to green, else, if part1 is a 
bluish color (0x98A5F5), then turn part2 to green. 

 I WILL NOT WORK - I HAVE TRIED EVERYTHING 

 can u please help 

 CODE: - 

 on(release){ 
 if (_root.part1 == 0x000000){ 
 myColor = new Color(_root.part1); 
 myColor.setRGB(0xA5DB84); 

 }else if (_root.part1 == 0x98A5F5){ 
 myColor1 = new Color(_root.part2); 
 myColor1.setRGB(0xA5DB84); 

 } 
 } 

 Thanks 

 Dyl

3.simple IF/ELSE statement question

"arrive" movie clip has text moving to frame 12 - where this cod
occurs

stop();
if(_root.bullets == 232){
	this.gotoAndPlay(14);
}else{
	this.gotoAndPlay(13);
}

frame 14 continues the animation movment - frame 13 has this code
this.gotoAndPlay(12);

basically I am trying to create a loop - 

the movieclip "bullets" is 232 frames long - 

I want the arrive movie clip to look at the bullets movie clip an
check to see when its done so it can proceed to frame 14 to finish. 

basically I want to start playing a movie clip - then stop it and allo
another movie clip on the root level to play completely and then resum
this movie clip.

what am i doing wrong here

4.Simple If statement

Hello i am having problems with a simple if statement.. i have a project with 
some sound, and i have different frames for the content of the project. there 
is a background music, and i made the background music stop on one frame. i 
want the background music to continue when i click on the link for the other 
frames, and i had a mysound.start(); function, but everytime i clicked on a 
link the music started from the begining. i want to make an if function that 
works something like this:

 if mysound = stop, then, play mysound.... else do nothing.    PLEASEEEE HELP 
ME!

5.simple for statement

I want to rewrite this which works great btw :

 if(bar1group == true){
 	barMC_1.gotoAndStop(3);
 	}
 else{
 	barMC_1.gotoAndStop(3);
 	}

 if(bar2group == true){
 	barMC_2.gotoAndStop(3);
 	}
 else{
 	barMC_2.gotoAndStop(1);
 	}
 	
 if(bar3group == true){
 	barMC_3.gotoAndStop(3);
 	}
 else{
 	barMC_3.gotoAndStop(1);
 	}

 if(bar4group == true){
 	barMC_4.gotoAndStop(3);
 	}
 else{
 	barMC_4.gotoAndStop(1);
 	}	

 if(bar5group == true){
 	barMC_5.gotoAndStop(3);
 	}
 else{
 	barMC_5.gotoAndStop(1);
 	}
 	
 if(bar6group == true){
 	barMC_6.gotoAndStop(3);
 	}
 else{
 	barMC_6.gotoAndStop(1);
 	}
 }

 And I'm trying this, which does not work the same way: 

 for(i = 1; i < 7; i++){
 	if(["bar"+i]group == true){
 		["barMC_"+i].gotoAndStop(3);
 	}
 	else{
 		["barMC_"+i].gotoAndStop(1);
 	}
 }
 }

 Can someone tell me what i am doing wrong ? 

6. Some help for a simple condition statement...

7. Simple if - then statement question

8. A Simple Question on the Combination of And / Or statements



Return to FLASH

 

Who is online

Users browsing this forum: No registered users and 64 guest