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


Similar Posts:


ActionScript 2.0 :: Flash8 For Loop Scope?

Dec 3, 2009

A question about the variable within the for loop it is always stuck on False -- even if the first condition gets achieved.I read that the for loop variable is treated as if it is completely seperate varibale from the one in the main even if they have the same name

PHP Code:
canwalk = true;function isheblocked [code]..........

View 2 Replies

Flash8 :: Looping Background And How To Stop A Loop

Aug 28, 2009

ive created a character loop for two characters that are in a walk cycle. when a button is pressed both characters change animation, now ONE of the characters is doing what i want it to, which is, change from walk to aim, then back to walk. but the other character is going from one animation to the second, and then just continuing to loop the second animation.

[Code]...

View 4 Replies

ActionScript 2.0 :: Flash8 Load Several Xml Within Loop, Or Just Replace One?

Jan 30, 2010

I am working on a gallery, the contents of which is arranged into categories and sub-categories. So, each category has a folder and sub-folders.

I have an xml file in the root directory which I'm using to create a menu. When the visitor clicks a button in the menu, the relevant set of images will appear (only one set at a time).

But, the thing I'm confused with is this...

If each sub-folder contains an xml list of images, should I

a.)load all the xml files right away? Into an array, for example, which will hold all the data? If so, How can I load xml files in a loop? And is this the right approach if there are a lot of files to include? Or,

b.)Is it possible to load the xml from each button and have it override the previous xml?

The code below loads an xml when the first button is pressed, but after that it does nothing!

Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;

[Code].....

View 1 Replies

Flash8 :: Plays A Sound In The Library On Loop?

Aug 21, 2011

i was looking into if there is anyway to work with sounds using actionscript?Basically im looking for something that

* Plays a sound in the library on loop

* stops that sound

* mute that sound (so it's still playing but cant be heard)

* unmutes that sound

the idea is so i can spread out this in scripts instead of in the frames.

View 1 Replies

ActionScript 2.0 :: Flash8 Scrolling MovieClip: Loop Within Set Area?

Jul 29, 2009

I've got a movieClip that's scrolling across the stage that loops nicely (kinda like the many cloud animations out there).

I've set the clip up to stop it's scrolling on a rollOver, and start up again on the rollOut.

My problem is that after the rollOut the loop doesn't work. The movieClip just keeps travelling.

Code:
blue.onEnterFrame = function() {
blue._x -= 2;
if (blue._x<=-0) {

[Code]....

View 5 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

ActionScript 2.0 :: Flash8 : Search Multiple Arrays For A Value?

Feb 26, 2009

I am attempting to search multiple arrays (over 300) for a specific value which will then determine if that question is to be loaded. I have used these over the years as the quizzes simply loaded questions randomly. Now I am appempting to move this into a computer adaptive test format. I have most everything worked out except for this part which is the key to the project.

What I have is 300+ arrays like the ones below. Once a student answers a question either correctly or incorrectly a difcal value is assigned. It is that value I need to search for to determine which question to load.

For example if the student answered a question incorrectly and the difcal was calculated as -4.03 (difcal values are always in array element[0]) I would need to search the all arrays to find that value and then load that array into the question function.

Code:

var q1:Array = new Array();
q1[0] = -4.03;
q1[1] = 0.57;

[code]....

View 2 Replies

ActionScript 2.0 :: Flash8 : Preloading The Multiple Sounds?

May 14, 2009

I have 10 sound files in an array.I am wanting to preload all of them and update a counter once each one loads sucessfully.So when song 2 for instance finishes loading then the counter would be at 2,then 3,etc....I think maybe I need to use a while loop to hook each sound into a load event?

View 1 Replies

Flash8 :: Multiple Album Photo Gallery

Jul 25, 2009

Being a newbie to this flash design and actionscript and self learning with the help of forums and tutorials I have create a simple photo gallery for a website I'm building. And all works fine. What I would like to do is add a list box to display different albums but I am having trouble with the actionscript and how to set out the XML file.

[Code]...

View 1 Replies

ActionScript 2.0 :: Flash8 - Use One HitTest For Multiple Objects?

Jul 28, 2010

I'll try to make my question pretty short and simple.

[Code]...

So what I'm trying to do is make the character stop when it runs into something. I can do that, but it will only work for one "block" movieclip I put on the stage. What can I do to make this work for multiple "blocks"?

View 2 Replies

ActionScript 2.0 :: [Flash8] Keylistener On Multiple Keys

May 22, 2007

I got a little problem on a simple code: There are 5 Mcs on stage named Key1 to Key5. I got a listener on keyboard that put the mc alpha to 40 if you press the key of the mc (1 - 5), and turn the alpha to 100 if key isn't pressed

Code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(49))key1._alpha=40;

[Code]....

The problem is that it works perfectly if you press a key at time, but it don't work if you press the 5 keys simultaneously , (make strange things :'1' to '4' pressed works, but '3' to '5' make the 5th mc as un-pressed) Is there a fine way to test if the 3 simultaneous keys (char '3' to '5') are pressed ?

View 2 Replies

ActionScript 2.0 :: Flash8 Multiple Variables Controlled By Key Presses

Jun 26, 2009

I am making a game using AS2, in which the user controls the character with WASD. I am making a tutorial level in which the level only advances past the first frame after the user has pressed W, A, S, and D. The level is a single frame in which there is a movieclip that has all the enemies. I made an offscreen button in the movieclip which has the code

Code:
on(keyPress "w"){
var w:Boolean = true;
}

[Code].....

When I run it, nothing happens and it stays on the first frame of the movieclip. No errors are shown in the output panel.

View 2 Replies

ActionScript 2.0 :: [Flash8] Multiple Scrollers Working On A Page

Apr 19, 2007

Has anyone found a solution to having multiple scrollers work on the same page? I tried applying different instance names on all components but that didn't work either. The AS below only allows for one scroller to work.

[Code]...

View 1 Replies

ActionScript 2.0 :: Flash8 Loading External Text With Multiple Spaces

Sep 5, 2009

I have been trying to get this working right for days and it is driving me crazy. It should be very easy, so I'm not sure what I'm missing.

I'm loading in an external text file, which is fine, but the problem is with how it is displaying.

It should look like the attached word file. But when I paste it in a text file it gets messed up. A sample of that is attached as well. I have tried making it look the same in the notepad file, but that doesn't come out right in the flash.

I have tried everything, importing as html, using xml files, copying the text into different programs and then into the text file.

View 3 Replies

ActionScript 2.0 :: Flash8 Previous Working Fla's Return Multiple Errors?

Dec 7, 2005

I've found out that when publishing with Flash 8 my previous MX's working fla files, I get multiple errors.I've had a look at the Export publishing settings and I think they're all correct: - Exporting version: 8- AS Version: 1.0So, I guess it must be a silly thing I'm doing wrong but after a long while I haven't been able to know what's wrong. Perhaps AS compatibility is not that accurate?The most common error I get is:"A ')' or ',' was expected" or"An unexpected '}' was found"(I'm using Spanish Flash 8, so I don't know if this is the exact message you're given in English Flash 8) The 'supposed to be wrong' code seems to be in lines like[AS].posicion = posicion+eval("abc" add i)+gap;abc=eval("_parent._parent.abc" add _parent.n)[/AS]and I even get a "Declaration must be inside a on/onClipEvent controller" here:[AS]._xscale=abc*1.4;[/AS] ...while ALL of this code worked perfectly in Flash MX, I get up to 104 errors in Flash 8

View 7 Replies

ActionScript 2.0 :: Flash8 - Tab Backwards Multiple Text Input Fields Instead Of Forwards

Aug 8, 2007

I have multiple text input fields (up to 40, depending on visibility)that tab backwards instead of forwards. Is there a simple solution to this mis-direction?

View 2 Replies

ActionScript 2.0 :: Flash8 - Buttons Inside Multiple Random External Swfs

May 23, 2008

detailed as possible. Took basic Flash classes, but no AS other than searching online, taking a couple Kirupa tutorials, so it's all greek tho recognizably so. I have 10 individual "scenes" currently in one swf file, but would love to break these apart individually, and load each into a "container" swf with a "random" code (so each visit to my site starts differently) which I've located and tested with Kirupa's super "Loading random movies" tutorial. Question is: currently I have active buttons in each scene which advance playhead to the next scene. How can I code these to load another swf into the main "container" file and kill/replace the current swf?

Another tutorial "Transitions between external swfs" suggests "if your buttons are not located on the main timeline, you will have to change the path to the container movieclip" - but doesn't show exactly how to do this, and I have to say I can't figure the "path" out! Another issue I foresee is that I'll need the script to automatically pull in the next swf file when the current one finishes, if the visitor doesn't click the button first... Haven't been able to find this with a few hours searching, though some threads come close.

View 1 Replies

ActionScript 2.0 :: Flash8 Dragging Multiple Movie Clips Using Begindrag Senocular Class

Feb 27, 2010

I need to have a custom mouse cursor and also have dragable object on my page. im using flash 8. I came across this site called senocular which had a list of .as files [URL]
and some simple useage such as:

on(press){
this.beginDrag(true,0,0,300,300); // constrained to 300x300 square
}
on(release, releaseOutside){
this.endDrag();
}

I would love to get this to work, however I dont know how to import this into flash 8. I thought classes only worked for flash 9 and actionscript 2.

View 1 Replies

ActionScript 2.0 :: Flash8 Fade In Fade Out Over Multiple Buttons

Apr 1, 2011

I have 4 buttons, I need each button to fade the others out as the mouseover event occurs. I can get this to work if I add in one other button to the actionscript on one, but as soon as I add actionscript for another one I get errors.

[Code].....

View 10 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 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







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