473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

seconds convertor to minutes in flash

Hello

can any one help me in this Experiment

iam building a seconds convertor to minutes in flash

i have the fig like this


1) text box ( instance name -> sec_txt ) input text box
1) text box ( instance name -> min_txt) dynamic text box
1) button ( instance name -> convertor_btn)


i wanted that .. in a way !

user enter seconds in SEC_TXT and click on the button ( CONVERTOR_BTN)
and it converts to MINUTES

and it the shows the resullt in ( MIN_TXT ) which is dynamic text box
plz help in this plz

by sending me a ( .fla file )
thank you !
Oct 21 '07 #1
16 6590
xNephilimx
213 Expert 100+
Hi 4183mal0we, welcome to TS IT/DN!
That is one easy task.
You just need to divide the input value by 60.

Are you willing to do this in AS 3 or 2?

Please, know that we are here to provide help, and by that I mean, to guide you through and letting you put some brains on it too, so we assume that you have some knowdlege and experience in the matter. If not, first try to learn, and then, when you encunter a problem, we will try to help you overcome it.

Best regards,
The_Nephilim

Hello

can any one help me in this Experiment

iam building a seconds convertor to minutes in flash

i have the fig like this


1) text box ( instance name -> sec_txt ) input text box
1) text box ( instance name -> min_txt) dynamic text box
1) button ( instance name -> convertor_btn)


i wanted that .. in a way !

user enter seconds in SEC_TXT and click on the button ( CONVERTOR_BTN)
and it converts to MINUTES

and it the shows the resullt in ( MIN_TXT ) which is dynamic text box
plz help in this plz

by sending me a ( .fla file )
thank you !
Oct 22 '07 #2
hello thank you for replying me back

the thing is I tried but its not working
i will be using in actionscript 3

plz can you send me the code over here

thank you !
Oct 22 '07 #3
the thing is I tried but its not working
i will be using in actionscript 3

plz can you send me the code over here


well if i divide the number / 60

that means you know the number ---> that user is going to enter this
number of your choice

but ... you don't know what number the user is going to put !
my question was that the user enter any number after that he / she clicks on the convertor button and that seconds number which is entered by the user is
showing in minutes !

plz help me in this

thank you !
Oct 22 '07 #4
xNephilimx
213 Expert 100+
Hi!
Please, post the code you got, so I can tell you where yo went wrong, andexplain you how you can correct it.

Kind regards
The_Nephilim

hello thank you for replying me back

the thing is I tried but its not working
i will be using in actionscript 3

plz can you send me the code over here

thank you !
Oct 22 '07 #5
if i knew the code
i was able to do it then
..

iam new in this category !
plz help me in this !
can you post me the code over here !

so what should i put under the buton ( convertor )

because when you will send me the code , i will under stand that
and after that i will go for further !


plz help
thank you !
Oct 22 '07 #6
xNephilimx
213 Expert 100+
If you divide the number by 60 does not mean you know the number!
You said your input text was sec_txt, your textbox is min_txt and your button is convertor_btn, well, I'll explain.

You should know that to dispatch events in AS 3 you must use event handlers, so if you want to register a click event, you should use the addEventListener function:

DisplayObject.addEventListener(event:String, callback:Function);

So, using your names will be something like this:
convertor_btn.addEventListener(MouseEvent.CLICK, onClick);

now the function onClick will be recieving the event object, so your function must have a parameter that will be the event itself, even if you won't use it at all:

Expand|Select|Wrap|Line Numbers
  1. function onClick(e:MouseEvent):void {
  2.     min_txt.text = String(Number(sec_txt.text) / 60);
  3. }
  4.  
See, I did what I told you and without knowing the number.

The complete code would be:

Expand|Select|Wrap|Line Numbers
  1. convertor_btn.addEventListener(MouseEvent.CLICK, onClick);
  2.  
  3. function onClick(e:MouseEvent):void {
  4.     min_txt.text = String(Number(sec_txt.text) / 60);
  5. }
  6.  
Best regards,
The_Nephilim

the thing is I tried but its not working
i will be using in actionscript 3

plz can you send me the code over here


well if i divide the number / 60

that means you know the number ---> that user is going to enter this
number of your choice

but ... you don't know what number the user is going to put !
my question was that the user enter any number after that he / she clicks on the convertor button and that seconds number which is entered by the user is
showing in minutes !

plz help me in this

thank you !
Oct 22 '07 #7
thank you for replying me back

you said

complete code would be

Expand|Select|Wrap|Line Numbers
  1. convertor_btn.addEventListener(MouseEvent.CLICK, onClick);
  2.  
  3. function onClick(e:MouseEvent):void {
  4.     min_txt.text = Number(sec_txt.text) / 60;
  5. }
  6.  
so thats it only i need to enter this code under the button !
and iam done

...
Oct 22 '07 #8
xNephilimx
213 Expert 100+
Now, not under the button, in the frame.
And yes, thats the whole code.

I reccomend you to start learning how to programfirst. Then, and only then start learning ActionScript.

Best regards,
The_Nephilim

thank you for replying me back

you said

complete code would be

Expand|Select|Wrap|Line Numbers
  1. convertor_btn.addEventListener(MouseEvent.CLICK, onClick);
  2.  
  3. function onClick(e:MouseEvent):void {
  4.     min_txt.text = Number(sec_txt.text) / 60;
  5. }
  6.  
so thats it only i need to enter this code under the button !
and iam done

...
Oct 22 '07 #9
i tried it but its giving error

it says




**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: The class or interface 'MouseEvent' could not be loaded.
function onClick(e:MouseEvent):void {

Total ActionScript Errors: 1 Reported Errors: 1
Oct 22 '07 #10
xNephilimx
213 Expert 100+
Try importing it at the beggining of the code:

import flash.events.MouseEvent;

Kind regards

i tried it but its giving error

it says




**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: The class or interface 'MouseEvent' could not be loaded.
function onClick(e:MouseEvent):void {

Total ActionScript Errors: 1 Reported Errors: 1
Oct 22 '07 #11
hello

i tired this also, but it still gives the same ERROR



**Error** Scene=Scene 1, layer=actions, frame=1:Line 3: The class or interface 'flash.events.MouseEvent' could not be loaded.
function onClick(e:MouseEvent):void {

Total ActionScript Errors: 1 Reported Errors: 1
Oct 23 '07 #12
xNephilimx
213 Expert 100+
Are you sure you are using AS3???

hello

i tired this also, but it still gives the same ERROR



**Error** Scene=Scene 1, layer=actions, frame=1:Line 3: The class or interface 'flash.events.MouseEvent' could not be loaded.
function onClick(e:MouseEvent):void {

Total ActionScript Errors: 1 Reported Errors: 1
Oct 23 '07 #13
yes


iam using actionscript 3
iam using flash professional 8
Oct 27 '07 #14
xNephilimx
213 Expert 100+
There's no way you are using AS3 in Flash 8.
AS3 is only available since Flash 9, Flash CS3 and Flex 2

yes


iam using actionscript 3
iam using flash professional 8
Oct 28 '07 #15
iam sorry dear support team my mistake

it was typed in a hurry
well now ..what to do
Oct 29 '07 #16
xNephilimx
213 Expert 100+
Ok then. If you are using AS2 it's basicly the same, the only thing that changes is the event handling part. It woud be like this:

Expand|Select|Wrap|Line Numbers
  1. convertor_btn.onRelease = function() {
  2.     min_txt.text = String(Number(sec_txt.text)/60);
  3. }
  4.  
And in AS3:
Expand|Select|Wrap|Line Numbers
  1. convertor_btn.addEventListener(MouseEvent.CLICK, onClick);
  2.  
  3. function onClick(e:MouseEvent) {
  4.     min_txt.text = String(Number(sec_txt.text)/60);
  5. }
  6.  
Best regards
The_Nephilim

iam sorry dear support team my mistake

it was typed in a hurry
well now ..what to do
Oct 29 '07 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Kription | last post by:
Hello, I am having a nightmare of a time getting seconds converted to hour-minute-seconds I have a third party application that outputs only in seconds since so if someone has been logged...
3
by: fred14214 | last post by:
I need to be able to enter an elapsed time into a text field. This time then needs to be converted into seconds and stored in a field in some table. The user will enter a time (format is...
4
by: MLH | last post by:
I have a procedure that runs. It takes 3-5 minutes generally. I would like to display the timelapse at the end of the process. I would like the approximate timelapse value of 0.002141 to be...
7
by: tshad | last post by:
Is there a quick function in vb out there that will convert seconds to minutes and seconds? Thanks, Tom
8
by: vunet.us | last post by:
How can I convert today's time (9:30:00) to seconds (34200) without using calculations like (9*3600)+(30*60)+0? Is there an easy function? Thank you
1
by: markdp | last post by:
I'm trying to write a program that takes a user inputted number of seconds and converts it into hours, minutes and seconds. So for instance, the program prompts the user for seconds, lets say 1000...
1
by: poorna | last post by:
Hai all Can any one help how to use currency convertor in Web application as I need to implement the currency convertor into my project. I tried in so many ways and was unable to gather any...
5
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have about ten integer values that each need to be converted to days, hours, minutes and seconds. I can't seem to find a formula for same that works. These integer values come from a...
3
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have various times formatted like 00:00:00, so for example, 01:32:05 would be one thirty-two with five milliseconds. I need to convert this into seconds (an integer). First of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.