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








How Do You Use 'with' Statements


Can someone give me quick instructions on how to use 'with' statements? I'm trying not to use 'telltarget' but when i use 'with' i get 'Target: trailing garbage found' what's up with that?

Thanks in advance for any help.




FlashKit > Flash Help > Flash Newbies
Posted on: 02-10-2003, 04:11 PM


View Complete Forum Thread with Replies

Sponsored Links:

Super Newbie Question: Using Multiple IF Statements, For One ELSE Statements
What i want to make ... is

on (release) {
if (part.text == 1) {
gotoAndStop(random(1)+4);

if (part.text == 2) {
gotoAndStop(random(2)+4);

} else {
gotoAndPlay(33);
}
}

that doesnt work for some reason.. Any ideas why? Thanks!

View Replies !    View Related
If Statements - Help Me
I have built this code to determine whether a button has been clicked to send it to a specific frame.

Trace(thisClick);
//Traces variable to return value as a test to me
if (thisClick=2) {
gotoAndPlay ("viewing");
} else {
stop ();
}

thisClick is returned as 0 but still the if statement runs.


For some reason Flash runs the code even though the variable thisClick is not equal to 2.

I have found that I must use this code instead but it is not as accurate and I would like to know why it is happening.

if (thisClick<>0) {
gotoAndPlay ("viewing");
} else {
stop ();
}

Should I use an else if ??

Thanks!

View Replies !    View Related
Help With If Statements
Basically for some reason I'm having problems with if statements - for some reason Flash wont allow me to use else if's it keeps saying it cant find matching if even though there is one directly above it - with correct amount of brackets andno syntax errors thoughout the script.


Other problem this is an extract of the code - i've traced it and it doesnt do the comparison correctly when sgoto = 1 it goes through the ==2 statemt too.

I've tried eq "1", ==1 and (eval(sgoto == 1))

but it still doesnt work any help would be greatly appreciated!!!


/:randomised = new Array();
for (var c = 0; c<5; c++) {
var rand = random(2);
trace ("rand "+rand);
trace ("selection array"+selection);
trace ("contents"+selection[rand]);
/:randomised[c] = selection[rand];

}

sgoto = /:randomised[0]; //take the first one
trace("goto!" + sgoto);


//theone = 0;

if (sgoto == 1) //equals a PROBLEM HERE
{
trace (sgoto +"==1");
theone = /:aArray[/:nextone];
trace("theone!"+ theone);
_root.cloud1.gotoAndStop(theone + 1);
_root.picture.gotoAndStop(theone +1);
start();
_root.gotoAndStop (3);
}


if (sgoto == 2) //equals e WANTED TO USE ELSE IF HERE
{
trace (sgoto +"==2");
var theone = /:eArray[/:nextone];
trace("theone!"+ theone);
_root.cloud1.gotoAndStop(theone + 1);
_root.picture.gotoAndStop(theone +1);
start();
_root.gotoAndStop (3);
}

View Replies !    View Related
Or Statements
hi there hope you can help.


I have an input box which users type a name into and a function which then uses that name to create a seperate section.

BUT, if they type for instance "Bob" I want it to not do the function.

Normally this would be fine as i would do:



Code:
if (input_text ne "Bob"){
gotoAndPlay("myfunction")
}



the problem is that if someone types "bob" or "bOb" or "BoB" etc etc it does not get stopped by the error check.


It gets more complicated.... the "not allowed" words are longer than bob, between 3 and 6 letters long and there are around four of them so it would ridiculous to have to enter all combinations of the words in order to put them in to the error checkin thing.


Any ideas????

View Replies !    View Related
If Then Statements?
OK, I want a button to have a telltarget action to play a movie within an instance. But, I only want it to play if a specific frame within that movie has been loaded. And vice versa -- I don't want it to play, if that frame has not been loaded.

-- I'm a designer, and far too unfamiliar with Actionscripts. Can anyone help????????

View Replies !    View Related
And Statements
Hello,

I have 2 input text fields in the same screen. One is called begindate and the other is enddate.

I want to be able to click on a button which will validate if the begindate = 01/01/01 and the enddate=12/31/01 and then goes to another frame.

My problem is AND and && give me errors when trying to use them.

How do I set up an AND statement with the data given?

thank you.

View Replies !    View Related
2 'if' Statements?
how can i script 2 'if' statements. I want two conditions to be met in order for one action to take place.

if this AND this happen then do that. otherwise. . .

View Replies !    View Related
If Then Statements Help
Hey there.

I need to do the following...

If (on roll out) button has not been clicked, play movie clip 1.

Else If (on roll out) button has been clicked, play movie clip2 instead and not movie clip 1.

How do I do this in Flash 5? I have no idea!

Thanks in advance,

Chris.

View Replies !    View Related
If Statements?
this is for the detection of a users bandwidth. i'm not familiar with the "if" statement. what i want to do is send the user to the page optimized for their bandwidth. so in the script below where would i put in...

getURL ("broadband_user.html", "_blank");

for broadband users and

getURL ("narrowband_user.html", "_blank");

for narrowband users?


*****the script*****

if (Number(/timer:time)>=15) {
time1 = "NarrowBand";
} else if (Number(/timer:time)<=15) {
time1 = "BroadBand";
}
time2 = 115/eval("/timer:time");
stop ();

********************

thanks for your help - matthew

View Replies !    View Related
If Statements....
I am interested if someone could tell me the code for:

I am looking for code for flash to reconize when a spaceship's shild has reached zero, to goto a different scene.

The code should be something like this...

if (variable) = 0 then goto scene 2
____________________________________________
Thanks,
Grant

View Replies !    View Related
If Statements
Does anyone know how to word an if statement checking to see if a movie is loaded into a level and if so to tell that movie in the level to go to and play a specific frame?

i.e.:

if there is a movie loaded in level2
tell it to go to and play frame 15

View Replies !    View Related
Please Help With If Statements
very simple question.......

//On the main timeline i declare a variable-

directionchange = 0;


//On a layer above is a movie clip named arrow-
//On a layer above i add this code-

if (_root.directionchange = 1) {
arrow._rotation += 45;
}

//finally a button on stage with-

On (release) {
_root.directionchange = 1;
}

//i want to control the rotation of the arrow with the value of a variable, but when you test this it ignores the if statement and rotates as soon as it loads.......Please, any assistance here?

View Replies !    View Related
Help With If Statements?
OK,

Im making a site for me animations, I upload daily and stuff and just recently I added an Archives page...I would like to have this one area load a movie and have two arrows on either side to navigate between them. So far I have it so it loads the movie, and you can go one movie up or one movie down with the buttons, but I dont know exactly how to get it to go beyond that...any help would be much apreciated!!

View Replies !    View Related
Help With If Statements?
OK,

Im making a site for me animations, I upload daily and stuff and just recently I added an Archives page...I would like to have this one area load a movie and have two arrows on either side to navigate between them. So far I have it so it loads the movie, and you can go one movie up or one movie down with the buttons, but I dont know exactly how to get it to go beyond that...any help would be much apreciated!!

View Replies !    View Related
If Statements
First off I have a button that when I roll over it it tells an mc to move to a certain location. What I want to know is if I have all ready rolled over it and the mc is in its other location, how would I tell that same button that if I rollover it and the mc is in that location not to do anything? Otherwise, if I roll over it again it jumps to the first frame and moves again, looks tacky...
Any help would be great, thanks william

View Replies !    View Related
Else If Statements
Maybe someone can help me figure this out...

Below is my code. It is a movie to detect keypresses. Basically what it is intended to do is the following:
-if a person presses Ctrl/C (nested below), Q1=correct.
-If a person presses anything but that combo, Q1 is incorrect.

This means I have to check first for any key press other than ctrl, and mark that as incorrect.

The tricky part is then tracking if the person does hit ctrl, I have to make sure that everything but ctrl followed by c is incorrect (ei, ctrl/a, ctrl/b, ctrl/d are all incorrect - only ctrl/c is correct).

Any ideas on how to do this? Seems like when I nest the two key downs and add and else statement, the second keydown is ignored. Below is my script:

onClipEvent (keyDown) {
pressed = Key.getCode();
if (Key.isDown(17)) {
if (Key.isDown(88)) {
_root.Q1 = "true";
_root.NextFrame();
}
}
}

Thanks!

View Replies !    View Related
If Statements
I'm using Flash MX.

Apologies in advance for the how basic this problem is.

I have a navigation menu, that I want the user to have control over with a button called "menu". The nav. menu is a MC called "buttons". When the user clicks 'menu', I want to use an if statement to determine where the 'buttons' MC is, and whether to push it off stage or pull it on stage.

So, for example, to begin with the menu is hidden. When the user clicks 'menu', the menu slides onto the stage, when the user clicks 'menu' again, the menu should slide off stage.

This is this code I am using:

on (release) {
if (_x._root.buttons = -740) {
setProperty("buttons", _x, 5);
} else {
setProperty("buttons", _x, -740);
}
}

This allows the menu to show up on 1st click, but does not remove the menu on 2nd click. What am I doing wrong?

Also, I know my code is inconsistent - can someone help me clean it up a little?

Eventually, I want to tween this menu with actionscript, how would I go about doing this?

Thanks in advance for your help.

Sid.

View Replies !    View Related
HELP On IF Statements Please
Please can someone help me out, I need an action script that will allow me to do the following:

*I have a number of drop down lists with numbers in them
*I want a number displayed in an uneditable box which changes when you pick a different number in the drop down box next to it!

*One drop down box to one uneditable outcome box!

Please can someone help me out! ASAP! Thanks in advance!

View Replies !    View Related
If Statements
Awright guys
right i amm trying to acumplish the same effect that can be found @ http://www.egomedia.com(NEW), The way the windows r minamized and maximized. I have it working fine but i have run into a small snag. When the windows r minimized they overlap each other when @ the same _x and _y but i have code setup to chack wether x_ is true or false, Wether or not it is available. have a look @ the code below


Code:
onClipEvent (enterFrame) {
if (_root.win1mx == "1") {// Checks to see if the min button has been pressed
_x += (_root.x1-_x)/_root.speed;//move
_y += (30-_y)/_root.speed;
_root.x1mx;// Makes x1 true(unavailable)
}
if (_root.x1mx) {// If not available goto x2
_x += (_root.x2-_x)/_root.speed;//
_y += (30-_y)/_root.speed;
_root.x2mx;// Makes x2 true(unavailable)
}
if (_root.x2mx) {// If not available goto x3
_x += (_root.x3-_x)/_root.speed;
_y += (30-_y)/_root.speed;
_root.x3mx;// Makes x3 true(unavailable)
}
}

x1=10 x2=110 x3= 220, are vairables postions along _x.
x1mx, x2mx, x3mx, are vairables to check and see if x1, x2, x3 are taken

I have this code on 3 clips

I hope someone can help me with this.

Cheers guys

View Replies !    View Related
If Else Statements
I would really appriciate any help with a math tutorial I am building. basically I have three input fields. All input fields need to be correct to move to the next answer.
here is what I have. What is wrong?



on (release) {
if (fac1 = 40)
if (fac2 = 3)
if (fac3 = 7) {
var GB = "Congratulations, click the Next button";
} else {
var GB = "try again";
}
}

View Replies !    View Related
If And Else Statements
I'm a bit stuck on what should be a simple problem:
Basically i'm trying to access the score to perform varying progressions in a movieclip. At the moment I'm using the trace command to make sure the right messages are being sent.
I'm using this code in an actions clip placed off stage:

onClipEvent (enterFrame) {
if (_root.score>4) {
trace ("level3");
}
if (_root.score>2) {
trace ("level2");
}
if (_root.score<2) {
trace ("level1");
}
}

View Replies !    View Related
If/else Statements
Okay, I'm back for some help.

I'm new to if/else statements and need a point in the right direction.

Here's what I need to do.

Let's say I have an 'about' button that onPress loads 'about.swf' into a target area (another mc). How do I tell the button that 'if' the swf is loaded, that go and stop at a label on its timeline (my buttons are MCs).

Also, do you need to have an 'else'?

Cheers. YP

View Replies !    View Related
If / Else If Statements
Could someone please tell me what I am doing wrong here? I have tried everyway that I could think of to get the statement to recognize the text being inputted into the text box, but nothing works.

Here is the script;

on (release, keyPress "<Enter>") {

if (passEnter.text eq "merlin"){

_level0:OtherSign.text = "Kerry LeBlanc";
}
else if (passEnter.text = "paws"){

_level0:OtherSign.text = "Jackie Sayer";
}}

The text box instance is named passEnter, I have tried using the variable name which is pw, I have tried substituting "=" for eq. None of it works, please help me to see what stupid little thing I am missing.

TIA

Kerry

View Replies !    View Related
Using If Statements...
Hello,

I have a button inside of a movie clip that I have made, and I was wondering if there was some kind of if statement or command so if my button was clicked on a certain frame of the movie, it would then go to a certain frame inside of my movie clip. I don't know if this is possible or not, but I'd thought I'd ask anyways. Thanks

View Replies !    View Related
If Statements
Hi,

I am programming some MC buttons and got a line of code to get my MC (home) to play backwards when mouse leaves button.

on (rollout) {
home.rewind = false
}

all i want to do is add an if statement so

on (rollout) {
if home.(frame number is less than or equal to 10?) then
home.rewind = false

Just don't know any of the action script terminology.

cheers,

will

View Replies !    View Related
If Statements
i've done coldfusion about a year ago, so I know concept of the in then statements, wondering if my idea will work though.

thinking of how to do a back button that affects a single movieclip. Basically, it'll say, if this MC's current frame is x, or x-x(a range), then go here on PRESS/RELEASE. wondering along the lines how to do this, trying it out without success, saw this action from menu.

ifFrameLoaded () {
}

wondering if i can put it under a on (Press) , ifFRameLoaded(14) then do a gotoandPlay(7) type thing. if you got tips on better how to do it, thanks, till then, i'm havin fun with errors =-)

oh, and main thing is, that i want to do it, so that there are multiple if's, basically 10-12 if's with half that many actions. in CF it was cfif's and cfelseif's.

thanks

View Replies !    View Related
OR Statements
Why doesn't my code work??


// Checks to see what day it is and do the according
if (_level0.themday == "Monday" || "Tuesday" || "Wednesday" || "Thursday" || "Friday") {
gotoAndPlay(3);
} else if (_level0.themday == "Saturday" || "Sunday") {
_level0.melboff = "CLOSED";
gotoAndPlay(1);
}

View Replies !    View Related
If Else Statements..
Hi, i need help in my Flash MX actionscript. I would like to create a command that helps to counter check if the input type is the correct or the expected username.. Such that when its not correct it will therefore not go&play the next frame. Requesting the user to re-enter the correct username.. Thanks.

View Replies !    View Related
If, Else Statements.
This has now become something i need to learn.

-part 1-
how can I use if, else statements to check for variable values (i.e. if X equals 1502, goto frame 1; if X equals 9876 goto frame 2; else do nothing)

If needed, I will post the file so far

-part 2-
how can I use if, else statements to limit the area in which an object can travel (see 'one dimentional mouse trails').

*sigh* when will I be able to answer questions rather than ask them.
-Z

View Replies !    View Related
If Statements
Hey, i was just wondering how to create an if statement that checks to see if a movie has been loaded into a level then takes one of two actions if it true - if you know what i mean?? lol

any help will be awesome

cheers

View Replies !    View Related
If Statements
hey there, got a little proble with this if statement - what i'm trying to do here is create a button that checks to see if a external swf has been loaded into a level if it has already been loaded but the user has already clicked to "close" it which actually set visible to false when they go to click on the same button to "reopen" it the button just sets the visible=true to that level and if the movie hasnt been loaded at all then it will just load the movie into a level - if you know what i mean - anyways this is the script i got so far it's not workin at the mo hopefully one of you guys can help out

---------------------------------------------------

on (press) {
if (level6){
level6._visible=true;
} else {
loadMovieNum("links.swf", 6);
}
}

View Replies !    View Related
If Statements
I have 5 different sections of my scene and each section has a different menu that slides in. When you click on a button to go to another section of the scene, I want it to play that menu sliding down, then the next sections menu sliding up.

I guess you would use an If statement that says if A is true then go play Adown then go to the next section. I tried getting it to work but had no success. I tried telling it when each condition was true then did an if statement but i guess I did it wrong.

So first it has to determine which menu is up at that moment, tell that menu to go to its corresponding menudown, and then go to the section in the gotoplay statement.

Could somebody help me please!

View Replies !    View Related
If Else Statements
Hello,
I was wondering if anyone could help me out with the scripting of an If Then Else statement. What I have going on is this, I have a button that loads an external .swf into a target movieclip using:
loadMovie("c.swf",_root.target4);
but I don't want the swf to reload if the button is pressed again, I know i need to script something like:

button.onRelease = function(){
If movie is loaded
do nothing
else
loadMovie("c.swf",_root.target4);
}

Its been a while since I've done any actionscripting so if any one could help me out with the correct syntax, I would greatly appreciate it.

thanks

View Replies !    View Related
Using If Statements...
hi guys, im having a problem. when I run this with the vars coming from a text file, i get all the values including undefined, where it should just over look them and give me ones with the value bigger or equal to 1. I think i might be writing it incorrectly. any help would be appreciated

for (i=1; i<= menutotal; i++) {
if (_global.menu["subText"+i] >= 1 ) {
trace(_global.menu["subText"+i]);
}
}

thanks,
-Nick

View Replies !    View Related
If Else & Statements
Hello,

I'm looking to create a movie where the user will type a word into a box. If the word is correct the movie will jump to another scene and play, if it is incorrect, a reply will pop up. I have coding that tells me how to do this with numbers... can someone please help me figure out how to adjust this to text? The part in bold is where I think I am having problems. Should it be "text" instead of number? Thanks!


Quote:




_global.age = function() {
a = Number(input);

if (a = Jump) {
gotoAndPlay("scene=1", "1");

View Replies !    View Related
*help (if Statements) *help
hello, i'm a long time lurker first time poster, and i love this flashkit board.

i'm trying to update my stupid old site and have upgraded from flash mx to mx 2004...

this code worked in mx as far as i remember...

on (release) {
if (3dmovie_mc._currentframe > 1) {
3dmovie_mc.gotoAndPlay(13);
}
}


of course now it doesn't. i can't really figure out why...
this is what the debugger tells me...

**Error** Scene=Scene 1, layer=buttons, frame=22:Line 2: ')' expected
if (3dmovie_mc._currentframe > 1) {

**Error** Scene=Scene 1, layer=buttons, frame=22:Line 3: Syntax error.
3dmovie_mc.gotoAndPlay(13);

all i want is for my button to check if the movie clip is past the first frame and if it is tell it to go to the 13th frame. i'm sure it's something simple i just haven't learned yet or am forgetting.

any help would be greatly appreciated, thanks.
-jeremy

View Replies !    View Related
If Statements Help
on(rollOver) {
homerollover.gotoAndPlay(2);
}
on(rollOut) {
homerollover.gotoAndPlay(12);
}
on(release) {
homerollover.gotoAndPlay(22);
gotoAndPlay(2);
if (biorollover._currentframe = 28) {
biorollover.gotoAndPlay(29);
}
}


now when you click on say Home, then it tells the movie clip home rollover to play animation starting on frame 22 and stopping on frame 28

so I have it show what page your on

now when you click on a different button I want whatever button you previously clicked to play the animation starting on frame 29 and ending on frame 35 (which basically is the reverse of the animation starting on frame 22)

so above I tried to say that if the Bio button had previously been clicked and thus ended up on frame 28 (showing your on the bio page) then when you click Home it will play the animation on the Home button but will play the reverse animation for Bio


But that script isnt working, if you click it when Bio isnt at frame 28 then it plays the animation on frame 29 anyway, and when Bio is on frame 28 then when you click Home it doesnt do anything to Bio

View Replies !    View Related
'with' Statements
I am trying to find out if there's any way to list targets to apply a with statement's properties to.

I've tried the following: though only ever the last target in the chain is recognised and have the properties associated with it:

code: with (vert1,vert2,vert3,vert4) {
_y = 12
_height = 360
}

and

with ((vert1) && (vert2) && (vert3) && (vert4)) {
_y = 12
_height = 360
}

and

with ((vert1) || (vert2) || (vert3) || (vert4)) {
_y = 12
_height = 360
}

in cases 1 and 2, 'vert4' gains the y and height properties, whereas in the last instance, vert1 gets them.

i Need ALL of them! :P

Please Help

View Replies !    View Related
If Else Statements
I'm making a turn based fighting game, and in this part of the programming, I'm trying to take what ever attack the user selected (attack,defend), and make it affect how much HP is taken away when attacked by the enemy. Here is the code I have, and for some reason, it just dosn't work? -

code:
stop();
hitchance = random(3);
this.enemymc.gotoAndPlay(2);
if (hitchance == 2){
if(defense == 5){
playerhealth = playerhealth - 5;
this.p1bars.healthbar._xscale = playerhealth;
}
else if(defense == 0){
playerhealth = playerhealth - 10;
this.p1bars.healthbar._xscale = playerhealth;
}
}


Now, in the if statements, the defense var. was defined by the user clicking a button and selecting to attack or defend. Here is that code-

code:
on(release){
defense = 0;
this._parent.player.gotoAndPlay(2);
gotoAndStop(7);
hitchance = random(3);
if (hitchance == 1) {
this._parent.enemyhealth = this._parent.enemyhealth - 5;
}
}


Now the defense button-

code:
on(release){
defense = 5;
gotoAndStop(7);
this._parent.player.gotoAndPlay(74);
}


Can someone PLEASE explain why this isn't working, I'm guessing I just don't know how else if statements work... lol...

Thanks in advanced

EDIT: Changed your [ color ] tags to [ as ] tags. - jbum

View Replies !    View Related
Can You Have Too Many If/else Statements?
Is it possible, or more importantly UNWISE, to have too many if/else statements?

I am working on a site that is heavily animated and I needed to have a several checks to see if mc_a, mc_b . .. . mc_z. are at certain points on their resepective timelines.

Is there limits to these types of statemetns? Are they CPU hogs?

Thanks for you anyone's 2 cents.

View Replies !    View Related
If Statements...
X is set to 1, but this is not working. Why not?


if (x=1) {
_root.MC1.gotoAndPlay("go");
}


Thanks!

View Replies !    View Related
Help With If Statements
I have some text fields where the user must fill in their height and weight. Depending on the result i have told flash to play various parts of the movie using if statements.

However i'd like flash to play an 'error checking' section of the movie if any of the text fields have not been filled in by the user.

As im fairly new to actionscripting, how do i tell flash to do this?

Any help much appreciated

View Replies !    View Related
If Statements
I'm having trying to get some if statements to work. How do I set it up where I have an if statement, and if that is met, then I have another if/else, but if the first if statement isn't met, I want the mc to go to a specific spot.

I'm working on this mc that follows the mouse (x direction only). If the mouse is between 50 and 706, the other if/else statement needs to run. If the mouse is less than 50, I need the mc to be in one position, and if the mouse is greater than 706, the mc needs to go to a different position.

Any ideas?

p.s. Here's the code that I already have for the mc to follow the mouse. The mc is 100 wide so the -50 is to track to the center of the MC.


onClipEvent (enterFrame) {
mx=_root._xmouse-50;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}
moveSpeedx=dx/2;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
}

View Replies !    View Related
Help With If Statements
Im trying to load variables with a true or false value from a text file. If the value is true, I want it to set the alpha properties of certain buttons to 100%. I don't think im coding my if statements properly as regardless of the variable value, it sets them to 100%.

Anyone know a good tutorial that might cover this? Or could show me what the code should look like?

View Replies !    View Related
IF Statements
Just to warn you, I'm not very good with ActionScript

Here it is in a very simple way:

I have four buttons, for example: red, blue, black, and pink. What I want to have happen is, when one of the buttons is clicked, they set a value to a variable, for example when you click on black, the variable "BUTTON" is set with the value, "black." I'm doing this with the AS:


Code:
on (release) {
button = "black";
gotoAndPlay("ANI");
}
I'm doing that for each button. And, as you can see, there is a command to go to the frame labeled "ANI," where a short animation will take place. At the end of this animation, I want something to analyze the variable "BUTTON" for it's value, and depending on what it is determining where it goes after the animation. It would make sense for there to be an IF/THEN type of deal, but as I said I'm not real good with AS and I don't know what I'm doing I've tried a few things, but nothing has worked so far. Any help would be greatly appreciated!

- wc

View Replies !    View Related
If Then Statements
Ok I'm making a website and i have it set up when you click on the pictures link pictures fade in but when you click on a different link they just dissapear. So what i want to happen is if some one clicks on the picture link they fade in and if they click on any other link they fade out how would i do that?

View Replies !    View Related
Help With My If Statements.
This is my first time working with if statements, and some say its easy but i find it kinda hard.

This is the command im trying to use

if (this.charnames == "name_rick") {
this.moves.gotoAndStop("a_command");
}
if (this.charnames == "name_james") {
this.moves.gotoAndStop("b_command");
}

-----------------------------------------------------
moves and charnames = movie clip label.
name_rick and a_command are functions inside the movie clip ect.

I tried almost anything i can think of but i still cant get it to work. Anyone know what problem im having?

Also, i tried using conditions on the if statements with variables but the if statements only work on the first frame. It will help me out alot if i can figure out this problem.

Thanks

View Replies !    View Related
If Statements
was wondering if you can define mulitple conditions, and if so, what is the syntax

View Replies !    View Related
If Statements
I have three buttons on the stage. They all three control a movieclip holder, which when the button is clicked, it loads a movieclip into the holder and plays about ten frames and stops on the tenth frame. This is good. But when you click the button again it does it all over again. I want to have the button when pressed check to see if this movie clip is already loaded so it won't do it again. I believe it would be done using variables and or if statements?? please help. Thank you in advance.

View Replies !    View Related
2 If Statements? Please Help.
i have a page i'm working on but i need some help or clerrification.

i want to set up a button that will go from scene 1 to scene 2 but only if the situation allows for it hense the if statement.

is the following script possible????


on(release,keyPress "<Enter>"){
if(name==null){
blah blah blah
}
if(name/=Valentino Rossi){
blah blah blah
}
else{
blah blah blah
}
}


*note* name is a var for an input box
if nothing is there i want a movie clip to open that says nothing is there (which I know how to do) however I want to make sure that the entered text is limited on to say one option at this point, i will eventually want the options to be up to 10 or so. is that possible with if statements?? if not how would the script look???????

View Replies !    View Related
Two If Statements - Help
Hi Everyone,

I was wondering how to make two if statements work within one check. For instance, this script is checking to see if the text in two different text boxes is of x value. This is what I have so far:


Code:
onClipEvent (enterFrame) {
if ((_root.hud.clip.text == 0) and (_root.hud.shot.text == 0)) {
_root.invis.gotoandplay(2);
}
}
So far, the script only works if I delete one of the statements between the "and." Am I using the wrong operator?

I know the answer to this question is simple, but I just can't quite seem to put a finger on it.

Thanks,

Mr_Welfare

Running Flash 8 Actionscript 2.0

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved