Can Flash Mx Count?
I want to invoke a getURL 10 seconds after my flash has ended. Can I do it with an actionscript, or am I better off to place the action on the 120th frame of the timeline (assuming 12 frames/sec)?
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-21-2002, 02:41 AM
View Complete Forum Thread with Replies
Sponsored Links:
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.
View Replies !
View Related
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.
View Replies !
View Related
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!
View Replies !
View Related
Can Flash Count?
I have a series of external jpegs that load into flash.
The total number of jpegs loaded into the movie varies and can range from 3 - 16.
Is there any way that flash can count the amount of external jpegs it needs to load and then set a variable?
for example:
if jpegLoad = 13 then
myVariable = 800
or
if jpegLoad = 3 then
myVariable = 2000
thanks,
neb
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
Adding In Flash (hit Count?)
hello all,
Im looking to have a system so that numerical values are assigned to buttons, and each time these buttons are hit, it adds up the numbers. I also want this to span frames also, is this possible? can anyone point me in the right direction? cheers
View Replies !
View Related
Using PHP To Count Files For Flash
i'm having some trouble figuring out how to best achieve this result on the actionscript end of things. before posting here i made sure to poke around the server-side scripting forum section with no leads. so hopefully i won't incur too much wrath.
anyway i found a post elsewhere about this subject, with some code provided for a .php document as thus:
PHP Code:
<?
$imageDir = "test_images/";
$fileCount = 0;
if (is_dir($imageDir) && $directoryPointer = @opendir($imageDir)) {
while ($oneFile = readdir($directoryPointer)) {
$thisFileType = strtolower(substr(strrchr($oneFile, "."), 1));
if ($thisFileType == "jpg" || $thisFileType == "jpeg") {<a href="#">#</a>
$fileCount++;
}
}
} else {
$fileCount = -1;
}
echo $fileCount;
where "test_images/" is the image directory being referenced on my server. bear in mind i know close to nothing about php. nevertheless, i run the script and it accurately sums up the number of jpgs i've got. no problems there. the issue i'm encountering is how best to grab the data returned by the php script as a variable in flash. i realize there is probably quite a simple solution to this (or a variety of them), but i've looked at several approaches with somewhat half-baked results. i can't seem to distill what the necessary elements are in retrieving data in this sort of scenario. (my coding background is fairly minimal).
at any rate, i did a bit of reading up on the XMLSocket class and how it's implemented, but i'm not entirely sure if it's what i need in this situation. here's the solution i found (coupled with the php script above) that makes use of loadVars:
Code:
var lvFileCount:LoadVars = new LoadVars();
lvFileCount.onLoad = function () {}
lvFileCount.onData = function (dataIn) {
numberOfFiles = unescape(dataIn);
}
lvFileCount.load("filecount.php");
trace(numberOfFiles);
tTextBox.text = numberOfFiles;
oddly it doesn't work for me (where "filecount.php" is the filename of my script). the output box issues "undefined" with the same message displaying in a dynamic textbox i've placed on the stage. obviously i'm missing something. here's that link again to the post i grabbed this code from, in case it provides some context. i've changed around the names of variables, etc. but it's essentially the same:
http://answers.google.com/answers/threadview?id=522972
anyway. help would be greatly appreciated or even a nudge in the right direction. cheers mates.
View Replies !
View Related
Flash Frame Count In Director MX
I have a flash cast member in Director MX, I want to be able to say that when the flash member reaches fram number 230 then to go to a different frame marker in director
this should be the script on the flash cast member should it not?
on mouseUp
if member(4 <-- this is the cast member num for the flash swf).frameCount = 230 then
go to "gameisland" <-- this is the frame marker in director
end if
end
for some reason it doesn't work it does nothing. the debugger lightning tool doesn't give me any errors
if this isn;t the way to do it does anyone know how to get director to go to the next frame marker based on a frame count inside a flash swf member????
-ivan
View Replies !
View Related
Play Count In Flash Player 9
Hi,
I'm looking for a way to count the number of plays an mp3 file my company is hosting is receiving in Flash Player. Is there a standard script I can use that will allow us to do this?
Edited: 01/23/2009 at 10:28:17 AM by JSizzler
View Replies !
View Related
Can I Count No. Of Images In Folder From Flash ?
Hi ! all
My query is related to loading images from folder. I have a folder outside. I have created a animation in flash, .
Now I want to load all the images one by one, but if there are 5 images then after the 5th images again 1st image should come.
I have done this thing also, but my doubt is what, how can i count that how many images are there in my folder.
Code on first frame
if (whichPic == 5) {
whichPic = 1;
}
whichPic = whichPic+1;
loadMovie("images/flashimages/image"+whichPic+".jpg", "square");
Code on the movieclip "square"
onClipEvent (load) {
_alpha = 0;
count=0;
}
onClipEvent (enterFrame) {
if (_alpha<=0)
{
count=0;
}
if (count==0){
_alpha += 3;
}
if (_alpha>=99)
{
count=1;
}
if (count==1)
{
_alpha -= 2;
}
}
I m attaching the source file also.
If possible give me the reply
View Replies !
View Related
Can I Count No. Of Images In Folder From Flash ?
Hi ! all
My query is related to loading images from folder. I have a folder outside. I have created a animation in flash, .
Now I want to load all the images one by one, but if there are 5 images then after the 5th images again 1st image should come.
I have done this thing also, but my doubt is what, how can i count that how many images are there in my folder.
Code on first frame
if (whichPic == 5) {
whichPic = 1;
}
whichPic = whichPic+1;
loadMovie("images/flashimages/image"+whichPic+".jpg", "square");
Code on the movieclip "square"
onClipEvent (load) {
_alpha = 0;
count=0;
}
onClipEvent (enterFrame) {
if (_alpha<=0)
{
count=0;
}
if (count==0){
_alpha += 3;
}
if (_alpha>=99)
{
count=1;
}
if (count==1)
{
_alpha -= 2;
}
}
I m attaching the source file also.
If possible give me the reply
View Replies !
View Related
Flash Counter? To Count Hits To A Site
Just finished (almost) my flash site but now i'm sitting back wondering if anyone's going to it
it's an all flash site.. i was just wondering if there's a simple counter or something i can add that isn't too tacky or noticeable that lets me know how many people click on it
i spose if there's an html one or non-flash one that's simple that'd be fine...
i can't search for it yet on google...
it take a while for google to pick it up?
View Replies !
View Related
Help Creating A Time Count Script In Flash 5
I need to create two versions of a banner for work.
(1) I need to have a movie play, stop, wait 15 seconds (or whatever tiem is needed) then play again.
(2) I need to have a movie play 3 times and stop.
I know i'm looking at If then statemnets, but I never was very good at javascript. (have to take full course I guess)
I have a book I bought off Ebay (How to do everything with Flash 5)
unfortunatly, it doesn't do what the title says... I have tried looking for some command to have it wait, or count the number of times it has looped, and I can't find anything, so i turn to you Oh Flash Guru's for Help. Actionscript is foreign to me...
Thanks!
View Replies !
View Related
Count Down Timer With Stop And Go Function (flash 5 Only)
I have used the folowing code to make the timer count down.
__________________________________________________ __
onClipEvent (load) {
startTime = getTimer();
countFrom = 10;
}
onClipEvent (enterFrame) {
currTime = getTimer();
elapsedTime = currTime-startTime;
timeRemain = Math.round(countFrom-elapsedTime/1000);
_root.time = timeRemain;
if (timeRemain<0) {
_root.gotoAndStop(2);
}
}
__________________________________________________ __
c
can some one please help me with the stop and go functions?
View Replies !
View Related
Can Flash Automatically Count The Number Of Files In A Folder Somehow
here's the situation. I am making a viewer for a series of flash movies that I will be creating in the future. I want the movies to load externally and so far I have been successful with automating everything about the viewer exept one detail. When the user reaches the final movie and hits the next movie button, the viewer attempts to load a movie that doesn't exist.
I need a bit of code that will all me to find out the number of movies available to load, so that I can put an "if n = numberofmovies, n = n. else n = n+1" on the next movie button.
I know that I can just hard code that number into the flash movie, but I would really like to automate it as I will be creating alot of these movies for a long time. Anyway if you know the code I would be most grateful.
View Replies !
View Related
Feeling Tricky- Having Flash Count Files In A Folder
What i'd like to do is have Flash count the number of files in a file on my server, so that it can adjust how many photos are in a given slide show without having to pass any variables or adjust anything in my .swf.
help! i've been banging my head against this for hours now!
Is there also a good way to get variables out of a PHP file?
Peace
_EmpireEmpire
View Replies !
View Related
Counting Files In A Directory And Passing The Count Back To Flash
Hi there,
Im trying to create a fully automated photo gallery - where my client only needs to upload image (jpg) to a ftp server and Flash / php takes care of the rest.
I´ve found a almost completely automated gallery that only needs to be told how many files it should read from a given directory. How do I make Flash and php read the number of files in a directory and pass that variable back to flash?
The gallery i want to use is located here: http://www.flashkit.com/movies/Scrip...7797/index.php
ANY help will be greatly accepted...
.vinterstille
View Replies !
View Related
Counting Files In A Directory And Passing The Count Back To Flash
Hi there,
Im trying to create a fully automated photo gallery - where my client only needs to upload image (jpg) to a ftp server and Flash / php takes care of the rest.
I´ve found a almost completely automated gallery that only needs to be told how many files it should read from a given directory. How do I make Flash and php read the number of files in a directory and pass that variable back to flash?
The gallery i want to use is located here: http://www.flashkit.com/movies/Scrip...7797/index.php
ANY help will be greatly accepted...
.vinterstille
View Replies !
View Related
Flash Gallery Loads PHP Script To Count Jpgs In File..how To?
Hi there,
I'm trying to set up a little photo gallery - I have some jpgs in a folder, and I want a way to count the jpgs in the folder so when flash gets to the end of them it knows, and won't keep trying to load new ones. I've read the best way to do this is with PHP...so I have a little php script which does this. I'm just not sure how to load that script in flash and assign the number it returns to a variable.
Any help is appreciated
View Replies !
View Related
Dynamic Photo Gallery, Can Flash Count The Total No. Of Jpegs Stored In A Folder?
I am making a gallery for my website and want it to generate dynamically. The way i want it to work is for flash to take a look inside a folder (e.g. images/photos) to see how many jpegs there are. The jpegs will be numbered 01 02 03 etc. to keep things simple at this stage. Once it has the total number of jpegs it creates movie clips and places the jpegs in them so they display on the screen.
What i need to know is, is flash able to count files from within a folder? How can this be done? If it cant then how can i get around this? I really don't want to be manually updating it the whole time, I just want to be able to drop the images in as needed.
View Replies !
View Related
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.
View Replies !
View Related
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.
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
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:
View Replies !
View Related
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
View Replies !
View Related
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>
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
[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
View Replies !
View Related
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;
}
}
View Replies !
View Related
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;
}
};
View Replies !
View Related
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!
View Replies !
View Related
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.
View Replies !
View Related
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
View Replies !
View Related
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.
View Replies !
View Related
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....
View Replies !
View Related
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!!!!!!!!!!!!!!!!!!!!
View Replies !
View Related
|