Actionscript :: Get The Name Of A MovieClip By Clicking Its Parent?
Jan 7, 2011
I have a Sprite that contains many MovieClips: by adding an eventListener (Mouse.CLICK) to the container Sprite I want to get the name of the MovieClip clicked. Is this possible?
View 1 Replies
Similar Posts:
May 20, 2010
I have a movie clip viz. A. Inside that I have another movie clip viz. B. Now A has an event listener which returns its X, Y on mouse down, which in turn is used to magnify A taking those X,Y as the center point. B has its own event listener, one for changing color on mouse over and other to show a pop-up on mouse down.
Problem: When i click anywhere inside A, not covered by B, there is no problem fetching X,Y. But if i click on B, which is covering some area of A, it doesn't work. Simply because the event on B is probably not letting the event of parent to fire. Even if i write to fetch X,Y on mouse down of B, it returns its own X,Y and not of the parent, i.e. A. Because of this, the magnification doesn't work accurately in cases where child movie clip is obstructing an area of parent movie clip.
View 3 Replies
Jul 9, 2009
I have a Flash file below and I am wondering what is the best way to do clicking on multiple objects. I know it has something to do with a parent and it's children, but I'm still unsure. [code]...
View 1 Replies
Jul 9, 2009
I have a Flash file below and I am wondering what is the best way to do clicking on multiple objects. I know it has something to do with a parent and it's children, but I'm still unsure. My current code for the parent movieclip is:
Code:
maskItems.addEventListener(MouseEvent.CLICK, checkMask);
function checkMask (e:MouseEvent):void {
if (e.currentTarget.tote) {
trace("hi");
}
}
That traces hi as long as the Parent is clicked, not the child. make all the children trace something if clicked?
View 10 Replies
Apr 11, 2009
I have a flash website www.sitzmarkgolf.com. I have a couple of embedded swf's in my main flash page. When you click on a menu item to switch to another page the embedded swf's reload the home page again until they stop playing. Is there a way via as to stop these swf's from playing when you click on a link? sorry I am new to flash and as.
View 4 Replies
Mar 15, 2011
I am trying to access a function that is on my document class for my AS3 project, from a nested class. That is, the Document Class calls Class A which then calls Class B. So I am trying to access a function from Class B, I am trying to use MovieClip(parent).function(); but I am getting error 1120. The MovieClip(parent) (fixed to reflect my document class, etc) works when I try it from other classes but not from this nested class.
View 9 Replies
Dec 10, 2009
I've struggled with this for a long time and have thrown in the towel. How the heck do you climb the ladder, then go back down again into another clip?
View 2 Replies
Sep 23, 2009
I have a 100%, 100% movieclip over my entire flash, with a 20% alpha. But I want to be able to click on things behind this movieclip,
View 5 Replies
Nov 12, 2010
I have a movieclip with moviclips in them. Lets class it...
mainMC = main movieclip
childMC = mcs inside the mainMC
The problem is that the mainMC is to be used as a button. If I click the part of the mainMC with a childMC, it doesn't work. I have to click a blank spot on the mainMC where no childMC exist in order for it to properly register.
View 5 Replies
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
Jun 1, 2010
i am using a movieclip who has two nested movieclips, the problem i am dealing is that when i try to get the width or height of the parent movieclip it always showing the values of the small nested movieclip, when i draw the movieclip it draw perfect but when i read this values shows that error, what can i do?
View 2 Replies
Sep 14, 2009
I have 5 movieclips on the stage. I also have a color picker. I would like for the user to click on the movieclip they want to change the color of. The color picker will change the color of the movie clip that the user has selected. Another feature that would be nice would be if the selected movieclip was highlighted or something so the user knows which one is selected. Anyone know if this can be done.
View 11 Replies
Jan 25, 2011
I am using Adobe Flash CS5, Action Script 3.0, and I want to disable my "home" movieclip after it has been clicked, so it stays a certain color or design that can't be clicked anymore. I already created the _up, _over, _down, and _disabled in the "home" timeline, and I don't know what to do after that.... i tried home.enabled = false, but it's already disabled when I hover to it. These are my codes so far:
stop();
home.stop();
home.buttonMode = true;
[code]......
View 6 Replies
Jul 30, 2003
I have a MC with the instance name of "price". When I click another MC that says "Competitors", I want "price" to move over left 50, and then up 60. I have tried everything I could remember but it has not been working. How to make this one fluid motion.
View 4 Replies
Mar 15, 2012
I have load child swf in parent swf, from child swf i am trying to run my parent swffunction I am trying this code
MovieClip(parent).testfun()
but this code is giving error.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@2b1aa061
[code].....
View 1 Replies
Mar 12, 2011
below shows how to add child in a movieclip. ebd.target.addChild(info_grd); there is button named my_btn inside the movieclip info_grd.I would like to remove movieclip info_grd.parent
View 2 Replies
Jan 26, 2010
If I have a MovieClip, simply a blue square with class AS file called blueBox, in the constructor of the blueBox.as file I have:
this.addEventListener(MouseEvent.MOUSE_DOWN, sayHello);
Why does this not call the sayHello method when I click the movieclip on the stage? I know on the stage that I could grab the instance of my bluesquare movieclip and add an event listener to it that way, but I just wanted to 'encapsulate' in a bit more.
View 5 Replies
Feb 5, 2010
I'm not very sure how to explain my situation... In short codewise: I have a movieclip that listens for a click-event, set trought addEventListener. At a certain point I 'addchild' a button to that movieclip AND disable the eventlistener of the buttoncarrying movieclip. (the button is over the movieclip on the screen, and clicking the button must NOT trigger the mouseclickevent of the parent movieclip.)
when clicking the button, i need to do some actions (works ok) AND get the movieclip listening to NEW clicks. But from the moment I add the evenlistener to the movieclip again, it seems to 'remember' the OLD moueclick meant for the button. That's what I can't have, I start to think that I need to flush a clickingbuffer belonging to the movieclip or something... Now in words: It's about a minimized login-window (=movieclip), that needs to maximize when clicking on it (anywhere on the window). When maximizing I add a form and some buttons. When clicking my "cancel"-button I want to minimize my login-window again and let it listen for mouseclicks again so we can maximize it again..
View 3 Replies
Jan 19, 2003
I want to do this: When the mouse is between two y-coordinates, let's say 40 and 50, a movieclip is supposed to be moved. How should I do this? I can move the movieclip by clicking on a button but how do I do this one? And where should the code be put? I thought that this code would work if I put it in the first frame, but it's not..
[Code]...
View 4 Replies
May 6, 2007
Basically, I need it so you click my movie clip with instance name of "bg"and it links to a site.. but it also opens as a new tab (Not a new window, but a tab like in mozilla), or a new window in internet explorer
View 1 Replies
May 1, 2009
I am usinga Flash CS4 file using Actionscript 2.0 I have a movieclip and a button and a combobox next to it. When I click on the button btn I use sucessfully the code below to stop the movieclip
[Code]....
View 5 Replies
Jan 16, 2010
how to do so by clicking on the button movieclip moved to x = 100; and when pressed repeatedly to x =- 150
event onRelease - not work:
Code:
yyy.onRelease = function ()
{
test._x = 100;[code]......
View 1 Replies
May 17, 2011
I'm trying to access a parent movieClip from the child movieClip
Here's what I want to do,
I've got a movieClip named wrong_mc, which plays for a couple of frames and on the last frame, its got a close button "close_btn" inside of it, now I wanna write the code such that when close_btn is played the movieClip "wrong_mc" should go and stop at frame1, I'm just not able to access this movieClip from the button.
View 5 Replies
Aug 30, 2011
I have drawn intersecting lines. The user can click on a region inside the angle formed by the two lines.When the user clicks inside the area, the small region formed by the arc between the two lines showing the angle should change. How can I do that.the region between the intersecting lines is sprite object to dispatch event listener, but the arc is shape object.
View 1 Replies
Dec 5, 2009
What happens is I've used the the bus and car mcs to drive on both sides of the road in the animation (they will go across the screen then flip over and drive back within their respective mc).When they first cross over they are layered right but because of the timing of each animation, there is a point where both are going the same way on the same side of the road. At this point the bus pulls up higher (to the side of the road to pick people up) and the car passes it. The problem is when the car passes it is registered as being behind the bus (which would be hitting people).So i'm trying to get the car to swapDepths and come to the front Only when driving on one side of the road, so only at a certain frame reference essentially - not the entire mc.
View 3 Replies
Mar 19, 2010
On the code i'm writing you can select an object to interact with it, but to deselect you have to click on it again, is there a way to make the deselection by simply clicking out of the MovieClip?
View 6 Replies
Jul 17, 2008
I am trying to play a nested movieclip by clicking on a button. I have an instance name for the nested moviclip, and this is the code I atatched to the button:
on (release) {
_root.conference.gotoAndStop(35);
}
Nothing happens when I click the button with that code. However, if I take out the instance name, the button will play the frame specified:
on (release) {
_root.gotoAndStop(220);
}
View 2 Replies
Feb 5, 2010
[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]
View 2 Replies
Apr 11, 2006
how can i scale a movieclip by clicking it and drag the corner points of it.
View 3 Replies
Mar 5, 2002
how to load different parts of a movieclip by clicking on buttons in an other moviclip?
View 2 Replies