ActionScript 2.0 :: Getting A Duplicated Movieclip's Name On Event?

Sep 8, 2005

I cannot find a solution anywhere for this issue. Searching the forum yields: "The following words are either very common, too long, or too short and were not included in your search: name"

Anyway, the thing is this.

I duplicate a movieclip several times, which is a button, and name the instances c0, c1, c2, etc. I want to use substring to extract the number behind this name when someone clicks on one of these buttons. I have the following function in the button:

Code:
on(rollOver) {
x = substring(this._name,1);
ripples._x = coords[x].split(",")[0];
ripples._y = coords[x].split(",")[1];
}

As you may guess, I need the number in the variable x. However, the pointer "this" apparently points to the level this button is on (_level0), and not the button itself. So "this._name" gives me nothing.

My question to you all is, how do I obtain the buttons instance name the user has clicked on? Or for that matter, any other property. How do I address the button itself, from the on(XXXX) function?

The code to spawn the buttons is (in a loop):

Code:
duplicateMovieClip("clickdot","c"+x,x+10);
setProperty("c"+x,_x,coords[x].split(",")[0]-8);
setProperty("c"+x,_y,coords[x].split(",")[1]-8);

Obtaining the coordinates instead of it's name would suffice as well.

View 4 Replies


Similar Posts:


ActionScript 2.0 :: DuplicateMovieClip - Add A OnRelease Event To A Duplicated MovieClip It Does Not Seem To Respond

May 14, 2006

I have created a MovieClip in the library that consist of buttons, graphics and other MovieClips. When the movie starts I attach this movie clip to a newly createdEmptyMovieclip like so

[Code]....

So all that works fine, except when I add a onRelease event to a duplicated MovieClip it does not seem to respond. So I was wondering if the duplicateMovieClip function does not copy the button inside the original MovieClip. The code for the button is

[code]....

View 1 Replies

ActionScript 2.0 :: Duplicated Movieclip Doesn't Inherit Loaded Movieclip?

Jun 27, 2006

I'm loading an image into a blank_mc within a movieclip called 'background_mc' using the MovieClipLoader object; when the onLoadInit for the MovieClipLoader object is fired, i then attempt to clone my 'backgound_mc' object and the loaded image it contains so i can do something with it (i,e a funky masky/blur thing, not important right now)I'm successfully loading my image into the blank clip within background_mc, the onLoadInit behaviour fires and duplicates background_mc once the image has been loaded, but in a disappointing turn of events, my clone of background_mc no longer has an image attached, and has instead reverted back to it's original form, just as ti was before it had the jpeg image loaded in.

View 3 Replies

ActionScript 2.0 :: [fmx] FOR Loops And Function - Why Only Event Put Inside The AttacHMovies Or Duplicated Movies Work

Nov 24, 2004

why this code dosent work at the same time in the timeline, and why only envent put inside the attacHMovies or duplicated Movies work, if i put them in the forr loops they dont work.

[Code]...

View 10 Replies

ActionScript 2.0 :: Get Some Actions On A Duplicated MovieClip?

Sep 24, 2010

I am trying to get some actions on a duplicated MovieClip Now what I got is something like this:

Actionscript Code: I have some loop wrapped around this so the 'i' changes.duplicateMovieClip("target", "new"+i, 100+i);// I use 'i' because i need a few of those...for(i=0;i<somenumber;i++){_root["new"+i].onEnterFrame = function(){//actions}}

And it won't work. Logically it just makes MCs "new1" "new2" "new3" and so on.And then it checks for those.If i put a MC named "new3" on stage, it works. I guess i'm just stupid and doing the duplication wrong or something.

View 9 Replies

ActionScript 2.0 :: [FMX]Removing A MovieClip That Is Not Duplicated

Feb 1, 2003

I've seem to have hit a snafu in a small animation I am creating for my next tutorial. What I have, is a movie clip that gets duplicated when the space bar is pressed. The movieclip has actions setup so that when the movieclip reaches a certain y value, it will remove itself via this.removeMovieClip()

The problem is, every movie clip that is duplicated does remove itself like it is supposed to. The exception is the original movie clip that I duplicate from. That movie clip seems to want to stay and cause problems (it is not removing itself because it isn't duplicated via attachmovie or the duplicateMovieClip method).

View 6 Replies

ActionScript 2.0 :: Using LoadMovie In Duplicated MovieClip?

Jan 3, 2006

I can't manage to load jpg in some duplicated mc. I tried to add the as to the container mc "img"

Code:onClipEvent (load){ this.loadMovie(_parent._name+".jpg"); which trace the correct path to the jpg but the jpg don't show up. (Which would be wrong as if I remember well, the mc when being duplicated loses the loadMovie part????To be confirm) So I thought that maybe the best would be to have it done while duplicating the movie but whatever I have beeen trying has been unsucessful. Here is the codes with duplicating mc.

[Code]...

View 1 Replies

ActionScript 2.0 :: Duplicated Movieclip Ontop?

Dec 30, 2008

whenever i duplicate this movie clipthe duplicated movie clip goes ontop of everything elsehow do i duplicate it in a manner that prevents it from sittingon top of everything else in my screen?

View 2 Replies

ActionScript 2.0 :: Button Click In Duplicated Movieclip?

Nov 4, 2009

Before telling you my problem in actionscript, I would like to explain on how the system works. Please bear with my long explanations.I have a list of data that need to be display out. I've created one movieclip and I named it table_mc. Inside the table_mc, I put 2 dynamic text and one blue box with alpha 0. In order to display a list of data out, I used a table component in flash to duplicate the movieclip, table_mc. It saved me from doing a "for loop".

I wanted the list of data to be clickable so I converted the 2 dynamic text in table_mc, into movieclip. I named it table_but. When I clicked onto table_but, the blue box will appear, alpha 100 to show that it is being clicked.Here's the problem. I've done an actionscript in table_mc. In the list example, when i clicked onto no '2', the blue box appear and if I clicked onto no '5' the blue box for no '2' should disappear. Unfortunately the blue boxes will appear there together when i clicked onto no '2', '5' and '7' because they shared the same movieclip table_mc. Is there a way to do it when the blue box can only appear at a time?

View 2 Replies

ActionScript 2.0 :: Link To Duplicated MovieClip In Loop?

Apr 17, 2007

I've got a form with radio buttons which were duplicated depending on the response from the database. However, when they are selected (even though they have the same group name) it is possible to select more than one. I've got round this problem by adding the selected one to a blank array and removing it from an array with all the possible radio buttons in. This then enables me to get the selected value and use it, and However, the other values (which are in another array) still show as selected (i.e. the dot is in the middle of the button) which isnt good. I've set up a loop which should go through each value in the "unclicked" array and set the radiobutton corresponding to it to unselected. The code I have is below:

for (i=0; i < unclicked.length; i++)
{
_root.RB[i].radioButtoni.selected = false;

[code]....

View 5 Replies

ActionScript 2.0 :: Attach Different Codes To Each Of The Newly Duplicated Movieclip?

Nov 15, 2009

I have a movie in witch i duplicate a MC several times.

Example:
MC1 (template mc)

Duplicated to:
Movieclip1
Movieclip2
Movieclip3

I want to attach different action script codes to each of the newly duplicated movieclips. Each Movieclip should have different on(release) scripts.

View 1 Replies

ActionScript 2.0 :: Duplicated Movieclip - Rotates When Moving The Mouse?

Apr 12, 2007

I have a tree movieclip that when clicked, will duplicate itself and the duplicated movieclip will be dragged, using this code:

Code:
onClipEvent (load) {
var i = 0;
if (this._name != "tree") {[code]....

BUt it only rotates when i am moving the mouse?

View 1 Replies

ActionScript 3.0 :: Accessing Duplicated MovieClip - Drag / Drop Dots

Feb 15, 2012

Going from AC2 to AC3. I have made a script that creates a dot (myTag) and a text label (nameLabel) when a button is pressed. Then the user is able to drag and drop the dots. This is what my script does so far. I want the text label to be hidden when dragging and displayed at the place where the dot is when user stops dragging.

Here is my code:
var tagArray:Array = [];
var labelArray:Array = [];
var nameCounter:int = 0
addLabelKnapp.addEventListener(MouseEvent.MOUSE_DOWN, addLabel);
function addLabel(event:MouseEvent):void {
[Code] .....

View 9 Replies

ActionScript 2.0 :: Array.onPress - Add A OnPress Event To Dynamically Duplicated MovieClips ID's Stored In Array List

Apr 15, 2011

lets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?

[Code]...

View 5 Replies

ActionScript 3.0 :: Parent Movieclip Doesn't Listen To Custom Event In The Child Movieclip?

Oct 24, 2010

I have movieclip which contains child movieclip. when child movie clip finish to play i want to run a function in a parent movieclip. so I made a custom event dispatcher in the first frame of the child movieclip:

[Code]...

View 4 Replies

ActionScript 3.0 :: Event Listener - When The Mouse Rollsover The Movieclip To Go To Frame 3 Of The Movieclip

Mar 4, 2009

i've not tried to do anything odd with eventListeners up until now. i have a movieclip with multiple frames that i use AS to attach a textfield to it. problem is i have a eventlistener for when the mouse rollsover the movieclip to go to frame 3 of the movieclip.

[Code]...

what's causing the textfield to suddenly take precedence and how do i stop it. when i trace the evt.target - it is my movieclip.

View 5 Replies

ActionScript 3.0 :: Adding Event Listeners For Movieclip Inside Movieclip?

Nov 5, 2010

I have a movieClip button in my library that I dynamically add multiple instances of to the stage using code (so each instance has a unique name). The button has two frames, so it has a basic rollover effect (just changes color. To make the rollover work, I've had to dynamically add an event listener to each new instance of the movieclip, which triggers the rollover function.

I was wondering, instead of adding an event listener each time, can I somehow have an event listener within the movieclip to take care of the rollover?  Or will it not make any difference to the number of event listeners, as it will still add a listener with each new instance of the clip?

View 1 Replies

ActionScript 3.0 :: Flash Button Inside MovieClip Inside MovieClip Doesn't Dispatch Event

Jan 25, 2012

I have a Button that is inside MovieClip1 which is inside MovieClip2; yet when i click the Button it doesn't dispatch Event.

View 5 Replies

Motionguide On A Duplicated Instance?

Apr 8, 2010

the boxes are being added to the ready queue. what i want is that as soon as the box reaches to the right most position, i want a motion guide to follow, that is that the box should then enter into the CPU box and stay there for a specific point in time. this time will be determined by the burst time input.i only want the motion guide to happen to 1 box at a time when it reaches the right most position alont the queue.how will i be able to do this

View 1 Replies

ActionScript 2.0 :: [FMX] Duplicated MC's Interaction?

Apr 7, 2003

I want two duplicated clips to do a hittest on each other. Anasteroid and a laser. I can use this. on one of the objects but howdo I pick up the name of the other object - it could be anything from

View 3 Replies

ActionScript 2.0 :: AttachMovie With Duplicated MC

Sep 26, 2006

Is there a way to link duplicated movieclips to the library? Because I need to attach these duplicated mc's to an other mc. So my problem is that I don't have a linkage identifier?

View 8 Replies

ActionScript 2.0 :: Set The Parent Mc Of The Duplicated Mc?

Mar 20, 2007

the "app" allows you to drag various movieclips onto a mc. On release the movieclip is duplicated.The question is: how can I set the parent mc of the duplicated mc? In this case the movieclip should be attached to "videoArea" SNippet

Code:
if(this.hitTest(videoArea)){
var duplicate:MovieClip;[code]....

View 5 Replies

ActionScript 2.0 :: Masking Of A Duplicated MC

Mar 22, 2004

I am trying to mask a duplicated mc.

I am attaching my .fla so you can take a look. The code is a bit long, but I marked the setMask code line with dashes (it's right on top). I marked out the setMask line so you can see how it looks like, because when I do mask, you can see any of the MCs that are being masked.

View 3 Replies

ActionScript 2.0 :: Masking Of A Duplicated MC?

Mar 22, 2004

I search my problem in this forum prior to writing this. I got a thread that explains exactly what I needed to know; however, it doesn't work for me...I am trying to mask a duplicated mc.I am attaching my .fla so you can take a look. The code is a bit long, but I marked the setMask code line with dashes (it's right on top).I marked out the setMask line so you can see how it looks like, because when I do mask, you can see any of the MCs that are being masked.

View 3 Replies

ActionScript 3.0 :: Add A Listerner Event To A Movieclip?

Sep 11, 2008

I am trying to figure out a way to add a listerner event to a movieclip that will perform a function once the movieclip has stopped playing.

I have a movieclip that has two labels, the first is "displayImage", and the second is "hideImage". When the user clicks on a thumbnail, I use "movieclip_mc.gotoAndPlay("hideImage")" and then "movieclip_mc.gotoAndPlay("displayImage")"... the problem is that it doesn't wait for the first "gotoAndPlay" to complete before running the second one, so only the second one is visible on the stage. So I was thinking about splitting them up into two functions and if I could add an event listener to the movieclip_mc, then when it stops, the second movieclip could play.

View 1 Replies

ActionScript 3.0 :: Catch The End Of A Movieclip Event?

Jan 7, 2010

I've a movieclip with 30 frames. At the last frame I added a Dynamic Text field in order to insert some text at run time. This movieclip is fired by a button, so I wrote this code:

[Code].....

View 11 Replies

ActionScript 3.0 :: Event.target Movieclip?

Jan 26, 2012

I have a movieclip named button1 that contains a dynamic text named txt in it.My problem is that if i try

if(event.target==button1)
{
}

[code]....

View 1 Replies

As3 :: Add An Event To Movieclip Inside Tilelist

Jul 7, 2010

I am working on a component where i need to register a click event on a button inside the moviclip which is inside a tilelist, can somebody point me in the right direction.Tilelist -> movieclip -> button (i need to register a click event on the button).

View 2 Replies

Flash :: Event For When A MovieClip Changes Position?

Mar 11, 2011

I'd like to be notified when a MovieClip changes position, regardless of whether the position was changed by my code, or by the built-in drag operations.

View 2 Replies

Actionscript 3 :: Click Event Outside MovieClip ?

Sep 30, 2011

Is there any way to detect if the user click outside a MovieClip?For instance, I need to detect it to close a previously opened menu (like Menu bar style: File, Edition, Tools, Help, etc). How can I detect this kind of event?

View 3 Replies







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