ActionScript 2.0 :: Using An IF Statement To Check If The Mouse Has Been Clicked?

Apr 1, 2007

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]....

View 3 Replies


Similar Posts:


ActionScript 2.0 :: When Mouse Is Clicked, Detect Which Movieclip Is Clicked

Sep 9, 2009

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.

View 6 Replies

Clicked Text If Statement

Jul 13, 2011

I have an issue with a web gallery that i am building and i was hoping for some help?

1. I have a stage and I add some title text to my stage and align it right and height centered.Im preview it looks fine but when i publish its in the center of the screen

2. I have menu items that are loaded from a XML file. I have added two test lines to this file that get added to the menu one text displays as "Contact me" and another called "Links"when this text is click I want to activate a Links movieclip/ wepart and a Contact for the other.I see the logic something like If clicked.text in menubar = "Contact Me" then run contactform else If clicked.text in menubar = "Links" then run Linksform End if.I am a vb.net programmer not flash any help would be great on both questions

View 3 Replies

ActionScript 3.0 :: Conditional Statement For ROLL_OUT If Button Clicked

Mar 2, 2011

I've been struggling with an issue for a while now and can't find a solution. I've got a series of movieclip buttons that I have going between states on ROLL_OVER, ROLL_OUT and CLICKED. It's very straightforward - except for the fact that I can't get the CLICKED function to take precedence over the ROLL_OUT and I was wondering if there was a way to make the ROLL_OUT conditional on the click. ex:

ActionScript Code:
//this is coded on a series of 5 buttons, only 1 is shown as example:
paintings2000_but.addEventListener(MouseEvent.ROLL_OVER,onPaintingsOver);
function onPaintingsOver(state)

[Code]....

So my issue is that I need the ROLL_OUT to be conditional based on whether someone has clicked the button or not; but I can't find a solution for how to do that in this context!

View 3 Replies

Flash :: Check An If Statement For A Particular Object?

Jun 9, 2011

I am trying to use a mouseevent.startdrag to move a particular movieclip, but I don't know how to go about checking the object in question. The code below doesn't seem to work with either ==Object(MCsquare) or just ==MCsquare.

function onStartDrag(evt:MouseEvent):void
{
trace(evt.target);

[Code]....

How can I run a check to see if the target object is MCsquare?

View 2 Replies

ActionScript 2.0 :: Check On More Than One Variable In An If Statement?

Sep 25, 2009

i am trying to find out if it is possible to check on more than one variable in an if statement at a time as i am usure how, so is it possible in as2 to check on more than one varialble if answer is equal to the number 1 and answer is to the number two and also the number three perform a function

var answer1:Number =1;
var answer2:Number =2;
var answer3:Number =3;
if(answer == 1 ) and answer == 2 and answer ==3);
if(answer == 1 and answer == 2)

View 3 Replies

ActionScript 3.0 :: Check Inputfield With If Statement?

Jun 10, 2011

I have the following code.

Code:
var codes_txt;
locatie_mc.visible = false;
check_mc.visible = false;[code]....

When someone enters text in the inputfield (Instancename= codes_txt) it has to be checked.

If it is good(GoedeCode) kaarten_mc has to go to the next frame.

If it isn't good(FouteCode) kaarten_mc has to go to the previous frame.

If the code does not excist they have to get an error: code does not excist.

It has to start checking after the function CheckCode.

Now I don't know how to check the inputfield. In theory I know what to do but I don't know how to put it into AS3.

View 1 Replies

ActionScript 2.0 :: If Statement To Check Answer?

Jun 29, 2004

The user needs to submit a dollar amount answer. They could write is several ways. I'm trying to accomodate it with the code below. It always evaluates it as the wrong answer (the else).

[Code].....

View 4 Replies

ActionScript 3.0 :: Conditional Statement - Reducing Opacity When Object Clicked

Dec 2, 2009

I'm trying to get it so whenever the object is clicked it reduces in opacity by 10% each time, and if it gets to 10% and it's clicked again it stays at 10% instead of going to 0. I got it to keep going down in opacity fine I just don't know the code to keep it from going lower. this is what I have so far

function fadeOut(e:MouseEvent):void {
instrument.alpha -= .1;
} if (instrument.alpha<.1) {
instrument.alpha = .1
} else {
instrument.alpha -= .1;
}

View 5 Replies

Professional :: If Statement To Check If Boolean Is True?

Aug 28, 2011

i want my if statement to check if boolean is true so here is my code.
 
name:Boolean = new Boolean();
mc1.addEventListener(MouseEvent.CLICK, myMouseEvent);function myMouseEvent(event:MouseEvent):void{    name:Boolean = true;        if(name:Boolean = true)    {        //code to run....      
}

Syntax error:expecting right paren before colon.
 
probably a simple explanation that i cannot this of.

View 3 Replies

Xml :: Flash - Run If/else Statement To Check If XML Node Is Empty?

Feb 23, 2010

checking an XML file for a specific node.

Example:

<vid
flv="videoName"
thumb="thumbnail.jpg"
title="Video Title"

[code]....

The first vid node contains a path to a logo graphic, I then need to check in my ActionScript if there is a logo there or not, and to do something if there is(display the logo) I can trace out the logo path so I thought I could run a simple if/else to check if there is anything in that node and if so to do something:

private function thumbOver(e:MouseEvent = null):void
{
trace("
");

[code]....

Now I've tried everything, but it will always trace out "Does have a logo" no matter what I do. I tried:

if (tabData[tabID].video[e.target.id].@logo == "")
if (tabData[tabID].video[e.target.id].@logo == null)

However I get the same results?

View 1 Replies

ActionScript 3.0 :: If / Else Statement To Check Whether Or Not External Swf Is Loaded

Oct 24, 2011

Just starting to delve into as3. I have made a flash website with four navigation buttons (home, products, about, contact). When user clicks on "products", an external movie clip is loaded and everything works fine. User clicks any button after that, and myLoader.unloadAndStop, the swf is removed when you navigate away from "products". However, if the "home", "about", or "contact" buttons are clicked first (before the external swf has been loaded), it of course, throws the 1009 error.I need some sort of if/else statement to check whether or not the external swf is loaded, remove it if it is, and if not, just navigate to the "page" clicked.[code]

View 0 Replies

ActionScript 1/2 :: Conditional Statement - Whenever The Object Is Clicked It Reduces In Opacity By 10% Each Time

Dec 2, 2009

I'm trying to get it so whenever the object is clicked it reduces in opacity by 10% each time, and if it gets to 10% and it's clicked again it stays at 10% instead of going to 0 I got it to keep going down in opacity fine I just don't know the code to keep it from going lower. this is what I have so far

[Code]...

View 1 Replies

ActionScript 3.0 :: Check To See If An Object Exists By Using A Simple If Statement?

Sep 27, 2010

I'm trying to check to see if an object exists by using a simple if statement.
 
if (object.name) {
//Do this
}
 
However, if the object doesn't exist, I get this error, "Error #1010: A term is undefined and has no properties" - which I understand is because the object doesn't exist. Is there a better way to check to see if an object exists?

View 1 Replies

Flash - Check The Cumulative Status Of OnLoadInit In A For Statement

Jun 11, 2010

In a setup like this is it possible to check the cumulative status of all onLoadInit?

for(var i:Number = 0; i < limit; i++) {
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadInit = function(mc:MovieClip) {

[Code]....

Initially I was thinking that I could pass an array of Boolean's, but I'm not really sure where to add that checkpoint, because a flash frame doesn't keep looping. Would I have to add it to an onEnterFrame()?

View 1 Replies

ActionScript 3.0 :: Check If A MovieClip Was Clicked?

Dec 31, 2011

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

ActionScript 2.0 :: Check If All Buttons Are Clicked?

Jan 18, 2007

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..

View 1 Replies

ActionScript 2.0 :: If Statement: Check If An Input Text Field Is Empty

Jun 3, 2004

I want to check if an input text field is empty. I only managed to do it this way;

mytext = textfield.text;
if(mytext != "") .....

The problem with this approach is that I also want to exclude variables with whitespaces.
I tried; if(!isEmpty(mytext) )..... but that didnt work.

View 11 Replies

ActionScript 2.0 :: Wait Then Check If Button Is Clicked?

Jul 18, 2010

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

View 1 Replies

Flash :: Arrays - As3 Check To See If Item In Array Has Been Clicked

Jun 29, 2011

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]....

View 1 Replies

Flex :: Check If Clicked Element Is Inside Of IVisualElement (parent)?

May 27, 2010

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.

View 1 Replies

ActionScript 3.0 :: Mouse Coordinates In An If Statement?

Sep 29, 2011

how to put mouse coordinates into an if statement, but as an 'if more than' but also 'if less than'. Something like:

Code:
if (mouseX > 190, but also <210) {
//do something
}

Is it possible to also do a similar thing to also include the Y position, to create a box of some sorts based on mouse position?
Something like:

Code:
if (mouseX > 190, but also < 210, mouseY > 20, but also < 100) {
//do something
}

I think it may have something to with setting each position as a var and pushing them into an array, but I can't get my head around it.

View 4 Replies

ActionScript 2.0 :: Mouse If Statement [flashCS4]?

Jun 24, 2009

I have an if statement that says:

Code:
this.onEnterFrame = function()
{
if(_root._xmouse >= 612)

[code]...

I get a trace but the tween does not happen.

View 1 Replies

ActionScript 3.0 :: Case Statement -- Mouse Position?

Feb 20, 2009

I've got a slider on my navigation bar that rides along with the mouse; movies play perpendicular to it as I scroll. If I click on the movie, I link out to another page (easy enough). However, the actual slider doesn't do anything more than look nice. I know that if I don't make this thing child proof, I'm going to catch grief about it. So I tried to set up a switch that links out according to range values y<0 && y>125. As it stands, I don't get any errors, it just always goes to default. I'm missing something.I could always try a gia-normous 'if' statement, but I thought that I'd give the switch a try.

View 4 Replies

ActionScript 2.0 :: If Statement - Check If Another Button Is Visible On Release Of A Button To Determine What Action To Be Taken

Jun 24, 2004

i'm trying to use if statements but can't get this thing to work i want to check if another button is visible on release of a button to determine what action to be taken.the 'gotoAndPlay("firstscene",1)' is just there as an outcome, will be changed later. anyway this is the code i've got on the button i'm pressing. blobyellow2 is an instance of a button blobyellow is it because it's an instance that it's not working?

[Code]...

edit: sorry forgot to put what's wrong with the code. it acts as though the statement is correct no matter if it is or isn't.

View 11 Replies

ActionScript 3.0 :: Check Event.target Type In "if" Statement

Mar 15, 2011

i have "roll over" event listener and i would like to that works only with MovieClips (without textfields etc.). I would like to write something like that:

if(event.target == MovieClip){ do something }
else { do something else}

This doesn`t work properly.
 
How to check type of event.target in "if" statement?

View 1 Replies

ActionScript 2.0 :: Music Loop - If Statement - Check Whether Or Not The Music.swf

Apr 5, 2005

I have 'Sound On' and 'Sound Off' buttons on mutiple scenes and I am playing the music loop in my flash movie by loading an external swf. When I move to the next scene the sound reloads which I do not want. How do I use an if-statement that checks whether or not the music.swf, that needs to be loaded is found and when it is found, go to a frame?

View 1 Replies

ActionScript 3.0 :: Event When Mouse Is Clicked Outside Of Swf?

Jan 23, 2010

I'm working on [URL] and I am using a small swf over the milk carton on the left. I use it to make it look like text being entered is on the milk carton. So its just a textfield and a button.

When the user clicks in the text box it clears and allows typing. This is good. This is the part I'm stuck on: If the user changes their mind about typing and clicks somewhere else on the screen (outside of the swf) I want the example text to return and the text cursor to stop flashing.

View 2 Replies

ActionScript 2.0 :: Leave A Marker Where The Mouse Has Been Clicked?

Oct 18, 2011

I have created a movie that requires the user to click on two points on an image. I want a visual indication to appear (eg a marker of some sort) to appear on the first and second click. Is this possible?

View 21 Replies

ActionScript 3.0 :: Detect Whether The Mouse Has Been Clicked Outside Of A Sprite?

Oct 28, 2008

Version: CS3, Flash AS3.

I want to detect whether the mouse has been clicked outside of a sprite (ie. a mouse click event anywhere on the screen except the sprite).

The idea is that you click outside an activated sprite to deactivate it. This is how menus and comboboxes function, but I can't see any way of doing it in actionscript.

View 2 Replies







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