ActionScript 3.0 :: Get Movieclip Name On Click On Movieclip?
Jan 5, 2010Is there a way to get a movieclips name when you click on that particular movieclip?
View 3 RepliesIs there a way to get a movieclips name when you click on that particular movieclip?
View 3 RepliesI want to be able to have my ketchup cursor and click on the buns and the buns go to the ketchup frame and vice versa with the mustard, but if the ketchup is already on then it would go to the frame with both mustard and ketchup.I would post my code but I dont really have much to post except the basic eventlistener function. I have googled it a million times and cant seem to find what im looking for.
View 6 RepliesI am building a flash interface and I would like a menu where it is hidden to begin with (just a tab). You click the tab to expand it, and click again to collapse it. I've made a movieclip with animation of the menu opening up and closing, but I can't seem to work out how I'd go about making the movieclip open and close properly.
View 4 RepliesI have 3 movieclip on stage. On user's click, I wish to attach another movieclip on the same x,y as the selected movieclip.
So right now, i'm guessing by getting the selected movieclip name, then i could get the x,y of it.
how to get a name of selected movieclip when any of them is pressed?
I have the movie clip "movie" in my library and the button "btn" on the stage.Now everytime I release "btn", I want to add "movie" to the stage and have it play from predetermined coordinates (let's say _x = 20, _y = 20)...So far, I've tried
Actionscript Code:
on (release) {duplicateMovieClip("movie", "movie2", 1);}
but that doesn't do the trick because it doesn't multiply the displayed movies.Everytime you release "btn", "movie" breaks off and restarts,I want it to finish its animation and have ANOTHER one spawn at the origin...
I have th following code below. When the monster is clicked I would like to remove it but the MouseEvent.Click event never fires? I'm using flash cs4.
import fl.motion.Animator;import fl.motion.MotionEvent;var this_xml:XML = <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*"> <source> [code].......
from various books, I know that to add eventlisenter for mouse click to a movieclip:
movieClipName.addEventListener (MouseEvent.CLICK, clickFunction);
then I define the function
function clickFunction(event:MouseEvent)
{ bla bla bla }
My questions are (as silly as they might sound!),
a) why do we need a parameter (i.e. event:MouseEvent) for clickFunction??
b) since we have a parameter for clickFunction, when we feed this function into addEventListener, why didn't we write movieClipName.addEventListener (MouseEvent.CLICK, clickFunction() );
I have a movieclip thats takes 10 seconds to show up on the animation.How can i click on this movie clip and open a webpage ?
View 1 RepliesI have bought a flash template in an online store. There are different buttons on it and some of them link to existing local html files from the pack - index-1.html, index-2.html etc. There are also some buttons that don't go anywhere right now but they are intended to be linked to some urls too. They react with animation on mouse rollover and I suppose they should go to some url if I set it somewhere on click. But there is no documentation about that in the pack. I searched through the Flash source file and all html pages files for something like "index", "geturl", also looked through them manually to realize how it could be made but with no luck. So, my question - is that possible that way or another to make that MovieClip button link to some my page, for example, "contacts.html".
View 1 RepliesIs 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 Replieshow to load the movieClip(symbol) on click of a button (and movie should not be on stage) it should be loaded only on Click event
View 9 RepliesI was just wondering why it is that after I have clicked a button to run a movieclip, I have to click it twice to run it again? I would like to be able to run it again with just one click - it is for a true and false set of questions. The movieclip is an animation that runs if correct (and there is another if it is incorrect.
Here is the button script
on (release) {
_root.tf1_mc._visible=false;
_root.tf2_mc._visible=true;
_root.tf2_mc.gotoAndPlay(1);
}
comment: tf1_mc runs when the true button is clicked and tf2_mc runs when the false button is clicked. The script above is for the false button
I have a movieclip with 2 layers (a background layer, and a text box layer), and i have an eventListener for clicking on it. The only problem is the function i call when clicking the MC only works when i click the background, if i click where the text box is in the MC the function doesnt get called?
Is there any way to treat the entire MC as a single entity rather than a layered one, or is there a way to specify which layer is to be clicked, and i can just add an invisible hit rectangle on a new layer in the MC.
I'm developing a small game using as3 , in that i want to pause my whole movieclip when a user click on quit button.
means when user will click on quit button , a dialog box will appear and will give options "yes" or "no".
so when i will click on quit button , i need to pause my movieclip for the time until user will select yes or no.
And also , if he will select option "no",application should be resume.
I have a MC in my project that acts as a popup window only it is really just a movie clip. One that loads hi-res pictures AND... here's the important part.... Has a startDrag() action attached to it so that the user can move the picture aside if they so desire. However to close this window, I'd like to have the user DOUBLE CLICK with the mouse. They should be able to double click anywhere on the movie clip or even anywhere else... it doesnt matter really. The thing is, how do I listen for a double click in ActionScript? There no method for the built in classes that I could find.
View 2 Replieseven better a source file when double clicking in a certain movieclip the execute a function.
View 1 RepliesWhat script do I need to make this:If I click 300px from the left, and 10px from top, that the movieclip move's to 300px from the left and 10px from the top. Sinned-B
View 2 RepliesHow do you click a movieclip and then after clicking you will go to the next frame??
going to next frame i know is gotoAndPlay("frame name or number");
but do i have do name the movieclip with an instance?
i'm developing a small game using as3 , in that i want to pause my whole movieclip when a user click on quit button.
means when user will click on quit button , a dialog box will appear and will give options "yes" or "no".
so when i will click on quit button , i need to pause my movieclip for the time until user will select yes or no.
And also , if he will select option "no",application should be resume
i will try to explain wit hierarchy to understand my problem
On scene1, i have taken 3 movieclips on first frame but at different layers.
And Each of this movieclip contains minimum 5 children movieclips.
so i want pause scene 1 movieclip from 2nd or 3rd child movieclip.
so how can i pause that movieclip?
I have this script on a button:
Code:
on (release) {
kast0.duplicateMovieClip("kast"+(num+1), 0);
this["kast"+(num+1)]._x = kast0._x+((num+1)*15);
this["kast"+(num+1)]._y = kast0._y;
num++;
}
And this in frame one:
num = 0;
"kast0" is a MC, that I want to duplicate (with every click), so there would be many of those in a row. But that script "erases" the "kast1" if it creates "kast2" currently I have my fla with only one frame and there is no other actions.
I have made a sort of drop down menu of a movieclip. There are actually two, the first one named list_over_mc is only to detect when the mouse is in the area for when to drop down the menu (onRollOver) and the other one, list_mc, is holding the menu itself. The problem is that when the menu is down nothing happens when I click the button (now named knapp1_btn). I have tried with another but with the same sort of script (but placed outside of the movieclip list_over_mc) and that works so I'm guessing it is because the button is "over" the other movieclip.
View 3 RepliesSay that i have a variable called explosion when this variable is set to yes i'd like it so that whenever you press the screen with the left mouseclick it "creates" a movieclip where you clicked that in the library is named bomb (or duplicate the movieclip from off screen if that is easier)
View 2 RepliesI need to add ac2 to a movie clip. When the movie clip is clicked on I want it to play and when it is clicked again that it will stop. This is the code that I have on the button already -
onClipEvent(enterFrame) {
this._rotation += 5}
I'm almost 100% sure that I have to write an if, else statement for this. Below is the code I have for a button(movieclip) I created. It is suppose to play an animation when you click on it. Then when you click it again it's suppose to play a second animation that will take it back to the original state. What is happening is, it goes straight to the clicked state without playing the animation. However when you click the second time it plays the animation that takes you back to the original state. Am I correct in believing the only way to get the animation to play on both clicks is to use an if, else statement.
function clickPlus(event:MouseEvent):void {btn1.gotoAndPlay("clickOpen"); }btn1.addEventListener(MouseEvent.CLICK, clickPlus);
function clickX(event:MouseEvent):void {btn1.gotoAndPlay("clickClose"); }btn1.addEventListener(MouseEvent.CLICK, clickX);
btn1.removeEventListener(MouseEvent.CLICK, clickPlus);
i am new with flash, and i had swf which contains big image it will resize to best fit. when i double click the image the clicked position come to center of the stage. i achived little bit, it zooming but image not come to center position. i have attached the fla file in it i have used this script to zoom on double click and bolded 2 lines are to position the image.
[Code]...
My_mc is a MovieClip. I want to scale My_mc on click event.
View 8 RepliesI have browse button on stage. when i click this i am uploading a image to a movieclip. then the movieclip is added to the stage. my issue is when i click the browse button 2nd time i need to select another image and add to another movieclip and display it to the stage
View 2 RepliesHow can i check if a click was on the stage (not on a other object in front of the stage - just on a place where no other object is - directly on the stage) OR on a movieclip (name "mcSlideHolder") like i'm trying here?
[Code]...
I've tried over 4 tutorials to make my movieclip link to a URL. It's just not working for some reason...
Here is my code.
ondemand.addEventListener(MouseEvent.CLICK,goThere);
function goThere(e:MouseEvent){
var request:URLRequest = new URLRequest("www.money.net");
[Code]....
This should work!! There are no compilation errors...
No mouse cursor change on hover... just like nothing is there.
How can i check if a click was on the stage (not on a other object in front of the stage - just on a place where no other object is) or on a movieclip (name "mcSlideHolder")?
function onMouse_Down(e:MouseEvent):void
{
trace("MouseDown occured");
[Code]....
My Problem is, that e.target.name is null, when clicking on the stage. When clicking on the mcSlideHolder e.target.name is "instance235".