ActionScript 3.0 :: IF Statement Always True - Not Supposed To Execute

Sep 10, 2011

I'm new to AS3 and Flash as a whole, but a decent programmer in Java and C,C#. The problem I have is this: No matter what I do, that "IF" statement ALWAYS executes, even if it shouldn't, and musn't, as said by the trace(isfirst), which outputs a 0, which means the IF is not supposed to execute. AKA: It displays first! and 0 every time it gets to frame 61, thus bringing me to the home page no matter what.

[Code]...

View 1 Replies


Similar Posts:


ActionScript 1/2 :: Execute Code In Previous If Statement If Second If Statement Is Executed?

Aug 31, 2011

if (variable == 1){
//code
//Execute this code.
} else if (variable == 2) {
//code

[Code]...
 
I dont want to copy the code from the first into the second and the first and second into the third.
 
My mind isn't working and there is probably an extremelly simple way to get this working.
 
I know I could used functions but for some reason it stops the instance referencing working: _root["bullet"+j] doesnt work in a function.

View 7 Replies

Professional :: If Statement To Check If Boolean Is True?

Aug 28, 2011

i want my if statement to check if boolean is true so here is my code.
 
name:Boolean = new Boolean();
mc1.addEventListener(MouseEvent.CLICK, myMouseEvent);function myMouseEvent(event:MouseEvent):void{    name:Boolean = true;        if(name:Boolean = true)    {        //code to run....      
}

Syntax error:expecting right paren before colon.
 
probably a simple explanation that i cannot this of.

View 3 Replies

Actionscript 3 :: Passes As True (or False) In An If Statement For A Variable?

Jun 27, 2011

Given this: if(myVar){}, what will pass as true or false?In JavaScript for example, false are values like null, undefined, 0, '' (empty string), false.

View 2 Replies

ActionScript 2.0 :: Recognizing True/false Statement Inside MC?

Apr 25, 2003

How do you get a True/False statement to be recognized inside a movie clip with a button on the main timeline as the control. I want my movie clip to stop at the last frame if the movie clip reaches the last frame. Otherwise gotoAndStop at the first frame of the clip. I was using

on (press) {
_root.m1.gotoAndPlay(2);
_root.m2.gotoAndPlay(1);

[code].....

View 9 Replies

ActionScript 2.0 :: If ... Statement Doesn't Execute E-mail Validation?

Aug 8, 2010

I have some code for validating e-mail data before it is send. I have including code from Bassem Bouguerra www.sub-science.com which uses the WebServiceConnector and deals with imaginary user's emails. The code validates my 3 fields correctly. The problem is that the last if ...statement doesn't execute despite that the data is correct and my ok and result variables are true. It is driving my mental.

stop();
import mx.services.*;
_lv = new LoadVars();

[code].....

View 3 Replies

ActionScript 2.0 :: SendLockCheck()to Return True Depending On The If Statement Within The OnLoad?

Feb 2, 2006

I just want a function to return true, but after a LoadVars.onLoad.event. Am I right in assuuming that the return in the onLoad = function below relates ONLY to that function? What I want is for the sendLockCheck()to return true depending on the if statement within the onLoad.

function sendLockCheck() {
var lockCheckResult_lv:LoadVars = new LoadVars();
var lockCheckSend_lv:LoadVars = new LoadVars();[code].....

View 2 Replies

ActionScript 2.0 :: Flash CS3 - Sam_MC Stops Moving And No Other Action Is Taken When The If Statement Containing GotoAndPlay Becomes True

Jun 16, 2011

The gotoAndPlay option isn't kicking in here. The object "sam_MC" proceeds along the specified root. But when the if statement containing gotoAndPlay becomes true, sam_MC simply stops moving and no other action is taken. When sam_MC's x coordinate becomes less or greater than a specified amount, I want the flash movie to restart. My code is located on the first frame of a layer I have named "actions." Here it is.

[CODE]....

View 0 Replies

ActionScript 3.0 :: ButtonMode = True; .useHandCursor = True; Only Works On Half Of The Button?

Sep 4, 2009

about.buttonMode = true;
about.useHandCursor = true;

I have this on a MC I use for a button - and it works but only on HALF of the object - how can I make so it works on the whole object itself?

View 1 Replies

ActionScript 2.0 :: If Condition - (condition1=true) AND (condition2=true)?

Jun 11, 2004

I know how to do this in other codes, but..if (condition1=true) AND (condition2=true) then... How do you do this in AS?

View 5 Replies

ActionScript 2.0 :: Does Flash Execute Codes Only In The Keyframe Or It Execute Whatever Is In The Frame Regardless Whether Its A Keyframe Or Not

Mar 16, 2005

When I place some codes in a keyframe, these codes are showing on all the following frames up till the next keyframe with codes. My question is, does Flash execute codes only in the keyframe or it execute whatever is in the frame regardless whether its a keyframe or not?

View 1 Replies

The Thumbnail Moves Where It Is Supposed But Does Not Get Any Larger?

Apr 23, 2009

I am trying to use Actionscript and movie clips. I get my script to work but my thumbnail does not enlarge when clicked. It stays the same size. Here is the script that I am using:

[Code]...

The thumbnail moves where it is supposed but does not get any larger. I have been working on this for 2 days now and have almost lost my mind!

View 4 Replies

ActionScript 3.0 :: Variables Expanding When Not Supposed To

Jun 13, 2011

I am trying to get input from my Arduino to Flash, Flash gets signals like this: [where each number seperated by a - at the end, stands for the input of a sensor]
mux0array: 0-0-0-0-0-400-0-0-0-20-0-0-0-0-0-65-
mux1array: 0-0-800-0-0-0-0-0-0-0-0-0-0-0-0-0-
mux2array: 0-0-0-0-0-0-0-0-10-0-0-0-0-0-50-0-

Code to convert this text to values in an array, using regular expressions [totally new for me] that would convert the data to:
0: 0,0,0,0,0,400,0,0,0,20,0,0,0,0,0,65
1: 0,0,800,0,0,0,0,0,0,0,0,0,0,0,0,0
2: 0,0,0,0,0,0,0,0,100,0,0,0,0,50,0
which is traced by this line: trace(dataId + ': ' + dataArray);
So dataId can change from 0 to 2, and dataArray contains multiple (integer) values

Friday, this worked perfect. But for some weird reason, it stopped working properly: it looks like it merges lines when it shouldn't:
1: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,02: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,01: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,1,0,1,0,1,0,21: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
As you can see, the first line, is working fine: 16 values
the 2nd line contains 33 values: the 16 values supposed to come after the 2:, but after that 16th value, a linebreak is missing, and the 0: is displayed as a 0, and adding his 16 values behind it. The same goes for line 3: 1: 16 values,2,16 values,0,16 values
the next line only merges 1: and 2:

This is the used script:
// accumulates data coming from arduinovar sensorData:String = "";
// connects to arduino boardvar arduino:SerialPort = new SerialPort();
arduino.addEventListener(DataEvent.DATA, onArduinoData );
arduino.connect( "127.0.0.1", 5331 );
function onArduinoData( event:DataEvent ):void{
[Code] .....

View 4 Replies

Flex :: FEmbedded Font Looks Different Than Supposed To

Dec 17, 2009

When an embedded font is used for a label it looks correct, but when the same font is used for a combobox, the selected item font looks different from the dropdown and label font.[code]Why would these look different (besides the size and color)?

View 2 Replies

ActionScript 3.0 :: Variable Are Supposed To Be Out Of Scope

Nov 14, 2010

This is suppose to be an error I overlooked, but when I saw that I have forgotten to declare weekDayLabels right below the class, shivers travel down my spine that it works.[code]

View 3 Replies

IDE :: Isn't Tweening Supposed To Stop At Last Key Frame

Dec 14, 2009

the last key frame of layer AboutBtn does NOT have a line before the black circle.I had trouble changing the image when I insert a new key frame AFTER that key frame.What does this mean?Isn't the tweening supposed to stop at the last key frame?What could be the possible action that caused this to happen?

View 3 Replies

Actionscript 3 :: MovieClip Does Everything It's Supposed To And Still There Is `error 1009`

Sep 25, 2011

I'm creating game in which user is given a map and five flags. User must drag flags, one by one to the countries, so after creating MovieClips that represent flags, I started creating code for them. That worked for France, but after I copied it to Germany and changed everything using CTRL+F ('france' to 'germany' and 'France' to 'Germany') it didn't. Well, actually it did, but there is some error. That's funny, coz German flag does absolutely everything it should, and still there is an error in the output. Here, that's the code:

[Code]...

View 2 Replies

ActionScript 2.0 :: Movieclip That Is Supposed To Mask The Background?

Mar 5, 2002

I'm very close to achieving the desired effect, however, i have been stopped dead in my tracks. I Used Pom's Real/Fake Mask Drag tutorial, so I have that set, however, my problem is getting the ripples to mask...

I have the background, and then I have the other movieclip that is supposed to mask the background (ripple).However, it either does not mask, or it only masks the first frame of the "ripple" mc...

(oh, btw...the ripple MC is dragged by the mouse, so the ripples follow the mouse. I saw an effect like this, a looooong time ago, probly in the days of Flash 3, and i was curious how to go about it, so I have been trying for the last few weeks...)

View 4 Replies

ActionScript 2.0 :: First Requirement Of The If Statement When Type In The Proper Input And Go Straight To The Else Statement

May 14, 2009

Having a few problems with what I thought was a simple if statement. Here is the code:

[Code]...

I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.

View 7 Replies

ActionScript 2.0 :: Movie Clip Is Supposed To Loop By Default

Jan 26, 2010

I know that a movie clip is supposed to loop by default, but mine seems to only go through the code once. Here is my code:

[Code]...

This code is supposed to check server time every second and once the server time passes the end time (stored in a global variable) it should go to a different frame. I've created a variable cd_time for testing purposes which displays current server time on the screen. I would expect it to change every second, but it only displays current time when it loads and does not refresh after.

View 2 Replies

Actionscript 3 :: What Are Width And Height Supposed To Represent For A Sprite

Feb 25, 2011

I'm working with a Sprite in AS3. Initially, width,height are 0,0 as expected.

After this:

var tf : TextFormat = new TextFormat();
tf.font = "Arial";
tf.size = 48;

[code]....

View 2 Replies

Actionscript 3 :: Isn't Supposed To Be A Simple Synchronous Architecture Language?

Feb 4, 2012

A simple piece of code that should trace [code] and I get something completely far away from that,[code]Is the trace function that bad? that slow? is it the fact that passing an argument to the function take so much time compare to the other one?is there something I can do to avoid this type of weirdness ?(For the record, my project is not to trace {rien, done and test}... I have 15k lines of codes that react completely differently if I compile them with "Omit trace statements" or not.

View 2 Replies

ActionScript 2.0 :: Next And Prev Frame Wont Stop Where They're Supposed To

Sep 28, 2011

ive recently created an actionscript 2 product gallery that has five sections for the types of product with navigation buttons that goto a new scene containing that sections products in each 'product' scene ive got left and right buttons that gotoandStop at either nextFrame or prevFrame so far so good this works fine even tho its simple [code]however when i originally tested it i had just one range of products so when it got to the end (ie furthest product right or left) it stopped however as ive added more scenes (i do this because i hate really long timelines) if the user clicks 'right button' at the end of the scene it displays the next scenes picture any ideas on how i can get it to understand where it is in the program and stop?just need to say I really dont get programming at all..i only managed that code by butchering a gotoAndStop that i added using the behaviours panel so the simpler the better lol

View 5 Replies

ActionScript 2.0 :: Instance-variable (array) Is Supposed To Be Unique

Oct 21, 2004

I encountered a rather irritating problem yesterday. I wrote a class. The class has got 1 variable of the type :Array. its a public variable.On the scene i have 2 movieclips which are connected to my class through its linkage in the library.My problem is that even though the instance-variable (the array) is supposed to be unique for the instance only it gets overwritten for every new instance i create.for example. if i assign the first instance's array 2 values (1, 1)and the do the same with the second but here i change the values to (2,2) then when i check my first instance it has got the same values as the second instance...that is (2,2). [code]

View 2 Replies

ActionScript 2.0 :: Loading Data From XMl File And Uses It To Run An If Statement. If Statement Fails?

Oct 10, 2008

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) {

[code]....

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.

View 1 Replies

Professional :: Root Template Supposed To Update Nested Pages?

Jun 26, 2006

I am using a nested template by following the normal practice of creating a template, which I will call "core" and then creating a page from that template and saving it as a "nested" template. So far so good, except, when I update the "core" template, it only updates the .dwt template files that I created from the core template. It doesn't update any of my content pages that were created from the "nested" templates, that were of course based on the core template. I can go into each nested template and then it updates the corresponding pages, but it just seems like updating the core should do all associated nested templates. Is this the way it is supposed to work?

View 1 Replies

ActionScript 2.0 :: Math.atan2 Woes - /supposed To Be 90 Degrees But It Return 0?

Mar 31, 2004

Code:
function rtd (rad) {
return rad*(180/Math.PI)
}

trace(rtd(Math.atan2(0,10))) //supposed to be 90 degrees but it return 0

trace(rtd(Math.atan2(-10,0))) // supposed to be 180 but it also return 0

what to do?

View 1 Replies

ActionScript 2.0 :: Read "true" As True?

Nov 18, 2003

I am pulling the words "true" and "false" from a query, but in flash I need them to be the values of true and false, not strings, is there a way to convert this datatype?

View 3 Replies

Actionscript 3.0 :: SWF Preloader - Site Supposed To Start From A Black Background And The Image Fading In

Oct 4, 2010

I have assembled a preloader using the method from this site, everything seem to work except for one problem My site supposed to start from a black background and the image fading in. However once I placed the preloader the image dose not fade in but appears right away to the full strength after the preloader gone to 100% Looks like it jumps to a few frames after the first frame of the main swf file. Please take a look at [URL] If you reload again you will see how the image fade in.

View 1 Replies

ActionScript 2.0 :: Drag & Drop - Perform A HitTest The Item Is Supposed To Dissapear, But It Doesn't?

Mar 1, 2005

I'm having a problem with my dragOver function.The point of my project is that can drag the items that are on the table to the little bag (this is a button) on the left bottom of the screen.The thing is that the dragging works but when I perform a hitTest the item is supposed to dissapear, but it doesn't....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved