Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 13th, 2004, 01:51 PM
mfulper mfulper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 mfulper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
time-need help

I am very new to Flash and programming. I am playing around with some things just to learn. I created one little project that displays the time. I wanted to create another that displays the time when you click on a button. I can get the time to display when I click the button, but the time stops. I can advance it by clicking the button again, but I want the time to continue counting on its own. All the script is in the button and it is the same code that I used for the first one that does continue to count. What am I doing wrong?

Thanks
mfulper

Reply With Quote
  #2  
Old February 13th, 2004, 03:18 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
Your actionscript to generate the time should be located on a movie clip instead of inside a button. The dynamic text field should be located within this movie clip. The actionscript on the movie clip will be set to enterFrame so that the text field can easily update itself. The most important thing to do is to put this actionscript within a function, so that you can call it at anytime from your button.

This actionscript goes in the movie clip's actions panel.

Code:
onClipEvent (enterFrame) {
	function time() {
		// The actionscript to generate the time goes here.
	}
}


This is for your button to call the function.

Code:
on (release) {
	time();
}

Last edited by jmichels : February 13th, 2004 at 07:33 PM.

Reply With Quote
  #3  
Old February 13th, 2004, 08:21 PM
rynoe's Avatar
rynoe rynoe is offline
_root.troubleMaker
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Location: Florida, USA
Posts: 638 rynoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 8 m 30 sec
Reputation Power: 5
I would use the first project you had that displays the time and include this actionscript:
Code:
time._visible = false;


and on the button put this actionscript:

Code:
on(press){

if(_root.time._visible = true){
    _root.time._visible = false;
)
else
_root.time._visible = true;
}(


That way you can toggle it on and off.
__________________
No problem is so complex that it cannot be resolved with the proper use of explosives.

Reply With Quote
  #4  
Old February 13th, 2004, 08:53 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
But if he does that, the time will keep stopping and he'll have to keep pushing the button. this.onEnterFrame or having the actionscript located on the movie clip will update the clock without him having to push the button over and over.

Reply With Quote
  #5  
Old February 13th, 2004, 09:09 PM
rynoe's Avatar
rynoe rynoe is offline
_root.troubleMaker
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Location: Florida, USA
Posts: 638 rynoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 8 m 30 sec
Reputation Power: 5
I am assuming that his first project was working and that updating function was already working within it, but yes if that is not the case you are correct jmichels.

Reply With Quote
  #6  
Old February 23rd, 2004, 10:16 AM
mfulper mfulper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 mfulper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
time-need help

Sorry for such a delay, but I wanted to thank you for your suggestions. I have tired both and still don't have it working but I think you have me heading in the right direction. I need to play aorund with it, which is how I learn best. I will be back if I can't make it work.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > time-need help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway