Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 02-20-2009, 04:49 PM   #1
adefesche
Registered User
 
Join Date: Jan 2009
Posts: 19
Red face [AS2] Time zone from ComboBox?

Hey all,

I'm trying to create a clock that allows the user to select a time zone from a combobox and have the correct time show up on a clock in the next frame. Right now I have this actionscript for the combobox:
ActionScript Code:
stop(); timeZone = myLocation.selectedItem; myLocation.dataProvider = [     {label:"Select a City", data:0},                           {label:"Dallas", data:6},     {label:"Los Angeles", data:8} ]; var oListener:Object = new Object(); oListener.change = function(oEvent:Object):Void{     trace(oEvent.target.value); }; myLocation.addEventListener("change", oListener);

and the code on the clock frame looks like:

ActionScript Code:
time=new Date(); // time object seconds = time.getUTCSeconds() minutes = time.getUTCMinutes() hours = time.getUTCHours() hours = hours +(minutes/60); hours = hours -timeZone; seconds = seconds*6; // calculating seconds minutes = minutes*6; // calculating minutes hours = hours*30; // calculating hours sec._rotation=seconds; // giving rotation property min._rotation=minutes; // giving rotation property hour._rotation=hours; // giving rotation property

But for some reason the clock is not pulling the variable "timeZone" and always shows the hour hand at its default position (12). For example, the data for "Los Angeles" is 8. If I put "8" in the place of "timeZone" it works, but "timeZone" does not. Why??
adefesche is offline   Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AS3] ComboBox inside Datagrid CFB001 Components 13 02-05-2009 10:18 AM
[AS2] scroll inside comboBox mrocha Components 0 12-19-2008 02:32 PM
[AS2] combobox or listbox mcgrailm Components 0 10-09-2008 04:49 PM
[AS2] ComboBox not swaping depth armored_ Components 1 10-05-2008 06:02 AM
[AS2] ComboBox Help Sparkmasterflex Components 1 09-25-2008 04:18 PM


All times are GMT. The time now is 09:29 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.