Welcome, Guest. Please login or register.
Did you miss your activation email?

News: Do you like LG Env Touch?
 
Best Screen Protector for LG Env Touch           Get a LG enV Touch for $99 with a contract          
Pages: [1] 2
Print
Author Topic: can i make 2 clock running at the same time?  (Read 739 times)
0 Members and 1 Guest are viewing this topic.
BLACKMETALDUDE
Clockmaker Beginner
*

Cookies: +0/-0
Offline Offline

Gender: Male
Posts: 31



WWW
« on: July 02, 2009, 03:31:03 AM »

hello all,

im curious if i can have 2 of the same clocks running at the same time but with "1" having a differant text than the other. if so how?

im in the process of making a clock.
Logged
MrChickenRings
M.F.K.R.
Clockmaker Beginner
*

Cookies: +5/-0
Offline Offline

Gender: Male
Posts: 269


"Crazy as they are, they're not crazy" - Scought


« Reply #1 on: July 02, 2009, 08:53:43 AM »

You should be able to.
You just set both the variables/instance names (whichever, depending on what code your using, one from the voyager site is the instance name) at time, and same for both dates.
Logged
BLACKMETALDUDE
Clockmaker Beginner
*

Cookies: +0/-0
Offline Offline

Gender: Male
Posts: 31



WWW
« Reply #2 on: July 02, 2009, 02:31:57 PM »

ok. i found out how to make 2 clocks. but the second clock needs to be in a different font. but every time i play the animation, the font stays the same as the first clock. how would i do that.

thanks again for the help!
Logged
MrChickenRings
M.F.K.R.
Clockmaker Beginner
*

Cookies: +5/-0
Offline Offline

Gender: Male
Posts: 269


"Crazy as they are, they're not crazy" - Scought


« Reply #3 on: July 02, 2009, 02:38:52 PM »

you'll have to offset the second code.
Logged
BLACKMETALDUDE
Clockmaker Beginner
*

Cookies: +0/-0
Offline Offline

Gender: Male
Posts: 31



WWW
« Reply #4 on: July 02, 2009, 03:12:27 PM »

no clue how to do that. if i post the code hear. could you modify it to be, offset? if soo hear you go!

/* START OF TIME CODE */
_root.onEnterFrame = function ()
{
    var _loc3 = new Date();
    var _loc1 = _loc3.getHours();
    var _loc2 = _loc3.getMinutes();
    var _loc4 = _loc3.getSeconds();
    var _loc5;
    if (_loc1 >= 12)
    {
        _loc5 = "PM";
    }
    else
    {
        _loc5 = "AM";
    } // end else if
    if (_loc1 == 0)
    {
        _loc1 = 12;
    } // end if
    if (_loc1 > 12)
    {
        _loc1 = _loc1 - 12;
    } // end if
    if (_loc1 < 10)
    {
        _loc1 = " " + _loc1;
    } // end if
    if (_loc2 < 10)
    {
        _loc2 = "0" + _loc2;
    } // end if
    if (_loc4 < 10)
    {
        _loc4 = "0" + _loc4;
    } // end if
    time_txt.text = _loc1 + ":" + _loc2 + " " + _loc5;
   time2_txt.text = _loc1 + ":" + _loc2 + ":" + _loc4 +" " + _loc5;
    hours_txt.text = _loc1 + ":";
    mins_txt.text = _loc2 + " ";
    ampm_txt.text = _loc5;
};

/* END OF TIME CODE, START OF DATE CODE*/

var currentDate=new Date();
var weekDay=currentDate.getDay();
var weekDay_string:String;
var year=currentDate.getFullYear();
var month=currentDate.getMonth();
var month_string:String;
var numberDay=currentDate.getDate();
var numberDay_string:String;/* I use numberDay_string variable for adding a 0 before the days between 1 and 9. It's look better this way. */if (numberDay<10){
  numberDay_string="0"+numberDay;
}else{
  numberDay_string=numberDay;
}
/* I use a swich-case block for displaing months by their name, as everybody know them. ActionScript see them like numbers between 0 and 11, starting with January */
switch (month){
  case(0):month_string="1"; break;
  case(1):month_string="2"; break;
  case(2):month_string="3"; break;
  case(3):month_string="4"; break;
  case(4):month_string="5"; break;
  case(5):month_string="6"; break;
  case(6):month_string="7"; break;
  case(7):month_string="8"; break;
  case(Cool:month_string="9"; break;
  case(9):month_string="10"; break;
  case(10):month_string="11"; break;
  case(11):month_string="12"; break;
}
/* I use a swich-case block for displaing days of the week by their name. ActionScript see them like numbers between 0 and 6, starting with Sunday*/
switch (weekDay){
  case(0):weekDay_string="Su"; break;
  case(1):weekDay_string="Mo"; break;
  case(2):weekDay_string="Tu"; break;
  case(3):weekDay_string="We"; break;
  case(4):weekDay_string="Th"; break;
  case(5):weekDay_string="Fr"; break;
  case(6):weekDay_string="Sa"; break;}
/* display the date in the desired way*/
displayDate_txt.text=weekDay_string+", "+month_string+" "+numberDay_string+" ";
day_txt.text = weekDay_string + ",";
month_txt.text = month_string;
date_txt.text = numberDay_string;

/* END OF DATE CODE*/
« Last Edit: July 02, 2009, 03:15:40 PM by BLACKMETALDUDE » Logged
MrChickenRings
M.F.K.R.
Clockmaker Beginner
*

Cookies: +5/-0
Offline Offline

Gender: Male
Posts: 269


"Crazy as they are, they're not crazy" - Scought


« Reply #5 on: July 02, 2009, 03:15:17 PM »

Crude i dont even use that code. Ill PM you with the code i use, and how to use it.
And ill go ahead and give it to you with the gain.
Logged
BLACKMETALDUDE
Clockmaker Beginner
*

Cookies: +0/-0
Offline Offline

Gender: Male
Posts: 31



WWW
« Reply #6 on: July 02, 2009, 03:16:54 PM »

lol. Thanks dude.
Logged
e-T
Administrator
*****

Cookies: +8/-0
Offline Offline

Gender: Male
Posts: 1687



« Reply #7 on: July 02, 2009, 11:11:00 PM »

In order to have multiple clocks running at the same time, you have to name the instances differently and add the code into the end of the code to identify it.  So with the code you already posted in this thread, you would use time_txt for one instance to have the hours, minutes and the AM/PM display and then change the entry for time2_txt to read the same
Code:
time_txt.text = _loc1 + ":" + _loc2 + " " + _loc5;
time2_txt.text = _loc1 + ":" + _loc2 + " " + _loc5;
.

So one instance of your time would be named time_txt and the other would be time2_txt.
Logged
MrChickenRings
M.F.K.R.
Clockmaker Beginner
*

Cookies: +5/-0
Offline Offline

Gender: Male
Posts: 269


"Crazy as they are, they're not crazy" - Scought


« Reply #8 on: July 02, 2009, 11:14:29 PM »

e-T Will it not run more than one text box with the same instance name?
And also, what if you have 2 different codes, on to seperate layers, as well as the text boxes?
Logged
e-T
Administrator
*****

Cookies: +8/-0
Offline Offline

Gender: Male
Posts: 1687



« Reply #9 on: July 02, 2009, 11:22:35 PM »

It has been my experience that using that single line of code for time_txt for more than one text field will result in one clock keeping time and the other remaining static.

As for the separate layers and different codes, I would have to see them first hand.  This is one of those things that would depend more on the conflicts that might arise between different codes and how they are written to control the swf file.

I recall seeing a clock with bart simpson that had 3 clocks from the Voyager people.  If I can track it down, I can look at how that code was written and confirm how it was accomplished.
Logged
MrChickenRings
M.F.K.R.
Clockmaker Beginner
*

Cookies: +5/-0
Offline Offline

Gender: Male
Posts: 269


"Crazy as they are, they're not crazy" - Scought


« Reply #10 on: July 03, 2009, 12:20:12 AM »

Well, if i have a diff. code, and it names in the Variable, does that matter?
And it doesnt _txt.
the codes are on my flash clock thread.
Ill throw somethin together to see real quick.
Logged
e-T
Administrator
*****

Cookies: +8/-0
Offline Offline

Gender: Male
Posts: 1687



« Reply #11 on: July 03, 2009, 12:59:55 PM »

If your coding uses the variable naming instead of the instance, I don't think there should be an issue but I can't be positive unless I went in and made a clock using that type of code.

*Edit*
This is the simpsons clock I was referring to earlier, posted by heskis1 on the Voyager forum.  Looking at the code, he named the instance slightly different but with the same concept.
« Last Edit: July 03, 2009, 01:10:48 PM by e-T » Logged
MrChickenRings
M.F.K.R.
Clockmaker Beginner
*

Cookies: +5/-0
Offline Offline

Gender: Male
Posts: 269


"Crazy as they are, they're not crazy" - Scought


« Reply #12 on: July 03, 2009, 01:11:35 PM »

well he is wanting the clocks to run different times so yhe has to use diff. variables    if they arew the same then it is fine.
Logged
e-T
Administrator
*****

Cookies: +8/-0
Offline Offline

Gender: Male
Posts: 1687



« Reply #13 on: July 03, 2009, 01:16:34 PM »

I'm not sure I know what you mean by "different times".  From the first post, I only got that the OP wanted to use different fonts for the 2 clocks...or did I misunderstand the original issue?
Logged
BLACKMETALDUDE
Clockmaker Beginner
*

Cookies: +0/-0
Offline Offline

Gender: Male
Posts: 31



WWW
« Reply #14 on: July 03, 2009, 10:13:17 PM »

i actually want all my clocks to run at the same time. but you said i could not have them at the same time and one had to be offset.  i just want one of the clocks/date to be in differant font.
« Last Edit: July 03, 2009, 10:20:27 PM by BLACKMETALDUDE » Logged
Pages: [1] 2
Print
Jump to:  

Got a new phone? Find the forum here





LG Env Touch Forum by LG Env Touch Forum










CopyRight 2008 LG Env Touch Forum
Powered by SMF 1.1.11 | SMF © 2006-2007, Simple Machines LLC
LG Env Touch Forum | Sitemap

Galaxy S3 | Galaxy Note | Galaxy Nexus | Kindle Fire | Atrix 4G | Motorola Xoom | Windows Phone 7
Nokia Lumia | Top Hosts | Samsung Galaxy Tab | Samsung Galaxy S2 | Samsung Galaxy S | Samsung Wave
HTC Evo 3D | HTC Evo 4G | HTC Incredible | HTC Incredible 2 | HTC Incredible S | HTC Thunderbolt
Motorola Droid Razr
| HTC Desire | HTC Desire HD | HTC Desire Z | HTC Desire S | HTC Wildfire
Motorola Droid | Galaxy Indulge | Nokia N8 | Droid Charge | Droid X | Droid X2 | Droid 2| Droid 3 | Fascinate
HTC Sensation | HTC Flyer | LG Revolution | Asus Transformer | Xperia Play | iPhone 4 | Nexus S | Droid Bionic
HTC One | HTC Wildfire S | HTC Droid Eris


This is an Un-Official fan based Website. The views expressed on this website are solely those of the proprietor, or contributors to the site, and do not necessarily reflect the views or opinions of the parties it covers, and is not affiliated with, endorsed or sponsored by parties involved.
If you have a problem with any of the content posted on this website, please contact "sales@verticalscope.com"
Term of Use | Privacy Policy | BlackRain 2006 by, Crip