Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Question About Condition---beginner



i hope somebody ...can help?!here is the problem:--it's about a movie clip called mc.--and the mc makes a very smooth alpha function from 100----to 0. OK . Now i want that if he is totaly invisible....to go automatically to a new label(called as)---and never less before)Here is what i try to do , but is not working...because when i give a condition like --if(ali=0)..it is working...but the smothness isn't visible...He just jump to the label...OK THANX.stop();ali=100;onEnterFrame=function(){ mc._alpha=mc._alpha+(ali-mc._alpha)/7} mc.onPress= function (){ali=0; if(ali=0){ gotoAndStop("as") } }



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 11-15-2004, 12:19 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Question About Condition---beginner
i hope somebody ...can help?!
here is the problem:--it's about a movie clip called mc.--and the mc makes a very smooth alpha function from 100----to 0. OK . Now i want that if he is totaly invisible....to go automatically to a new label(called as)---and never less before)Here is what i try to do , but is not working...because when i give a condition like --if(ali=0)..it is working...but the smothness isn't visible...
He just jump to the label...OK THANX.
stop();
ali=100;
onEnterFrame=function(){
mc._alpha=mc._alpha+(ali-mc._alpha)/7}
mc.onPress= function (){
ali=0;
if(ali=0){
gotoAndStop("as")
}
}

Is This Possible? Mouse Movement As A Condition For A "if Condition Statement"
Hi. Does anyone know if it is possible to use mouse movement for a condition statement.
something like this.

if (detectsmousemovement){
some actions
}


how do i go about this? any help? thanks

If Condition ?
I done Flash but don't know much about ActionScript please can you tell me how if condition works ? As an example also Thanx. For example we want to if text is = "Hello" Then Unload movie.

Condition's
how do u cancel a condition after it has been set?

Condition....
Hi guys,

I'm using the next script:


Code:
if (_root.result="nee")
{
this.gotoAndStop("Error");
}
else if(_root.result="ja")
{
this.gotoAndStop("Succes");
}


But my variable result is always "nee". Even when I log in right. I know that the right id is known by flash, because I made a variable "url", which is displayed. What am I doing wrong? I tried ==, but this doesn't work either. Variable result is coming from a php-file:


PHP Code:




<?php
        session_start();
        include ("inc_connect.php");
        $username = $_POST["username"];
        $wachtwoord = $_POST["wachtwoord"];
        $query = "SELECT * FROM fotos WHERE user ='$username'";
        $result = mysql_query($query, $db);
        
        while (list($id, $user, $pass, $foto) =
        mysql_fetch_row($result)){
        
        if ($username == $user && $wachtwoord == $pass)
        {            
             print "&resultaat=ja";
             print "&url=$foto";
             $_SESSION["foto"] = $foto;
        }
        else
        {
             print "&result=nee";
             print "&error=" . urlencode("U heeft een verkeerde gebruikersnaam en/of wachtwoord ingetypt.");
             $_SESSION["username"] = $username;
             $_SESSION["wachtwoord"] = $wachtwoord;
        }
    }
?>

Help Regarding Using IF/Condition
Hi there,
How can I place a check/condition that if a ww movie is loaded in a xx movie clip then disable yy button, keeping in mind the yy button is in another movie cilp called zz???

I would really appreciate your help. I hope didn't make it difficult enough!!!!

Once Condition Is Met... Do Something...
I am fairly new to actionscript.

In the attached file I have made a background for my site. It will contian buttons that when pressed will cause the background to "slide". I have got this far but now I am stuck.

When the background is finished sliding into place. I want to load an external swf. What code do I use to get my movie to listen for a condition to be met so that it will load a different movie depending on what the background/button is?

For an example for what I am trying to do, ckeck out http://www.hotmatchcustomcycles.com

Thanks in advance.

Oh, by the way. In Actionscript 1 what is a "/:" ? What replaced it in AS2?

Using Condition
Hi there I've got _mc button named title_bg and three functions defining up,down and pressed mode this all works great but i'd like to disable the RollOut function when the _mc is pressed or in other words on frame 11.
here is the code i've got and i think i need to add a condition statement inside the onRelease function but i'm not sure how to go about with frames, any ideas?

here is my code:


title_bg.onRollOver = function(){
title_bg.gotoAndPlay(2); }

title_bg.onRollOut = function(){
title_bg.gotoAndPlay(6); }

title_bg.onRelease = function(){
title_bg.gotoAndStop(11);}

Condition
Hello,


I want know where can I find in action script

condition where can put it .... and I want know what mean dir1


Code:
onClipEvent (enterFrame)
{
if (this.hitTest(_root.ball.alt_hit))
{
_root.y_dir1 = _root.y_dir1 * -1;
_root.wallcrash_sound.start();
_root.wallcrash_sound.setVolume(50);
} // end if
}
bye
broken heart

If Condition
Ok I'm pretty new to AS

I know how to do this in other codes, but..

if (condition1=true) AND (condition2=true) then...

How do you do this in AS?

If Condition
ok does anyone know or can link me to a right tutorial on to set time condition:

i.e. if system idle for certain time it wil play certain MC or load certain swf.

please anyone.


thank you

Condition
hi guys

here is the deal. i have made two swf file, where i am calling the one swf to another main swf file.

1st it loads the movie to the main swf file, but when i reclick on that button and again it loads that 1st swf to main swf. this keeps on going loading as keeps u pressing that buton which loads the one swf file to main swf.

i am trying to do is once the one.swf is loaded than no matter how many time u click on that button it will not reload the one.swf. it should load once only to "stage main swf"

i used this script

on (release) {
loadMovieNum("one.swf", 1);
}


but after how do i add the condition for the no more reload.??????????????

If Condition
Ok I'm pretty new to AS

I know how to do this in other codes, but..

if (condition1=true) AND (condition2=true) then...

How do you do this in AS?

FMX AS[2]: Condition Ignored?
I have used this format many times with no problems until now.

Simply, if a condition is met--in this case if step is found inside the array, I would like to throw a trace to the output window.
If i convert "step" to an input field it works.
But even if I hard code the the step value say to "3" it will not??
Is there somethng new about MX2004 that I should be doing?

Thanks


fnext =function(){
//INT
varray = new Array(3,4,5);
vtofile = "contents/screen";
step = onestep+=1; //int ard 2
ext = ".swf";

//loop conD search
for(i=0; i<=varray.length; i++)
if("3"==varray[i]){
trace("onestep= "+onestep);
//--concat
}

More Than On Condition
Alright this is my crack head way of doing this. I have several buttons that when turned on or off will communicate either true or false variables. When you turn on the right combination you hit another button that will check and then depending on the combo you input it should take you to the next scene or a try again. But the script I made is crashing my flash. Can anyone help me out?

on (release) {
if (btn1 == true && btn2 == false && btn3 == true && btn4 == true && btn5 == false) {
gotoAndPlay("open");
} else {
gotoAndPlay("tryAgain");
}
}

Action/condition-help
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.

LoadMovie When Condition Is Met
I need some advice on the best way to use a function to detect a clip's position while it is moving, and execute a loadMovie to a target when the desired _y position is reached.

I have a function on the timeline and movie clips with onClipEvents on each keyframe (or 'page' in the context of the site) that call this function. The clips pass a variable to the function which is supposed to determine the right content movie to load when the condition is met:

onClipEvent (load) {
category = "home";
_root.moveMe(category);
}

Function moveMe itself looks like this:

function moveme(category) {

currenty = getProperty("_root.presentation", _y);
speed = 5
toLoad = category;
if (toLoad == "home") {
if (currenty<20 && currenty>-20) {
loadMovie ("home.swf", "_root.content");
}
}
else if (toLoad == "biography") {
if (currenty<-321 && currenty>-361) {
loadMovie ("biography.swf", "_root.content");
}
}
else if (toLoad == "bookings") {
if (currenty<-662 && currenty>-702) {
loadMovie ("bookings.swf", "_root.content");
}
}
else if (toLoad == "contact") {
if (currenty<-1000 && currenty>-1043) {
loadMovie ("contact.swf", "_root.content");
}
}
else if (toLoad == "discography") {
if (currenty<-1344 && currenty>-1384) {
loadMovie ("discography.swf", "_root.content");
}
}
else if (toLoad == "journal") {
if (currenty<-1685 && currenty>-1725) {
loadMovie ("journal.swf", "_root.content");
}
}
else if (toLoad == "tracks") {
if (currenty<-2026 && currenty>-2066) {
loadMovie ("tracks.swf", "_root.content");
}
}
}

Problem: the function seems to be loading the wrong pages when it's called. It doesn't wait for the sliding clip to reach the desired _y position before loading the movies. When the sliding clip reaches the desired position, the movies that are loaded will disappear and there will be nothing loaded. It looks like the function is doing this when the sliding clip reaches the desired _y position for each possibility in the logic.

Do I need a for loop?

What's happening? I'm at my wit's end!!!!

Check Condition
I have a movie where clip 2 is loaded at a certain point in clip 1. what I would like to do is evaluate a variable and return to clip 1 if true or play a specific frame in clip 2 if false. I have defined an array and associated values (0) in clip 1, and reassign the values at in certain frames in clip 2 when they are reached. an if statement on the first frame of clip 2 does the evaluation.

my thoughts were if the value = 0 then gotoandplay a label in chip 2 and reset the value to 1. the next time through the value would = 1 (unless reset in a different frame) and a gotoandplay frame x in clip 1 would happen. it doesn't, bad logic. any ideas?

Need If Condition To End This Game
Hi everyone

I am very new to flash action script envioment some how with tutorials on this site i am trying to develop a game

and i need if and else condition to end this game.
if lives=0
goToandStop("gameover",1) or something like that.

can anyone help me out in this.
plz ignore dirty look and feel for the game.

Thanks.

ref.fla @
http://www.geocitites.com/bhupha/game.fla

If With Multiple Condition... && &&
I have to preload several level, so I put a stop action on each on the first frame and from the master level I check if they are entirely loaded, so if yes, jump t frame 5 who told each level, start... NOT WORKING...

Can you help me!

This is the frame sequences:

Frame 1:

loadMovieNum("menu.swf", 21);
loadMovieNum("fond.swf", 2);
loadMovieNum("accueil.swf", 19);



Frame2:

if (_level2.bytesloaded>0&&_level2.bytesloaded==_leve l2.bytestotal&&_level21.bytesloaded>0&&_level21.by tesloaded==_level21.bytestotal&&_level19.bytesload ed>0&&_level19.bytesloaded==_level19.bytestotal) {
gotoAndPlay(5);
}

Frame3:
gotoAndPlay(2);

Frame5:

with (_level2 && _level21 && _leve19l) {
play();
}
stop();

Inserting A Condition
getSelection = new Object();
getSelection.onSetFocus = function(oldSel, newSel) {
if (_root.mousePosY>100) {
trace("OVER 100");
_global.lastSel = oldSel;
_global.thisSel = newSel;
_root.lastSel = oldSel;
_root.thisSel = newSel;
}
};
Selection.addListener(getSelection);


With the code above I want to restrict when the code runs depending on the y mouse position. The if condition needs to determine whether Selection.addListener(getSelection); runs I don't seem to be able to add a condition to it!?

Can anyone help me
cheers
Ol
Selection.addListener(getSelection);

Switch Condition
I'm a new member here.
Just want to say hi!

I have a question concerning the switch statement.
I would like to actually use a condition for the cases.

That's what I wanna do:

switch(this._x){
case (this._x >= 620)
trace ("Your x position is over 620);
break;
case (this._x <= 0)
trace ("blabla");
}

Any help?
Thanks !

Easing / Condition
im trying to use some easing/resizing effect on my site. Once u click thebutton the object on the stage smoothly change it's size and the content will load in or attache in to it. The thing is that i want my content wait until the object reach a certain size. To do that im trying following solution:

aboutAtt = function() {
var size = _root.squere._width;
if (size >= 300) {
_root.attacheMovieClip("aboutContent", "aboutContent",2);
}

_root.aboutButton.onRelease = function() {
easingsq = 340; //that's for resizing...
aboutAtt(); // calling the function to attache a content
}

OK, that works fine, i mean it checks if the object reach 300px and than attache mc, but the only problem is that i have to click the buttton twice, otherwise it wont attache...

Please help!

Wirte Condition
I have 14 clips on the stage

is possible to write some condition for this simplier?

the name of mcs is jewish_point_01,..., jewish_point_14

it works but, if i need to handle 100 of mcs?

it must exist some better solution


Code:
//check box handler function **start**
function setMapVisibility() {
trace("fn setMapVisibility called!");
checkBox1_value = jewish_point_chBox.getValue();
trace("checkBox1_value = "+checkBox1_value);
if (checkBox1_value == true) {
this.mainMap.map.pan.jewish_point_01._visible = true;
this.mainMap.map.pan.jewish_point_02._visible = true;
this.mainMap.map.pan.jewish_point_03._visible = true;
this.mainMap.map.pan.jewish_point_04._visible = true;
this.mainMap.map.pan.jewish_point_05._visible = true;
this.mainMap.map.pan.jewish_point_06._visible = true;
this.mainMap.map.pan.jewish_point_07._visible = true;
this.mainMap.map.pan.jewish_point_08._visible = true;
this.mainMap.map.pan.jewish_point_09._visible = true;
this.mainMap.map.pan.jewish_point_10._visible = true;
this.mainMap.map.pan.jewish_point_11._visible = true;
this.mainMap.map.pan.jewish_point_12._visible = true;
this.mainMap.map.pan.jewish_point_13._visible = true;
this.mainMap.map.pan.jewish_point_14._visible = true;
} else {
this.mainMap.map.pan.jewish_point_01._visible = false;
this.mainMap.map.pan.jewish_point_02._visible = false;
this.mainMap.map.pan.jewish_point_03._visible = false;
this.mainMap.map.pan.jewish_point_04._visible = false;
this.mainMap.map.pan.jewish_point_05._visible = false;
this.mainMap.map.pan.jewish_point_06._visible = false;
this.mainMap.map.pan.jewish_point_07._visible = false;
this.mainMap.map.pan.jewish_point_08._visible = false;
this.mainMap.map.pan.jewish_point_09._visible = false;
this.mainMap.map.pan.jewish_point_10._visible = false;
this.mainMap.map.pan.jewish_point_11._visible = false;
this.mainMap.map.pan.jewish_point_12._visible = false;
this.mainMap.map.pan.jewish_point_13._visible = false;
this.mainMap.map.pan.jewish_point_14._visible = false;
}
}

Condition Statment Ignored?
Hello,


I'm attempting to cycle through an array one value at a time a display each resule in a field "field1"
This part of the code functions ok.

My problem arise when I test for a condition in field1 or field2.
The condition statments are totally ignored?


//INT
//cycle through array
var step=0;
var varray = new Array("start",1,2,3,4,5);
var field2 = 4;

function fstep(){
step+=1;
trace(step);
//loop array[step]
for(i=0; i<=varray.length; i++){

if(step>=varray[i]){
trace("varray=" +varray[step]);
field1=varray[step];
break;


//Condition statement ignored???

//if exceed array last value do the following...
if(field2>=4){
trace("page number exceeded!");
field2="test";//or last value in array
}
}
}
}


Or better yet, does someone have better method to cycle throuhg an array?

iaustin

Array And Condition
Hi,
i got a problem using some arrays in combination
with an if- condition.
I wanted to make a lo-budget search possibility
by making 4 arrays like this

bauContainer = new array("bauen","wohnen","ziegel",....);
and tried to combine it with that on-handler Code.

on (release, keyPress "<Enter>") {
if (suchFeld == bauContainer) {
suchFeld = " Thema Bauen";
} else if (suchFeld==wohnContainer) {
suchFeld = "Thema Wohnen";
} else {
suchFeld = " Kein Suchergebnis";
}
}
but it doesn't work where is the problem.
Do I have to put a variable as a transferer?
trhanks flo

'if Else' Condition Not Working
Actionscript 2
Flash MX 2004

Hi there

Ive got buttons on the main timeline that set a variable to determine what text appears 10 frames later after a transition animations.

The button code is
<code>
on (release) {
gotoAndPlay("OUT");
var initial=1;
}
</code>

The other buttons set the var initial to 2,3,4,5 etc.

At frame label OUT the code is...
<code>
if (initial=1){
header.text=this.newsVar;
subheader.text=this.newsSection_1;
maintextnoscroll.text=this.newsSection_1_maintextV ar;
imagemc.loadMovie("images/lewisnews.jpg");
} else if (initial=2){
header.text=this.aboutusVar;
subheader.text=this.aboutusSection_1;
maintextnoscroll.text=this.aboutusSection_1_mainte xtVar;
imagemc.loadMovie("images/history.jpg");
} else if (initial=3){
header.text=this.servicesVar;
subheader.text=this.servicesSection_1;
maintextnoscroll.text=this.servicesSection_1_maint extVar;
imagemc.loadMovie("images/methodology.jpg");
} else if (initial=4){etc etc..........................
</code>

At the moment it is only performing the first action, ie it is taking initial = 1 or is only performing the first action no matter what 'initial' is.

I am using the If Else condition correctly?

Many thanks

M

Condition Not Working?
Hello,
I am using Flash MX 2004 and my condition is not working:

MovieClip.prototype.doorFloat = function(starting,ending,stepping){
if (Boolean == true) {
this._y = this._y+stepping;
}
if(this._y >= 450) {
Boolean == false;
}
}

It never changes the Boolean to false? I assume it is my ">=" but I changed it and it never works.

Any ideas?

Thanks
Jay

Add A Condition In My If Statement
i know it sounds stupid, but how can i add a bounch of conditions in my if statement. i hear that with "and if" i can solve my problem, but i couldnt.

i did it this way
code:
if(papapa==pepepe, lalala==lelele, mamama==mememe){
do something;
}


but its not working...

Colour Condition
Hi all....happy new year to you all!!!

I have a mc which changes colour RGB levels depending on section your in.

Can anyone tell me if its possible to condition a mc to see if its changed to its chosen colour before continuing.

something like????

_root.onEnterFrame = function() {
if (_root.intro.color == 0x6600ff) {
delete this.onEnterFrame;
nextFrame;
}
};

Looping Until Condition Met
i have a simple loop between 2 frames.
how could i get it so... it loops between frames 1-2 for 'x' amount of seconds then if the seconds have elapsed continue playing frame 3 onwards?

i have used setinterval to pause a frame but can't get an if statement to work.

code: function unpause() {
gotoAndPlay(_currentframe+1);
clearInterval(my_interval);
}
my_interval = setInterval(unpause, 5000);
stop();

What's Wrong With This If Condition ?
Here's the code I'm using to hide and show a text using one button.

on (release) {
if(text._visible=true) {
text._visible=false;
} else if (text._visible=true)
text._visible=false;
}

it hides it but doesn't show again, why ? using dynamic text, I also tried only if condition but that also does the same. Thanx

Button With Condition
I am nea to AS so sorry if it's a stupid question....

Here is my problem: I have 3 buttons and when I click on one of them there will be an animation (for example a fade in effect of a text and fade out when I click on other button)),my question is how can I do (verify) if the animation of the button is activated (is playing) so when I push the button again (wile the animation is playing) the animation will not restart ....
Sorry for my bad english

If Condition Asking For Two Variables To Be Set
for i know that i often fail when it comes to syntax , i thought i might ask how the syntax would be if i'd want to ask if two variables are set.
say i'd want to let things happen if the variables _root.move==1 and at the same time _root.window==0.

in this piece of code:

onClipEvent (enterFrame) {
if (_root.move == 1) {
if (_root.mainVarX == 0) {

homeX = (-_root._xmouse*1)+328;
homeY = (-_root._ymouse*1)+400;

} else {

homeX = (-_root.mainVarX);
homeY = (-_root.mainVarY);

}

thisX = _x;
thisY = _y;
diffX = homeX-thisX;
diffY = homeY-thisY;

if (_root.mainVarX == 0) {
moveX = diffX/10;
moveY = diffY/10;
} else {
moveX = diffX/10;
moveY = diffY/10;
}

_y = thisY+moveY;
_x = thisX+moveX;

}
}

my problem is, that i let something scroll in front of a button on mouse release, and flash now thinks that i left the button and thinks it should fire up stuff that should happen on rollout, which shouldn't when i mouse release on the button.

thanks for your help. i figured, i better ask before i go mad for two days

Help Writing A Condition
I've worked out what i need I just need help to write the simple script for this condition, i ask this because i havn't done much coding b4

if var y=100 then subnav._visible = 1

in english if make the subnav visible when variable y is 100, on a button press

cheers

rat

Condition Problem
Code:
*on sence 1
score == 0

*on a button
on (release) {
this._parent._parent.score++;
}

*on a movie clip in the sence 1
if (score = 10) {
_root.gotoAndStop(5);
}
it ain't working...

Condition With Various Values
hello all,
I have an if statement that checks the value of a Dynamic Field "Power".
Once it has checked the value I would like it to go to frame 5, 10 or 15 depending on the value. I have managed to get it working with one value but I really need it to work inside a number of values.
I know that the issue is with the condition inside the if statemenent.
Anybody know how you would actionscript it.


Code:
if (power = 25 to 50)
gotoAndPlay(5);

else if (power = 50 to 75)
gotoAndPlay (10)

else if (power = 75 to 100)
gotoAndPlay (15)


Thanks for the help.

Function Under Condition
Hi everybody,
could you help me with this?:

On root timeline I have a button with this script:

Code:
on (rollOver) {_root.fast = true}
on (rollOut) {_root.fast = false}

and one movie clip with motion tween inside.

I would like to control speed of that tween with described button. Above every frame of tween inside mc is this script:


Code:
if (_root.fast = true) {
function timelineFaster() {
nextFrame();
updateAfterEvent();
}
var tweenFaster:Number = setInterval(timelineFaster, 42);
} else {
function timelineFaster() {
nextFrame();
updateAfterEvent();
}
clearInterval(tweenFaster);
play();
}


This function works perfectlly standalone, but with condition doesn't. Have any idea? Thanks for anything in advance.

chulimanga

OnEnterframe And If(){}condition
I'm working on a small flash project , swf file only 25kb , when i try to run my swf flash project freeze . Reason for that i found in actionscript file .
Action script file have about 1000 - 1500 line of code ( i dont know exactly because a lot of empty space beetwen actions ) .
Action script is build mostly by if (){}condition .
All code are in onEnterframe function because of that flash freeze .
Then i split my code in 2 parts . 1 that is running under onEnterFrame function and 1 that is running on onRelease function . That solve the problem .

I dont know way ?
Possible reasons .
To much if (){}conditon under onEnterFrame function ?

If you have similar experiences please post .

Opening With Condition.
Is there any way to open a flash document with a condition set by a php for example.
Expanded explination....

I am trying to make an application that has multiple age ratings. Without making seperate swfs for each age group, is it possible to make, for example; index.php/15 open dissalowing the 18 stuff, but index.php/18 opening the more mature stuff.

Help Validate A Condition
am using flash 8 I confused on how make this , I have two movie clips on
_root let say MC1 and MC2 i want that when i drag MC1 over mc2 meet a condition and MC2 do a action how i do this ??

[F8] Please Help With An Actionscript Condition
Hello! I wanted some help from one of you with this condition.

There are 2 tweens called "mc_sun" and "mc_welcome" I want to run when someone clicks on a button called "btn_home", but I don't know exactly how to write the code because I've already tried these 2 modes...

In this one, both tweens run but I have to double click the button "btn_home" so the 2nd tween runs.

btn_home.onRelease = function () {
if(mc_sun._y == 700) {
myTween = new Tween(mc_sun,"_y",Regular.easeOut,startY,startY-200,16 ,false);
}
if(mc_sun._y == 500) {
mc_welcome.play();
}
}

And in this one, where I placed the 2nd statement into the 1st one, doesn't work, what can I do if I want that both tweens run when someone clicks just ONCE on the button "btn_home"??????

btn_home.onRelease = function () {
if(mc_sun._y == 700) {
myTween = new Tween(mc_sun,"_y",Regular.easeOut,startY,startY-209,16 ,false);
if(mc_sun._y == 500) {
mc_welcome.play();
}
}
}

THANKS FOR THE HELP!!!!

Condition Problem
This is in Actionscript 2.0...

I need a button called "con1" to appear if a series of three different MC's are pressed.

in the initial frame i have:
con1._visible = false;

When each MC is pressed they become disabled like this:

on(release){
this.enabled = false;
}

The MC's are called "a1","b1", and "c1".
I want to set up a condition in the initial frame that says:
if (a1.enabled = false)
(b1.enabled = false)
(c1.enabled = false){
con1._visible = true;
}

I think I am approaching this totally wrong, well it isn't working anyhow.
Does anyone have any ideas???

Tween After If Condition
HI
Please any body Help me the code is not Working
my movie is when car_mc hits glow_mc the function Tween should be caried out
but The following Code is not Working can anybody correct this
onClipEvent (load) {
function Tween() {
easeType = mx.transitions.easing.Bounce.easeOut;
var begin = 20;
var end = 380;
var time = .5;
var mc = car_mc;
carTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time, true);
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.glow_mc)) {
Tween();
trace("Collision");
}
}

Help With A Simple Condition Please
Hey all,



Fantastic help i get from here, thanks very much.

I have a small problem which i am sure will be easy to solve but not for me lol



One of my movie buttons are controlled like this:



Code:
// Takes effect when the mouse has moved over the object.

this.leaflet_mc.onRollOver = function() {
leaflet_mc.gotoAndPlay("_over")
}

// Takes effect when the mouse has moved away from the object.

this.leaflet_mc.onRollOut = function() {
leaflet_mc.gotoAndPlay("_out");
}

// Takes effect when the mouse has clicked the object.

this.leaflet_mc.onPress = function() {
_root.containerl.loadMovie("leaflet.swf");
}
Now what is happening is i hover over the object and it animates as it should which is great and when i move off the object the animation starts to stop which it also should so top marks there but.... what i dont like is that once i move off the object and the animation starts to stop, if i hover over it again it makes the animation play the onRollOver again but whilst the movie is in this state i do not want it to do so.



In a nutshell if i move away from the object i do not want it to recognise the onRollOver until the animation has finished for the onRollOut.



Please help :-) Thanks you

Basic If.. Condition...
I know this must be easy.. but I really can't get this thing right..

I'm doing a band choose script like.. broadband or dial-up..

like when the person clicks on broadband... a variable called band is set:

on (release) {
play();
band = "broadband";
}

and when it gets to the movie on the 3rd level... the script won't read the variable.

if (band = "narrowband") {
gotoAndStop("narrowband", 1);
} else if (band = "broadband") {
gotoAndStop("broadband", 1);
} else {
gotoAndStop("notset", 1);
}

it's playing notset.. even if the band is chosen...

how do I fix this?

Dynamic If Condition?
I have an Array of textFields that each contain a business name. Each business has properties associated with it, describing what it does and the services it provides.

shopping = false;
music = true;
food = false;
bar = true;
oilchange = false;
whatever = true;
etc;

I want to set up filters to highlight certain businesses. In other words, you can click on Food and Music icons, and only the business that have live music AND serve food ares shown. So HERE is my problem:

If I click the food filter icon or filter A or whatever, I can say:


Code:
if ( business[i] has food ){

highlight those businesses
}
But I need to dynamically define the condition. Whether the icon is currently on or not is stored in a boolean variable. If the user has clicked 3 filter icons, how do I say:


Code:
if ( business[i] has food=true AND bar=true AND music=true) {
highlight those businesses
}

or

if ( business[i] has Music=true AND Shopping=true AND bars=true ) {
highlight those businesses
}

or

if ( business[i] has this=true AND that=true ) {
highlight those businesses
}
Any ideas? I'm sure there is an easy way to do it, but I'm having trouble wrapping my brain around it. Syntax isn't the issue here. I'm just not smart enough to figure out the logic. Thanks in advance for any help.

Play Condition
Hi,
I make a flash game, but I have some problems at a script. It is a text input, with an instance name "input1", and a button. When user will type 5, I want it to go to the next frame, and if the user type anything else, it will go to frame 45, where it is written that the answare is wrong.
I made this, but it didn't worked

HTML Code:
on (release, keyPress "<Enter>") {
if (input1 == "5") {
play();
} else {
gotoAndStop(45);
}
}
Anyone can help me?

How Using Undifined As A Condition
Hello

can you write if (my_var:String = undifined]{
do this
}

Thanks

T.

Copyright © 2005-08 www.BigResource.com, All rights reserved