ActionScript 2.0 :: How To Make Decimal Variables Fixed

Feb 21, 2004

I'm making a small game with a timer that have to show the time in seconds with 2 decimals all the time (i.e. 34.71 sec. or 51.00 sec.) How do I force the time-variable to always have two decimals?

View 5 Replies


Similar Posts:


ActionScript 2.0 :: Make Decimal Variables Fixed?

Feb 21, 2004

how to make decimal variables fixed. I'm making a small game with a timer that have to show the time in seconds with 2 decimals all the time (i.e. 34.71 sec. or 51.00 sec.) How do I force the time-variable to always have two decimals?

View 5 Replies

ActionScript 2.0 :: Number Type Variables - Round Decimal Places

Mar 7, 2007

I have a Number type variable that is outputting as 3.46666666 I want it to round it up to 1 decimal place i.e., 3.6 so I can display it in a text field what do I do any ideas?

View 2 Replies

Actionscript 3 :: Make Nested Fixed Length Vector?

May 29, 2011

I want to make a nested Vector, where i define the length of the nested vector too, someting like this:

var kb:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>(4)>(4); // 4x4 vector

This line throws a compilation error - anyone knows, if this is possible?

View 1 Replies

ActionScript 3 :: 9 Slice Scaling - How To Make TextField Fixed

Mar 20, 2012

I'm making window component on Flash Professional CS4 and now I have 1 problem. At the top of window is dynamic textfield for title. When I scale window text is also scaling. So is there any way to make textfield fixed in same position and same size? 9-slice scaling is enabled.

View 2 Replies

ActionScript 3.0 :: Function To Make A MovieClip Circle Around Fixed Point

Feb 17, 2011

I posted a while back looking for a function to make one movieClip circle around a fixed point. The solution I was given (which has worked perfectly up until now) is:[code]This function is called repeatedly by a Timer (loopTimer) with delay 10.The problem I have hit now though, is that if I want to modify or reverse the speed of rotation at any point it causes a jump in position (because I am setting the x and y values directly, rather than incrementing them e.g. "x = ..." rather than "x += ..."). Can anyone see a way to modify this function so that I can just increment the x/y positions?

View 5 Replies

Actionscript 3 :: Extending Any Class From MovieClip Make Both The Classes Fixed

May 8, 2011

I have a library symbol, exported for Action-Script and to Frame1. Now in the document Class, i write

public class Test
{
public function Test():void
{

[Code]....

Now the code works fine but when i write my own (sealed/fixed) Box Class that surely Extends MOVIE-CLIP, statement-2 gives error , i know the Box Class is not dynamic but the Movie-Clip is Dynamic. Now what i understand that Movie-Clip Class being dynamic becomes fixed/sealed when it is extended by any Fixed/sealed Class???

View 1 Replies

ActionScript 3.0 :: Make A App Where The User Enters A Decimal Number?

Jul 3, 2009

I am rather new to actionscript and having some trouble. My goal is to make a app where the user enters a decimal number and the number of decimal places and the output is displayed in a dynamic text box. Here's what I have so far:

ActionScript Code:
go_btn.addEventListener(MouseEvent.CLICK,Display);
function round(num:Number, dp:int):Number {
var decimal:Number = Math.pow(10, dp);
trace(Math.round(decimals * num) / decimal)

[Code]...

View 1 Replies

ActionScript 3.0 :: Make A Textfield That Is A Fixed Size And That Replaces The Overflow Text

Aug 4, 2009

I'm attempting to make a Textfield that is a fixed size and that replaces the overflow text that an ellipse (...). Has anyone found any clever ways to do this?

View 6 Replies

ActionScript 2.0 :: Way To Make Health Decrease By Decimal / But Show Whole Number In Textbox

Jan 9, 2010

I 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 Replies

ActionScript 3.0 :: Array Of Variables - Make A Bunch Of Variables From A For Loop

Feb 21, 2009

How can I make a bunch of variables from a for loop. for example for (var i=0; i<total; i++) {var bunch(i);}. that i make a bunch of variables named bunch1, bunch2, bunch3. I keep getting errors. I program and use so many different languages that I dont know if that can be done with AS3. my only other alternative i can think of is to create some sort of event dispatcher object array. but I dont know how to get them all to send events to one listener with there index number.

View 5 Replies

ActionScript 2.0 :: Make A Square Grid Of Fixed Side Length But Varying Grid Number Using Code?

Jul 5, 2011

I want to make a square grid of fixed side length but varying grid number using code.That is, the number of grids should be specified by the user (say 3*3) and after pressing a button, the stage should be broken into 3*3 grids.I don't want any code, just a method on how to do it. I have tried it by using simple loops but the method just fails for no reason I can figure.

View 5 Replies

ActionScript 3.0 :: Can't Make Dynamic Variables

Nov 13, 2009

I've been working in a new proyect and i came to this problem that is really getting me tired. I'm supposed to make a given number of items (constructed from an extended Sprite)[code]...

View 1 Replies

ActionScript 2.0 :: Joining Two Variables To Make One?

Jul 15, 2011

What i have on the stage are lots of balls each with there on name b1,b2,b3 etc. and i have something that is going to hit it with hitTest.

Insted of hardcoding all the balls into the hitTest i want to have a variable containing the first part of the objects name (_root.b) then add i on the the end and i would loop from 1 to how many balls are on the stage eg. 10.

so for my code at the moment I don't have a loop but using "i = 0"

Here is my code:

ActionScript Code:
onClipEvent (enterFrame) {
i = 1;
j = "_root.b"+i+".ball2";

[Code]......

When i trace "mcName" it shows "_root.b1.ball2" which is the correct object, but the hitTest doesn't seem to see it and fails.

If i put mcName as "_root.b1.ball2" (hardcoding it) it works.

Ive tried so many different tweaks and just can't seem to get it to do it.

View 1 Replies

ActionScript 2.0 :: Make Arrays As Variables?

Dec 26, 2006

why cant the variable "height" modify the position of y? =S im new at ac so i dont know if an element of an array can be a variable? and how do i make it a variable?this is a par of the code im writing to make a group of movieclips appear offstage in a random positions as long as it is offstage (i know the array is not random since i give the values of each element but i tried by putting y= math.random * number?... but in the coordinates i didnt knew how to specify that it could be any random number exept the lenght of the stage)

onClipEvent (load) {
myArray = new Array ();
myArray[0]=-100;

[code].....

View 8 Replies

IDE :: How To Make Flash Outpur Variables

Aug 6, 2009

I'm new to flash, have some experience with HTML and JavaScript.I wonder if and how I can have a flash object in an HTML page that returns or updates a variable in the page, or assigning it to an input element's text property...for example a flash with a form that upon submission updates the equivalent form in the HTML.(I know I can do it all in HTML, just wondered on how its done...)

View 3 Replies

ActionScript 1/2 :: How To Make ComboBox Write Variables

Nov 27, 2009

I am a dynamic site newbie, but have been making simple animations with Flash for some years. I have got a friend to give me a leg up to create a flash page full of input text boxes that write to a text file via PHP and are then dispayed in dynamic text boxes. [URL]. I want to replace some of the imput text boxes with combo boxes. eg if the combo box has the options of say "rigid" or "trailer" it would write which ever was selected in the text file so this would be displayed in the dynamic text box for the end user to see. It seems very simple but I have looked all over the options for combo boxes and can see no mention of variables.

View 2 Replies

Flex :: Make Objects With Key Names From Variables?

Dec 26, 2009

I would like to make an Object that has key names taken from a variable. Probably this is not clear enough, so let me make an example.

I have two variables var str1:String = 'firstKey'; and str2:String = 'secondKey';

How can I make an object that would look like:

var obj:Object = {firstKey: 'some value', secondKey: 'some other value'}, note that firstKey and secondKey are values of variables str1 and str2.

Doing obj = {str1: 'some value', str2: 'some other value'} does not yield a result that I would like

View 3 Replies

ActionScript 2.0 :: Variables Not Adding Together To Make New Number

Feb 24, 2011

Having some issues with some variables not adding together to make a new number. Instead they are appending to each other as if adding characters onto a string rather than a number. Here is my code.

ActionScript Code:
var dispenserPos:Object = {x1:"41", y1:"180", x2:"283", y2:"180", x3:"530", y3:"180", x4:"775", y4:"180"};
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
[Code] .....

It should be tracing out 388 instead of the numbers appended onto one another.

View 2 Replies

ActionScript 2.0 :: Unable To Make Variables And Buttons?

Feb 7, 2004

I have a movie clip button that has 3 states:up, over, out, and press.the action script inside the movie clip button looks like this:

stop();
onRollOver = function () {
this.gotoAndstop("_over");

[code]....

View 5 Replies

ActionScript 2.0 :: Make An Externally Loaded SWF And Variables

Feb 25, 2004

I'm tryin to do catalog on CD using flash. There will be 15 pages of items w/ the selections. The coding I'm using for their options is from this: [URL] Now my question is, since I can't use a DB because it's on a CD, I have to pass the variables through flash. But when they are done making all their selections how do I make an externally loaded SWF using this command:

[Code]....

read the final values that were selected on the specified pages? I've read lots of the threads concering passing variables and none of them. Also if anyone knows of any way to hold a DB on a CD and be able to write to it as well as read from it lemme know

View 8 Replies

ActionScript 2.0 :: Make Variables As Instance Names?

Jun 20, 2006

I have created movie clips using loops that names them box1, box2, box3.... via = i + 1;duplicateMovieClip (_root.box, "box" + i, i);but i then want to edit a textbox which is rooted inside each movie but related to the movieclip just produced. so if box1 had just been produced then:box1.textbox.text = " E cell = +j+"V";is done so effectively i am looking to do: box+i.textbox.text = " E cell = "+j+"V";

View 2 Replies

ActionScript 2.0 :: Make A Form In Flash That Has Multiple Variables?

Oct 30, 2009

I am trying to make a form in Flash that has multiple variables, i then want to use a PHP form to send them in an email but can't get it to work. I think that I'm not properly setting up the PHP file for multiple variables:

<?php
$sendTo = "00000@gmail.com";
$subject = "Visitor";

[code]...

View 1 Replies

ActionScript 3.0 :: Parse Html Source To Make Variables?

Jul 2, 2011

is it possible at all using Flash/AS to get the html source code of a webpage and parse it to get some variables from a specific part in the html code..?

View 2 Replies

ActionScript 2.0 :: Variables - Make A Multimedia / Presentation Where Depending On The Options

May 15, 2009

i need to make a little multimedia/presentation where depending on the options you take (normal buttons) a Mc plays and in the end you a get list of itmes depending on the choices you took. I cant remember how to do it, its been a few years since i last did something like this, is there any good tut where i can understand how to do it? cant find anything, basically what i want is to be able to save the choices the user takes during the "game" and with each lode a different .txt at the end. Is this possible with Fl8? its going on a USB Stick, and it'll be a .exe that will load a few swf . . .

View 6 Replies

ActionScript 3.0 :: Make The Timer Fire All Variables In Strict Sequence?

Mar 17, 2010

I'm looking for will all happen in about two or three seconds. I'm re-building my own website using AS3 package classes. When the API loads I want everything to appear in sequence from invisible to visible. First the logo, a few lines drawing themselves, then all the navigation buttons at the top appearing in a quick-fire horizontal row, then the content rolls in, etc. I want strict, accurate control over about two or three seconds, of how and when everything on stage goes from invisible to visible in a quick-fire sequence. I know it can all be done with several timers for each alpha going from 0 to 1. But can all the variables going from alpha 0 to 1 be bundled into an Array? And the Array fired by ONLY ONE Timer using a For Loop? Or am I just barking up the wrong tree? Should I just use a bunch of Timers? I want to avoid a Tween because I want very accurate control of the quick-fire invisible to visible effect. And I want it to be easy to change later. Can this effect be done by ONLY ONE Timer rather than several Timers? And if it can, how do I make the timer fire all variables in strict sequence? Do I use an Array with a For Loop? Or something else? I've been looking for a couple of days but still haven't found anything close.

View 2 Replies

Flex :: Initialize And Make Condition For 2 Variables In Single For Loop?

Oct 28, 2010

How to initialize and make condition for 2 variables in single for loop in Flex let keep i and j are two variables

View 2 Replies

ActionScript 3.0 :: Make A Proper NavigateToURL Sending Variables Using POST Method?

Apr 11, 2012

I really need to send a variable via POST method to an URL and the navigate to it. navigateToURL sends variables using GET method, although I specified POST. URLLoader sends variables using POST method, but does not navigate to the URL.

View 4 Replies

ActionScript 2.0 :: Make A Simple SWITCH Statement With Button._name As Variables?

Jun 18, 2007

I want to make a simple SWITCH statement with Button._name as variables for CASE

so i got this code:

Code:
Button.addListener(_root);
_root.onRelease = function() {

[Code]....

View 2 Replies

ActionScript 3.0 :: Make A Personalized Flash Children's Book - Text Fields And Variables?

Jun 14, 2011

I'm looking for the best way to be able to have a user input their name, age, etc, and then place that data into a Flash Story book, to make it personalized. For Example:Name:_____Age:_____BOY/GIRL:____and then for example if the user decided to Enter: (Cooper, 7, Boy) the story would add those variables, so it might say:"Once upon a time, there as a 7 year old boy named Cooper, who lived in flying shoe."Ideally, I would want to be able to have the text auto format so that it looks like a seamless paragraph, no odd line breaks or spacing issues no matter how long the name they entered was, so for example if they entered "Cooper" or "Cooper William Johnson III", either way the text would still flow correctly

View 4 Replies







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