ActionScript 2.0 :: IF ELSE Statement Doesn't Work?

Aug 24, 2009

I'm doing a simple array test...I thought I could have values in an array and then run it through a loop and have a IF this value equals "x" do whatever, ELSE do this.

I have the value on a button and it doesn't work.The loop runs but the IF ELSE statement doesn't do what I THOUGHT it should do. It runs every value through the script as if the IF ELSE statement doesn't matter. Am I missing something?Here's the flash code (see below):

var myArr:Array = new Array;
myArr = ["red", "green","blue"];
function checkArr (checkTest){[code].....

View 7 Replies


Similar Posts:


Actionscript 3.0 :: The If Statement Doesn't Work

Jun 14, 2009

im trying to make a website based on a tutorial. when a certain button is clicked a selected page will load when the previuos page plays the OUT:label and hits the end label which are situated on the every pages mc timeline. Tyhe problem is that the function doesent work

the function is like this

Code: Select all
kontakt_btn.addEventListener(MouseEvent.CLICK, newPage); 
function newPage(e:MouseEvent):void

[code]...

View 3 Replies

Tweener For /if Statement Doesn't Work?

Dec 23, 2009

I am executing a hittest when a chicken meets a crocodile; the chicken is afraid for the crocodile and turns back flying up in the air and back on the ground. In fact most of it works, allthough I can't get the wings to stop fluttering. As soon as the chicken returns on the ground, this must happen.This is the piece of code where it is about: (the function winger() is called once at the hittest)

[flash=]function winger()
{
var counter:int=0;[code].......

without the counter it works. changing it into an if-statement with the counter af the 2nd tweener, doens't work either.

View 1 Replies

ActionScript 2.0 :: Call The ImageSize Function With The If Statement It Doesn't Work?

Aug 18, 2006

Code:
_global.picWmax = 436;
But when I call the imageSize function with the if statement it doesn't work.
Code:
function image(){

[Code]...

View 3 Replies

ActionScript 2.0 :: If Statement Inside If Statement Won't Work

Mar 30, 2011

why this code won't work

[Code]...

I'm sure you can put if statements inside other if statements, seriously I can't figure it out

View 4 Replies

ActionScript 2.0 :: Dynamic Masks - Trail Doesn't Resize And The Mask Still Doesn't Work

Oct 16, 2009

I decided to try to use setInterval for myanimation, which is just a mouse trail.However, I'm trying to get teh mouse trail to be a dynamic mask.In my previous swf this was achieved by using a holder mc with the animation inside and then using this as the mask. But this time I just canpt seem to hit on the right way to get it to work. The code I am using for the mouse trail is:

Code:
var i:Number = 0;
var myInt:Number;
var t:MovieClip;[code].....

in the function, but now the trail doesn't resize and the mask still doesn't work.

View 1 Replies

ActionScript 3.0 :: If Statement Doesn't Affect For Loop?

Jan 15, 2011

I wrote a function within a function to control 2 Tweens.(the 2nd one isnt in the function, it's called)My problem is... is that it works for the first time.. the button is hovered over and all the other buttons show themselves and then disappear again, except the one you're over. Then I do it a 2nd time and it doesn't work. why is it only working right one time? and why isn't the if statement I put in the local function affecting the for loop? The 2nd time it takes the button you're hovering over with it and fades it out. (even though the if statement registers according to trace)this is the code

import fl.transitions.Tween;
import fl.transitions.easing.*;
var shortInst:Array = [btn1, btn2, btn3, exit];

[code].....

View 6 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 3.0 :: Width Doesn't Work - How To Make It Work

Apr 21, 2010

I have a button object that I need to scale to align with the variable width of an array of images.However, when I set the width in code, the button does not actually become that width. Tracing out the width gives me the correct value, but on screen.. it's off.

I've proved it to myself by scaling the same button object manually in the properties pane and visually comparing. Both of the buttons below have a width of 410.

Code:
navigatorDown_btn.width = 410;
navigatorDown_btn.x = (stage.stageWidth/2)-(navigatorDown_btn.width/2);
trace(navigatorDown_btn.width); // output: 410

View 4 Replies

ActionScript 3.0 :: EMPTY STRING - Main + Sub Even If It Doesn't Exist Outside The If Statement?

Jul 18, 2011

Code 2 assume that main = main + sub even if it doesn't exist outside the if statement, that's obvious since sub is an empty string.

[Code]....

View 4 Replies

ActionScript 3.0 :: If Else Statement Does Not Work?

Oct 21, 2009

have a very common function i use in educational quizes that self rate the user depending on their score (resulting from answering multiple choice questions). So I have set up a variable called score no trouble...but when i implement my trust "if else" heuristic from AS2...i get all these errors and my flash file does not work.

stop();
if (score <= 5){ endMsg.gotoAndStop("score1");} else if (score > 6 and score <= 11){ endMsg.gotoAndStop("score2");} else { endMsg.gotoAndStop("score3");}

[code]....

View 6 Replies

ActionScript 3.0 :: If Statement Does Not Work?

Jan 3, 2011

the problem is that for some reason my if statement doesn't work

Code:
if( key.isDown( Keyboard.UP ) )
{

[code].....

View 2 Replies

ActionScript 2.0 :: Simple If Statement Won't Work?

Feb 18, 2006

I am using Flash 8, and for some reason, my if statement won't work. I have a scrollbar which scrolls a movieclip (that contains AS loaded material (eg. attachmovie). I want it so that only when the material is longer than the scrollbar do I see the scroll bar.For some reason, it doesn't work. The traces don't even work!

if (scrollbar._height < menu_mc._height) {
scrollbar._alpha = 100;
trace("works");[code].....

View 2 Replies

ActionScript 3.0 :: Switch Statement Work With HasOwnProperty

Jan 24, 2012

Is it possible to have switch statement work with hasOwnProperty :

[Code]....

View 4 Replies

ActionScript 2.0 :: Building An IF Statement To Work With PixelBreakers Swfmacmousewheel?

May 14, 2004

building an IF statement to work with PixelBreakers swfmacmousewheel, I cant quite get my head around it. Heres where I am at.

Actionscript Code:

MouseWheel.addListener(this);function onMouseWheel(delta:Number):Void { this.emptyScroller._y += delta * 3;}

I want to stop scrolling once emptyScroller._y = 0, so the content doesnt get scrolled right off the edge of the browser. I want to say something like: if emptyScroller._y < 0... "stop scrolling upwards, but allow the user to still scroll downwards until y = someVar"

View 3 Replies

ActionScript 2.0 :: Nested If Statement That Refuses To Work Properly

Oct 28, 2009

I have written a nested if statement that refuses to work properly. My fla file consists of the main timeline and a movieclip. The problem lies in the pwrbtn function. I need the pwrcomp Boolean to prevent the call to firstpage() from happening more than one time. However when I test it keeps cycling so my traces are frame2, true, frame2, true, so on and so forth. Have I just made some small mistake that Im not seeing?

[Code].....

View 2 Replies

ActionScript 2.0 :: XML - Make The Final Trace Statement Work?

Oct 17, 2006

I have the following code in the main timeline:

[Code]...

how to make the final trace statement work?

View 5 Replies

ActionScript 2.0 :: If Statement Inside MovieClipLoader Object Work?

Aug 25, 2008

I recently built a preloader using the MovieClipLoader object. I used the following events: OnLoadComplete, OnLoadProgress and onLoadStart. I registered my listeners etc and then I decided I wanted to get a bit fancy. So I decided that within the onLoadProgress I would add an"if" statement, this if statement would basically say if the loaded content equals 70 then animate the preloader graphic off the screen using tweening (very simple). The onLoadProgress is continuously called while the content is being loaded but it seems that it does not want to correctly execute my if condition.

Here is the code for the onLoadProgress.
loadListener.onLoadProgress = function (target:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
trace("onLoadProgress");
txtLoaded.text = String (Math.floor (bytesLoaded / bytesTotal * 100)) + "% loaded";
mcProgress._xscale = bytesLoaded / bytesTotal * 100; // address the bar
[Code] .....

View 5 Replies

Swf Into Fla Doesn't Work?

Jul 23, 2009

I have a swf that is pretty complicated, you can interact with the page and go to different keyframes and it stops and/or starts depending on buttons, but I want to put it in a fla or something so I can put other swfs next to it and build it up and put several of them together as one.

I don't care about making it too complicated, I just want one interactive swf to go to the next compiled swf when that movie ends, but when I try importing it or loading it it just runs straight through without stopping or paying any attention to the scripting.

View 16 Replies

ActionScript 2.0 :: CS3 'if' Doesn't Work But 'else' Does

Apr 8, 2010

I am trying to more between frames using the data returned from a node n_EventID in an xml, when the node returns "1408" I want to move to frame 1 but if it returns anything else I want to move to frame 2. The part where the code moves to frame 2 seems to work perfectly but I can't seem to move to frame 1 when "1408" is returned.

xmlResultFinish = new XML();
xmlResultFinish.ignoreWhite = true
xmlResultFinish.onLoad = loadXmlResultFinish;

[code]....

View 5 Replies

Flash Doesn't Work On Some IE's?

Apr 14, 2010

I'm having a problem, where random IE's are not able to display my .swf file. All the IE's are IE8 with the latest flash pluggins and all security's are set at Medium, however some IE's get just a grey box and other's get the full flash file. What's going on? It works fine in Safari and Firefox of course, but why so much difficulty with AS3 Flash9 in IE? here is a link to the site, and it's the big image changer at the bottom of the front page.

[URL]

View 2 Replies

.swf Fullscreen Doesn't Work?

Nov 19, 2009

But my proublem is that I have a flash presentation.The defalt for moving the slide screens back and forth are left and right arrows.It works fine when tested or even the .swf fileBut then the left and right buttons don't respond when I go to fullscreen.

View 5 Replies

ActionScript 3.0 :: SWF Doesn't Work In IE

Dec 10, 2009

Is it common for AS3 apps to not work in IE? Is there a way to make them work? I have a movie clip in my library linked to a custom class Main and I have nothing on stage. Just one frame. Everything is built inside that movie clip. I add that movie clip to stage through a document class and everything works perfectly in Firefox and Chrome but when I open it in IE, it's just a blank page.

View 6 Replies

IDE :: Pop Up Doesn't Work In IE But In Safari?

Apr 12, 2007

i followed the instructions oh how to make a centered pop up window here :i'm using a mac..nd it works in Safari... but when i try to use explore to open it, the pop up window doesn't come up...why is that.......? did i do something wrong?here is my website:and please click on 'message' to see for yourself.

View 5 Replies

IDE :: Pop Up Doesn't Work In IE But In Safari

Jan 9, 2004

i followed the instructions oh how to make a centered pop up window here : [URL]

i'm using a mac... and it works in Safari... but when i try to use explore to open it, the pop up window doesn't come up..

here is my website: [URL] and please click on 'message' to see for yourself.

View 6 Replies

ActionScript 2.0 :: F8 DuplicateMovieClip Doesn't Work

Jan 15, 2009

this is what i have on the maintimeline:[code]I have 4 moveiclips called: redhex, bluehex, greenhex, and yellowhex.what the above code should do is make a 15x15 grid of hexes (yes i wanted all 4 hex mc's overlapping each other at each space on the grid.).Before i added the lines to dupllicate the blue, green, and yellow hexes also... the redhex movieclip duplicated exactly as it should.But after adding the lines to duplicate the blue, green, and yellow hexes also, in the same locations... Nothing at all showed up when i tested the movie (not even the redhex's)

View 4 Replies

ActionScript 2.0 :: Key.isDown Doesn't Work?

Apr 12, 2009

In the actions of a movie clip,I want to use something like:

PHP Code:
if(Key.isDown(W)){
//do stuff
}

But,it does not take anything else than LEFT,RIGHT and some others.I even tried ASCII:

PHP Code:
if(Key.isDown(100))
{}

It doesn't work.Then how do we use keys like W,A,S,D?

View 1 Replies

9-slice Scaling Doesn't Work

Sep 18, 2009

I've made a rounded rectangle with a gradient fill and another rounded rectangle over it with a transparency to create kind of a glossy effect. Both objects are part of a symbol in the library of the FLA file. Then, I activated the checkbox to create a scale-9 grid, and the Export for Actionscript checkbox in order to add this symbol from AS3. Next I made sure that every rounded corner was completely included in the slices on the edges of the grid. Well, no matter what, the object is scaled as a normal graph: the rounded corners appear bigger and deformed.

View 4 Replies

ActionScript 2.0 :: [F8] : DuplicateMovieClip Doesn't Work

Mar 12, 2010

this is what i have on the maintimeline:

Code:

initialize();
function initialize() {
for (i=1, r=0; r<15; r++, i++) {
for (c=0; c<8; c++) {

[code]...

I have 4 moveiclips called: redhex, bluehex, greenhex, and yellowhex.what the above code should do is make a 15x15 grid of hexes (yes i wanted all 4 hex mc's overlapping each other at each space on the grid.).Before i added the lines to dupllicate the blue, green, and yellow hexes also... the redhex movieclip duplicated exactly as it should.But after adding the lines to duplicate the blue, green, and yellow hexes also, in the same locations... Nothing at all showed up when i tested the movie (not even the redhex's)

View 8 Replies

ActionScript 2.0 :: CS3 Querystring Doesn't Work

Oct 26, 2010

I'm in a big distress, I'm using AS2 with CS3 (Flash 9.0 on OSX Snow Leopard) and I can't get the querystring. I don't understand it has always worked before with my previous version of Flash. I'm using this AS code: t_txt.text += _root.age; I have a dynamic text linked to t_txt. For the HTML I simply published using Flash, then I changed in the html file like this:

<param name="movie" value="age.swf?age=56" />

And

<embed src="age.swf?age=56" quality="high" etc >

When I set to use AS1 it just works fine. But I can't use AS1 all my projects are with AS2. So what's wrong?

View 3 Replies







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