ActionScript 3.0 :: Calculating Total Number Of Hours?
Mar 18, 2012calculating total number of hours after adding my hours and minutes once clicking on a button. this is actionscript 3.0.
View 1 Repliescalculating total number of hours after adding my hours and minutes once clicking on a button. this is actionscript 3.0.
View 1 RepliesI am using FLEX version 3.0I want to calculate the total working hours. I am giving you the details and what i have done in it.
var a:Number = 2.00;
var b:Number = 2.00;
var c:Number = 1.45;
[code].....
I have some buttons that you press and it makes different types of toppings appear on a burger, but I'd like there to be a cost attributed to each topping and a running total showing the cost in the bottom right corner. The cost must be deductible if the toppings are removed.
View 4 RepliesIs there anyway I can get the total size of all files queued from swfupload right after the user selected the files? I need to be able to display something like "0 of 184MB" when the upload is about to start.
View 1 RepliesI'm trying to extend an isometric Flash game based on as3isolib. The game does only support diamond shaped grids but I have to implement the possibility to have rectangular shaped grids, too.
[Code]...
How can I find out the total number of MovieClips on stage at any one time?
I've just had to optimise a tile based scrolling game by ripping clips off and on the stage as it scrolls. I could have used gotoAndStop scrolling but I was hoping I could try clip ripping first (reorganising my entire library wouldn't keep me on schedule) - so far the overhead has been drastically reduced.
But I want to be double sure there aren't any MCs lurking (implementing this is producing rarely occuring bugs), how can I get the number of clips attached?
I have made calculator from tutorials but i was unable to add a radio button that will add number to the total after calculating two number.here is my AC3.[code]
View 0 RepliesI'm trying to make a kids score board where there are 20 icons all with scores behind them between 1 and 20 and a kid chooses an icon, clicks on it to reveal their score, thenthe score is added to their teams running total at the bottom of the window. (There are 2 teams) The thing i have a problem with is generating the random numbers and also where exactly to drop in the actionscript in the timeline. I've tried different variations of the Math.Floor(Math.Random) but i cant seem to get it to produce the numbers i want!
View 7 RepliesIm having trouble getting Flash to return the total number <ProjectImage> nodes in the following xml.
Code:
<?xml version="1.0" ?>
<work>
<project>[code]...
Im trying to get the Total number of images for each project. But it only returns the first image for each project....Do I need to nest a loop within the project loop to get the images for that project?
[AS]
function loadXML(loaded) {
if (loaded) {
projectNode = this.firstChild;[code]......
I'm trying to do something that makes sense in my head, but can only translate to code with mixed success.On the screen is 6x4 grid of boxes, 24 in total. These boxes represent a number of entries in a big visual timeline, the total of which can be anywhere from 1 to many thousand. Of course, only a fixed number of 24 can be seen at any one time.The grid scrolls left/right to show previous/future timeline entries in their box form.
The grid normally starts at the very first entry, but there is an offset built-in to it so that you can, for instance, start the display of these entries at a certain point. For instance, if you have 26 entries with an offset of 1, that means there will be 1 entry not seen to the left (before), 24 on the screen seen, and 1 entry not seen to the right (future). Or if you have an offset of 10, there would be 10 to the left (not seen) and 16 filling the space on screen, etc.The scrolling basically slides the entries left or right by a factor of 4 (since the columns consist of 4 boxes), but must be clamped to not scroll beyond the total number.
Is there some simple math anyone can think of to track the state of these boxes? I ask because I will have Flash create *only* the 24 max that can be seen at any one time. Any time you scroll to the right or left, Flash will create up to 4 new boxes to fit that next column, and then animated all 28 boxes (24 existing + 4 new) to move the new ones on (and the old ones off), and then delete the old ones. This is to keep things optimized since creating many thousands of boxes that each load external content is not very feasible.
Hope this makes sense to someone. It would be similar to what you see here, but with scrolling (and more importantly, something to keep track of it all): [Url]
I have used the loader class and the load method to load a swf file that has several frames. how I determine the total number of frames in the SWF file timeline after loading?
View 3 Repliesi have a dynamic image gallery, and what I want to do is be able to load a number that is saved in a text file and use it as the total number of images in that folder for an if statement:
this is what I have so far:
Code:
var imageNumber:Number = 1;
var loader:URLLoader = new URLLoader(new URLRequest("images/info.txt"));
loader.addEventListener(Event.COMPLETE, completeHandler);
[Code]....
how can I use the value of a variable within a function outside of that function without having to create a class and package and all that?
I need to be able to have the function return a value of a variable within itself and be able to target that value outside the function..
At the moment I'm making a presentation for school in Flash MX 2004. I want some kind of progression bar in the presentation. This is how I have it in my mind:
2/15
2 is the current frame and 15 is the total number of frames. I know I have to do this with the use of ActionScript in combination with dynamic text labels. How can I read out the current frame number and the total number of frames?
The names of the dynamic text labels are:
"cFrame" and "tFrames"
I am developing a game for mobile in AIR (as3). I have created some bots for this game that initially just wander around. But when a bonus enters the stage, they have to move to the bonus.The detection of a new bonus and moving of the bots works fine, but there is something wrong with the manipulation when a new bonus enters the stage.Basically, this is how it works (or I try to make it work):My bot moves along with his rotation as a parameter. (works fine)
private function moveToNextLocation():void
{
var angle:Number = _rotation * 0.0174532925; // 1 degree = 0.0174532925 radians
var speedX:Number = Math.sin(angle) * _speed;
[code]....
I'm trying to do a isometric game, diamond shaped stage. And want to know how the formula for translating the mouse position over a tile into the correct row/column of it.
[Code]...
I'm trying to run a sqlite query in flex to count the total number of records I believe its working fine but I just can't figure out how to display the results - all I get back is [object Object].
private function overviewOne():void{
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConn;
stmt.text = "SELECT COUNT(user_id) FROM tbl_user WHERE status_status ='Away'";
[code]....
So how do I make a reference to the COUNT(user_id)?
(flash.data::SQLResult)#0
complete = true
data = (Array)#1
[code]....
I have 3 swfs of a cloud animation, one for the day, one for the evening and one for the night. I would like to load the day swf from 6 am to 3 pm, evening from 4 to 6 and night well...the rest..but honestly I dont know where to start or how to make flash read the computers internal clock.
View 5 RepliesI try to increment each 2 hours but I don't know how to proceed.
View 2 RepliesIs there a way to compare the current time to a bunch of times (loaded from XML) and have it figure out which is the closest to the current time?
View 3 RepliesI want to show a full 24 hours along the datetimeaxis wherever the values fed into it happen to fall. I thought that setting the minimum and maximum of a datetime axis on the chart would have that effect.
so I have private function loadDayComplete():void{ //called when data is reloaded. also includes reassigning the dataprovider of the chart.
[Code]...
When I load up the function though it doesn't plot any points when the min and max are set. If I take out the minimum and maximum they show up fine! I double checked in debug mode that the minChartDate and maxChartDate are what they should be.. but maybe I'm misunderstanding how minimum and maximum are supposed to function... I also tried widening the min/max to include several days and still no luck. I also tried assigning the min/max when the chart data changes like so:
[code]This passes the date to another function that uses the date to see who in my office is oncall in the database and displays their name. The problem is, everyone that is oncall has to be oncall until 7am the next morning. So this works great IF they were off at Midnight each night. Is it possible to subtract 7 hours from this date?
View 3 Repliesi want to have an swf loaded between 8am and 6pm and another one between 6pm and 8am. How can i do that? i guess it's not very hard but i don't get it. i suppose i need a variable with the hours. then do a if statment that check if the current hours is between 8am and 6pm. then if it's between this time do this if not do that..
View 8 Repliesuse it for my final project to graduate with a CS degree. I did some basic animation type stuff around 5 years ago in school but nothing major. I want to make a website for a non-profit organization for my project. I know what I want to do, but I need to give my advisor an estimate of how many hours it will need to complete it.Here is a general outline of tasks I want on the website:Message boardBlogEmbedded videoPhoto galleryArchived newsE-commercestoreGuestbookCounterPollsApplications - games, instant messenger type thing (if I have time)
View 5 Repliesi am trying to create a 24 hour countdown clock that will loop and play backwards counting it self back down to 00:00:00:00, being new to flash As3 i am struggling to create this animation
00:00:00:00
hours:minutes:seconds:milliseconds
I have been given this code by a very helpful user
var timer:Timer = new Timer(1000);
var currentSeconds:int = 86400;
var milliseconds:int = 86400000;[code].......
the problem i am having now is do i need to add an instance name to the 00:00:00:00 design on the flash stage for the code to work as i have tried and i think im doing something wrong.
I have recently developed a standalone Flash entertainment system, containing Flash games and screensavers etc., i have also included a third party mp3 player.
The problem i have is the PC is left switched on daily and the system is used quite heavily, i.e mp3's playing in background while screen savers are displayed and games are played.
Everything starts fine but after a few hours the flash animations slow down to about 2 or 3 frames per second, then the PC will finally crash.
I am trying to create a 24 hour countdown clock that will loop and play backwards counting it self back down to 00:00:00:00, being new to flash As3 I am struggling to create this animation. The AS3 code I have put into my actions is as follows:
var timer:Timer = new Timer(1000);
var currentSeconds:int = 86400;
var milliseconds:int = 86400000;
var result:String = "";
timer.addEventListener(TimerEvent.TIMER, countDown);
function countDown(e:TimerEvent):void {
[Code] .....
When I press to test the movie the numbers are still 00:00:00:00. Below I have attached a link to an image to give a better idea of where i am at with this animation: [URL]
I'm making a timeline with a moving car. It has to go from left to right in about 11 hours. I got this code and the car is moving from left to right:
[Code]...
But everytime I refresh my page the car is at the begin again. So I have to attach it to a Timer/date class to it so it stops at a certain point / time and date.
I am a game programmer and i have made a game where there is a character which has to select the right pieces and avoid the wrong ones. the pieces/food come from top, the character jumps and fetches them. Thats why we are keeping a gap between the pieces to avoid the character touching the wrong ones.
Problem : When I win the game and keep re-playing it continuously for more than an hour i notice that the gameplay gets slow(slow FPS). The behavior and movement of the characters become slow. Upon playing for 3 hours the slowness is easily noticeable. This also happens when I minimize the game window or get the focus off the game to some other window for a long time (half an hour or more). The problem doesn't come if I play once or if I lose the game and try again. This comes when I keep playing it for a longer time.
I am building a scheduling system. The current system is just using excel, and they type in times like 9:3-5 (meaning 9:30am-5pm). I haven't set up the format for how these times are going to be stored yet, I think I may have to use military time in order to be able to calculate the hours, but I would like to avoid that if possible. But basically I need to be able to figure out how to calculate the hours. for example 9:3-5 would be (7.5 hours). I am open to different ways of storing the times as well. I just need to be able to display it in an easy way for the user to understand and be able to calculate how many hours it is.
View 2 RepliesI'm hitting a wall on this one. My script finds the difference in hours between 2 dates, however..
var data:Array = ["2011-08-30 11:19:19", "01-09-2011 02"];
var aDate:String = data[0].split(" ")[0];
var dateElements:Array = aDate.split("-");
var date1:Date = new Date();
date1.setDate(int(dateElements[2]));
[Code]...
As you can see, the date elements trace out the way they should. Now try changing the first element of the data array to "2011-08-31 11:19:19". Although the date elements are fine, the last trace gives a totally weird value. What's even weirder is that when compiling this script a second time in Flash IDE, it takes a long time to compile, then traces nothing at all, as if the script times out.