ActionScript 3.0 :: Multiple Conditions In A FOR Loop?

Apr 6, 2010

Is it possible to have multiple conditions within a FOR loop ?

Code:

for (var i:Number = 0; (i < anArray.length & aBoolean = false); i++) {
trace("woah, this worked!");
}

So the loop carrys on as long as 'i' doesnt exceed the length of the array AND a Boolean remains false.

View 3 Replies


Similar Posts:


ActionScript 2.0 :: CS3 Multiple Conditions In A "for Loop" ?

Nov 6, 2009

Can you use multiple conditions in a for loop?

For example, I am trying to attach images 1-6 to a specific movieclip, and images 7-12 to another and so on.

So my logic was to do this:

for (i=1; i<=6; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i) ;
}
for (i=1: i>6 && i<13; i++) {
container2.attachMovie("thumb"+i,"thumb"+i+"_mc",i );
}

But it's not working. Ony the top loop works.

View 1 Replies

ActionScript 2.0 :: Multiple Conditions - An Object Will Go To A New Frame If Multiple Buttons Are Pressed?

Aug 12, 2009

i have an if statement, an object will go to a new frame if multiple buttons are pressed

PHP Code:[code].....

now i want it so that if one condition is met the mc will goto frame 2, if 2 conditions are met, frame 3 and if 3 conditions are met, frame 4.i know i could do this with a lot of if statements but i have a lot of movie clips to use this code on, so is there any way to write an if statement that will trigger different options if multiple conditions are met?

View 4 Replies

ActionScript 2.0 :: Multiple Conditions Not Working?

Jul 26, 2009

I've got two functions that work separately, but don't like to work together. Specifically, function "onEnterFrame" stops working after function "connectT."

function onEnterFrame(){
connectT();
checkBounds();
}

[code]....

View 7 Replies

ActionScript 2.0 :: Multiple Conditions Not Working

Jun 15, 2011

I have some code that needs to read like the following:IF the original position(origX) DOES NOT EQUAL where my object is(this._x) AND delay variable(delay) is set to 0, then I need to display a movieclip. There is an X on the movieclip so users can close it, and when they click the X, the delay variable is set back to 1, so the movieclip won't keep loading.

ActionScript Code:
var delay = 1;
if (origX == this._x && delay == 1)
{

[code]....

View 4 Replies

ActionScript 2.0 :: If Statement With Multiple Conditions?

May 18, 2005

I want to set multiple conditions for an if statement, but I don't want the conditions to all have to be true, I want to say if (a or b or c or d, etc. is true) then do this. I don't want to say if (a && b && c && d, etc. is true). Is it possible to have an if statement with an "or" in the condition? If so, what's the proper syntax for that?

View 1 Replies

ActionScript 2.0 :: Multiple Conditions To One If Statement?

Jul 8, 2009

This is my code

Code:
if (mp1._y != 555) {
new Tween(mp1, "_y", Strong.easeOut, 650, 555, .5, true);

how/where can I ad a second condition like

Code:
mp1._alpha!=100)

to that same statment before that tween plays

View 2 Replies

ActionScript 2.0 :: Statement With Multiple Conditions?

May 18, 2005

I want to set multiple conditions for an if statement, but I don't want the conditions to all have to be true, I want to say if (a or b or c or d, etc. is true) then do this. I don't want to say if (a && b && c && d, etc. is true). Is it possible to have an if statement with an "or" in the condition? If so, what's the proper syntax for that?

View 1 Replies

ActionScript 2.0 :: Switch/Case Multiple Conditions?

Dec 31, 2007

I have this switch here .. which doesn't seem to be working..

Code:
Power = 100;
switch(Power){

[code]....

View 4 Replies

ActionScript 3.0 :: Checking Against Multiple Asynchronous Conditions?

Feb 1, 2010

If I have one parent class that instantiates 5-10 different child classes, each of which need to load multiple assets etc, how can I check within that parent class to make sure all of the 5-10 children are loaded & ready to go before telling the program to continue?

The tricky part is that the exact number of those 5-10 classes that are instantiated is determined at runtime, so I can never be certain which I should be waiting on and which not to be waiting on. And just to be clear, these are different modules of sorts, not multiple instances of the same exact class.

View 3 Replies

ActionScript 2.0 :: Playing Multiple Conditions In An If Statement

Mar 13, 2002

I have a button that I want to play first one frame label in a movie clip, and then another, depending on a variable.

The problem that I am having is that the movie does not wait for the first part to finish before jumping to the next.

Here is an example of the code

on (release) {
if (_root.busMove.bus == 2) {
_root.busMove.gotoAndStop ("A2beg");
_root.busMove.gotoAndPlay ("Bbeg") ;
}
}

It goes right to Bbeg, flickering briefly over A2beg which will not do!

View 10 Replies

ActionScript 3.0 :: Flash Filtering XML With Multiple Conditions

Jul 7, 2010

I am trying to filter xml data based on a varying amount of factors, both category and range (code below). Is it even possible to put more than one conditional statement in an XML filter?

Code:
var l_results:XMLList = xml.products.product;
// testing
currentRanges = ["floss", "envy", "cool", "moon"];//

[Code]....

View 1 Replies

ActionScript 2.0 :: [MX] Multiple "IF" Conditions?

Jun 3, 2003

How can I put multiple conditions into an IF block? I have tried the following and it doesnt work ;[AS]if(_root.neo.hitTest(_root.camera2)) & (camera2Off = true){[/AS] I have also tried two &'s but that doesnt work ether

View 1 Replies

ActionScript 3.0 :: Flash For Loop Loading Multiple Images Into Multiple Movieclips

Feb 5, 2012

[Code].....

I have a group of 16 images that I would like to load 1 of each into each movieclip. I want image1 to be inside of visual1, image 2 inside of visual2, and so on. the images are named like, 1960s_(1).png where the 1960 (year) part is coming from the rangeNum variable. The above gives me this error: 1061: Call to a possibly undefined method addChild through a reference with static type int.

View 4 Replies

ActionScript 2.0 :: 1 For Loop To Loop Multiple Arrays?

Aug 25, 2010

How do i word a for loop to make it loop through multiple arrays?I want 1 for loop to loop through multiple arrays in order to move/alter objects.I want to keep the arrays separate.

ActionScript Code:
characters = new Array();
characters[0] = male;

[code]........

View 3 Replies

ActionScript 3.0 :: Loading Multiple Images To Multiple Loaders With A Loop?

Sep 2, 2010

i have been building a library that has thumbnails which you click to view the full image. i have built the application it works but i want to change the way the image on the actual thumbnail loads using code instead of manually adding the value to the url loader component.

var myX;var instanceN:String;trace(instanceN);var currentLoad:uint = 0;// current loader and image loadingvar thumbnailURL:String;//Thumbnail URLvar thumbReq:URLRequest;// Thumbnail url requestfor(var k:uint = 0;k < iL_btn.length; k++)[code].....

the loop runs fine without the last line of code which i've commented out.the make up of these thumbnails are a uiLoader component which are each inside there own movieClip.what i wanted this to do was every time the loop runs it currentLoad adds 1 to its value then that value is subbed into instanceN:String and thumbnailURL address that bit works the trace statements read correctly.but my issue is using the instanceN value as the instance name path which then loads the current thumbnailURL value which is the URL address for the thumbnail picture.when i try to load the url address using the commented out code above i got the error .TypeError: Error #1010: A term is undefined and has no properties.the trace statements correct values below

the first value is the currentLoad value.

the second value is the instance name path.

the third is is the URL address for the thumbnail.[code].....

View 3 Replies

Professional :: For Loop To Add Multiple Mc From Library?

Jan 12, 2012

I have 3 different MovieClips inside my library,
 
I can put each one severally to the stage,

but I can't put all of them using for loop and addChild();

View 9 Replies

ActionScript 3.0 :: Loop Multiple Flv Simultaneously

Oct 22, 2007

I really hope someone can help me with this one! I've been trying to loop several embedded flv files in one flash document. I've found some really useful script that works when applied to one flv file in the document, however I don't really know how to adjust the actionscript so that it applies to the other three flv files on the page.[code]

View 2 Replies

ActionScript 2.0 :: Dragging Multiple Mcs Using For Loop?

Jan 9, 2009

I have many MCs on the stage ,I just dont want to paste the same code to all MCs one by one..so I want to ust the following loop but not sure where to paste the following code.

ActionScript Code:
myArray=new Array("mc1","mc2","mc3","mc4","mc5","mc6","mc7","mc8","mc9","mc10")
for(i=0; i<=myArray.length; i++){

[Code]......

View 4 Replies

ActionScript 3.0 :: Create Multiple MC's In A Loop?

Oct 26, 2009

I want to make multiple empty MCs and fill each one with a thumbnail for a menu. I want to do this using for loops so I can control as many as I need.

What's the most efficient way of doing this?

I'm used to creating empty MCs in AS2, but I'm not familiar with the new display object way of handling this method.

So far I have this:

Code:
for (i=0; i<numImages; i++) {
thmb.push(gallery.features.image[i].@thmb.toString());
var imageLoader:Loader;

[Code]....

View 6 Replies

ActionScript 3.0 :: Multiple Loaders In Loop?

Jul 6, 2010

in a loop i wish to load a sequence of images in an individual movieclip for each. e.g image0 in movieClip0, image1 in movieClip2 etc...

i've set up the loop and the movieclips are added using an array.

addChild(aMovieClips[i]);

when i use loaders.load(new URLRequest("assets/images"+section+cityCode+i+".png"));

it unloads the previous images and only shows one image in the last movieClip.

I then tried using loader[i].load but this didnt work.

I then tried creating the loaders outside of the loop and then adding them to an array but this doesnt seem to work.

specifically it breaks at aMovieClips[i].addChild(aLoaders[i]);

How do i go about adding a different image to each individual movieClip.

View 5 Replies

ActionScript 3.0 :: Loop For Multiple For Statements?

Oct 20, 2010

I need to put a load of MC's on stage with the use of an array as such:

Code:
for (var i = 1; i = 4; i++) {
if (reg[i] == "singlewall") {
var Wall:MovieClip = new wallClass() as MovieClip;
mainClip.addChild(Wall);
}
}

I need a lot more then 4 though and I need a way to make new "Wall" variables
Tried doing it with:

Code:
for (var i = 1; i = 4; i++) {
if (reg[i] == "singlewall") {
var Wall:MovieClip = new wallClass() as MovieClip;
Wall.name = "mc"+i;
mainClip.addChild(Wall);
}
}

This does not work though, yields an infinite loop somehow

View 4 Replies

ActionScript 2.0 :: Loop The Multiple Scenes?

Mar 9, 2010

1. Created a flash banner ad on the first scene. Take note they're all under frame one because I used movie clips for the animations (Movie clip ends on the 100th frame and not sure if I need to add a stop(); code there or place the gotoAndStop command). Anyways, moving on.

2. I created a new banner onto another scene which by now I have 2 scenes. Just like scene 1, all the animations and such are all under frame 1.

3. Placed an action script on the first scene to play the next scene.
gotoAndStop("scene 2", 1);

4. For the second I placed the action script:
gotoAndStop("scene 1", 1);

Output:It looks like my banner ad is flipping one scene from another without stopping. I know my action script is not correct. I know you folks are far more experience in flash, so I implore your wisdom.

View 2 Replies

ActionScript 3.0 :: Multiple Radio Buttons In For Loop?

May 15, 2009

I have this for loop that is basically pulling some info from an xml file and putting it in a list box. And for each item in the xml, it also adds 2 radio buttons.Everything is working properly except all the radio buttons have the same y location, and i want them to be spaced apart, not on top of each other.I have tried messing around with the y location (rb1.y+105, etc) but I'm not having any luck.

for (var i:uint=0; i<il.length(); i++) {
lb.addItem({data:il.description.text()[i],
label:il.title.text()[i]});

[code].....

View 2 Replies

ActionScript 2.0 :: Flash8 Affecting Multiple MCs With A For Loop?

Feb 24, 2010

Let's say I have ten widgets that have ten items that need to be turned off. What am I doing wrong here?

Code:
for(i=1;i<=10;i++){
var tempWidget = ["widget0" + i];
trace(tempWidget);
tempWidget.item._visible=false;
}

The trace returns the correct value yet the loop doesn't turn the ten items off. Why?

View 2 Replies

Professional :: Loop Playing Multiple SWF Files

Jul 8, 2011

I have several SWF files which are essentially little trivia files, provided to me by a 3rd party. They are individual files that number about 20. I am wondering, how can I play this as a list; like a playlist, and then loop back to restart? I'd like to do this in the stand alone player however it can only seem to load 1 file at a time. How I might look to accomplish this looping playlist?

View 1 Replies

ActionScript 3.0 :: Working With Multiple Instances - For Loop?

Dec 17, 2011

I'm very new to Adobe Flash CS5.5. Can you create a common instance EG: "Enemy" and then control it like so:
Enemy.x += 1;
So that all instances of Enemy will move forward one pixel each frame? Instead of just one enemy? If this is not possible could I set up some sort of array of enemies like you can in C and try something like:
int EnemyNo = 1;
for(EnemyNo = 1; EnemyNo < 5; EnemyNo++) {
Enemy[EnemyNo].x += 1;
}
Does Flash even support "for" loops?

View 21 Replies

ActionScript 3.0 :: Refering To Multiple MovieClips Using Loop

Jul 5, 2010

I simply want to be able to access 3 already created, but not yet added movieclips using a loop. I've tried a few code combination but can't figure out the syntax.[code]

View 2 Replies

ActionScript 3.0 :: Get Regarding Motion With Multiple Movieclips (from A For Loop)

Sep 18, 2010

there is something i just dont get regarding motion with multiple movieclips (from a for loop). I have tried many different approaches, and every time there is either all the clips move in the same direction, other times they only move one direction, other times when i get individual motion for each object they dont move smooth, and seems more too move very slowly across the scene but rapidly back and forth in a small area. I dont have any specific code to show, but does anyone have tips or a place to direct me, cause i dont understand the logic of it, however i want to understand.

View 2 Replies

ActionScript 3.0 :: Mask Multiple Object Through A Loop?

Oct 4, 2010

can I mask multiple object through a loop

should be the question

ActionScript Code:
for (var m = 0; m < mylooper; m++ ) {
MovieClip(holdbox.getChildByName("mytxt" + [m] )).mask = mymask
}

it seems to only mask the last object not all of them

View 3 Replies







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