ActionScript 2.0 :: Output Is Always The Same Number The Whole Time?
Jun 5, 2003
This is my code:
onClipEvent(load) {
test = new Date();
}[code]....
But the output is always the same number the whole time. Is there anything wrong with my code?
View 1 Replies
Similar Posts:
Mar 24, 2010
SO, I want to do a very simple program, and I have no clue how to even get started. This is what I need to do. Several Different boxes to put something into. I Have Done That, I can type into them. Their instance names are
Box1
Box2
Box3
Heres what I have no clue on how to do though, completely lost. Box 1 needs to have the value psr.
[Code]...
View 2 Replies
Jun 22, 2009
test.fla has the document class test.as. This is test.as:
Code: Select all// test.as
package
{
import flash.display.MovieClip;
public class test extends MovieClip
[Code]....
Why is it so? I want to be able to output the value of number through the document class like I showed in the code of test.as above.
View 1 Replies
May 10, 2007
i have a set of buttons outputted by using an array/loop (through xml).
when i click on a button i want to get the array number of the specific item i click on.
here's my logic:
Code:
for(i = 0; i < totalList; i++) {
this.container["item_" + i].bg.onRelease = function () {
itemClicked = this[i];
trace(itemClicked);
}
}
so basically i need to know what i would replace this[i] with in order for it to actually output it's array number.
View 4 Replies
Sep 8, 2010
I have a simple dynamic textfield with the variable name total_txt. Why am I getting an error with this code?
Code:
var myNum:Number = 0.00;
total_txt.text = myNum;
I'm assuming it's because the textfield is only wanting to read a string and not a number, but how do I output a number to a dynamic textfield?
View 5 Replies
Apr 27, 2011
I'm working on updating a quiz game my employer has. One problem I encountered was that the timer that runs during the "exam" mode of the game wouldn't work, so I found a work around by replacing it with a timer that did. All that it is, is a dynamic text box on the first frame of the questions, with the following script embedded in the start button to make it run:
start_time = getTimer();
countdown = 7200000;
onEnterFrame = function () {
elapsed_time = getTimer()-start_time;
[Code]....
When the game ends following the completion of question # 20 (there's about 200+ questions programed into it, with the 20 chosen at random) the game is redirected to a frame with results page; and here the time stops, using this code: count=(stop); Rudimentary, but effective - at least in stopping the timer. On this page is the option to save the results, with input found on this page (score, name, date and time completed) being output on another page, in a form the user can save or print off. What I can't figure out is how to output the elapsed time paused in the resutls screen, to dynamic text box in the save form. What script do I want, to send this information to the proper text box at the end?
View 1 Replies
Aug 24, 2010
Is there a way to output in the text filed a number of how many times the video looped? (how many times it has played)
View 2 Replies
Feb 15, 2011
For some reason I'm unable to output the time returned by the php. This code is on my website and viewrs from different countries see different times.
[Code]...
View 15 Replies
Oct 31, 2009
I have a C executable (named myprogram). When I run it by ./myprogram I get some output statements on the standard output of my Linux shell. I used run.php to get access to whatever is being printed to the standard output:
#run.php
<?php
$output = shell_exec('./myprogram');
echo $output;
?>
Then I called an HTTPService having id="service" to access this run.php file and I also set the text attribute of a TextArea to {service.lastResult}. When I run my Flex app, the interface kind of halts for a moment and then the TextArea displays all the 20 lines at once. But if program is run from Linux shell they appear one by one. Is there a way by which I can display a line as soon as it gets printed to standard output? This will then make the TextArea show the output in real time.
Or is Flex unable to do this? Rather how can a PHP program achieve such effect i.e. showing, whatever is being printed on standard output, concurrently in the browser in real time? Myprogram outputs 20 lines each after some microseconds. I want only the first line of standard output to appear in TextArea of Flex or in the browser (but in real time) while the program may then continue running the program.
View 3 Replies
Feb 8, 2011
Does the getTimer function affect the output time? so it's seen different in each country? I've created adigital clock using the time received from a php. Customers see a different time than mine. (php file works perfectly and output the time in my timezone).
View 3 Replies
Dec 27, 2011
Is it somehow possible to output the traces in a deployed application to a display element?'m aware of the debug deploy in Flash Builder, but unfortunately I can't convince my iPad to work with that,Edit: On second thought, a full console output would probably be best. The flash console kostik suggested looks pretty good, so making it display the console output would be ideal.
View 2 Replies
Nov 9, 2011
I've been playing with prototype a bit and I've noticed that either it isn't as static as it should be or that some functions are protected from altering, or that in some cases the prototype actually extends a function. For example, I was trying to modifiy the global trace function to output the current time of a trace action, something like this :
Code:trace("lulu"); // output 12:48:17.286 lulu I DID achieve something close to it, but it seems that I haven't actually modified the global trace function, but rather it's "_root" counterpart,
[Code]...
View 3 Replies
Jun 12, 2006
Does anyone know an url where I can get the current time as either a string or a number? Or how do I solve the problem that flash can't create an external time? Or does anybody have a
perl-file that they wouldn't mind sharing with me that could do the trick
View 2 Replies
May 20, 2004
I'm doing a simple hex converter with a input window(hex) and output window(dec)
Currently i'm using a simple script on a button to covert the hex to dec
on (release) {
outputBox = parseInt(inputBox, 16);
}
This is ok if you want to convert one hex number at a time, what i want to do is input lots of hex values (in the input window) and convert them to dec (to the output window) in one go.
View 8 Replies
Mar 2, 2010
I got a slideshow class, and in here I have a Number variable named "currentImage". This is changing(with the method currentImage += 1 when you click to the next image.
The problem is that when I trace currentImage (Event.ENTER_FRAME), it gives different values on odd and even frame numbers. On frame number 1 trace is 0, on frame number 2 trace is 1 and so on, on frame number 3 it is back to 0 and so on.
The slideshow works, but I got a function that resets the slideshow and this function is also using currentImage, this function doesn't work because of the changeing number.
View 3 Replies
Mar 15, 2004
how to display a random number every time i need to display 3 digit random number display and i has also a random number display for 3 dec place too
View 2 Replies
Apr 1, 2009
I composed this function to convert a number to a time format (HH:MM:SS.T):
PHP Code:
function convert_sec_HHMMSST(_arg:Number):String {
var hr:int;
var hrText:String;
[Code]....
It works. But I'm thinking it could be optimized for performance. How would you pare it down?
View 3 Replies
Mar 15, 2004
does anyone know how to display a random number every time i need to display 3 digit random number display and i has also a random number display for 3 dec place too
View 2 Replies
Nov 20, 2009
I'm quite new to AS3 (coming from php/c#) and like it very much. My problem: trace doesn't output anything in the Output window anymore?!
View 2 Replies
Nov 20, 2009
I'm quite new to AS3 (coming from php/c#) and like it very much.My problem: trace doesn't output anything in the Output window anymore?!
View 3 Replies
Oct 25, 2011
I have a fixed amount of words. Lets say 20 words. I want each of these words to be put into symbols - so i have 20 symbols (box1...box20). Now i want the boxes to fall from the top of the screen and until they reach below the screen. But (and this is where i'm lost) I want to have them fall at different speeds AND I want to control how many boxes falls at a time. Starting out with one box and when this box is out of the screen I want to control the amount of boxes/symbols entering the screen next.
A function telling that next there should be i.e. three boxes entering and falling/floating across the screen (from just above the top of the screen untill they all have reached the bottom). And i want to be able to call a function which starts X boxes - even before the existing boxes in the scenes has dropped). It would be nice to have a function, ie. fallBox(3) , which may be called at any time.
View 5 Replies
Dec 7, 2010
I want to find out if the user is currently using more than one finger to draw on the screen.currently, the TouchEvent object doesn't have any property like touchCounts, which tells the number of touches on the screen. it just has a touchPointID, which helps to identify a particular touch.
do i need to handle this on my own ? for eg: in the TOUCH_BEGIN event handler i could see how many different unique touchPointID i have received and update the count myself.
View 1 Replies
Dec 30, 2009
I want the classic odometer styled counter but i want to put in some information for it to run with.. A start date, a end date and a number (e.g. meters) which needs to be reached in the given time spanThe odometer should hereafter show the current progress and increased accordingly.So i figured out how to get the time span traced out in seconds and thereby the meter increase every second (dividing: meters/seconds)Now the tricky part is to put these numbers in the odometer: The current progress and the increasement.
View 2 Replies
Dec 17, 2009
what Have I done wrong! I want 'time' to return a number from the function it fires, So that it gets placed into the alphaTo Function ....> have a look
Code:
blocks = 6;
for(i=0;i<blocks;i++){
[code]....
So you see that I want to return a Number to 'time' ... How do I Return the Number?
View 3 Replies
May 7, 2009
I wonder if anyone on here has any experience of the above component [URL]. It produces 'turning page' books from jpegs and I'm having problems with one aspect of it. I've created a 'GO TO' button where the user can enter the page number that he or she wishes to visit. It all works beautifully, with one problem. The FlippingBook component is set to start at page '0'. This means that if the user enters '5' in the GO TO page box and clicks 'GO', he or she will be taken to page number 6, rather than 5, because what we are calling page 1, the component calls page 0.
I need to try and find a way around this, as if we're working on existing brochures with contents lists and index numbers, it is not feasible to just change all the page numbers. I would think that I need some code to tell the component to add a page to the number each time, but I'm not clear what the code should be or where it might be added.
View 2 Replies
Mar 11, 2012
I have a long list of images in the library linked as image1, image2, image3 etc. how do i set up a for loop that will display these images in one go (one on top of the other), i thought this would be trivial but everything ive tried doesnt work, i think i may be confusing run time with compile time with my attempts, when i set up a for loop with the iterator replacing the number (in the image name) i just get errors. Sure i could hard code every one but i find that dissatisfying.
View 2 Replies
Feb 7, 2010
I'm making a shooter where you are a plane and drop bombs on below boats(your flying over the sea) and I have 2 types of boats, a red and blue one. I want the game to make a random boat(either red or blue) to come along every now and then. I have created a var Boat, and made it generate a random number between 0+1, so either 0 or 1. Then in the function on load put "if (Boat > 0)" import the red boat and 1 for blue.
The problem is is that the red boat always comes, and not the blue boat, and if I make it 0 for the blue boat only the blue boat comes. I think its because when the game starts it generates the number that number is the same through out the game. how to make it generate a random number each time a boat comes? Or anything else that might work.
View 2 Replies
Feb 7, 2009
with the following problem:I have 1 button that when hit 1 time shouldplay "movieclip 1"when hit for the second timeplays "mc 2"on so on untill mc9(each movieclip plays continously when once activated)
View 0 Replies
Dec 6, 2010
The buttons are used to jump to a specific (root-)frame (based on a variable); they're all nested inside a moviclip, each on its own layer, and for every frame there's one button more showing (imagine a staircase). Now, is there a way for a script that works for all buttons without adding the specific frame number every time? I started working with
ActionScript Code: on (release) {_root.gotoAndStop(_root.VAR+3);} where VAR also defines, how many buttons are shown (eg. frame number of the button-MC). +3 is just for the frame number on root. That way, of course, all buttons eventually lead to the same frame, or more precise: only the last button shown will lead to the correct frame.
View 4 Replies
Jun 17, 2011
Dyamic text box timer problem?
var score:int=0;score += 10;
addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void{ mytextbox.text = String(score);}
on first click it adds number 10 then it doesnt goto 20 on the next clicks?
View 3 Replies