ActionScript 2.0 :: Current Time As Static Variable?
Oct 7, 2008
I've been trying to create a script that pulls the current time and turns it into a variable, the problem is the variable keeps updating as the time changes, where as I need it to remain static as the time that is was when the variable was first created...it's just a simple:
i have to read the current class name inside a static method. For non-static method it's easy i just call getQualifiedClassName(this) but inside a static method this is off course invalid.
The Idea is i want to make avariable that stores his value after i close the swf and open ti again,
an example:
i make acounter
var i:int = 0; var timer:Timer = new Timer(1000); timer.start();
[Code]....
the value of i will increase but after i close the application and open it again the value will return to 0 , keep the variable stores his value after closing the application ?
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
I've checked the forum a couple times, couldn't find an answer.this file gets local time, and then adds 5 minutes to it, problem is that when the minutes gets to 60 it continues because it's getting the actual time from the first time and just adding 5 to it
I've got this code that displays the time but, I want the time to display dynamically, updated by the user's sytem clock so it always displays the "current time".
I have a flash file of a snowman doing various activities. He's doing 7 different things (all individual movie clips) and I place each of the movie clips on the first 7 frames, I placed a stop action on each one.Here is the code I used
var myDate = new Date(); var localHours = this.myDate.getHours(); if (this.localHours>=6 || this.localHours<=18)
I'm trying to sync video with content. I can use cuepoints in Flash CS5 for that, or I can use FLVplayercaptions to sync video with caption. Is there a way to know the current time of playback?
Below I have a counter program. the counter starts running once i open the swf file. Now I need to place a button where i can get the static session time like say 00:01:50 in a text box telling " You have been logged for+time+time. I dont have any idea how i can get the locked timer. The timer goes on running. I want the static time to be displayed when i click on the exit button too. Because exit button opens a page where this time will be displayed, so the user knows how long he has spent on my swf.
Code: //initial variables var timing:Boolean = false;
But it doesn't work. I can't seem to change the value of "poop" with code. It only accepts a value that I place, ex. var poop = 2, but that doesn't let me change it.
I want to display the current time into a dynamic text box. The time comes correct but the seconds is not running... I want live seconds. what modification should i do to my following code?
I'm attempting to use Flash for displaying "scrolls" on our educational access channel. I have an announcement on each frame, which has a 7 sec delay, and a footer that displays the current time. What I would like to do, using the vars the Hours and the Minutes trigger a command that at a set time, like 8:20, it would jump to another swf file that might contain a video playback component. I can't seem to come up with the right combination to trigger it a set time. Here is what the frame 1 AS contains.
ActionScript Code: stop(); var wT:uint = 1000; //wT = waitingTime var ttL:uint = 1; //ttL = times to loop function customTimer (timeToWait:int = 1):void { [Code] .....
I have a class named Locator that I use to GeoLocate a user. There's a static method in that class called "locate()". This method then calls another method which sets a static variable called "loc" to an instance of a LngLat class.The issue I'm having is, when I call the locate method at Frame 1 on the scene, and then try to access the loc variable it shows as null... but when I trace the loc variable after it's set in the Locator class it shows as an object.[code]and then trace the variable at the end of the static method in the Locator class it shows as a object and the city is traced as expected.
I am trying to work with a global variable in Flex and it does not appear to be working correctly. In my default mxml file I declare the following public var appID:int;
This variable keeps track of the session ID across my application for SQL purposes. On another mxml page I call the following code which should update the global variable to the current ID.
// Get the ID sqlStatement.text = "SELECT Max(id)FROM applications"; sqlStatement.execute(); var result:SQLResult; result = sqlStatement.getResult(); FlexGlobals.topLevelApplication.appID = result.data[0];
Lastly I run a SQL Update query using the ID as a parameter. My problem is that the FlexGlobals.topLevelApplication.appID is always 0, for some reason the global variable never gets updated, I have checked to ensure that result.data[0] is correct but the value never gets passed to the global variable.
I've used similar code to this before in another project, but for some reason it's not working here: Code: var current:MovieClip; menu01.menuslide.arch.onRelease = function() { if (current != null) { Tweener.addTween(current, {_y:0, time:.5, transition:"easeOutExpo"}); Tweener.addTween(menu01.menuslide, {_x:0, time:1, transition:"easeOutExpo"}); [Code] .....
I need to assign a value equivalent to the name of the button that is being pushed to the variable 'current'. when I trace 'current', I get 'undefined'. I used this in the past in this way below and it worked: Code: a2.onRelease = function() { if (current != null) { current._alpha = 0; current.removeMovieClip(); attachMovie("002", "box002", 10, {_x: 0, _y: 30}); [Code] ..... Why the first code block isn't working?