If Statement Question (should Be Easy)
I have a if statement:
Code:
if (_root.totalMoney < 0) {
gotoAndStop(2);
} else {
stop();
}
totalMoney is a vairable that is set to 0 on frame 1. I update this based on choices throughout the application. I want to check when this vairable goes below 0.
When I am updateing the vairable I use this code:
Code:
on (release) {
_root.monthly = 820;
call("_root.50");
}
I call frame 50 in the root because that is where the calculations take place.
Is there a way that I can call frame 50, or check the frame in an if statement? Something like this (which does not work)?
Code:
if (_root(50).totalMoney < 0) {
gotoAndStop(2);
} else {
stop();
}
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-13-2003, 02:46 PM
View Complete Forum Thread with Replies
Sponsored Links:
If Statement (easy?)
hi,
this is so easy, but driving me nuts.
on (release) {
if(_root.submenu==8) {
stop ();
} else {
_root.submenu.gotoAndPlay(3);
}
... all i want to do, is to check that when frame 8 in submenu is current, then to do nothing. STOP
if not ... well, why doesnt it work???
thanks for any ideas
View Replies !
View Related
Easy If Statement
i have a two layer movie onle layer has this code and the layer spans the entire movie with one key frame
if (page == 1) {
stop();
}
the other layer had a keyframe mid way with a button with this code
on (release) {
set(page, 1);
nextFrame();
}
why doenst this work i click the button nothing then i took out a = on the top code and it just stops
also how do i do a if statement with two variables like if (page =1, load = 1) bla bla do i use the coma?
dont laugh at me lol look at my member status then look at this problem he he how did he make it this far ask yourself
View Replies !
View Related
- Easy IF Statement Help -
I have this so far:
on (release) {
if (_root.portfolioInfo is at frame number X) {
_root.portfolioInfo.gotoAndPlay("PortfolioNoBorder ");
}
}
I want that if you click a button when mc portfolioinfo is at a certain frame number, it will play the frame label "portfoliono border"
thanks!
n
View Replies !
View Related
Easy If Statement Question
Hi,
I'm using Flash 8 on Mac.
I have a simple scroll bar with an up button and down button to control the bar. I'd like to add an if statement limiting the Y position to 0 for the top button and 300 for the bottom button.
Here is the current code for my up arrow button.
on (release) {
setProperty("Scroll/Text", _y, Number(getProperty("Scroll/Text", _y))+45);
}
Basically, if(y position > 0) then proceed....
I think this is a simple thing I'd like to do, but I just don't know how....
Thank in advance!
Ari
View Replies !
View Related
Easy If Statement Question
I am just trying to get this if statement to work. Basically what I want is when the button labeled t2 is pressed I want one of my other movie clips to go to the first frame and stop. Here is the code I have written. Any help would be greatly appreciated.
t2.onPress = function() {
torso.gotoAndStop(3,0);
if (t2.onPress == true) {
bottom.gotoAndStop(1,0);
}
}
her is the code that is controlling the movie clip that I want to affect when I press t1
b1.onPress = function() {
bottom.gotoAndStop(2,0);
}
b2.onPress = function() {
bottom.gotoAndStop(3,0);
}
b3.onPress = function() {
bottom.gotoAndStop(4,0);
}
View Replies !
View Related
Easy If Statement Question Flash Mx
I have a movie that plays. Let me explain it like this. When the movie opens a object moves onto the screen. Then 4 buttons come up with this code...
on (release) {
t = 1;
play();
}
When you click the button the object moves back off the screen then (this is how its supposed to work) flash evaluates the value of t if its 1 2 3 or 4 and sends you to a coresponding frame. heres the code for that..
stop();
if (t = 1) {
gotoAndStop(21);
} else if (t = 2) {
gotoAndStop(22);
} else if (t = 3) {
gotoAndStop(23);
} else {
gotoAndStop(24);
}
I dont know whats wrong with it because whatever button i click it still sends me to the last frame like it ignores the if and sends me to frames 21 22 23 and then 24 real quick. Whats wrong with the code?
Thanks
View Replies !
View Related
Loading Data From XMl File And Uses It To Run An If Statement. If Statement Fails.
[Flash CS3 (Flash 8 available as well)]
[Actionscript V2 (AS3 Not available for this project. End result must be in AS2. Plus I haven't learned AS3 yet)]
Hi
Sorry about running two posts so close together, but I couldn't change the other one to reflect the changes I've made in my problem.
The 1st post dealt with my theory that my IF statement wasn't written correctly, and so failed. But I've since disproved that.
Okay here is the situation.
I isolated elements from a larger app that I'm putting together and the problem still followed.
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.
The purpose of the application is to load an XML file(works)
Populate 2 text fields with information from the XML file(works)
Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
Heres the code:
Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
if (success) {
//point to the first node with information
var track_xml = data_xml.firstChild;
//loop through each node
while (track_xml != null) {
//print out each node
test1 = track_xml.toString();
//point to the next node
track_xml = track_xml.nextSibling;
//Runs my code
//Define the contents of two text fields located in the movie
textOne = data_xml.firstChild.childNodes[3].firstChild;
textTwo = data_xml.firstChild.childNodes[5].firstChild;
trace("data_xml.firstChild.childNodes[3].firstChild = " + data_xml.firstChild.childNodes[3].firstChild);
trace("data_xml.firstChild.childNodes[5].firstChild = " + data_xml.firstChild.childNodes[5].firstChild);
/*dummyYes = data_xml.firstChild.childNodes[5].firstChild;
dummyNo = data_xml.firstChild.childNodes[6].firstChild;
dummyMaybeEmail = data_xml.firstChild.childNodes[3].firstChild;
dummyMaybeFax = data_xml.firstChild.childNodes[4].firstChild;*/
//Checks between the two text fields for a match
if (textOne == textTwo) {
trace("It is selected!" + textOne + " " + textTwo);
check_fax.selected = true;
} else {
trace("Ir is NOT selected!" + textOne + " " + textTwo);
check_fax.selected = false;
};
}
} else {
trace("error reading file");
}
delete data_xml;
};
data_xml.load("XML/dummy2 - email.xml");
};
After you read the code, you'll have noticed the trace commands I stuck in there.
They send this to the output panel:
Code:
data_xml.firstChild.childNodes[3].firstChild = 1
data_xml.firstChild.childNodes[5].firstChild = 1
Ir is NOT selected!1 1
So as far as I can see, it reads the XML file with no problems, it loads the text fields with no problem. But for some reason the IF statement refuses to recognize that both the XML nodes contain the same information.
If I alter the code like so:
Code:
textOne = 1;
textTwo = 1;
Then the IF statement works. It sees that the two text fields are identical in content, and the checkbox is selected.
So whats wrong with the Data from the XML file?
I haven't a clue.
I tried converting from a string to a Numeral using:
Code:
newText = Number(textOne);
But that didn't work, it just produced "NaN" when traced.
I tried populating the XML file with text versus numbers, still no luck.
What came from the trace:
Code:
data_xml.firstChild.childNodes[3].firstChild = hi
data_xml.firstChild.childNodes[5].firstChild = hi
Ir is NOT selected!hi hi
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.
CheckBoxes are mandatory.
But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
I'd really appreciate some help and suggestions with this, I think I'm out of ideas.
Thanks
-Lem
View Replies !
View Related
Problem With Continue Statement And Label Statement
What am I doing wrong?
ActionScript Code:
var a = {
a:[1,2,3,4,5,6,7,8,9,0],
b:[1,2,3,4,5,6,7,8,9,0],
c:[1,2,3,4,5,6,7,8,9,0],
d:[1,2,3,4,5,6,7,8,9,0],
e:[1,2,3,4,5,6,7,8,9,0],
f:[1,2,3,4,5,6,7,8,9,0],
g:[1,2,3,4,5,6,7,8,9,0]
}
outerLoop: for(var i in a){
trace(i);
for(var j in a[i]){
trace(' '+j);
continue outerLoop;
}
}
Quote:
1039: Target of continue statement was not found.
View Replies !
View Related
Converting 'If Else' Statement To A 'switch' Statement
I am attempting to convert the following If statement to a Switch statement and I'm unclear as to the details of the execution of it. If someone could help me with this I would be very grateful. Here is the If statement followed by the shell of my attempted switch statement. TIA.
var spotOne:Boolean = true;
var spotTwo:Boolean = false;
var spotThree:Boolean = false;
var spotFour:Boolean = false;
btn.onRelease = function() {
f (spotOne) {
ball.slideTo(450, 100, 1);
spotOne = false;
spotTwo = true;
} else if (spotTwo) {
ball.slideTo(450, 150, .5);
spotTwo = false;
spotThree = true;
} else if (spotThree) {
ball.slideTo(100, 150, 1);
spotThree = false;
spotFour = true;
} else {
ball.slideTo(100, 100, 1);
spotFour = false;
spotOne = true;
}
};
---------------------------------
(attempt at conversion to switch)
var spotOne:Boolean = true;
var spotTwo:Boolean = false;
var spotThree:Boolean = false;
var spotFour:Boolean = false;
btn.onRelease = function() {
var location:Number = ?
switch(location) {
case spotOne:
ball.slideTo(450, 100, 1);
spotOne = false;
spotTwo = true;
break;
case spotTwo:
ball.slideTo(450, 150, .5);
spotTwo = false;
spotThree = true;
break;
case spotThree:
ball.slideTo(100, 150, 1);
spotThree = false;
spotFour = true;
break;
case spotFour:
ball.slideTo(100, 100, 1);
spotFour = false;
spotOne = true;
break;
}
View Replies !
View Related
SUPER EASY / RETARDED EASY SetMask ?
Ok got a simple retarded question. I have 1 swf loading into a holder_mc and a mask_mc set with setMask but it is not working. There is nothing else to this but so help me it is not working and I know I have to be overlooking something simple but I am just not seeing it.
Heres the whopping 3 lines of code:
code: stop();
contentHolder_mc.loadMovie("home.swf");
contentHolder_mc.setMask(contentMask_mc);
Example attached.
thx
c
View Replies !
View Related
Need A Simple If/else Statement, SOSneed A Simple If/else Statement, SOS
hi, i'm a new learner.
currently, doing an exercise on button.
i want to do a navigation button like
www.fendi.com (pls refer, thx ; )
where button that onPress it will remain,
the rest not clicked, will fade out.
i think i need a right if/else statement.
i've tried few, but still not working.
i have my flash file attached.
hope some experts here can help.
hear from you guys soon, thanks
View Replies !
View Related
Easy Question Or Not So Easy?
I am trying to save buttons and movies I have created to the main Library for use in other projects and I am having trouble figuring out how to do this. I am using flash mx. I tried going into program files and flashmx and finding the library that way. I thought I found the folder and exported a file to it and when I opened the folder it was there but when I was in flash and opened the main library flash provides for you it did not show up. Please help this newb.
thanks,
Don
View Replies !
View Related
Easy Easy Question
alright i have a movie clip within my movie that will display text, but the text is always different and it loads it dynamically what is the best way for each of my buttons to tell the movie clip to load and then tell the textbox to load a specific file.
View Replies !
View Related
_alpha / Easy In And Easy Out
I need for this code a Easy in/ onRollOver and Easy out/ onRollOut.
---
for(i=1;i<6;i++){
theButton=_root["mc"+i];
theButton.thisNum = i ;
theButton._alpha = 0;
theButton.speed = 5
theButton.onEnterFrame=function() {
if (_root["mc"+this.thisNum].overMe) {
this.elasticScale(150, 0.7, 0.3)
} else {
this.elasticScale(100, 0.7, 0.3)
}
}
theButton.onRollOver=function(){
this.speed = 5;
if (this._alpha > 100)
{
this._alpha += speed;
}
else
{
this._alpha = 100;
}
_root["mc"+this.thisNum].overMe=true;
_root["mc"+this.thisNum].swapDepths(5000)
}
theButton.onRollOut=function(){
this.speed = 5;
if (this._alpha > 100)
{
this._alpha -= speed;
}
else
{
this._alpha = 0;
}
_root["mc"+this.thisNum].overMe=false;
_root["mc"+this.thisNum].swapDepths(5000)
}
}
View Replies !
View Related
Like Statement
Is there a way to do a "like" statement like an ASP database record seatch?
What i need to do is find a number in a list of number that is returned from my asp. The value list looks like this..
&Values=0|1||2||3||4||5||6||7||8||9|10|
What i want it to do is if |3| is found in that string then it will show a movie clip. If is not found in the string it will not show the movie clip. Is there away to search a string for a value?
View Replies !
View Related
If Statement
Hi,
I have a problem (see the files I included).
What do I want: when somebody presses on the left arrow button that the timeline goes to frame number 10.
In frame 3 (in the main timeline) I wrote:
If ("/:film1richting"=-2)
Go to and Stop (10)
Else
Go to and Play (2)
End If
This doesn't work. I don't know why because the variable is -2 (see the arrowleft button actionscript)when somebody presses the left arrow button. I don't want to solve this problem by writing a simple actionscript in the left arrow button: On release go to frame 10. But I want to use the if statement in frame 3. Does anybody know what I must do?
http://members.home.nl/u-p/movement.swf
http://members.home.nl/u-p/movement.fla
Thanks
[Edited by U.P! on 08-21-2001 at 07:32 AM]
View Replies !
View Related
With Statement
I could really use some help here.
I am trying to build a inverted tree. With one object at
the top and then on the next level down there will be 2
objects and so on and so on. I've decided to use
movieclips. I made a movieclip and set linkage.
it's name is "node". If I am doing this dynamically
using the attachmovie() I have to assign a name and a level,
so I do that. Now for the location I have decided to use
the "with", because I have dynamically attached the movie
I do not know what the name is, so I try to build a
name string and pass it to the "with" statement. this
does not work.
here is the code, it is start when you hit a button.
ndx = 1;
powersof = 1;
xmove = 25;
ymove = 25;
index = 1;
count = 1;
if (_root.TextField6 == "anatomy") {
while (index<=_root.anatomy.length) {
if (index == 1) {level_movie = "node_"+ndx;
_root.attachmovie("node", level_movie, ndx);
currentmovie = "_root." + level_movie;
with (currentmovie) {
_x = 138;
_y = 90;
ndx++;
}
} else {
}
while (count<=Math.pow(2, index)) {
level_movie = "node_"+ndx;
_root.attachmovie("node", level_movie, ndx);
currentmovie = "_root." + level_movie;
with (currentmovie) {
_x = 138+(xmove*count);
_y = 90;
ndx++;
}
count++;
}
count = 1;
index = index+Math.pow(2, powersof);
powersof++;
}
}
stop ();
I really would appreciate some help.
thanks all
my email is rbrumback@imedlink.net
View Replies !
View Related
If Statement
Hi guys
I think this is very simple for you but I need it
I'm trying to make a small game and I have 3 counters
win, lost and tries where tries =8 and win=0 and lost=0
it's like this
on (release) {
if (variable1==variable2){
tries--
win++
} else {
tries--
lost++
}
}
Now I want to tell the actionscript to loop until tries =0 and then go to frame 20
that's all
I know it's very easy but...
thanks in advance
View Replies !
View Related
If/else Statement Help
Okay guys,
I managed to figure out my other problems ... now I have a new one ...
I'm fairly new to if/else statements so I need some help with this one ...
here's what i'm doing ...
I have a series of MC's that are draggable and have target areas (meaning they will snap into position once dragged into the target area) ... now what I need to do is (or at least I think) write an if/else statement that says 'if all mc's are dropped into the target area go to and play xxx' ... how do i do this ...
help appreciated as always.
eg
View Replies !
View Related
If/else Statement - HELP
Should be a simple question. How do I do this correctly in actionscript?
If (_parent movie = frame2) {
gotoandPlay (frame1)
I don't really even need an else. I want it to keep going till it reaches frame2 of the parent movie.
View Replies !
View Related
Please Help Me With An If Statement
i'm not that big of an actionscripter, but i'm trying this thing, basically, its when u click a button it plays a certain frame within a movieclip, depending on where what frame the movie clip is already in, have a look at this::
on (press) {
if (mens_sub_buttons = (1)) {
tellTarget ("mens_sub_buttons") {
gotoAndPlay (2);
}
} else {
tellTarget ("mens_sub_buttons") {
gotoAndPlay (16);
}
}
}
if its at frame 1 i want it to play frame 2 , but if its at anything else i want it to play number 16
but it doesnt work! any ideas??
thanks alot!
View Replies !
View Related
If, Then Statement
I have created a drag and drop application, and now I want to add a few rules. I have assigned values to the different MCs and I want to create an If, then statement that will add the movie clips as they are dropped into the target area. So when a certain value is achieved it will not let any other objects to be dragged in until pieces are taken away. Can someone help me out, I'm not sure where to start.
View Replies !
View Related
If Statement
I have a series of buttons that when pressed open up a movie clip inside another movie. I am using this for a visual comparison of 2 different materials, from which there are 15 to chose from. Each of the 15 materials has a button for which I have built a function. Upon press of button x, the chosen material opens in "picture frame" movie (currently opens in picFrame2 only). How I want it to work: if there is already a picture in picFrame1, I want the second choice to fill the 2nd picFrame, if not, in picFrame1. Null doesn't work, any suggestions on what will?
function showMaterial (movieName, thisClip) {
if (_root.picFrame1 == null) {
_root.picFrame1.attachMovie(movieName, thisClip, 1);
} else {
_root.picFrame2.attachMovie(movieName, thisClip, 1);
}
}
Thanks in advance
View Replies !
View Related
If Statement
ok here is what i have
on (release) {
value1 = A;
value2 = B;
value3 = C;
value4 = D;
value5 = E;
value6 = F;
value7 = G;
value8 = H;
value1 = Number(value4)+Number(value5)+Number(value7)+Numbe r(value9);
a = value1;
value3 = Number(value4)+Number(value5)+Number(value6)+Numbe r(value11);
C = value3;
value2 = Number(value5)+Number(value6)+Number(value7)+Numbe r(value10);
B = value2;
if (value4 == Number(value3)-(Number(value5)+Number(value6)+Number(value11)) or value4 == Number(value1)-(Number(value5)+Number(value7)+Number(value9))) {
d = value4;
}
if (value5 == Number(value1)-(Number(value4)+Number(value7)+Number(value9)) or value5 == Number(value2)-(Number(value6)+Number(value7)+Number(value10)) or value5 == Number(value3)-(Number(value4)+Number(value6)+Number(value11))) {
e = value5;
}
if (value6 == Number(value3)-(Number(value5)+Number(value4)+Number(value11)) or value6 == Number(value2)-(Number(value5)+Number(value7)+Number(value10))) {
f = value6;
}
if (value7 == Number(value1)-(Number(value5)+Number(value4)+Number(value9)) or value7 == Number(value2)-(Number(value5)+Number(value6)+Number(value10))) {
g = value7;
}
if (value12 == Number(value8)-(Number(value1)+Number(value2)+Number(value3)+Numb er(value4)+Number(value5)+Number(value6)+Number(va lue7))) {
h1 = value12;
}
if (value9 == Number(value1)-(Number(value4)+Number(value5)+Number(value7))) {
a1 = value9;
}
if (value10 == Number(value2)-(Number(value5)+Number(value6)+Number(value7))) {
b1 = value10;
}
if (value11 == Number(value3)-(Number(value4)+Number(value5)+Number(value6))) {
c1 = value11;
}
}
Now what I am trying to find out is if i can use the if statements like i have.. Since there is many ways to find out the different variables i need to use the or statement so it checks to make sure that the variable is equal to each other, so it dosnt change the variables that have already been typed in...
View Replies !
View Related
Else Not In If Statement
Does anyone know how the else handler is not within the if statement? Error Flash seems to want to give me.
if (clickSpot_x ne _root.beetle._xmouse)
{_root.beetle.play();
else
if (clickSpot_x = _root.beetle._xmouse)
{_root.beetle.stop();
}
}
Thanks a million!
View Replies !
View Related
'for' Statement
12 eggs in a carton
when you rollover the first egg the other 11 should disappear.
do i have a syntax prob?
on (rollOver) {
for (i = 2; i <= 12; i++){
_parent.egg[i]._alpha=0;
}
}
I think i do ;(
View Replies !
View Related
Help On If Statement
here is the actionscript for pong game
main scene with one frame:
player1 = 0
if (player1 = 10){
gotoAndPlay("otherscene", 1)
}
stop();
ball engine (when it pass the end of the "table")
player1 = player1 + 1
all I do is skip this game to "otherscene"
need help on this actionscript. I can't find what's wrong. I need it soon because I need it done for final project
View Replies !
View Related
If Statement With &&
Is something wrong here?
if ((_root.current == "buzz") && (root.newPress== "company")){
gotoAndPlay("3");
}else{
gotoAndStop(1);
}
one of them works on its own, but when the && is in there, it doesn't.
thnx
View Replies !
View Related
Why Is My IF Statement Ignored?
Something's wrong... I've puzzled this over for days now and can't seem to figure out what went wrong.
Here's my code:
temp = 1;
temprandom = (Math.random()*100);
if (car[temp] == 0)
{
if (temprandom < 10)
{
car[temp] = 1;
}
}
So essentially, here's what I'm having happen.
I'm working with a variable in a declared array Car. If car[1]==0, there's a 10% chance that it'll become 1, otherwise it'll stay at 0. But the problem is the code seems to be ignoring my Math.random command. I did a trace... so far example, temprandom = 42. Yet when it comes to the if statement if (42 < 10), which it's not, it'll still increment car[temp] up to 1. Regardless of whether or not temprandom is higher or lower than 10, it always increments.
Any idea why it's doing this?
View Replies !
View Related
If, Else & Var Statement Help...Please?
Ok, I'll try to explain this easily.....First check out my site so you can get a feeling for what I'm talking about.
-->>http://www.dynamai.net/FLASH/main.swf *Go to the Portfolio link.
My problem is that I want an info button to be apparent only for certain pieces of art. The portfolio section of the site consists of 1 loaded movie clip (square buttons on left) and the .jpg images which are loaded as the user clicks on the individual boxes. The main movie starts out with:
_root.mc.loadMovie(image);
which sets an variable which all other .jpg files are loaded into as the user clicks the appropriate boxes.
on (release) {
_root.image = "http://www.dynamai.net/images/artwork/digital/abstract.jpg";
My thought was to have the info button residing on the stage and as the user clicked it would go through this statement:
on (rollOver) {
if (image = "http://www.dynamai.net/images/artwork/traditional/man.jpg" ) {
tellTarget ("info") {
gotoAndStop("Man");
}
} else {
tellTarget ("info") {
gotoAndStop(1);
}
}
}
If these images matched then the Info text for that picture would appear. For some reason it seems that it should work, but I know I've screwed up somewhere simple.
If you need to look at the fla let me know. I would realy appreciate any help... Thanks a lot!!
View Replies !
View Related
If/then Statement
trying to get a basic if/then statement to work: someone help out?
on mc
Code:
onClipEvent(load){
bag1 = true;
bag2 = true;
}
onClipEvent (enterFrame){
if (bag1==false){
_root.bag2._visible = 0;
}else if (bag2==false){
_root.bag1._visible = 0;
}
}
on button
Code:
on(press){
_root.bag1==false;
trace("false");
}
http://www.sphosting.com/furrysnake/...l_if_then.html
http://www.sphosting.com/furrysnake/...el_if_then.fla
View Replies !
View Related
If Statement
I'm probably going about this all wrong but it's the only way I can figure to do it, if it's possible. What I want to do is find out what the movie is on level1 and do something on that condition. Here is what I have for coding but it's not working. Maybe someone can tell me what's wrong with my coding or if I'm going about this all wrong?
on (release) {
if (_level1="downloads.swf") {
loadMovieNum ("images/downunload.swf", 1);
} else {
unloadMovieNum (1);
}
}
This is an action assigned to a button. All is does is unload the movie so it's not seeing downloads.swf on level1 even though it's there and I'm clueless on what I'm doing wrong. Is it possible to do it this way? Thanks for the help in advance
View Replies !
View Related
Help With If/Else Statement
Hi,
I'm tryint to check on my root timeline if on the time line of my MC (blueGreen) has reached a certain point ("finished") then I want to proceed to "melt" on the MC timeline.
this is what i have, but I know the condition statment in the if part is not correct.
if(blueGreen=="finished")
with(blueGreen)
gotoAndPlay("melt")
Else(gotoAndStop(_root.("waiting")))
please help i know my code is HORRIBLE!
View Replies !
View Related
If Then Statement Help
I need help. I'm not a action script guru. I have 5 buttons. one character that is wearing sunglasses. What I want is when you click the red button, the sunglasses turn red, blue button they turn blue, etc...
I want this to stay this way throughout the entire movie.
I think this can be done by if then statements and setting the visibility, but I don't know the code. Can anyone help. In layman's terms if possible.
Thanks,
Tom
View Replies !
View Related
'for' Statement
this works:
_parent._parent.slide1.magnify.gotoAndStop(1);
_parent._parent.slide2.magnify.gotoAndStop(1);
_parent._parent.slide3.magnify.gotoAndStop(1);
but this doesn't:
for (i=0;i<20;i++){
_parent._parent.slide[i].magnify.gotoAndStop(1);
}
what am i doing wrong??
View Replies !
View Related
If Statement ( I Think)
Hello everyone. I need to figure out a way to code the following pseudo code:
if the user hasnt moved the mouse in 30 seconds and there is no movie loaded in level 10, _root.gotoAndPlay(1);
this is for a presentation that passers by would play with. Is this possible to do? Any help is greatly appreciated.
View Replies !
View Related
If Statement
Hello everyone. I have an MC that has a open and close type of animation. When the user clicks on it it opens and currently they have to click again to close it. What I want to do is have a script say:
if the MC is open and the user's mouse hasnt been in the vicinity (x and y) for 30 seconds then the MC should close.
anyone know how to script this? Any help is greatly appreciated.
View Replies !
View Related
If Statement
Happy New Year!
ok i need some help.
i need a action for a button what tells a movie
that if it is on frame 10 it plays and if it is not
it dosent play
will it be somethink like this
_root.submen if (frameNum>10)
play
View Replies !
View Related
If Statement
I am trying to use an If Statement to load a movie clip depending on the answer typed in an input box.
I have the "correct" movie clip placed on frame 3 and the "incorrect" movie clip on frame 2 and the following actionscrpt attached to my button.
on (release) {
if (ans=125) {
tellTarget (_root.correct) {
gotoAndPlay(3);
}
} else {
tellTarget (_root.incorrect) {
gotoAndPlay(2);
}
}
}
But when I run the script it always come up correct even if ans = 55 for example.
Can you help?
Cheers
James
View Replies !
View Related
If Statement
k i have this 3d spinning thing here. i'm trying to make each word be a link. i'm doing this by nesting buttons in the MCs (the MC's being the words), however, in frame 3 of the script layer there is a script saying:
Code:
gotoandplay (2);
frame 2 being the rotation of the array that has been used, this gotoandplay bit seems to be thwarting any such mouse scripts i try to put onto the buttons. from reading a few tutorials it seems that i could possibly use an IF to get around this. what i'm wanting it to do is basically:
if the afterparty bit is clicked gotoandplay scene 2, 1
else gotoandplay (2)
from what i could gather the script should look something like this:
Code:
if (afterp = 1)
gotoandplay ("afterparty" , 1)
else
gotoandplay (2)
endif
afterp being the instace name of the MC and afterparty being the name of scene 2
however when i add the script i either get scene 2 just comeing up without prompting or the whole thing flashing like crazy, i've tried swapping the afterp bit for the name of the nested button and that still doesn't work. anyone have any ideas?
cheers, squid.
View Replies !
View Related
If Statement
Hi...
not up on the If statements and wondered if this is possible?
trying to load a new image every time a thumb nail is clicked and want the stroke around the image to only animate once. So if its been animated then stop where it is, otherwise start.
on (press) {
loadMovieNum("flash/imgpop1.swf", 7);
stroke = "flash/imgstroke.swf";
if (stroke>=12) {
tellTarget ("stroke.stop") {
}
} else if (stroke<=2) {
tellTarget ("stroke.gotoAndPlay(3)") {
}
}
}
im trying to say, if the imgstroke.swf is at or after frame 12 then stop. Otherwise if its before or at frame 2 go to and play frame 3.
Can someone clean it up a little?
thanks
cuse
View Replies !
View Related
If Not / Else Statement?
is there an "if not" statement in flash,
see i want to achieve:
if object1 is over object2 then (action) but else (do nothing)
ive played about with else statements but it always asks for else if, with which i would have to add if not... the above. that doesnt work.
View Replies !
View Related
OR Statement
Why doesn't this 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 Statement
Hi
I've got an animation (equilizer style) ... when the swf start, the var audioStatus = 1.
A button is place behind the equilizer so when the user click, it stop the animation and set the var audioStatus = 0.
But I want that when the user click again the animation replay.
Here's my script :
Code:
on (release) {
if (audioStatus = 1) {
eq01.stop();
eq02.stop();
eq03.stop();
audioStatus = 0;
}
if (audioStatus = 0) {
eq01.play();
eq02.play();
eq03.play();
audioStatus = 1;
}
}
The problem is that the first time I click on the button to stop the animation, it work well and the var is changing to 0, but when I click again, nothing happen
Please help !!!
View Replies !
View Related
If/then Statement Help...
ok. i'm trying to do something... when the user hit's the "right arrow key" the numbers on the screen stop, but when the number stops where it supposed to (ie. 6) then that movieClip will do something different (ie. change of x value) and this would work down the line so that when all the numbers have been stopped at the correct position something else occurs, and so on...
below is the code that i've attempted to use, but it's not working, and my limited experience using if/then statements and clipEvent statements has prevented me from further trouble shooting. i'm using mac osx (10.2.2) flash mx
onClipEvent (keyPress) {
if (this.stop("6")) {
this._x = 529.4;
} else {
this.play();
}
}
hopefully this makes sense, any help, and or advice would be much appreciated. thanks.
Ken
View Replies !
View Related
If Statement
how do you make an "if" statement cause a movie clip to play a certain frame if it's at frame 1 and "stop" or "play" at other frames.
Something like:
if(_root.myMovieClip=frame(1)){
play.nextFrame;
}
else{
play();
}
This isn't right but any help would GREATLY appreciated.
View Replies !
View Related
If Statement
how do you make an "if" statement cause a movie clip to play a certain frame if it's at frame 1 and "stop" or "play" at other frames.
Something like:
if(_root.myMovieClip=frame(1)){
play.nextFrame;
}
else{
play();
}
This isn't right but any help would GREATLY appreciated.
View Replies !
View Related
|