Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash


Advertisements:










ActionScript 3.0 :: Check If A MovieClip Was Clicked?


How can I check if a Movieclip is clicked.I have two MovieClips on my stage .one has the instance name "yes" the other one is called "no"

if yes is clicked it should do something

if no is clicked it should do something else

but how do I check which one was clicked ?


View 6 Replies (Posted: 12-31-2011, 10:02 AM)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 2.0 :: When Mouse Is Clicked, Detect Which Movieclip Is Clicked
I have parent movieclip and in that many different children movieclips

What i want to do is when i CLICK, i want to detect which movieclip it has clicked and call corresponding function (defined by onpress event) of that movieclip.

Posted: 09-09-2009, 06:26 AM

View 6 Replies!   View Related
ActionScript 2.0 :: Check If All Buttons Are Clicked?
i need a very simple interactivity to work on .. i have 6 btns on stage and only when all are clicked i want my next event to take place ..say i want to trace("done ") when all are clicked .. but the user can click the btns in any order..

Posted: January 18th, 2007

View 1 Replies!   View Related
ActionScript 2.0 :: Wait Then Check If Button Is Clicked?
How would you code to achieve something like this:Prompt appears to click a button Wait n seconds If after n seconds the button is clicked, go to frame X If after n seconds the button is NOT clicked, go to frame Y

Posted: 07-18-2010, 10:34 AM

View 1 Replies!   View Related
ActionScript 2.0 :: Using An IF Statement To Check If The Mouse Has Been Clicked?
I'm trying to write an if statement so that when the user clicks on my button i tween some content in.

Here is my AS Code:
ActionScript Code:
if (news.onRelease == true){
function newsContent(){

[Code]....

Posted: April 1st, 2007

View 3 Replies!   View Related
Flash :: Arrays - As3 Check To See If Item In Array Has Been Clicked
Sorry if this is a little n00b-ish. I'm working in AS3. I've got an array of 8 buttons. I'm currently hiding the button that is clicked using e.currentTarget. How can I tell flash to make all the buttons that aren't the currentTarget to become visible (i.e. if a button has been hidden by previously being clicked, how do I tell it to become visible again when another button is clicked?)

[Code]....

Posted: Jun 29 11 at 15:31

View 1 Replies!   View Related
Flex :: Check If Clicked Element Is Inside Of IVisualElement (parent)?
I'm trying to check if a clicked element is inside of an IVisualElement in Flex 4. So I want something like "if this element is in this element, then execute function". I'm aware of the 'parent' property but this doesn't seem to work when my element is not a direct child of the element but for example 3 levels deep.

Posted: May 27 10 at 11:12

View 1 Replies!   View Related
ActionScript 2.0 :: Button To Open A Movieclip And Then Close The Movieclip When Clicked On Again
I am a super noob at actionscript. And I want my button to open a movieclip and then close the movieclip when clicked on again. I have no idea what to add after that here is the code I have for the button so far.....this button opens it.

on(release){
this.linemc5.gotoAndPlay("ear");
}

and this is another button I made that can close it, but I want it to be in the same button rather than seperate.

on(release){
this.linemc5.gotoAndPlay("earclose");
}

Posted: 05-19-2010, 10:42 AM

View 2 Replies!   View Related
ActionScript 3.0 :: Replacing Movieclip With Another Movieclip When It's Clicked On?
I've got music player and one of the controls is a movieclip which acts as a PLAY and PAUSE button. What I would like is to swap the image of this movieclip everytime it's clicked. How would I go about doing this?

Here's my code...

ActionScript Code:
playPause_btn.addEventListener(MouseEvent.CLICK, onPlayPause);
function onPlayPause(event:MouseEvent):void{

[Code].....

Posted: 07-09-2009, 08:52 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Check If Any Other Movieclip Is Hitting One Specific Movieclip ?
Is there any way to check if any other movieclip is hitting one specific movieclip (not two specific movieclips) something like --> if(movieClip1.hitTestObject(movieClipX)){

with movieClipX being any movieclip

Posted: 08-25-2009, 05:14 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Movieclip Able To Check If Land On The Correct Movieclip?
I have 8 movieclip on stage, 4 of them being the contents, and the other 4 being the target. I have to drag all of the 4 contents, into the target. apparently, i am able to do that, but the problem i'm facing right now, is the button that is on stage, is suppose to check if the movieclip are in the right place, which i set them.

Here are the codes:

ActionScript Code:
import flash.events.MouseEvent;
import flash.display.MovieClip;
var startX:Number;

[Code]....

Posted: 09-20-2010, 02:16 AM

View 2 Replies!   View Related
Replacing Movieclip With Another When It's Clicked On?
I've got music player and one of the controls is a movieclip which acts as a PLAY and PAUSE button. What I would like is to swap the image of this movieclip everytime it's clicked. How would I go about doing this? Here's my code...

[Code]...

Posted: Jul 9, 2009 2:58 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Movieclip Cannot Be Clicked?
Ive got my target game where the target spawns on the stage at a random position. When the target spawns however, i am unable to click it to shoot it?

Ive got my event listener for the target in my actions on that frame, but its giving me the following error:

1061: Call to a possibly undefined method addeventlistener through a reference with static type class.

If i comment out the addEventListener for the Target the game runs but i cant click it, if i dont comment it out i get that error and the game wont run.

Posted: April 12th, 2011

View 14 Replies!   View Related
ActionScript 3.0 :: MovieClip Will Not Move Unless Clicked
At the start of my movie (its a game), you press a button that moves you to the second frame where the game starts when called by a function on the main timeline called startThisGame(). A symbol called "player" is spawned from a class called Player and when right or left arrow are pressed it responds by moving left and right. Problem: The "player" wont respond to key presses unless I first click anywhere on the actual game window, either in test mode or after publishing. This did not happen before and now it does.

Posted: 02-03-2010, 11:36 PM

View 3 Replies!   View Related
ActionScript 2.0 :: _alpha = 0 When Clicked Outside Movieclip?
how to have a MC have _alpha = 0 when clicked anywhere outside the mc

Posted: October 30th, 2006

View 9 Replies!   View Related
ActionScript 3.0 :: Controlling Clicked Movieclip?
Is there a way to capture what movieclip that have been clicked so I don't have to wright a new "nextFrame" function for every clip

myClip_mc.addEventListener(MouseEvent.MOUSE_OVER, overMyClip)
myClip_mc.addEventListener(MouseEvent.MOUSE_OUT, overMyClip)
function overMyClip(event:MouseEvent)[code].....

Posted: April 28th, 2009

View 10 Replies!   View Related
ActionScript 2.0 :: MovieClip Button Stay Down When Clicked
Ok, I've search through the forums but none of the posts seem to work for me. I've got 4 buttons that each have an onRollOver, onRollOut, and onRelease function on them. I would like the onRollOver state to stay in place after the user clicks the button they're over. Then, when the user clicks on a different button, that buttons down state sticks, and the previous button's state unsticks and goes to the rollout function. I've read through and tried this thread:[URL]

Posted: May 21st, 2007

View 5 Replies!   View Related
ActionScript 3.0 :: Get A Movieclip Fill Color To Change Once Clicked
I'm trying to get a movieclip fill color to change once clicked. I'm able to get the mouseover and mouseout working. But the click state isn't working properly.

Here's my code:

Code:

my_mc.addEventListener(MouseEvent.MOUSE_OVER, onFolderOver, false, 0, true);
my_mc.addEventListener(MouseEvent.MOUSE_OUT, onFolderOut, false, 0, true);
my_mc.addEventListener(MouseEvent.CLICK, showMovieclip, false, 0, true);

[code]....

When I use the above code, nothing happens once clicked. I tried using the color property, but, although that made a color change (black), it wasn't the color I had indicated (white).What I have is a movieclip ("my_mc"). Inside the movieclip are other movieclips. When one is clicked, only that movieclip ("my_mc.movieclip01"), is highlighted.

Posted: 05-23-2009, 05:31 PM

View 1 Replies!   View Related
ActionScript 3.0 :: Not Reload An Already Loaded Movieclip When Clicked On Navigationbutton?
How to NOT make Flash reload an already loaded movieclip from the navigationbar/buttons when clicked on. [code]...

Posted: 08-21-2009, 11:13 AM

View 3 Replies!   View Related
ActionScript 1/2 :: Loading MovieClip Based On What Button Clicked
I looped my buttons just fine. However, I am trying to load a movieclip based on what button is clicked. the code loads the same movie everytime though.

Posted: Mar 30, 2009 4:42 PM

View 13 Replies!   View Related
ActionScript 3.0 :: Move MovieClip Position When Button Clicked
I have a simple arrangement where a movieclip moves to a new x y position when a button is clicked. I want the movieclip to slowly move or 'glide' there instead of jumping straight to the new position.

Heres the code..
btn_up.addEventListener(MouseEvent.CLICK, moveUp) ;
function moveUp(event:MouseEvent):void {{
allcontent.x += 200;
allcontent.y += 200;
}}

Posted: 05-22-2010, 04:21 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Function Executes When An Instance In The Movieclip Is Clicked?
I'm so getting confused with this,So i'm making a card game, and i'm just on the beginning of it. I've already added the objects on the stage and stored them on an array.now i made a function that when it executes the .x and .y properties of these cards would change. this is what i did, but nothing seems to happen.the array MyCards contain movieclip objects not strings and also, the function executes when an instance in the movieclip is clicked

ActionScript Code:
distCards(MyCards);
function distCards(cards:Array):void{
for (var i:int=0;i<cards.length ;i++) {

[Code]...

Posted: 08-16-2010, 05:54 AM

View 1 Replies!   View Related
ActionScript 2.0 :: Getting Zoom Out Effects For MovieClip When Next Link Clicked
How can I get the disappear (I used zoom out) Effect when I click another link I mean I want to get the zoom out effects for the previous movie clip when I click the next movie link.

Posted: May 13th, 2008

View 5 Replies!   View Related
ActionScript 3.0 :: Remove A MovieClip From The Stage Once A Button Has Been Clicked?
What i want to happen seems quite simple yet i keep getting the error "access of undefined property" when what i'm trying to remove is in fact defined in the same class but it obviously cannot gain access to it.

I want to remove a MovieClip from the stage once a button has been clicked.The MovieClip is created in the same class as my button function i created. The button works fine but whatever i try to put within the function to remove the MovieClip cause the error i mentioned at the start.

Posted: March 5th, 2010

View 5 Replies!   View Related
ActionScript 3.0 :: Flash Sending Variables When Movieclip Is Clicked?
I�m trying to send variables when a movieclip is clicked and use some frames later.

Code:
function langFr(e:MouseEvent):void{
var language = "fr";
play();
}

When the button is clicked, the movie plays until frame 10, where there�s the code:

Code:
if (language == "fr"){
trace ("French")
}

but it�s not working. I imagine that because I�m creating the variable inside the function and trying to read it outside. But how can it be done?

Posted: June 5th, 2011

View 3 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved