ActionScript 2.0 :: Targeting All Dynamically Attached Clips

Aug 21, 2006

I want to target ALL the 20 clips attached as below, at the same time, when I press the button "blue". However, my code can target only ONE of the clips at any time. I have tried attaching the clips to a separate dynamic clip and then targeting it but problems with the registration point (0,0) of that clip means I cannot achieve the result I want:

Code:
for(i=0;i<20;i++){
mc = this.attachMovie("red","red2"+i,i);
var scaleFactor:Number = Math.random() * 80 + 20;
mc._x = Math.random()*500;
mc._y = Math.random()*400;
mc._xscale = scaleFactor;
mc._yscale = scaleFactor;
blue.onRelease = function(){
new Tween(mc,"_xscale",Strong.easeOut,mc._xscale,200,3,true);
new Tween(mc,"_yscale",Strong.easeOut,mc._yscale,200,3,true);
}}

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Targeting Attached Movie Clips

Dec 13, 2005

I'm having trouble figuring out how to target a series of movie clips i'm attaching to my movie.I'm loading some xml for a slideshow and i'm generating a series of dots at the bottom of the screen to indicate how many steps are in the slideshow and the circle is meant to highlight your current position as you step through the presentation.the MC for the dots is two keyframes with a different color and a stop action on each frame.
Here's the rundown of the code:

1. There's nothing weird here, i'm just bringing the xml in [code]

2. Here is the loadXML function i reference in the xml.Data.onLoad above:[code]Okay so now i have some dots with the instance names, step0, step1 etc. right? And at the end of my loadXML function you see the firstImage(); function. This is where my problem is, how do i target the first (step0) instance? I have no problem when I write "step0.gotoAndStop(2);" but I need to figure out how to use a variable to keep moving it along when i make my next and last functions for the slideshow.

3. Here is the firstImage function:[code]how do i target the step the same way i target the image? do i have to go back and do something in the loadXML for loop?[code]

View 2 Replies

ActionScript 2.0 :: Targeting Dynamically Generated Clips?

Jul 27, 2008

I'm trying to make a flash widget that loads thumbnails from an xml document and have each thumbnail link to a different web page. So far everything works fine but I don't like using _root incase the widget gets loaded into another swf. In my expereice _lockroot dosen't always work.the line highlieted in red will only work if targeted through root as opposed to all my othere reference to ["placeHolder"+i] which use this.["placeHolder"+i]. I've tried _parent, this._parent and adding lots of other _parents. Nothing will work this is the file structure _root.placeHolder'N'.tn_mc. how I can substitute _root for a relative path.

widget_xml = new XML();
widget_xml.ignoreWhite = true;
widget_xml.load('flashWidget.xml');//path to document

[code].....

View 1 Replies

ActionScript 2.0 :: Assigning X / Y Positions To Dynamically Attached Clips

Jun 29, 2008

As you can see I am attempting to assign x,y positions to clips that are being "attached."
var clipArray = new Array();
clipArray = [189, 275, 361]; // x positions
for (var i:Number = 1; i < 4; i++) {
this.attachMovie("clip"+i,"butt_"+i,i,{_x: [clipArray(i-1)], _y: 142});
}

View 4 Replies

ActionScript 2.0 :: Targeting Clips On Layers - Change The Level Dynamically?

Jan 15, 2004

[URL] Theres the example to work with....anyway....as you can see, im loading in movies externally...each on its OWN different level....what i want to do is make it so that when i click a menu option on the left, the current swf loaded on the stage closes and the new one comes up (to avoid the clutter of 10 differnt windows all scattered).....here are my thoughts:

1. have variables on the root timeline that are basically "currentLoaded" and "currentLevel" -- which basically will store the name of the currently loaded swf and the level that its on.

2. each swf would have code on frame one that would see if the 'currentLoaded' varible is blank, and if not...it will close the current loaded swf ....

my dilemma is that i dont know how to change the level dynamically...i know you could do the instance name like this:

[Code]....

View 4 Replies

ActionScript 2.0 :: Targeting With Multiple Attached Slideshows

Jun 15, 2007

My flash file creates multiple slideshow instances. These slideshow's are each controlled by some buttons and AS code that reside within the attached container clip. The code for buttons and slideshow nav is as follows (this resides on first frame of attached movie, not on _root):

[Code]...

The problem is that instead of just controlling the slideshow for which you are viewing, the keys control all other slideshows as well at the same time. Where the buttons, when you click them, control only the slideshow that they are contained in. I've tried writing an absolute path to the specific slideshow movie in question like:

[Code]...

View 3 Replies

ActionScript 3.0 :: Targeting Attached Library Item Sub-elements?

Aug 13, 2009

I've created a movieclip in my library which has, among other things, a dynamic text field. This text field has an instance name of "txt".

I then attach this movieclip and want to set the txt instance, but I get an error:

Code:
1119: Access of possibly undefined property txt through a reference with static type flash.display:DisplayObject.

Here's my code:

Code:
var mcLoader:DisplayObject
public function MainClass() {
mcLoader = addChild(new MainLoad)

[Code]....

View 2 Replies

ActionScript 2.0 :: Targeting Attached Movieclip - Variable It Doesn't Recognize Its Path

May 6, 2004

i have a problem adressing or targetting a attached mc when i target de mc directly it works fine but when i try it trough a variable it doesnt recognise its path anymore??? hopefully a part of the code is gonna explain the situation a litle better... this piece works fine:

[Code]...

View 3 Replies

ActionScript 2.0 :: Targeting Attached Movieclip - Variable Doesn't Recognise Its Path Anymore

May 6, 2004

i have a problem adressing or targetting a attached mc when i target de mc directly it works fine but when i try it trough a variable it doesnt recognise its path anymore???

[Code]...

View 3 Replies

ActionScript 3.0 :: Accessing Clips Inside Clips Of Dynamically Generated Clips

Jan 15, 2009

For loop generates clips containing clips. I need to access a specific clip (look_back) within the parent clip generated by the loop. Not sure how to do this.[code]

View 1 Replies

ActionScript 2.0 :: Flash8 - Attaching Movie Clips To Already Attached Movie Clips?

Jun 5, 2011

As most of you don't know, I've been creating an rpg game. And, after several tries of art making, etc, I have finally moved back into coding the game. And now, I'm stuck on the equipment system idea. At first, I thought I would just place a bunch of goToAndStop's for each movie clip to go to a frame that has that certain armor piece. This was my first idea for an equipment system. However, after doing some research, and realizing how much lines of code could be saved, I started looking into simply adding and removing movie clips from the character as my new equipment system idea. Now.... on to the problem.

Basic want/ overall achievement wanted: Create an equipment system, which will basically attach movie clips (items) onto characters, which themselves will already be attached movie clips on the stage.

Problem: What is the exact code to do this? And Is there a better way to do this for an equipment system (a less laggy or more efficient way perhaps that I'm not seeing; Check the code below to get a better idea of what I'm talking about)?

Part of the code (or basic idea of code; see comments for extra details

code:
//Don't worry I have an OnEnterFrame function here;
//attachedObj= the character; figure= the MC name of the character;
attachedObj = attachMovie("figure", "figure"+1, 1);

[Code].....

View 2 Replies

ActionScript 2.0 :: Targeting The Movie Clips?

Jul 29, 2006

I've just finished the navigation buttons in my flash movie which take the viewer to the different sections of the site by directing the playhead to the right frame label. I've used the following code to do this:

on (release) {
this.gotoAndStop("info");
}

I have a problem though: I've also created a movie clip animation where two rectangular shapes move in simultaneously from the left and right sides of the stage creating a sliding door effect. When the viewer is in a particular section (frame) and they use one of the nav buttons to go to another section, I'd like for this animation to play (giving the effect of sort of closing a particular section) and then having another movie clip where the sliding doors open up in the incoming section to reveal that section. My problem is that I don't know what actionscript I'd use to achieve this. What code would I use on the nav button to make the first sliding door movie clip play, then have it move to the second sliding door movie clip and then finally go to the section labelled on the nav button.

View 5 Replies

ActionScript 2.0 :: Targeting Movie Clips?

Feb 25, 2002

Ok, here's the deal. I have a MC in a MC, but i want to target the middle MC.MainStage -> Clock -> clock(art)there is a button on "clock(art)" i want it to target "Clock" to animate. i know the root function should target the mainstage...how can i target that middle MC?

View 3 Replies

ActionScript 2.0 :: Can't Get The Clips To Be Attached To The Right Side

Jul 20, 2006

I was making a small animation maybe for forums and stuff just wanted to see if i cud do it when i had some problems. What i want to happen (don't ask why) is to have these random movie clips from the library to come on stage from the far right side and to move over to the left and be deleted, but have the movie clips being moved, deleted, and loaded continuously. The problems i'm having are that i can't get the clips to be attached to the right side because the depth is all different. here's the code on the first frame. I will attach the .fla file too.

Code:
onEnterFrame = function() {
//random number generator
rand = Math.random()*20;

[Code].....

View 4 Replies

ActionScript 2.0 :: Targeting Movie Clips From Buttons Within Other Mcs?

Feb 27, 2010

I'll try and make this as clear as i can, so as not to waste your time. I think it's something really simple i'm just missing...On the main timeline, i've got a movie clip ("mc_A") that contains two other movie clips ("mc_1" and "mc_2").at the end of it's timeline, I put a button in "mc_1" to play "mc_2". I'm using

on (release) {
telltarget ("_root.mc2") {
play () ;

[code].....

View 1 Replies

ActionScript 3.0 :: Targeting Nested Movie Clips?

Feb 25, 2010

Here's my example, on frame 1 is an mc I created named holder. Inside there's an mc named box. Inside box are four mcs, circles1-4, inside the circles I have four skulls. If I want to affect only the skulls, what is the proper way to go about it?For instance, whats the proper way to write a trace statement?or , if I wanted the skulls to fade individually on mouse over, how would you properly go about writing this function?
 
function over(evt:MouseEvent):void{
evt.target.alpha = .5;
{

[code]....

View 8 Replies

ActionScript 2.0 :: Targeting Children Movie Clips?

Jan 23, 2009

I have main MC when press it opens up and then has buttons in that MC.if main_MC is open then press it again will close it. Problem is I need to target the buttons inside main_MC but I can't cause it targets main_MC and thus closes the MCI tried doing main_MC.sub_MC.onPress = function ...... but it still targets the main_MC.

View 4 Replies

ActionScript 2.0 :: Targeting Dynamic Clips In Array?

Jun 29, 2006

I made an array containg 3 clips and dynamically attached them to my main timeline. I can successfully tween all of them with the following code.

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

[code].....

View 2 Replies

ActionScript 2.0 :: Move Attached Movie Clips?

Oct 27, 2008

I am trying to move attached movie clips, but I've come across a problem. This is the code inside the movie clip that's attached:

ActionScript Code:
function moveFrom(which){
for (i=which;i<20;i++){

[code]....

View 9 Replies

ActionScript 2.0 :: Attached Clip In Between Depths Of Other Clips

Mar 8, 2006

I have ablut 60 movie clips attached dynamically on the stage in flash each at various depths. I want to place some other movie clips in between the depths of those clips dynamically .. how would i go about that?

View 2 Replies

ActionScript 2.0 :: Nesting Attached Movie Clips?

Nov 13, 2006

is there a cleaner way to attach movie clips than this type of syntax?

_root.attachMovie ("Frame", "frame", 60);
frame._x = 375;
frame._y = 375;

[code].....

View 2 Replies

ActionScript 2.0 :: OnRollOut Not Working On All Attached Clips

May 21, 2007

i'm trying to make this little news section and for some reason the rollover and rollout works only on the last news itemClip to be attached. you can take a look at it HERE and see that the bottom one is the only one working.[code]

View 3 Replies

IDE :: Targeting Multiple Movie Clips In Motion Tweens?

Apr 2, 2009

I am trying to target multiple tweens, trying to turn their visibility false/true. I have named each tween in the tween properties box, and I have targeted them like this: plane.plane2.tween1._visible=false (and so on), but no go! Only the first of the seven is actually affected--the others are not.

View 11 Replies

ActionScript 2.0 :: Position Movieclip On Top Attached Movie Clips?

Nov 27, 2009

I would like to have one movieclip over the top of other attached ones. I have tried getNextHighestDepth on the movieclip, but it still doesn't work. Here is my code for attaching the movieclips:

PHP Code:
function growSpider() {
spiders = 0;

[code].....

View 1 Replies

ActionScript 1/2 :: Drag And Drop With Attached Movie Clips?

Nov 16, 2009

I have a button that has an onPress function that attaches a movieclip with startDrag(true) so the attached movie snaps to the mouse and can be dragged around. The problem is that I don't know how to set up the onRelease function so that when the mouse button is lifted the attached movieclip is removed. Also, the attached movie appears in the upper left corner for just an instant before snapping to the mouse.

View 9 Replies

ActionScript 3.0 :: Targeting Movie Clips - Go Back And Alter Appearance

May 28, 2009

I have created several movie clips in a loop.

[Code].....

After they are added to the stage I later want to go back and alter their appearance. I am having difficulty targetting them:

[Code]...

View 3 Replies

ActionScript 2.0 :: .onEnterFrame And HitTest Now Apply To The Clips Attached To The Original Clip?

Jan 5, 2010

say I have a clip with an onEnterFrame running on it with a hit test to check if the user has rolled off the clip . . . Then i create an empty clip within that clip and attach clips to it. Will my .onEnterFrame and hitTest now apply to the clips i have attached to the original clip?

View 2 Replies

ActionScript 2.0 :: Dynamically Targeting A Path From A MC?

Jun 23, 2009

I have a function and some textfields within a movieclip, and I need to reference those textfields dynamically. This worked when I'd had the TFs on the stage, but not since I've placed them in an MC.The TF naming convention works out to this:

Code:
t_t1c1r1
t_t1c2r1
t_t1c1r2

[code]....

So, to access them dynamically, I combine the letters with index numbers to be gotten through the function's arguments.

Code:
this['t_t1c'+i+'r'+ii].text;
Object(this)['t_t1c'+i+'r'+ii].text;

The numbers represented by "i" and "ii" are coming through fine in trace, but the path is still wrong. I've tried different combinations of _level0, etc., but it only works in my testing when I make an absolute reference to the field (e.g. Object(_level0.mc_instance)['t_t1c'+i+'r'+ii].text which is not a viable solution).

View 1 Replies

ActionScript 2.0 :: Dynamically Targeting A Path From An MC

Jun 23, 2009

I have a function and some textfields within a movieclip, and I need to reference those textfields dynamically. This worked when I'd had the TFs on the stage, but not since I've placed them in an MC.The TF naming convention works out to this:[code]The numbers represented by "i" and "ii" are coming through fine in trace, but the path is still wrong. I've tried different combinations of _level0, etc., but it only works in my testing when I make an absolute reference to the field (e.g. Object(_level0.mc_instance)['t_t1c'+i+'r'+ii].text which is not a viable solution).

View 1 Replies

ActionScript 2.0 :: Dynamically Remove Any Attached Mc's If There Are Any?

Mar 7, 2004

how would i go about writing a function that looks at an mc(empty mc) and deletes any attached movie clips (if there are any).

View 12 Replies







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