ActionScript 2.0 :: Show How Often A Certain Number Hits?
Nov 29, 2010i make simple random tester. it show how often a certain number hits.
View 0 Repliesi make simple random tester. it show how often a certain number hits.
View 0 Repliesi have something like this in the frame:
var number1 = 10
var number2 = 10
And in the stage i have 3 dynamic text boxes. The 1 one has the variable number1 the secound one has the variable number2. But how do i do so in the third box it says 20? I want it to substract number1 and number 2 and show that in the box.
when I started my movieclip was simple...its an info popup that comes up when someone clicks another movieclip on the stage...anyhow, when it comes up it looks like a projector screen that is being pulled down...there is also a number in the top right that is supposed to be scrolling...there are two problems with my popup...
1) the scrolling number does not show up...
2) the content in the info popup refuses to stay invisible until the "screen" is pulled all they way down...
the first link shows what the scrolling number is supposed to look like...I did not change anything regarding the scrolling number when I altered the content to fit and look decent in the info popup..
how I can format numbers in Flash so that it will show two decimal places regardless of the number itself?
View 4 RepliesI have animated button inside movie clip. On rollover, button zooms in and rotates. It even swaps depths (that took me a while). However, if I have 10 buttons on the screen, one of them, and only one, will not rotate, and will not zoom, but everything else works. The kicker? The button is never the same. To see what I mean... I have the site staged on this [URL] clicking on the number will show a picture
very little code here (as you can imagine)
on rollOver {
_root.stopandgoto(frame#);
x=0
x=x+2
_root.instance.swapdepths(x)
}
I have tried and tried but i cannot get a number to force show 2 decimal places.I have lots of different buttons and selection boxes that output a different value for 'sizePrice' and 'effectPrize'. An example can be seen below:
Code:
if (sizeSelectionBox.value=="size1") {
sizePrice=67.20;
calcTotalPrice();
[code]...
I need totalCost to always show 2 decimal places so if it is 60 it needs to say 60.00, if it is 67.2 it needs to say 67.20
I'm starting my progression from AS2 to AS3 and am running into a glitch that has me tugging at my hair.I'm basically trying to create a button that will generate a random number and place it into a text field. However, when I try to run the script as shown, It hits me with a 1067 Implicit Coercion error message.However, if I run the currently commented out String variable test it works fine but when I try to to run the Number variable code it errors out on me.The random number generation code is working (based on the trace) but for some reason won't show up in the text field (named myText).[code]
View 2 RepliesI have tried and tried but i cannot get a number to force show 2 decimal places.
I have lots of different buttons and selection boxes that output a different value for 'sizePrice' and 'effectPrize'. An example can be seen below:
Code:
if (sizeSelectionBox.value=="size1") {
sizePrice=67.20;
calcTotalPrice();
[Code]....
I need totalCost to always show 2 decimal places so if it is 60 it needs to say 60.00, if it is 67.2 it needs to say 67.20
I thought the *100/100 should do it but its no
Im trying to make a script that show numbers counting to a certain number. Need some help. I want to start at 0 and then counting up to for example 52.
View 3 RepliesI need to show the amount of times the counter has been moved along the board, ie how many turns the player has.
the dynamic text box is called 'moves' and the counter is a button which is pressed for each move. Therefore, it would need to be added to the onRelease function.
I'm trying to figure out the best code to limit the number of photos loaded into my slide show. Say I want to limit it to 50 pictures. I'm loading pictures into an array and want to stop at 50. Below part of the code.
ActionScript Code:
// this frame is for loading pictures into an array
noPics.visible = false;
[code].....
Im trying to make a script that show numbers counting to a certain number.I want to start at 0 and then counting up to for example 52.
View 4 RepliesI am making a flash game for a school project, and I decided to make a stick fighting game.once the enemy attacks the player their health just drains. The only way I can fix it is if I have a decimal instead of a whole number, but I have the variable of the health in a text box to display the players current health and it doesn't look to good with a decimal number.So, I am wondering if there is a way to make the health decrease by a decimal, but show a whole number in the textbox.[code]
View 2 RepliesI use a variable to show the percentage loaded number in a dynamic text box. The problem I have is that it only works when there is more than 1 frame in the preloader scene.
My guess is, that when there is only one frame, the code is not being refreshed to update the text box.
ie var percentage; percentage = math.round( getBytesLoaded() / getBytesTotal() * 100);
I have a button that triggers the function addToBet on a card game and doesn't allow the textfileds to show any larger number but I can't top the clips with the coins I'm trying to attach. The function showBet keeps running.
bet = 1;
function addToBet() {
bet ++;
[code]....
Dear Guys I Want To Generate A Random Number Between 2 Number BUT Without Generating 2 Same Number I Mean If For Example Already Generated Number "2" Next Time Did Not Generate It , Is There Any Solution
View 5 RepliesI'm making a small adventure game, and I want the game to go to the next frame once the main guy MC hits another invisible mc, like where the door is. I suppose another way of doing this is when the main guy mc hits an xy coordinate. So basically what I want is a script that says, when MainguyMC hit another MC/ coordinate, go to frame 2
View 14 RepliesI Want To Generate A Random Number Between 2 Number BUT Without Generating 2 Same Number I Mean If For Example Already Generated Number "2" Next Time Did Not Generate It,
View 4 RepliesI have two movieclips A and B when the movieclip A hits the movieclip B , I want the movieclip A to be removed what code should i write for this flash problem ?
View 1 RepliesI want it to remove everyone that it hits, but it only removes the first one that hits. I am sure the answer is simple, but i am slow. Here is the code:
ActionScript Code:
function removeSpawn(){
for(j=0;j<lvl1A;j++){
[code]......
_root>mc1>mc2>box
The box got this code:
PHP Code:
onClipEvent (enterFrame) {if (_parent.hitTest(this)) { trace("hitting"); }}
I want the box to trace when it hits mc2, but it don't works!
I have 2 movie clips with a linkage. In a process both mc's are being attached lots of times and a new name is given to each every time.I want to make it so that is these 2 mc's hits each other they dissappear, but i can't do that because they all have different names and i don't know how to call to them.
View 1 RepliesIs there a way to keep track when an FLV hits a certain point in its playback WITHOUT using cue points? If so, how is this implemented and does it make the experience sluggish?
View 3 RepliesWhen the timer hits 10 I want it to go to frame 2.Here is the script:
var clock:Number = 0;
if (Number == 10){
gotoAndPlay (2);
[code].....
I want a hittest of the _root.mouse and a mc when the mouse is down.
I tried among other things this but it doesnt work.
this.onMouseDown = function(){
if ((_level0._xmouse == boll._x )&&(_level0._ymouse == boll._y )){
trace("down");
}
}
Is it possible to make a visitor hits counter using just AS2 ?
Or what is the other way to do this ?
The site is totally in flash only.
Im looking to make something happen when my timer of 30seconds reaches zero. This is the code I've used: how to ad a function that will make something else happen??
[Code]...
Im making a sort of maze game and have a ball that moves up, down, left and right when the corresponding arrow key is pressed. What I want to do now is introduce some walls, how do I make the ball stop moving when it touches a wall? (so it doesnt pass through the wall)
View 1 RepliesBasically the code creates 3 sasquatches. When you click on the sasquatch it displays "you be dead sucka!", well, only ONE of the 3 sasquatches are registering hits, and the one that does traces "you be dead" 4 times.
package{
import flash.display.*;
import flash.events.*;
[code].....
I'm initiating my migration process from AS2 to AS3 .After reading A LOT of tutorials and, of course, pretty much everything that mister senocular wrote I finally got something going Well until this pickle[code]...
View 8 Replies