Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-31-2005, 04:01 PM   #1
Xposure
Registered User
 
Join Date: Aug 2005
Posts: 8
Default Action Script Help

Hello, I was asked to fix a couple things in a Flash Movie for a friends client. However, one of the fixes deals with the action script and I just don't know enough about that yet ... so if anyone can help I would appreciate it. Here is the problem ...

The scene has a clock on it ... set to 0:00 when the scene starts. The text states that the test takes two minutes, however, when the clock starts its count it only goes to the 1:00 minute mark. The question was to see how I can alter the below action script to make the counter count to 2 minutes instead of 1 minute.

The script:

onClipEvent (enterFrame) {
myCount = Number(_parent.count);
if (myCount<=9) {
_parent.myTime = String("00:0"+myCount);
} else if (myCount>=60) {
_parent.myTime = String("01:00");
} else {
_parent.myTime = String("00:"+myCount);
}
_parent.count = myCount+2;
}

I have tried changing the "60" to "120", but that did not work ... I also changed the "01:00" to "02:00" ... but all that did was after the count up to 60 it listed 2 minutes instead of 1 minute.

-Scott
Xposure is offline   Reply With Quote
Old 08-31-2005, 04:14 PM   #2
Curly Brace
Rock is alive!
 
Curly Brace's Avatar
 
Join Date: Jun 2004
Location: Russia
Posts: 603
Send a message via ICQ to Curly Brace
Default

Try this one:
ActionScript Code:
onClipEvent (load) {     current_minute = 0; } onClipEvent (enterFrame) {     myCount = Number(_parent.count);     if (myCount<=9) {         _parent.myTime = String("0"+cur_minute+":0"+myCount);     } else {         _parent.myTime = String("0"+cur_minute+":"+myCount);     }     if (myCount == 60) {         myCount = 0;         cur_minute++;     }     _parent.count = myCount+2; }
Curly Brace is offline   Reply With Quote
Old 08-31-2005, 04:24 PM   #3
Xposure
Registered User
 
Join Date: Aug 2005
Posts: 8
Default

Curly thanks for the response ... I plugged in what you sent and it started the count, but when it hit 0:60 it stopped there. Instead of counting the full 120 seconds with the final screen showing 2 minutes. Make sense?

Any other ideas?

Thanks again
Xposure is offline   Reply With Quote
Old 08-31-2005, 04:25 PM   #4
Curly Brace
Rock is alive!
 
Curly Brace's Avatar
 
Join Date: Jun 2004
Location: Russia
Posts: 603
Send a message via ICQ to Curly Brace
Default

Could you please show the code that handles _parent.count variable?
Curly Brace is offline   Reply With Quote
Old 08-31-2005, 04:29 PM   #5
Xposure
Registered User
 
Join Date: Aug 2005
Posts: 8
Default

I have searched for this variable, but can not find it in the MC ... I will continue to look.

Thanks
Xposure is offline   Reply With Quote
Old 08-31-2005, 04:32 PM   #6
Curly Brace
Rock is alive!
 
Curly Brace's Avatar
 
Join Date: Jun 2004
Location: Russia
Posts: 603
Send a message via ICQ to Curly Brace
Default

And that would be perfect if you could just attach the whole fla here.
Curly Brace is offline   Reply With Quote
Old 08-31-2005, 04:37 PM   #7
Xposure
Registered User
 
Join Date: Aug 2005
Posts: 8
Default

Curly .. I looked to use the attach option, but it would not take the FLA ... is there another place to attach the FLA?

Thanks

I realized ... I need to zip it ... guess that makes sense

Last edited by Xposure; 08-31-2005 at 04:42 PM. Reason: Update
Xposure is offline   Reply With Quote
Old 08-31-2005, 04:55 PM   #8
Xposure
Registered User
 
Join Date: Aug 2005
Posts: 8
Default

well i have zipped the fla and tried to use the attach feature ... however, when i try to upload it comes back and tells me that there is no data in the file. doesn't make sense to me, because if i unzip the file it is there. any suggestions?
Xposure is offline   Reply With Quote
Old 08-31-2005, 05:10 PM   #9
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

_parent.count is not going to show anything over 60 seconds. The code Curly Brace gave you counts up to 60 seconds then changes the current minute to 1 and sets seconds back to 0. So it will never go over 60.
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 09-01-2005, 02:54 PM   #10
Xposure
Registered User
 
Join Date: Aug 2005
Posts: 8
Default Attached file

Thanks for all the help yesterday ... I have pulled the part of the Flash Movie which needs the change. Hopefully this will "help you, help me".

Again, in the movie there is a counter which starts at 00:00 and counts to 01:00 minute. I need the movie to actually count from 00:00 to 02:00.

thanks again
Attached Files
File Type: zip CCT.zip (142.8 KB, 160 views)

Last edited by Xposure; 09-01-2005 at 03:20 PM. Reason: Updated
Xposure is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:48 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.