Old Movie Count Down...
i am trying to make a slide in flash mx 2004 and i don't know how to make the circle rotate like a pie to reveal the numbers for the countdown. like in old black and white movies when they start they do the black and white count in. if anyone understands what i mean and can help that would be great.
FlashKit > Flash Help > Flash General Help
Posted on: 05-25-2006, 01:05 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Word Count (or Character Count) For An Input Field
How would I create a word/character count field to count down characters used when typed into an input filed.
i.e. input field has a maxChar=255. I want the user to see the chars count down from 255, so they'll know how many they have left.
I figure it would be along the lines of wordCountField=maxChar-currentNumOfChars...would that be right?
Thanks.
Word Count (or Character Count) For An Input Field
How would I create a word/character count field to count down characters used when typed into an input filed.
i.e. input field has a maxChar=255. I want the user to see the chars count down from 255, so they'll know how many they have left.
I figure it would be along the lines of wordCountField=maxChar-currentNumOfChars...would that be right?
Thanks.
Movie Count Down Intro
Anyone can point me in the direction of creating a movie count down intro...
The one where you have like
10
9
8
7
6
... something like that
I Can't Make My Movie Count
HI all.
I can’t seem to get this sound code to work.
I want this loop to start counting the the number of times the sound has been played.
So that after ,say 3 times, the sound is volumed down to 50%.
The problem is that there are many scenes and I need to declare the variable global so that the counting doesn’t clear off.
I actually placed the sound (called “destination” in the library) in a MC called “cyborgsnd”. Then I placed it on the scene. And the code is on this MC”cyborgsnd” :
onClipEvent (load) {
_root.cyborgsoundplayed = ++_root.cyborgsoundplayed;
if (_root.cyborgsoundplayed >= 3) {
cyborgsound = new Sound();
cyborgsound.setVolume(50);
} else {
_root.cyborgsoundplayed = ++_root.cyborgsoundplayed;
trace(_root.cyborgsoundplayed);
}
}
BTW: how do you target each sound anyway? i only know how to target all sounds. because i can not set an instance name of sound symbols...
can someone help? Thanks in advance!
Random Movie Count
Hi,
Can you please tell me how do we count the randomly played movieclip.
Thanks
Vinesh
Variable Count Up - Movie Time
In my movie I have three variables.
"Play" "Stop" and a dynamic text box called "Time".
I would like the dynamic text box called Time to start counting up second by second when you click play, and when you click stop, the time stops. (Kind of like a VCR times a movie when you hit play and stop)
Does anyone have any ideas on how I could do this?
How Can I Count Down Time Left In My Movie?
I want the length of my movie to be shown on my published movie as a countdown of how many seconds there are until the movie ends. Does anyone know if I can code this and if so, is there a tut. available out there. I have looked a lot... in case you're wondering. Thanks in advance.
Movie Not Playing With A Varible Count
Hi, I'm getting close to finishing my spot the difference game. I have sorted out a variable count on my six buttons (thanks to you guys) and every time they are clicked they play a movie of a circle being drawn.
My problem is when the last button is pressed (6) it is set to jump a frame forward which its suppose to, however it doesn't play the movie, in the instant below it will not play the mouse movie it will just jump straight to frame (3).
this is the actionscript I have set up for each button.
ActionScript Code:
on (release) {
mouse.play();
}
on (release) {
_root.mousebut._visible = 0;
_root.m3._visible = 1;
_root.buttonsPressed++;
if (_root.buttonsPressed == 6) {
_root.buttonsPressed = 0;
_root.gotoAndPlay(3);
}
}
How can I make it play the movie before it jumps to frame 3
many thanks foo
Switch Simple Count Up To Count Down
Hello...first post for me after finding a lot of great info here.
I've found a simple count up script over on Actionscript.org
var count:Number = 0;
var maxNum:Number = 1250;
var num:Number = 1;
this.createTextField("txt", this.getNextHighestDepth(), 0, 0, 100, 50);
onEnterFrame = function () {
count += num;
if (count >= maxNum) {
num = 0;
txt.text = "125.0";
} else {
var v = count / (maxNum / 125);
txt.text = v;
var str = String(v);
var io = str.indexOf('.');
if (io == -1)
{
txt.text = v + '.0';
}
}
}
This works great for my use, but now I am trying to figure out how to make it count down. I've tried changing everything to opposites like count=1250 and maxNum=0 (I think this would be the minNum instead), count+=num to count-=num, and count>=maxNum to count<=maxNum. But I'm stuck...any ideas? I'll search through the forum to see if I can find any info, but if anyone has a answer, that would be great. Thank you very much!
AS2.0 Count Number Of Children In A Movie Clip
I recently made a post similar to this one with little response so maybe someone can tell me this:
How do you count number of children in a movie clip?
i would like to be able to target each child but if you could at least tell me how to find the total number of children, that would be one step closer
thanks
MC Ploader %age Count Up Is Not Shown As Movie Loads Onto Another One....
xy100c.swf is loaded by means an empty (instance name is xy100c)
mc unto intro.swf which is loaded on level 10 over a basemovie.swf (this one level0);...
Quote:
loadMovie("swf/xy100c.swf","xy100c");
the test with bandwith profiler reveals xy100c.swf´s preloader is perfectly operational ;
however in the site as "xy100c.swf" loads the percentage counting up is not shown (there is a light movie clip to entertain during pre loading which works fine) ;
the question is , what´s amiss ??
Thank you all for the attention
PS:-
p loader code is the well known :
Quote:
totalK = getBytesTotal()/1000;
loadedK = getBytesLoaded()/1000;
remainingK = totalK-loadedK;
percentageK = Math.round((loadedK/totalK)*100);
if (loadedK>=totalK && totalK != 0) {
gotoAndPlay (3);
}
AS2.0 Count Number Of Children In A Movie Clip
I've seen plenty of articles on AS3 for doing this, but is there _any_ way of doing this in AS2? I've need to loop through every child mc within several other mc's and change their colour... but cannot find any way of doing it (or anything confirming it can't be done!).
Please Review : How To Stop A Count When The Movie Reached A Specific Frame?
Basically, i want to stop the Distvar from ticking after i reached the last frame ( which is 151 ) or the first frame of the mc, myMC1. I tried using
if (cfrm==1 || cfrm==151) {
//stop
}
but it didn't work coz if the ymouse is still within 0-175 or 225-400, the Distvar will still continue ticking...
so any ideas? below is my script.
// Fort Canning Park Walthrough : final semster project
// user speed input
if (_root.input.text == "") {
speed = 1;
} else {
speed = _root.input.text;
//trace(speed);
}
// forward and rewind of mc
myMC1.onEnterFrame = function() {
mousePos = _root._ymouse;
cfrm = _root.myMC1._currentframe;
if (mousePos>0 && mousePos<175) {
_root.myMC1.gotoAndStop(cfrm+speed/1);
} else if (mousePos>225 && mousePos<400) {
_root.myMC1.gotoAndStop(cfrm-speed);
}
};
updateAfterEvent;
// Time
timevar = Math.round((getTimer()/1000));
// Distance
function distcount() {
distvar = Math.round(getTimer()/1000*speed/3);
}
if (mousePos>0 && mousePos<175) {
distcount();
} else if (mousePos>225 && mousePos<400) {
distcount();
} else {
//stop
}
if (cfrm==1 || cfrm==151) {
//stop
}
updateAfterEvent;
the bold part in the script denotes bug which i'm not sure how to fix. Please help, thanx in advance i own you.
Count Down Timer Changes In Count Up
Is it possible to make a count up timer (from a specific date, birthday for exemple) from the count down timer ?
I've tried to change a few things (I'm very bad in programming) but I can't get the date properly.
If not, do somebody know a count up timer (.fla) that I can use ?
Thanks, thanks, thanks
Frankie
Count Down Timer Changes In Count Up
Is it possible to make a count up timer (from a specific date, birthday for exemple) from the count down timer ?
I've tried to change a few things (I'm very bad in programming) but I can't get the date properly.
If not, do somebody know a count up timer (.fla) that I can use ?
Thanks, thanks, thanks
Frankie
Forcing A "DELAY" - Revised (making Movie Pause & Count)
hi,
I would like to know if anyone knows how to "DELAY" and action. I would like to cause a small delay on a button action.
This action is tied to a dynamic menu. When the button is pressed (frame 3 of 3) it makes a URL call and then goes back to frame 1 to "refresh". The movie continues to frame 3 and stops. The problem is that it is not pulling in the content fast enough, so I would like to make the URL call, make the movie pause for 1 second, then go to frame 1 and refresh.
Here is the code... (I want to make the movie count 1 second before executing the gotoAndPlay)...
on (release) {
// sendSERVER.setVerb("VERB_XXXX_XXXXX");
x = x+1;
trace ("X is "+x);
sendSERVER.sendData("http://MY URL IS HERE);
sendSERVER = new sendDataList();
THIS IS WHERE I WOULD LIKE TO FORCE A 1 SECOND DELAY
gotoAndPlay (1);
}
Forcing A "DELAY" (making The Movie Pause & Count)
Hi,
I would like to know how to make a FLASH movie stopr and count before continuing any actions.
Essentially,
When a button is clicked, I want the movie to COUNT for 1 second, and then execute a go to and play command.
Thanks in advance for any ideas...!!!
(I know this should be simple, but I can't seem to figure it out).
THANKS!!!
Count Down
This is a really simple question ( hence in newbie forum) about how to count down from lets say 30 seconds. Not using the stupid put 30 frames and each frame be a second. I a need variable. Thanks for putting up with such a dumb question.
How Can I Count From 60 To 0
Hello all
I need a timer shown on the flash movie that shows the number 60 decrement to 0. How can I do that.
Thank you all in advance.
Count Down Help
Count down clock
I’m wondering if anyone can help me. I know this may be simple, but for some reason I cant get it.
I want to create a countdown clock.
I want it to read the system clock like this
days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
timedate = new Date();
todaydate = timedate.getDate();
day = timedate.getDay();
dayname = days[day];
month = timedate.getMonth();
monthname = months[month];
year = timedate.getFullYear();
hours = timedate.getHours();
minutes = timedate.getMinutes();
seconds = timedate.getSeconds();
fulldate = dayname+", "+monthname+" "+todaydate+", "+year;
if (seconds < 10) {
seconds = "0"+timedate.getSeconds();
}
if (minutes < 10) {
minutes = "0"+timedate.getMinutes();
}
if (hours < 10) {
hours = "0"+timedate.getHours();
}
hour = hours+":"+minutes+":"+seconds;
But, I want the clock to count down from this date
Aug 30th 2002
So that the clock reads “Days, hours, seconds” remaining.
Thanks in advance.
Hit Count
Can someone tell me how u detect if something is hit twice?
I need the script to do nothing until hitTest has happened for the second time on an object, numerically named.
Thanks
Count
When I have a textfield, with text in it. How is it possible to select a certain character out of it. Or do I have to put it first in an array and then select the wanted letter?
greetz
kilikMC
Count Up
Hi
I'm a complete newbie when it comes to flash, but I'm trying to use flash to create screensavers and intros for verious website and I need some help...
I wish to create a screensaver for my site, THE BUILD and so far all I have is a background and an updating webcam image which I got help from here .
What I want to do is add a "count up" script like the one I have on THE BUILD saying Day 154 or something. Also, is it possible to grab html from a site and present it in the flash site? (e.g showing the first three news items on THE BUILD and refreshing it every so often).
As I said I am a complete newbie so a step by step tutorial type the thing would be useful but not neccessairy.
Thanks for your help
Jotty
Count
Hi there.
I´m trying to build a number count and I got 2 results, but still can´t figure out how to fix them.
1- I have this code but I couldn´t figure out how to fix its position, color, typo and how to make it stop at 100.
code:-----------------------------------------------------------------------------_root.num = 0;
createTextField("my_txt", 0, 100, 100, 1, 1);
my_txt.autoSize = true;
my_func = function () {
_root.num++;
my_txt.text = _root.num+"% intensive work";
};
my_int = setInterval(my_func, 250);
--------------------------------------------------------------------------------
2- I downloaded a flash file with a countup and countdown and deleted all things referred to the countdown. So I got sowmething that counts from 1 to 999. I want it to start alone, without the button and to stop at 100 hundred. The file:
Count Up?
I have been messing with MCs found here and I just cant get anything to work.
When I preview the movie, "_level0.instance1.counter" shows up in the dynamic textfileld.
I have attached what I am working with. Any help is greatly appreciated.
/z
Count Down
Is there anyway that I can make a countdown script for flash not like the 5,4,3,2,1. But one that displays time and date. I found this but I dont know haow to incorporate the script into flash
<script language="JavaScript1.2">
/*
Dynamic countdown Script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS,
visit http://www.dynamicdrive.com
*/
function setcountdown(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday
}
//////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
//STEP 1: Configure the countdown-to date, in the format year, month, day:
setcountdown(2004,12,25)
//STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
var occasion="Christmas!"
var message_on_occasion="Merry Christmas!"
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
var countdownwidth='480px'
var countdownheight='20px'
var countdownbgcolor='lightblue'
var opentags='<font face="Verdana"><small>'
var closetags='</small></font>'
//////////DO NOT EDIT PASS THIS LINE//////////////////
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","A ug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all? document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000) )/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000 ))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da ){
if (document.layers){
document.countdownnsmain.document.countdownnssub.d ocument.write(opentags+message_on_occasion+closeta gs)
document.countdownnsmain.document.countdownnssub.d ocument.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+ closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.d ocument.write(opentags+"Occasion already passed! "+closetags)
document.countdownnsmain.document.countdownnssub.d ocument.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"Occasion already passed! "+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.d ocument.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.d ocument.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags
}
setTimeout("countdown()",1000)
}
</script>
<ilayer id="countdownnsmain" width=&{countdownwidth}; height=&{countdownheight}; bgColor=&{countdownbgcolor}; visibility=hide><layer id="countdownnssub" width=&{countdownwidth}; height=&{countdownheight}; left=0 top=0></layer></ilayer>
Count Up
it is going to be for a project were people donate money to help kids in need, so i need to make something that looks like it is real time adding up the amount so far donated. there is no way for me to give the real amount because it would be changing so fast so we just want something that say starts out at a nuber and goes up by 5 cents an hour.
how crazy hard is this to do?
thanks all
Count Down
Hi,
i need an example for function that will count down the time that remains till certain date .... like:
remains: 2days 4hours 4minutes 24seconds till day X
thanks
Day Count Down
I need to put up a banner with a day countdown (only numbers)
Does anybody know how to do a that?
Thank you
How To Count?
Hi,
Im trying to make a image gallery using bits of other peoples code. (im still learning)
what im trying to achive is that when it loads 3 images it then drops down and carries on loading the images.
e.g.
image 1 | image 2 | image 3
image 4 | image 5 | image 6
image 7 | image 8 | image 9
i thought i could achive this using a if statement but it just displays all the images
the image loading script works great im just a litttle stuck with the counting. could someone point me in the right way( i have put my none working counting code in bold?)
Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 70;
Yspacing = 70;
count = 0;
if (count==3) {
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbHolder._y = i*Yspacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
count += 1;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
}
else
{
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
count += 1;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
}
};
myPhoto.load("xmlphoto.xml");
thanks
Charlie
[F8] Count Up
I want to make a counter similar to the one on this page
http://www.ecowash.com.au
where the numbers count up from a specified starting point.
I am a flash newbie and would really appreciate any assistance
cheers
JB
Count
Hi,
I doon't know if I am going about this the right way but anyhow.
What I want to happen is that when part1 gets to 3, 1. passed is displayed and percent is increased by 1. THis works but it doesn't stop
it just repeates itself again and again
Any help appreciated.
part1 =0;
percent=0;
_root.onEnterFrame= function(){
if(_root.part1==3 && _root.part1 <4){
_root.step1 = "1.Passed";
//_root.percent +=1;
trace(step1);
//_root.overall = _root.percent*10;
}
}
A Count ?
I have a global_count and function called newPiece, when newPiece is called a new item is added and the count increases by a factor of 1. In my clear_btn code I want to remove the peice based on item_mc count.
When I click the clear button the count traces 1, but the item_mc count is 0, so the item doesn't get removed unless I click the clear button again.
Why does it work the way that it does?
How can I fix this?
ActionScript Code:
_global.count = 0;
function newPiece() {
// create a movieclip to hold the functionality of the peice of furniture
// keep all the furniture inside 1 clip (called 'pieceContainer') for organizational purposes
// var count:Number = floor.pieceContainer.getNextHighestDepth();
var item_mc:MovieClip = pieceContainer.createEmptyMovieClip("item_mc"+count, count, this.getNextHighestDepth());
// create a container to load the furniture swf into
var container:MovieClip = item_mc.createEmptyMovieClip("container_mc", 0);
container._x = 0;
container._y = 0;
// setup a MCL to handle the swf's loading, when its loaded, apply the freeTransform methods to it.
item_mc.mcl = new MovieClipLoader();
item_mc.mcl.addListener(mclListener_2);
item_mc.mcl.loadClip("decals/"+this.piece+".swf", container);
count++;
//
//add value of width and depth to text box
item_w.text = j;
item_h.text = k;
}
ActionScript Code:
clear_btn.onRelease = function() {
trace(count);
_root.pieceContainer["item_mc"+count].container_mc._visible = 0;
count--;
if (count == -1) {
mx.controls.Alert.show("The room is empty!");
count = 0;
}
};
Count Down
how can i make a count down in flash to till the release of my new version.
I Can't Count
Hello again! I was wondering if any of you wonderful people could help me with this? I am trying to have a movie clip using dynamic text count from zero to 720.
The AS is pretty simple, and the dynamic text variable is: count_travler. See below this AS is another script i was using.
ActionScript Code:
onClipEvent(enterFrame){
mcstart = 0;
mctotal = 720;
if(mcstart > mctotal){
count_travler = Math.round(mcstart + 1);
}//end if
else if(mcstart == mctotal) {
null;
}//end else
}//end if
Here is the second script. But it just jumps to 719 and does not count.
ActionScript Code:
onClipEvent(enterFrame){
var sum:Number = 0;
for (var i:Number = .5; i < 720; i++) {
count_travler = "$" + sum + i;
}
}
Thanks in advance!
Count Up
I need some help on code to just have numbers count up from 100,000 to ?????? 1 count every 15 sec. THANK YOU -
Count Down
Been looking all over for a tutorial on how to make a countdown. I am trying to make something simple that goes from 75 to 6 any ideas or direction. I am experianced in AS and was going to do it all using AS however I want it to look decent. So I want to add a lil flavor, graphics, ect... let me know thanks yall im going to keep looking.
Count Down: Help
Please, somebody have an equivalent "Count Down" example to be used in ASP, and that corresponds with the example in PHP that appears in this Link http://www.kirupa.com/developer/mx/countdown.htm ?
It combines Flash + PhotoShop + PHP
Doing A Count Up Not Down
Hi
I've followed the tutorial for creating the countdown at
http://www.kirupa.com/developer/mx/countdown2.htm
What i'm looking to do is change this to count up for example displaying the number of days since and event in the pasted. I've tried tweaking the actiion script but the counter just messes up. Can anyone point out the best way to change the code below.
Code:
// stop the timeline
stop();
// first get this current year so this example
// remains valid for some time to come
currentDate = new Date();
thisYear = currentDate.getFullYear();
// define the event date counting down to
// this is constant so it won't need to be
// calculated in the onEnterFrame function below
// currently counting down 'til christmas of 2003
// Date( year, month-1, date [, hour [, minute [, second [, millisecond]]]])
eventDate = new Date(2007, 9, 25);
eventMillisecs = eventDate.getTime();
counter.onEnterFrame = function(){
// get the current date and time as it exists at
// this instance in time when the frame is entered
currentDate = new Date();
currentMillisecs = currentDate.getTime();
// the milliseconds between the current time and the
// time of the event can then be calculated by simply
// subtracting the current time's milliseconds from the
// milliseconds of the time of the event
this.msecs = eventMillisecs + currentMillisecs;
// if the msecs variable is less than 0, that means the
// current time is greater that the time of the event
if (this.msecs <= 0){
// and the event time has been reached!
// play the next frame for the result of the countdown.
play();
// a return can be used to exit the function since
// in going to the next frame, there's no need to
// continue with the remaining operations.
return;
}
// if the date hasn't been reached, continue to
// devise seconds, minutes, hours and days from
// the calculated milliseconds
this.secs = Math.floor(this.msecs/1000); // 1000 milliseconds make a second
this.mins = Math.floor(this.secs/60); // 60 seconds make a minute
this.hours = Math.floor(this.mins/60); // 60 minutes make a hour
this.days = Math.floor(this.hours/24); // 24 hours make a second
// make sure each value doesn't exceed the range in
// which they exist. Milliseconds, for example, will
// be shown in a range of 0 - 999. The modulous
// operator, or %, well help in that. Here the values
// are also turned into strings preparing for the next step
this.msecs = string(this.msecs % 1000);
this.secs = string(this.secs % 60);
this.mins = string(this.mins % 60);
this.hours = string(this.hours % 24);
this.days = string(this.days);
// add on leading zeros for all the number values (which are
// now strings) that aren't 3 or 2 characters long based on the
// range being used to represent them. Because mseconds and
// days have up to 3 characters, a while loop is used to
// continuously add 0s until they have 3. Other values which
// only need 2 leading 0s can get by on a single if check
while (this.msecs.length < 3) this.msecs = "0" + this.msecs;
if (this.secs.length < 2) this.secs = "0" + this.secs;
if (this.mins.length < 2) this.mins = "0" + this.mins;
if (this.hours.length < 2) this.hours = "0" + this.hours;
while (this.days.length < 3) this.days = "0" + this.days;
// finally, display your values. If you want to put your values
// in a textField, you can pretty much just stop here and throw them
// into your textField as desired. This example, however will go a step
// further and use images for numbers for each numerical value in the
// countdown to the desired date.
// So, for that, loop through all the movies in this counter clip using the
// evaluateFrameFrom prototype method on each. A single check for a
// _parent variable is used to make sure the property found in a for
// loop is a movieclip and is within the timeline of this counter clip.
// TextFields and buttons would also be true here, but since the contents
// within counter are strictly those numbers movieclips, we won't have to
// be concerned with such complications. The only movieclips in this counter
// clip are the numbers movieclips with the frames of the imagery making up
// the numbers of 0-9.
for(movie in this){
if (this[movie]._parent == this) this[movie].evaluateFrameFrom(this);
}
};
// this function is a MovieClip.prototype meaning its available to be used by
// all movieclips. It's a sneaky function that saves a lot of work by using
// name each numbers movieclip in the counter movieclip to determine which value
// it needs to display based on the times derived from the previous
// calculations of the onEnterFrame. What it does is seperates a movieclip's
// _name into a variable word and a number. The variable word will represent
// the variable to look up a value for in the passed variableClip and the
// number will be used to get a character from that value (a string) which
// represents which number this movieclip should display.
MovieClip.prototype.evaluateFrameFrom = function(variableClip){
// split this _name into an array of 2 values seperated by an underscore
var nameArray = this._name.split("_");
// the first value represents what variable in variableClip (counter clip)
// this movieclip is used to represent whether it be mins or hours etc.
var numberSet = variableClip[nameArray[0]];
// next a number representing which character in that first value this
// movieclip should display. this will be between 0 and 2 (any one of
// three values). number() is used to force it to be a number value.
var character = number(nameArray[1]);
// a frame number can then be derived from the value of the numberset
// variable based on the character defined by character. number() is
// used to force it to a number value and 1 is added to offset the
// frame value by one since 0 is at frame 1 and 1 at frame 2 etc.
var frame = 1 + number(numberSet.charAt(character));
// if the movieclip is not already at the frame, move it there!
if (this._currentframe != frame) this.gotoAndStop(frame);
};
// an example of the above function in action would be for a movieclip
// with the name "days_1". days_1 is seperated into an array by dividing
// the name by its "_" character giving "days" (nameArray[0]) and "1" (nameArray[1]).
// The value of days is then retrieved from the passed variableClip using
// associative array ssntax and is set to numberset. The value of days in variableClip
// would be a string something along the lines of "045". character is then used
// to get which of those 3 values this movieclip is to represent. It is just
// nameArray[1] turned into a number or "1" to 1. So, charAt(1) of "045" would
// be 4. Turn that into a number and add one and you get frame 5 where the image of
// the 4 is located. The movieclip, days_1, is then played to that frame to show it.
Count This.....
Once again i require your assistance, oh kind experts of this exquisite program...
- My problem is this:
I have what resembles a puzzlegame (drag n' drop in the right place! _droptarget), and I am trying to get an mc to play when all pieces are in the right place.
There are 6 pieces to the puzzle, and they bounce back if not dropped in the right location...
But how do i script the ending....???
Thats like 6 "if" commands... or something...
I used this script at the end of my framescript:
ActionScript Code:
mychecker = function () {
this.counter++;
trace("mycounter:"+counter);
if (this.counter == 6) {
trace("Correct Placement!");
}
But instead of counting when i drop a piece in the right _dropTarget it counts everytime i drop on the stage, regardless of where it is....
I don't understand this....
Hope for help....
Loop Won't Count
Hey,
I'm running a simple loop in frames 3 through 5.
Frame 3 sets y=3.
Frame 4 has y=y+1.
Frame 5 loops back to 4.
In Frame 4 I have a dynamic text box with a variable name y.
I'm losing my value of y each time it loops. It appears to be reset to zero after each loop. This is so basic and I've been stuck for hours.
HELP PLEASE!!!!!!!!!!!!!!!!!!!!
Count Down Clock
I need help creating a count down clock. One which will count down from 5 minutes and include seconds and minutes. I need for a scoreboard I'm making I would also like to know if it would be able to stop the clock so to pause a game. Thanx
I Tried The Count Thing
var a, b;
var score = 0;
function makeProblem () {
a = Math.ceil(Math.random()*12);
b = Math.ceil(Math.random()*12);
problem = a+" + "+b+" = ";
}
function checkAnswer () {
count++;
if (count == 10) {
gotoAndPlay ("Scene 4", 1);
} else {
// they got it right
if (answer == (a+b)) {
score++;
answer = "";
rightAnimations.gotoAndStop(Math.ceil(Math.random( )*5));
makeProblem();
// they got it wrong
} else {
wrongAnimations.gotoAndStop(Math.ceil(Math.random( )*5));
}
}
}
makeProblem();
thats the code i did, but that doesnt seem to count i think the count is in the wrong spot but i cant figure out where to put it, if i move it i get errors.
Count Days?
please help me I don't know how to use textfield to show how many days have passed since a specific day in a past.
Thanks
Size Does Count
OK, I'm a total newb in Flash 5... so please bear with me.
I'm trying to make a menu in Flash.. I've got the text down, the buttons down, even the effects down. But, I cannot understand why, when I make a menu that is sized at 200 points in width and 1000 points in height, that when I put the menu on my site, it is so much smaller.. the only way I can make it larger is if I use an enourmous sized stage with enormous font sizes.. how can I remedy this?
I know this is a really stupid scenario, but I don't quite understand the size ratio... I'm so used to WYSIWYG..
Help please?
Number Count Down.
well hi and thanx 4 taken the time 2 read this post
i am new 2 flash and well i know the basic`s so i though it was time 2 move on with action script.
right i have looked and cant seem 2 find a tut on a scrip that will @ the beggining have numbers counting down from random 9-0 and when it has finished with all 9 digits add a letter so @ the end of the count down it will have a word
thanx again hope some 1 can help me out as i would like 2 go a little further in action script but as i said im a new-b flasher will no knowladge @ all of action script
=)
Count Trouble Again
i have a simple movie which is set with a single varible (count) a series of if statements find out what the value of count is and loads a movie into a clip while unloading the movie that was previously loaded.
two buttons reside in the movie stage one adds to count one subtracts count is then interegated at a second frame if its value >= the maximum (as in: if count >= 89 , unloadmovie "picture" , goto frame 1) it is reset to 0 and the start movie is loaded otherwaise it goes through the if statements until it finds one which is the same and loads the corresponding movie.
it just seems to drop into a constant loop any suggestions would be very useful.
cheers
COUNT ROWS
How do I count the rows of a textfield?
I actually have to take care, that the user can't write more than 4 rows in a textfield, but it is not possible with counting the characters.
thx
|