Actionscript 3.0 :: Disabling Clips That Are Placed From A Loop?

Aug 2, 2010

I've go some movieclips I dynamically placed on the stage in a loop using addChild(). The clips have there own class called DragAndDrop. Once the clips are are drop to the hitarea I want to deactivate them. The problem I'm having is when I run the function in the DrapAndDrop class it deactives not only the movieclip that was just dragged but the last one that was attached in the loop as well (ie I drop mc1 into the proper area mc1 and mc7 deactive).

Here is the loop that add all the clips to the stage:

[Code].....

I don't understand why its disabling both the dropped clip and the last clip in the loop when supposedly event.currentTarget should only carry the value of the object being dropped and not the instance of the object.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Disabling Clips That Are From A Loop?

Aug 1, 2010

I've go some movieclips I dynamically placed on the stage in a loop using addChild(). The clips have there own class called DragAndDrop. Once the clips are are drop to the hitarea I want to deactivate them. The problem I'm having is when I run the function in the DrapAndDrop class it deactives not only the movieclip that was just dragged but the last one that was attached in the loop as well (ie I drop mc1 into the proper area mc1 and mc7 deactive, 7 being the final clip in the loop). Its frustrating me because I dont know why its happening and I dont know how to fix it?Here is the loop that add all the clips to the stage:

Code:
private function createTerms():void
{

[code].....

View 1 Replies

ActionScript 2.0 :: Disabling Movie Clips Via _xscale?

Nov 21, 2006

I have some MC's and they have buttons and other MC's within them. (dynamically loaded). I don't want them to be seen or the buttons enabled until my startbutton is pressed. I tried

mc.enabled = false
mc._alpha = 0

and it didn't work. (If anyone knows why, I'd be curious to know the answer)

So I did mc._xscale = 0

and that seems to do the trick. They aren't visible and there's no fear of anyone pressing any invisible buttons.

View 8 Replies

ActionScript 2.0 :: Buttons Within Movie Clips Are Disabling?

Oct 8, 2003

so...i've got these buttons in movie clips. the buttons are animated for mouseover and i've also got an action on the first frame of the main timeline to get the buttons to stay active when clicked on, so the view knows where he is.the problem with this is that any time i go to put an action on the button itself to pull up an external .swf or whatever, the buttons stop animating and/or stop staying "depressed" on the active sheet.

View 1 Replies

IDE :: Referring To Clips - Loop To Add Clips By Class And Give Them A Name

Mar 15, 2009

I have created a loop to add my clips by class and give them a name

[Code]...

Then I want to loop through these clips and change the alpha, I have tried casting as I thought that was how you do it but I get the 'cannot convert string' error

[Code]...

View 1 Replies

Flash :: Loop Through Different Movie Clips In AS3?

Nov 13, 2009

I have five movie clips in my library. I want to load each to the stage with a fade in and fade out. I thought I could just call them into an array, but I can't find how to reference them. I have other clips in the library too so I can't just grab them all.

View 2 Replies

ActionScript 3.0 :: For Loop Movie Clips?

Jun 20, 2010

Is it possible to put the following into a loop?

ActionScript Code:
var box1:Box = new Box();
var box2:Box = new Box();

[code].....

View 1 Replies

ActionScript 3.0 :: Movie Clips In For Loop?

Feb 5, 2009

I've got a MovieClip with a linkage name of trackInfo. I'm trying to get XML information in a for loop to create and populate instances of the MovieClip for the length of the XML file.Here's what I have so far:

Code:
var myXML:XML;
var myURL:URLRequest = new URLRequest("tracks.xml");

[code].....

View 14 Replies

ActionScript 2.0 :: Get The For Loop To Duplicate The Clips?

Feb 29, 2004

I'm trying to make a bit stream across my page when you mouseover a button. The bit stream can be quite long, so I wouldn't think to do it by hand. I'm wondering how I would go about making the stream start out, and how I can get each bit to follow the other right behind it. (They're about 10 pixels wide) I can get the for loop to duplicate the clips, but I can't seem to get them in order.

View 5 Replies

ActionScript 3.0 :: Using A For Loop To Display Movie Clips In A Row?

Sep 4, 2009

All I am trying to do is display a movieclip (just a small rectangle) and have it repeat along the x-axis, adding one to it's instance name each time. It seems to work according to the trace statements but it only displays the last movieclip.
 
Here is the code:
 
var transition:mcTransition = new mcTransition();
for(var i:int = 1; i < 10; i++){    trace(i);    addChild(transition);    transition.x = i * 10;    transition.name = "transition_mc" + i;    trace(transition.name);    trace(transition.x);}

View 2 Replies

ActionScript 3.0 :: Use A For Loop To Display Movie Clips In A Row?

Dec 9, 2009

I know this is probably really simple but it is frustrating me. All I am trying to do is display a movieclip (just a small rectangle) and have it repeat along the x-axis, adding one to it's instance name each time. It seems to work according to the trace statements but it only displays the last movieclip.
 
Here is the code:
 
var transition:mcTransition = new mcTransition();
for(var i:int = 1; i < 10; i++){    trace(i);    addChild(transition);    transition.x = i * 10;    transition.name = "transition_mc" + i;    trace(transition.name);    trace(transition.x);}

View 1 Replies

ActionScript 3.0 :: Use A Loop To Add Some Movie Clips To The Stage

Mar 20, 2011

I'm trying to use a loop to add some movie clips to the stage, but I want to give each one a different name so I can refer to them in another function, but I don't know how that is done. I'm trying to learn how to do this so I can create an Isometric game. Here's my code....

[Code]...

View 3 Replies

ActionScript 3.0 :: Create Movie Clips With Loop?

Sep 10, 2010

So basically, this is how I'm adding one movie clip to the stage. var balloon_mc1 = new balloon(); this.addChild(balloon_mc1); How do I do this for 100 of these movie clips, without typing var balloon_mc1 = new balloon(); this.addChild(balloon_mc1);

var balloon_mc2 = new balloon(); this.addChild(balloon_mc2);

var balloon_mc3 = new balloon(); this.addChild(balloon_mc3);

View 3 Replies

ActionScript 2.0 :: Referencing Movie Clips In A For Loop?

Jul 16, 2003

I want to have 4 to n movie clips on my stage and to be be able perform monotonousperations on all of them in a for loop like so.

for(i=0;i<numClips;i++)
{
if(this.hitTest("clip"+i))

[code]......

View 3 Replies

ActionScript 2.0 :: Loading Into Clips Created By For Loop?

Nov 28, 2008

why this won't work?

Code:
var base:MovieClip = this;
// initiate

[code].....

View 1 Replies

ActionScript 2.0 :: Attaching Movie Clips With A Loop?

Feb 24, 2004

I'm trying to make a portfolio page where each of my thumbnails loads with the 'fading grid' effect. I've made all the thumbnails movie clips with the appropriate script, and they all work fine. I've also set them to be exported for actionscript, each with a number as their name, i.e. "1" "2" and so on.

I was then planning on using the following bit of code to load these movies into my portfolio clip, to save me having to do it at author-time.

[Code]....

But for some reason, instead of loading two movies, each one 10 to the right of the previous movie, it just loads them on top of each other. Is it something to do with the stage not updating?

View 3 Replies

ActionScript 3.0 :: Assigning Names To Movie Clips In Loop?

Mar 21, 2009

im trying to run a loop and assign all my new movie clipswith different names. i have tried .name and ._name they dont seemto be working..

for (var i = 1; i<=5; i++) {
imageName = new ImageMovie();
this.addChild(imageName);

[code].....

View 1 Replies

ActionScript 3.0 :: Loop Through An Array Of 5 Movie Clips Using A Timer?

Apr 24, 2009

I am trying to loop through an array of 5 movie clips using a timer. Below is the script that plays the first movie clip, then plays the next clip over and over.  
 
var timer:Timer = new Timer(2000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();

[Code].....

View 3 Replies

ActionScript 3.0 :: Create Movie Clips With Loop On The Stage

Sep 10, 2010

So basically, this is how I'm adding one movie clip to the stage.

[Code]....

View 4 Replies

ActionScript 3.0 :: Dynamically Naming Movie Clips In A Loop?

Oct 5, 2010

k say i wanted to create a bunch of movieclips in a for loop but wanted to name them something different each time, how would i dynamically name them?

View 1 Replies

AS3 :: Flash - Use An Timer To Execute And Loop Movie Clips Of Different Length?

May 13, 2011

How would I go about using a timer to initiate multiple movie clips at once, and then loop them if they are all different lengths so that they restart in sync once more?

For example, say at t=0, 3 movie clips are started. Movie clip 1 is 3 seconds long. Movie clip 2 is 6 seconds long. Movie clip 3 is 10 seconds long. Movie clip 1 would end before movie clip 2 and 3, but I don't want it to restart until the others are both finished.

Furthermore, is it possible to set a countdown so that the the movie clips are initiated not after a duration, but after a specific time? For example, instead of having a timer countdown from 10 seconds and then playing, it instead countdowns until say 12:00 PM and then plays the movie clip.

View 2 Replies

ActionScript 2.0 :: Control Dynamic Clips On Stage W/ Loop Function?

Feb 4, 2010

have a mc on stage ('sq') and it gets duplicated using the loop.have a simple Tween function for over state called 'over'how would I write so that when rollover on (for example) sq3,apply the over function to sq2 and sq4 as well (the ones next to the target)?[code]

View 3 Replies

Actionscript 3.0 :: Access Multiple Movie Clips With Loop And GetChildByName?

Nov 3, 2010

All i really want to do is be able to affect multiple movieclips at once with event listeners and greensock tweens.

The first snag I hit was that I couldn't create references to movie clips using the old [] Associative array referencing method. Maybe I still can with AS3, but I couldn't get it to work...

So I found another technique using getChildByName that returns a reference to a movie clips and allows me to store that reference in a variable.

However, the movie clip I'm trying to affect with an event listener resides inside of another movie clips, so to build the address (aka, root.mc1.m2.mc3) to the mc I want to get to is proving to be difficult. (I'm very new to AS3...)

I thought the trace(target1_mc.target2_mc.name); at the bottom of the following code would output the name of target2_mc but it doesn't.[code]...

View 2 Replies

ActionScript 2.0 :: Created A Grid With Over 200 Movie Clips Dynamically Using A For Loop?

Dec 9, 2005

I've been staring at the screen too long and I'm sure the answer is simple but this has been bugging me for a bit now. I've created a grid with over 200 movie clips dynamically using a for loop. I was wondering if there was a way to assign rollovers and such to each new clip using the same loop.

I've been poking around with it a bit but can't seem to get it working and sure don't want to write over 200 rollover functions so any help would be great.

View 7 Replies

ActionScript 2.0 :: For Loop - Duplicates Movieclips - Call / Create The New Clips

Feb 25, 2006

I have a for loop which duplicates movieclips. To call/create the new clips, I use this:

[Code]....

View 1 Replies

ActionScript 3.0 :: Accessing Multiple Movie Clips With Loop And GetChildByName

Nov 3, 2010

All i really want to do is be able to affect multiple movieclips at once with event listeners and greensock tweens.The first snag I hit was that I couldn't create references to movie clips using the old [] Associative array referencing method. Maybe I still can with AS3, but I couldn't get it to work..So I found another technique using getChildByName that returns a reference to a movie clips and allows me to store that reference in a variable.However, the movie clip I'm trying to affect with an event listener resides inside of another movie clips, so to build the address (aka, root.mc1.m2.mc3) to the mc I want to get to is proving to be difficult. (I'm very new to AS3...)I thought the trace(target1_mc.target2_mc.name); at the bottom of the following code would output the name of target2_mc but it doesn't...[code]

View 2 Replies

AS2 :: Professional - Loop To Include All Movie Clips In The Array Without Having To Type Out All Their Names?

Sep 1, 2010

I have a simple array of movie clips ("box1" "box6") that I have created on the stage. I then have a simple onRollOver function that is iterated for each of these movie clips, as shown below. As it is now it's working fine, but I can forsee two potential problems for when I use larger arrays and apply this technique to my real working files.

If I were to have many more movie clips, the first line of code would be much longer as it lists each movie clip instance name. Is there a way to use, for example, a for loop to include all these movie clips in the array without having to type out all their names? As you can see here, I have used a simple numerically-incremented naming process. I think the problem may be that I am using movie clips with instance names assigned on the stage and not created through ActionScript.The function as I have created it makes all the movie clips gotoAndStop(1) and then the one that has been rolled over goes to frame 2. Is there a way of making all the movie clips in the array except the one that has been rolled over gotoAndStop(1), ie. is it possible to exclude the rolled-over movie clip from the first part of the function? Here it works just fine as it is, but I'm thinking that maybe when I start using more complex functions with tweens etc it may cause problems. Or not?

[Code]...

View 5 Replies

ActionScript 2.0 :: Loop - Flash 8 Duplicating Movie Clips And Setting 3 Nodes From XML

Apr 4, 2007

Flash 8 duplicating movie clips and setting 3 nodes from XML. I am trying to read in an xml with 3 parameters; 2 links and one text field for a caption. What am I doing wrong this time?

[Code]...

I am trying to have "bMC" load into and repeater for however many XML props there are. within "bMC" are two MC's that on click would open window or grab file and One Text field which would load in caption. For some reason the "bMC" isnt even loading at all. Attached is the .Fla

View 2 Replies

ActionScript 2.0 :: For Loop With Array And XML - Populate Dynamic Movie Clips And Text Fields

Aug 10, 2007

I have a Flash site I am developing that feeds in XML into various arrays and populates dynamic movie clips and text fields. I am having trouble making a for loop that works with my movieclips and text fields. I am probably only missing one step and if I can figure it out I will cut my lines of code about 10X. I have attached the fla and image files in a zip file.

View 1 Replies

ActionScript 3.0 :: Set Up A Simple Enter Frame Loop To Adjust The Alpha On A Grid Of Movie Clips?

Aug 25, 2009

I've set up a simple enter frame loop to adjust the alpha on a grid of movie clips ("bubbles") using a distance formula from the mouse pointer.I've got a hunch that while this works fine, there's a more efficient or processor friendly way to do it.

grid of mc's created here....and pushed into an array
 stage.addEventListener(Event.ENTER_FRAME, loop);
 function loop(e:Event):void{    for each (var j in bubbArray)[code].....

View 1 Replies







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