ActionScript 2.0 :: Counter Decrease By Two On Click But No Negative Value
Mar 11, 2011
I have a counter and when I click on this button I want it to decrease by two but not into the negative numbers. If it is 1 it should go to 0, if it is 2 it should go to zero if it is 3 it should go to 1.
Code:
on (press){
meme._x = Math.random()*200;
meme._y = Math.random()*200;
if(loader <= "1"){
}else if(loader = "1"){
kek = loader-1
counterclk.text=doh
loader=kek;
}else{
kek = loader-2
countclk.text= kek
loader = kek;
}}
At the moment it will do everything perfectly except when it is 1 when I click on it nothing changes.
View 3 Replies
Similar Posts:
May 18, 2011
I need a counter click button that can storage every click on a txt file or something..
View 1 Replies
Oct 6, 2010
I have a flash ad on my site that cycles through about about 8-10 products each with their own buy button that adds the item to the shopping cart and takes them to the shopping cart page. What I want to do is create some kind of counter or tracker that keeps track of how many times each product was clicked on. I would prefer an external file to be generated and updated per new click. Is this possible?
View 1 Replies
Oct 15, 2009
I'd like to build a simple flash menu that tracks the clicks and counts them up (counter) to a database using asp... I've googled quite a bit but I'm unable to find anything.
View 1 Replies
Aug 24, 2009
i have 12 buttons, and i wish to raise counter number for 1 when i click on it. When i click on the same button second time i dont want to count. Then when i click on another button i want to raise the counter number for one. But the problem is when i click back again on the first button the first number shows, but i want that the counter counts to 12 successively, and not when i click on the same buton shows its "count" number. here is my code for 2 butons:
stop();
this.nevidni_vongola.onRelease = function(){
gotoAndPlay("dondola");
var count:Number = 0;
[Code].....
View 2 Replies
Oct 29, 2010
How to create a simple .swf in which the user presses a button, a textfield has a number, the number goes up by one each time the button is clicked?
View 3 Replies
Jul 17, 2011
check if a negative number is less than another negative number. The if condition logic seems to be in order as far as i can tell but it doesent work for some reason :
Code:
public function minuscheck(testnumber:int):void
{
if (testnumber < -1)
[code]....
View 6 Replies
Mar 22, 2010
[Code]...
I would like to decrease timeb by around 5 every second. Is this possible? Everything I've tried seems to be failing.
View 8 Replies
Mar 8, 2009
there just havig a stupid problem where the health on my game increases on my game instead of decreases when the player is hit. here is the source codeHUD.as (Scoreboard)
Code:
private var stageRef:Stage;
public var s_score:Number = 0;
[code].....
View 3 Replies
Mar 22, 2010
I've been developing a flash game with a friend, and have hit a minor snag with the timers. My entire game runs in one frame, spawning movieclips and handling all that game-related stuff. Thing is, I've got a timer that spawns one thing (a boulder, in case anyone is wondering), and I'd like to have that setInterval (milliseconds) decrease every second by a set amount.
The important snippet of my code looks like this:
var timeb = 750;
bfalltimer = function () {
spawnboulders();
if (gaslevel<=0) {
clearInterval(boulderspawntime); }};
boulderspawntime = setInterval(bfalltimer, timeb);
Every second, I'd like time to decrease. I've tried everything I can think of - did I miss anything? How would I properly do this?
View 2 Replies
Oct 23, 2010
i have this script
Quote:
on (release) {
health -= 10;
if (health>500) {[code].........
I was wondering if there is a code i can use to replace the 10 with a random number between say 1-10.(Ergo when the script triggers the health is decreased with something between 1-10 instead of the set nr 10)
View 2 Replies
May 12, 2011
How to decrease the size of a button?
I have a button in which it contains an image.But my problem here is i am unable to decrease the width of the button along with image.
How can we decrease the size of that kind of button.
If possible provide me some sample code.
Below is my sample code:
<mx:Button id="line" toggle="true" paddingLeft="1" paddingRight="1" icon="@Embed(source='Images/line.png')" toolTip="Line" useHandCursor="true" buttonMode="true" click="doDrawEnable()" ></mx:Button>
View 3 Replies
Jan 13, 2009
The buttons increment the score when clicked. is there a way to start an individual timer per button so that the sooner it is clicked, the higher the points? [code]...
View 0 Replies
Mar 24, 2011
I want a number stoed in a variable to decrease by 1 everytime the right key is pressed. here is my code but it isnt working.[code]...
View 4 Replies
May 12, 2011
How to decrease the size of a button?
I have a button in which it contains an image.But my problem here is i am unable to decrease the width of the button along with image.
How can we decrease the size of that kind of button.
If possible provide me some sample code.
Below is my sample code
<mx:Button id="line" toggle="true" paddingLeft="1" paddingRight="1" icon="@Embed(source='Images/line.png')" toolTip="Line" useHandCursor="true" buttonMode="true" click="doDrawEnable()" ></mx:Button>
View 0 Replies
Aug 14, 2005
What I'd basically like to do is have a slider that controls the size of a Movie Clip. When you move the handle to the right, the MC becomes smaller, and when you move it to the left, it becomes bigger. I found an article at Sitepoint (www.sitepoint.com/print/actionscript-animation-flash), which did the opposite of what I want to do, but I couldn't seem to reverse the code.
View 2 Replies
Mar 7, 2007
How do I decrease or increase speed on the animations? for example I just want a text to move from right to left but as its get close to the left to start slowing down until it gets to wher I want it, I hope you know what I mean, If not this is a site that uses that when text goes up or down or the buttons
View 3 Replies
Dec 16, 2009
I have an mx:vbox and inside i have several mx:text elements.how do i decrease the gap between each line of text that is shown ?i tried doing the following:
<mx:VBox borderColor="black" borderStyle="inset" width="80%" verticalGap="0" paddingBottom="0" paddingTop="0">
<mx:Text text="a" width="80%" paddingBottom="0" paddingTop="0"/>
[code].....
View 2 Replies
Mar 17, 2011
I have a movieclip slider_mc that can be dragged across the screen. There are also lots of small movieclips on the stage that I would like to increase and decrease their size depending on how close the draggable movieclip is to them
View 1 Replies
Jul 15, 2011
I know there are performance loses if you don't specify variable types explicitly. Do ActionScript/Java developer in general prefer the use of the in classes or no?
public function hello():void
{
this.speaker.says("hello");
}
vs
speaker.says("hello")
View 3 Replies
Nov 11, 2009
Recently i made flash animation in 500x300px, now i need to re-create the same animation in 100x65px, plz tel me how can i decrease the dimension of same animation widout re-creating it in new dimension. is there any codes or tools or plugins?
View 3 Replies
Jun 29, 2010
I want to use two buttons, one for increase and the other for decrease, to change the numeric value of a variable. I will use this variable to call a line width in some lineStyle code that I have. Basically, the user will be able to use the buttons to change the width of the line they are drawing in real time. I have attached the fla with the beginnings of this section.
How do I get the buttons to affect my variable?
View 9 Replies
Jan 18, 2011
I have a Dynamic Text area called txt, I write the value 5000 by txt.text="5000"; In my scene there will be 2 buttons. When one of the buttons is pushed the value will decrease 250 by 250. For example; at first push it will decrease to 4750, at the second push it will decrease to 4500 and so on...And when it is pushed to the other button this value will increase 250 by 250.For example; the value will be:4500 by pushing twice to the decreasing button, then it'll be:4750 by pushing once to the increasing button.I tried with the below codes but it didn't work. The value decreases only once, it doesn't keep on decreasing when I pushed twice to the decreasing button.The value seems as 5000250.
[Code]...
View 1 Replies
Aug 21, 2009
I'm having problems with actions script in Flash 8.I'm trying to make a little side scrolling fighting game, i've got a character and an enemy which follows him and has an attack animation when close, but I can't get the health bar to decrease when the hitting animation occurs while in contact with the hero.[code]I put this script on an invisible square which appears during the attack animation, HERO is my hero's instance name and HP the health bar's. Whats suppose to happen is that the enemy goes for the attack animation which is of hitting the hero whith an axe, and when the invisible box hits the hero at that moment, the hp should go down..
View 1 Replies
Jul 13, 2006
I have 2 buttons and a dynamic text field. I want one button to increase the bet by �10 and the other to decrease it by �10. The amount should change in the textfield.This I have done. But how do i set a minimum bet of �100 and a maximum of �500 so that it wont carry on decreasing once it reached �100 and so on and so forth....?
View 14 Replies
Jan 18, 2011
I have a Dynamic Text area called txt, I write the value 5000 by txt.text="5000";
In my scene there will be 2 buttons. When one of the buttons is pushed the value will decrease 250 by 250. For example; at first push it will decrease to 4750, at the second push it will decrease to 4500 and so on...And when it is pushed to the other button this value will increase 250 by 250. For example; the value will be:4500 by pushing twice to the decreasing button, then it'll be:4750 by pushing once to the increasing button. I tried with the below codes but it didn't work. The value decreases only once, it doesn't keep on decreasing when I pushed twice to the decreasing button.The value seems as 5000250.
txt1 = txt.text;
Decrease.onRelease = function() {
txt.text = txt1 - "250";
};
Increase.onRelease = function() {
txt.text = txt1 + "250";
};
And there is one thing too I wanna make if it is possible; I want to place the decreased value of txt dynamic text to valuetxt dynamic text. For example; when the value is done as 4500 by pushing twice to the decraesing button, the valuetxt area will be 500. When the increasing button is pushed once, txt value will be 4750 and valuetxt area will be 250.
View 2 Replies
Jul 7, 2004
i want to try to decrease scale of movie clip. it should be 90 but i don't know what code to add. it should move slowly down.
_root.myclup11._height = 100;
_root.myclip11.onEnterFrame = function() {_root.myclip11._height -=1};
UN@
View 1 Replies
Dec 29, 2011
Im using swipe on my android app and would like to define the boundary. But the container is a LOT bigger then the stage and will reach a negative value. How would I setup my if statement for this?
View 13 Replies
Sep 21, 2010
How we can lessen the length of Dividing bar between two components. like in this example i want the length only of two pixel.
View 1 Replies
Mar 21, 2012
I need to dynamically increase and decrease the alpha value in a "for loop" like shown belowfor example if the 'for loop' is for 5 times and the alpha i need to change is "x" then
loop 1 --> x = 0.3;
loop 2 --> x = 0.5;
loop 3 --> x = 1.0;
[code]......
View 3 Replies