[flexcoders] Re: ColorPicker.selectedColor to #hex

2008-07-24 Thread Doug Lowder
Check out Number.toString().  You can pass it a radix parameter of 16 
to convert the output to hex.

--- In flexcoders@yahoogroups.com, Merrill, Jason 
[EMAIL PROTECTED] wrote:

 I don't mean for this to be a cross-post, I sent it to Flashcoders
 accidentally.
 This must have been done many times before.  How can I translate the
 ColorPicker.selectedValue to a 6 digit hex number? i.e. if the color
 selected is, 66, if I trace ColorPicker.selectedColor, traces 
102. I
 tried gooling for an Actionscript hex converter, but didn't come up 
with
 anything. This is in order to display the selected hex# to the user 
as
 #006699, not to manipulate the number.  
 
 Thanks.
 
  
 
 Jason Merrill
 Bank of America 
 Enterprise Technology  Global Risk LLD
 Instructional Technology  Media 
 
 Join the Bank of America Flash Platform Developer Community
 
blocked::http://sharepoint.bankofamerica.com/sites/tlc/flash/default.
as
 px  
 
 Are you a Bank of America associate interested in innovative 
learning
 ideas and technologies?
 Check out our internal  GTO Innovative Learning Blog
 
blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/defaul
t.
 aspx   subscribe
 
blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/_layou
ts
 /SubNew.aspx?List=\{41BD3FC9-BB07-4763-B3AB-A6C7C99C5B8D\}
Source=http:/
 /sharepoint.bankofamerica.com/sites/ddc/rd/blog/Lists/Posts/Archive.
aspx
  .





[flexcoders] Re: ColorPicker.selectedColor to #hex

2008-07-24 Thread Doug Lowder
Cool.  Here are a couple other ways to pad the 0's, for anyone with 
an aversion to loops:

hexString = 00.substr(0, 6 - hexString.length) + hexString;

or:

var pads: Array = [00, 0, , 000, 00, 0, ];
hexString = pads[hexString.length] + hexString;

--- In flexcoders@yahoogroups.com, Merrill, Jason 
[EMAIL PROTECTED] wrote:

 Thanks guys, here was my solution:
 
 public static function decimalToHexidecimal(number:Number, 
upperCase:Boolean=false, addPound:Boolean=false, 
addOx:Boolean=false ):String
 {
   var hexString:String = Number(number).toString(16);
   while (hexString.length  6) hexString = 0 + hexString;
   if (addPound) hexString = # + hexString;
   if (addOx) hexString = 0x + hexString;
   if (upperCase) hexString = hexString.toUpperCase();
   return hexString;
 }
 
 Jason Merrill 
 Bank of America 
 Enterprise Technology  Global Risk LLD 
 Instructional Technology  Media
 
 Join the Bank of America Flash Platform Developer Community  
blocked::http://sharepoint.bankofamerica.com/sites/tlc/flash/default.
aspx 
 
 Are you a Bank of America associate interested in innovative 
learning ideas and technologies?
 Check out our internal  GTO Innovative Learning Blog 
blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/defaul
t.aspx   subscribe 
blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/_layou
ts/SubNew.aspx?List=\{41BD3FC9-BB07-4763-B3AB-A6C7C99C5B8D\}
Source=http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/Lists/Po
sts/Archive.aspx .





[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-17 Thread Doug Lowder
Verify that you get midnight Jan 1, 1 AD from the following and 
you'll have the epoch adjustment value:

new Date( -6213559680 ).toUTCString()

Converting from timeticks returned by your webservice:

var epochAdjustment: Number = -6213559680;
var d: Date = new Date ( CurrentTimeTicks / 1 + epochAdjustment );
trace( d.toString() ); // client's local time


--- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] 
wrote:

 I agree with you 100% Josh but the better ones want the all might 
$$ 
 and my company isn't willing to pay for it, it's just nice to 
have.  
 So I need to find a free one or give it up.  But I'm not willing to 
 do that just yet...  soon, but not yet.  :-)
 
 They do have have some pseudocode on the site but it really shows 
it 
 using the DateTime in .Net.  And my understanding of that is that's 
 built in so there's no convesions (although I could be wrong).
 
 -M
 
 
 --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ 
 wrote:
 
  Switch to a different web service, or call whoever provides it 
and 
 get some
  documentation :)
  
  What the hell is 1AD? We haven't been keeping nice records since 
 like 200AD
  or something.
  
  And do they count all the various leap seconds? What about that 
 time when
  some pope rejigged the calendar and we disappeared like 13 days or
  something?
  
  Anybody proving information of such a monstrously non-standard 
 fashion
  should also be providing some serious documentation and/or 
 pseudocode.
  
  -Josh
  
  -- 
  Therefore, send not to know For whom the bell tolls. It tolls 
for 
 thee.
  
  :: Josh 'G-Funk' McDonald
  :: 0437 221 380 :: josh@
 





[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-16 Thread Doug Lowder
Sorry, I missed a parameter in there - that should have been new Date
(0).

  new Date( CurrentTimeTicks / 1 - new Date(0).getTime() )

If you truly have a 100ns count since 1 AD as CurrentTimeTicks (the 
math works out, but you should still verify that with the webservice 
if possible), then you would need to adjust for the difference 
between CurrentTimeTicks=0 (presumably Jan 1, 1 AD 00:00:00 UTC) and 
Date(0) (Jan 1, 1970 00:00:00 UTC) and pass that to Date() after 
converting to milliseconds along the way.


--- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] 
wrote:

 I tried a few things along those lines and not even getting 
close... 
 really:
 
 setDate =  new Date(nanoSeconds/1000 - new Date().getTime()); 
 RETURNS Tue Jun 20 09:55:17 GMT-0400 1933
 
 setDate =  new Date(nanoSeconds/(60*1000) - new Date().getTime
 ()); RETURNS Tue Jun 30 09:26:26 GMT-0400 1931
 
 setDate =  new Date(nanoSeconds/(60*1000) - new Date
 (1970,0,1,0,0,0,0).getTime()); RETURNS Mon Jan 12 19:17:43 GMT-0500 
 1970
 
 setDate =  new Date(nanoSeconds/1000 - new Date
 (1970,0,1,0,0,0,0).getTime()); RETURNS Mon Jan 3 19:43:04 GMT-0500 
 1972
 
 There's a problem with the math but I'm just not able to find it.  
 Any more help??  Maybe someone knows a different Web Service?
 
 Thanks,
 Mark
 
 
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
 wrote:
 
  CurrentTimeTicks looks like a 100ns count from the year 1 AD.  
You 
  could try:
  
   new Date( CurrentTimeTicks/1 - new Date().getTime() )
  
  Then use the Date.toString() or Date.toUTCString() method to 
 examine 
  the result.  You may need to adjust if CurrentTimeTicks isn't 
  relative to UTC.
  
  Also, don't assume daylight savings time is always a one-hour 
  offset.  Some time zones work from increments of a quarter-hour.  
 You 
  have the UtcOffsetTicks available to give you the correct offset.
  
  HTH,
  Doug
  
  
  --- In flexcoders@yahoogroups.com, Mark markp.shopping_id@ 
  wrote:
  
   Actually the problem is that the CurrentTimeTicks and 
  UtcOffsetTicks 
   is returned in nanoseconds or increment of 100 nanoseconds so I 
   can't use, new Date(CurrentTimeTicks);.  It returns as not a 
  date  
   Here's how the XML looks:
   
   
   TimeZoneInfo
 NameDateline Standard Time/Name 
 DaylightNameDateline Daylight Time/DaylightName 
 StandardNameDateline Standard Time/StandardName 
 DisplayName(GMT-12:00) International Date Line 
   West/DisplayName 
 UtcOffsetTicks-4320/UtcOffsetTicks 
 CurrentTimeTicks633516008019218750/CurrentTimeTicks 
 IsInDaylightSavingfalse/IsInDaylightSaving 
   /TimeZoneInfo
   
   
   
   
   
   --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ 
   wrote:
   
All typed off the top of my head in gmail and untested:

//Get a date for the UTC time numbers will match, but will be 
 in 
   local time
var foreignTime:Date = new Date(CurrentTimeTicks);

//Strip our current (local) offset (check my -/+ math!)
foreignTime.time -= foreignTime.getTimeZoneOffset() * 1000 * 
 60;

//Convert so the foreign value appears when getting the local 
   value (again,
check +/-)
foreignTime.time += UtcOffsetTicks * 1000 * 60;

if (IsDaylightSaving)
foreignTime.time += 360;

//Now if you fetch hours, minutes, seconds from foreignTime 
 they 
   should
return the numbers you'd like.

I've probably got a couple of +/- switched around, and if the 
   ticks are
seconds instead of ms knock off 3 zeros from some of those 
  fields, 
   but that
should give you a starting point :)

When you get the correct answer, please post it to the list 
in 
 a 
   follow-up
to this thread.

-Josh

On Mon, Jul 14, 2008 at 11:34 PM, Mark markp.shopping_id@ 
   wrote:

 I asked this question going into a weekend so I wanted to 
re-
  ask 
   it
 today and see if anyone has any ideas on how to work this?

 Thank You,
 Mark






-- 
Therefore, send not to know For whom the bell tolls. It 
tolls 
  for 
   thee.

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: josh@
   
  
 





[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-16 Thread Doug Lowder
Bah.  Obviously I'm not testing any of this myself - I'm leaving that 
up to you!

A call to new Date(0).getTime() will just return 0, so that won't 
work.  What you need is the number of milliseconds *between* 1 AD 
00:00:00 UTC and Jan 1, 1970 00:00:00 UTC.  I don't think there's a 
way to use ActionScript's Date class to determine this.  You can use 
a different technology (Java's GregorianCalendar class, for example) 
or just extrapolate an approximation of that value.  It will be a 
constant once determined.

(1970-1 = 1969) yrs * 365.25 days/yr * 24 hrs/day * 3600 secs/hr * 
1000 ms/sec * 1 timeticks/ms = 6213691440 timeticks 
(100ns)

(This is definitely an approximation, since there aren't precisely 
365.25 days per year, and it doesn't account for leap seconds, etc., 
but it might be close enough)

Adjust CurrentTimeTicks by that constant and pass it to Date(), 
converting to milliseconds somewhere along the way:

new Date( (CurrentTimeTicks - 6213691440) / 1 )
or:
new Date( CurrentTimeTicks/1 - 6213691440 )

Hope that gets you a bit closer to a solution.


--- In flexcoders@yahoogroups.com, Doug Lowder [EMAIL PROTECTED] 
wrote:

 Sorry, I missed a parameter in there - that should have been new 
Date
 (0).
 
   new Date( CurrentTimeTicks / 1 - new Date(0).getTime() )
 
 If you truly have a 100ns count since 1 AD as CurrentTimeTicks (the 
 math works out, but you should still verify that with the 
webservice 
 if possible), then you would need to adjust for the difference 
 between CurrentTimeTicks=0 (presumably Jan 1, 1 AD 00:00:00 UTC) 
and 
 Date(0) (Jan 1, 1970 00:00:00 UTC) and pass that to Date() after 
 converting to milliseconds along the way.
 
 
 --- In flexcoders@yahoogroups.com, Mark markp.shopping_id@ 
 wrote:
 
  I tried a few things along those lines and not even getting 
 close... 
  really:
  
  setDate =  new Date(nanoSeconds/1000 - new Date().getTime()); 
  RETURNS Tue Jun 20 09:55:17 GMT-0400 1933
  
  setDate =  new Date(nanoSeconds/(60*1000) - new Date().getTime
  ()); RETURNS Tue Jun 30 09:26:26 GMT-0400 1931
  
  setDate =  new Date(nanoSeconds/(60*1000) - new Date
  (1970,0,1,0,0,0,0).getTime()); RETURNS Mon Jan 12 19:17:43 GMT-
0500 
  1970
  
  setDate =  new Date(nanoSeconds/1000 - new Date
  (1970,0,1,0,0,0,0).getTime()); RETURNS Mon Jan 3 19:43:04 GMT-
0500 
  1972
  
  There's a problem with the math but I'm just not able to find 
it.  
  Any more help??  Maybe someone knows a different Web Service?
  
  Thanks,
  Mark
  
  
  
  --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
  wrote:
  
   CurrentTimeTicks looks like a 100ns count from the year 1 AD.  
 You 
   could try:
   
new Date( CurrentTimeTicks/1 - new Date().getTime() )
   
   Then use the Date.toString() or Date.toUTCString() method to 
  examine 
   the result.  You may need to adjust if CurrentTimeTicks isn't 
   relative to UTC.
   
   Also, don't assume daylight savings time is always a one-hour 
   offset.  Some time zones work from increments of a quarter-
hour.  
  You 
   have the UtcOffsetTicks available to give you the correct 
offset.
   
   HTH,
   Doug
   
   
   --- In flexcoders@yahoogroups.com, Mark markp.shopping_id@ 
   wrote:
   
Actually the problem is that the CurrentTimeTicks and 
   UtcOffsetTicks 
is returned in nanoseconds or increment of 100 nanoseconds so 
I 
can't use, new Date(CurrentTimeTicks);.  It returns as not a 
   date  
Here's how the XML looks:


TimeZoneInfo
  NameDateline Standard Time/Name 
  DaylightNameDateline Daylight Time/DaylightName 
  StandardNameDateline Standard Time/StandardName 
  DisplayName(GMT-12:00) International Date Line 
West/DisplayName 
  UtcOffsetTicks-4320/UtcOffsetTicks 
  CurrentTimeTicks633516008019218750/CurrentTimeTicks 
  IsInDaylightSavingfalse/IsInDaylightSaving 
/TimeZoneInfo





--- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ 
wrote:

 All typed off the top of my head in gmail and untested:
 
 //Get a date for the UTC time numbers will match, but will 
be 
  in 
local time
 var foreignTime:Date = new Date(CurrentTimeTicks);
 
 //Strip our current (local) offset (check my -/+ math!)
 foreignTime.time -= foreignTime.getTimeZoneOffset() * 1000 
* 
  60;
 
 //Convert so the foreign value appears when getting the 
local 
value (again,
 check +/-)
 foreignTime.time += UtcOffsetTicks * 1000 * 60;
 
 if (IsDaylightSaving)
 foreignTime.time += 360;
 
 //Now if you fetch hours, minutes, seconds from foreignTime 
  they 
should
 return the numbers you'd like.
 
 I've probably got a couple of +/- switched around, and if 
the 
ticks are
 seconds instead of ms knock off 3 zeros from some of those 
   fields, 
but that
 should give you a starting point

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-14 Thread Doug Lowder
CurrentTimeTicks looks like a 100ns count from the year 1 AD.  You 
could try:

 new Date( CurrentTimeTicks/1 - new Date().getTime() )

Then use the Date.toString() or Date.toUTCString() method to examine 
the result.  You may need to adjust if CurrentTimeTicks isn't 
relative to UTC.

Also, don't assume daylight savings time is always a one-hour 
offset.  Some time zones work from increments of a quarter-hour.  You 
have the UtcOffsetTicks available to give you the correct offset.

HTH,
Doug


--- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] 
wrote:

 Actually the problem is that the CurrentTimeTicks and 
UtcOffsetTicks 
 is returned in nanoseconds or increment of 100 nanoseconds so I 
 can't use, new Date(CurrentTimeTicks);.  It returns as not a 
date  
 Here's how the XML looks:
 
 
 TimeZoneInfo
   NameDateline Standard Time/Name 
   DaylightNameDateline Daylight Time/DaylightName 
   StandardNameDateline Standard Time/StandardName 
   DisplayName(GMT-12:00) International Date Line 
 West/DisplayName 
   UtcOffsetTicks-4320/UtcOffsetTicks 
   CurrentTimeTicks633516008019218750/CurrentTimeTicks 
   IsInDaylightSavingfalse/IsInDaylightSaving 
 /TimeZoneInfo
 
 
 
 
 
 --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ 
 wrote:
 
  All typed off the top of my head in gmail and untested:
  
  //Get a date for the UTC time numbers will match, but will be in 
 local time
  var foreignTime:Date = new Date(CurrentTimeTicks);
  
  //Strip our current (local) offset (check my -/+ math!)
  foreignTime.time -= foreignTime.getTimeZoneOffset() * 1000 * 60;
  
  //Convert so the foreign value appears when getting the local 
 value (again,
  check +/-)
  foreignTime.time += UtcOffsetTicks * 1000 * 60;
  
  if (IsDaylightSaving)
  foreignTime.time += 360;
  
  //Now if you fetch hours, minutes, seconds from foreignTime they 
 should
  return the numbers you'd like.
  
  I've probably got a couple of +/- switched around, and if the 
 ticks are
  seconds instead of ms knock off 3 zeros from some of those 
fields, 
 but that
  should give you a starting point :)
  
  When you get the correct answer, please post it to the list in a 
 follow-up
  to this thread.
  
  -Josh
  
  On Mon, Jul 14, 2008 at 11:34 PM, Mark markp.shopping_id@ 
 wrote:
  
   I asked this question going into a weekend so I wanted to re-
ask 
 it
   today and see if anyone has any ideas on how to work this?
  
   Thank You,
   Mark
  
  
  
  
  
  
  -- 
  Therefore, send not to know For whom the bell tolls. It tolls 
for 
 thee.
  
  :: Josh 'G-Funk' McDonald
  :: 0437 221 380 :: josh@
 





[flexcoders] Re: DateFormatter gives weird results

2008-06-26 Thread Doug Lowder
Hi Chris,

It seems like you are located in a GMT -0500 timezone, and what looks 
like 19 hours being added to your time is actually 5 hours being 
subtracted (24 - 5 = 19) so you end up seeing 19 hundred hours from 
the previous day.  This is because the Date() constructor with a 
single argument expects a value in GMT, but Flex does automatic 
conversion to client local time.  Have a look at the 
Date.getTimezoneOffset() method as a way to help convert to local 
time.

HTH,
Doug

--- In flexcoders@yahoogroups.com, Chris [EMAIL PROTECTED] 
wrote:

 Bump...
 
 --- In flexcoders@yahoogroups.com, Chris chriskeeler0831@ 
 wrote:
 
  So I have some code which formats milliseconds (for a video 
player) 
  in 
  to NN:SS format.  When I try to add the hours (JJ:NN:SS), 
  DateFormatter adds 19 hours to the result.  WTF?  Code Below:
  
  private function formatTime(item:Date):String {
  return dateFormatter.format(item);
  }
  private function videoDisplay_playheadUpdate():void {
  /* If playhead time is 0, set to 100ms so the 
  DateFormatter doesnt return an empty string. */
  var pT:Number = videoDisplay.playheadTime || 0.1;
  var tT:Number = videoDisplay.totalTime;
  
  /* Convert playheadTime and totalTime from seconds to 
  milliseconds and create new Date objects. */
  var pTimeMS:Date = new Date(pT * 1000);
  var tTimeMS:Date = new Date(tT * 1000);
  
  vidCurrentTime.text = formatTime(pTimeMS);
  vidTotalTime.text = formatTime(tTimeMS);
  }
  
 mx:DateFormatter id=dateFormatter formatString=JJ:NN:SS /
  
  Any help is appreciated.
  Thanks.
  -Christopher Keeler
 





[flexcoders] Re: httpservice and repetitive calls

2008-06-25 Thread Doug Lowder
You can fix this on the server by setting the no-cache header to max-
age=0, must-revalidate in the aspx page.  When possible, that's the 
best solution IMO.

--- In flexcoders@yahoogroups.com, Cameron [EMAIL PROTECTED] wrote:

 I'm using the httpservice to make a call to an aspx page which runs 
a 
 query and returns the results. This is fine, but if I try to run 
the 
 same call again, the service is not actually going out to make the 
call, 
 but rather just returning the results from the previous call. I 
know 
 this because the aspx page logs each call made to it. I always see 
the 
 first call, but no subsequent calls come through if I post the same 
 data. If I send a different set of data, the call works fine, but 
then 
 will not post that data again. Any ideas on why it doesn't want to 
 actually make the call? Below are the relevant pieces of code:
 script ...  
 public function lblClickHandler(event:Event):void{
 tgtdata = event.currentTarget.data.toString();
customer_id = event.currentTarget.data;
 useHttpService();
   }
 
 public function useHttpService():void {
 userReq.url = dstURL; //set in another part of the 
code
 userReq.method = GET;
 
 var Obj:Object = new Object();
 Obj.w = wispid;  //wispid is just a number that is 
set 
 elsewhere
 Obj.i = tgtdata;
 userReq.send(Obj);
 }
 ...
 /script
 mx:HTTPService id=userReq result=gethttpResult(event) 
 fault=handleFault(event) useProxy=false method=GET 
 resultFormat=object /





[flexcoders] Re: SWF Cache

2008-05-22 Thread Doug Lowder
If you can add content (besides your Flex app) to the server, you can 
do both.

http://www.adobe.com/devnet/flex/articles/version_sync_ria.html

It's an older article but the concepts still apply.  Long story 
short, your Flex app can periodically read some server side data 
(say, an XML page via HTTPService), compare the version number of the 
app to the latest available version, and force the browser to reload 
if a newer version is available.


--- In flexcoders@yahoogroups.com, Don Kerr [EMAIL PROTECTED] wrote:

 Thanks Kevin! I'll give it a try.
 
 Since I'm continual enhancing the apps for my users, ensuring the
 correct version is higher priority than a faster download.
 
 I appreciate the help.
 Don
 
 
 Don Kerr
 Manager, Space City AUG
 http://www.spacecityaug.com
 
 --- In flexcoders@yahoogroups.com, Kevin Fauth Kevin.Fauth@ 
wrote:
 
  Hey Don-
  
  It's a quick and dirty trick to prevent caching, but if you're 
just
  writing a single Flex app (1 swf, no modules) then you can append 
some
  random GET data to the tail end of the swf extension.
  
  For instance, instead of doing:
  EMBED src=effect.swf quality=high ...
  you would do:
  EMBED src=effect.swf?v=1.1.05 quality=high ...
  
  If you're using the AC_OETags.js file, then you'll have to modify 
line
  180 in Flex 2 or 187 in Flex 3 to include your versions (think of
  escaping Date() or something like that).
  
  That *should* ensure a clean version coming down.  Keep in mind 
that
  even a 300k Flex app can take a good amount of time to d/l for 
dial-up
  users, so caching isn't necessarily a bad thing.  Otherwise, just 
make
  sure your meta tags are in the HEAD section of your HTML.
  
  - Kevin
  
  --- In flexcoders@yahoogroups.com, Don Kerr fusionpage@ wrote:
  
   BTW, I've tried all the html tricks and none work in IE or 
Firefox...
   
   META HTTP-EQUIV=Cache-Control CONTENT=no-store
   META HTTP-EQUIV=Expires CONTENT=Mon, 04 Dec 1999 21:29:02 
GMT
   META HTTP-EQUIV=Pragma CONTENT=no-cache
   META HTTP-EQUIV=Expires CONTENT=-1
   
   I need a browser-independent solution for always ensuring my 
flex apps
   load the current version. Maybe there is something in 
Actionscipt that
   I can do to force reload of the swf from the server? I don't 
know. Any
   suggestions?
   
   --- In flexcoders@yahoogroups.com, Don Kerr fusionpage@ 
wrote:
   
How can I prevent my Flex app swf from being cached? When I
 release a
new version, I want to ensure the user is using the latest 
swf.

Thanks,
Don
   
  
 





[flexcoders] Re: unable to bind to property warnings binding to read-only properties

2008-05-21 Thread Doug Lowder
Yes, sorry for the confusion.  That should have been:

creationComplete=event.currentTarget.someProperty=foo.bar


--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote:

 We don't recommend putting curly braces around the values of event
 attributes like creationComplete... that makes it look like 
databinding
 even though it isn't.
 
  
 
 Gordon Smith
 
 Adobe Flex SDK Team
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Doug Lowder
 Sent: Tuesday, May 20, 2008 3:18 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: unable to bind to property warnings 
binding
 to read-only properties
 
  
 
 Binding has a lot of associated overhead and doesn't really serve 
any 
 purpose when it's a value you know is never going to change. 
 Somehting like the following works well for me.
 
 someProperty={foo.bar}
 
 becomes:
 
 creationComplete={event.currentTarget.somePorperty=foo.bar}
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 , mikebgrove mikebgrove@ 
 wrote:
 
  i make extensive use of read-only properties in my ActionScript 
  code. i find that anywhere i try to bind to a read only property 
i 
  get a warning in flex builder's debug mode indicating that flex 
 can't 
  bind to the property.
  
  here's a simple class to illustrate the point.
  
  package 
  {
  public class Foo
  {
  public function get bar():String {
  return bar;
  }
  }
  }
  
  if foo is an [Bindable] instance of Foo, then a binding to 
 {foo.bar} 
  will produce this warning:
  
  warning: unable to bind to property 'bar' on class 'Foo' (class 
is 
  not an IEventDispatcher).
  
  Foo is not an IEventDispatcher, but since every property of Foo 
is 
  immutable it shouldn't need to be.
  
  this may be a flex defect, judging by the title of the defect at 
  http://bugs.adobe.com/jira/browse/SDK-1046.
 http://bugs.adobe.com/jira/browse/SDK-1046.  i've asked adobe 
 support 
  to make more details about this defect public.
  
  i'm interested in strategies to avoid this warning for read-only 
  properties. in some cases this warning is instrumental in helping 
 me 
  figure out a binding problem, but unfortunately the important 
  warnings are nearly impossible to find among the hundreds of 
  irrelevant warnings for binding to read-only properties.
  
  here are some of the strategies i can think of, none great (i'll 
  continue using the above Foo class as an example):
  
  1) don't bind to {foo.bar}, bind to {getBar(foo)} or {foo.getBar
 ()}, 
  adding the getBar method either to the MXML component trying to 
 bind 
  to foo or the Foo class itself.
  2) declare the bar getter function as [Bindable] to a made up 
event 
  name, e.g. 
  [Bindable(event=barChangedNeverGonnaHappen)]
  
  are there other strategies people have employed to eliminate 
these 
  warnings for read-only properties? i trust i'm not the only one 
  whose eclipse debug console has been consumed with warnings like 
  these.
  
  thanks.
  
  -mike
 





[flexcoders] Re: Drilldown ideas

2008-05-21 Thread Doug Lowder
You can get rid of the popup window's blur effect by setting 
the modalTransparencyBlur style inherited from Panel.  I think you'd 
set it to 0.

HTH,
Doug

--- In flexcoders@yahoogroups.com, markgoldin_2000 
[EMAIL PROTECTED] wrote:

 If a user wants to drilldown into a dataGrid's cell what could have 
 been the best approach? Popup windows? Other ideas? If popup it is, 
can 
 I completely get rid of a blur affect when popup window is shown?
 
 Thanks for help.





[flexcoders] Re: Securely Interfacing Between Flex and Databases

2008-05-21 Thread Doug Lowder
Kenny, are you saying you want to implement security *within* your 
Flex app?  I think you'd have serious security holes with that (your 
decompilation concern, for one).  Typically security would be handled 
at the client-server level, by hosting your SWF on a server that has 
been configured to accept connections over https (e.g., 
https://myserver.com/myapp), connecting to your app via HTTPS from a 
browser, and designing your Flex app to connect to other servers over 
HTTPS as well.  Web servers and browsers already have built-in 
implementations of RSA, SSL/TLS, and the other industry standards 
mentioned in other posts so there's really no need to implement them 
yourself.  The same SWF (with certain design considerations taken 
into account, of course) can be accessed on the web non-securely 
(over HTTP), or securely (over HTTPS).

HTH,
Doug

--- In flexcoders@yahoogroups.com, kenny14390 [EMAIL PROTECTED] 
wrote:

 So the bottom line is to use an algorithm like RSA? To take a much
 simpler example, if the Flex app receives the encrypted data 1234
 and it wishes to use that data, it must first decrypt it. So it
 performs the decryption in some AS and now you have the decrypted 
data
 that you wanted. My question now is, if someone decompiles your app
 they can see your decryption method and thus decode the data on 
their
 own. Nothing is private in the Flex app due to the decompilation 
concern.
 
 Regarding SSL, I suppose this is out of the question if we're 
talking
 about a Facebook application. I don't have much control over their
 security.
 
 --- In flexcoders@yahoogroups.com, andrewwestberg
 andrewwestberg@ wrote:
 
  I think you're confusing simple secret key encryption (DES, AES,
  etc..) with public/private key encryption (RSA).
  
  In secret-key encryption if an attacker steals the data and 
guesses or
  brute forces the secret key, they can see the data.
  
  In public/private key encryption, a message you send to the 
server is
  encrypted by a public key and can ONLY be decrypted by a private 
key
  known only to the webserver (the certificate you bought from 
verisign,
  thawte, etc...)  This is how when you sign onto paypal or some 
other
  site over https, you don't have to worry about your credit-card 
being
  stolen in transmission.  Sitting in some DB at the company where
  employees can get at it, you should worry, but during 
transmission,
  it's unlikely to get cracked.
  
  -Andrew
 





[flexcoders] Re: Bug or bad programming?

2008-05-20 Thread Doug Lowder
Because mxml is xml, you'd need to use something like:

   {status.selectedValue amp;amp; access.selectedValue}

with the  encoded as amp;.

HTH,
Doug

--- In flexcoders@yahoogroups.com, nathanpdaniel [EMAIL PROTECTED] 
wrote:

 I have been working on a form where I have 3 fields.  Two fields 
are 
 RadioButton controls, the third a CheckBox control.  Now it is as 
 below:
 
 mx:FormItem label=Access
 mx:HBox width=100%
 mx:RadioButtonGroup id=access /
 mx:RadioButton label=Public groupName=access selected=true 
 value={true}/
 mx:RadioButton label=Private groupName=access value={false}/
 /mx:HBox
 /mx:FormItem
 mx:FormItem label=Status
 mx:HBox width=100%
 mx:RadioButtonGroup id=status /
 mx:RadioButton label=Active groupName=status value={true} 
 selected=true/
 mx:RadioButton label=Inactive groupName=status 
value={false}/
 mx:CheckBox id=featured label=Featured 
 enabled={(status.selectedValue)?((access.selectedValue)?
 true:false):false} /

 /mx:HBox
 /mx:FormItem
 
 Looking at the checkbox enabled it shows: 
 {(status.selectedValue)?((access.selectedValue)?true:false):false}
 
 A simple {status.selectedValue  access.selectedValue} would be 
 desired, but it causes an error in Flex.  I tried using || rather 
 than  (just for kicks) and it works.  Flex is wanting the  to 
be 
 an html entity... So I was wondering, is this just bad programming 
on 
 my part and I need to do something different, or is it a bug in 
Flex?
 
 -Nathan





[flexcoders] Re: unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Doug Lowder
Binding has a lot of associated overhead and doesn't really serve any 
purpose when it's a value you know is never going to change.  
Somehting like the following works well for me.

  someProperty={foo.bar}

becomes:

  creationComplete={event.currentTarget.somePorperty=foo.bar}


--- In flexcoders@yahoogroups.com, mikebgrove [EMAIL PROTECTED] 
wrote:

 i make extensive use of read-only properties in my ActionScript 
 code.  i find that anywhere i try to bind to a read only property i 
 get a warning in flex builder's debug mode indicating that flex 
can't 
 bind to the property.
 
 here's a simple class to illustrate the point.
 
 package 
 {
   public class Foo
   {
   public function get bar():String {
   return bar;
   }
   }
 }
 
 if foo is an [Bindable] instance of Foo, then a binding to 
{foo.bar} 
 will produce this warning:
 
 warning: unable to bind to property 'bar' on class 'Foo' (class is 
 not an IEventDispatcher).
 
 Foo is not an IEventDispatcher, but since every property of Foo is 
 immutable it shouldn't need to be.
 
 this may be a flex defect, judging by the title of the defect at 
 http://bugs.adobe.com/jira/browse/SDK-1046.  i've asked adobe 
support 
 to make more details about this defect public.
 
 i'm interested in strategies to avoid this warning for read-only 
 properties.  in some cases this warning is instrumental in helping 
me 
 figure out a binding problem, but unfortunately the important 
 warnings are nearly impossible to find among the hundreds of 
 irrelevant warnings for binding to read-only properties.
 
 here are some of the strategies i can think of, none great (i'll 
 continue using the above Foo class as an example):
 
 1) don't bind to {foo.bar}, bind to {getBar(foo)} or {foo.getBar
()}, 
 adding the getBar method either to the MXML component trying to 
bind 
 to foo or the Foo class itself.
 2) declare the bar getter function as [Bindable] to a made up event 
 name, e.g. 
   [Bindable(event=barChangedNeverGonnaHappen)]
 
 are there other strategies people have employed to eliminate these 
 warnings for read-only properties?  i trust i'm not the only one 
 whose eclipse debug console has been consumed with warnings like 
 these.
 
 thanks.
 
 -mike





[flexcoders] Re: Date object and daylight saving - need help

2008-03-24 Thread Doug Lowder
Can you provide the code that shows how you are creating and printing 
the Date objects?  A lot of times, I've discovered the mistake is 
somewhere other than the Date classes (no offense!)


--- In flexcoders@yahoogroups.com, reflexactions 
[EMAIL PROTECTED] wrote:

 Need a quick fix for this problem.
 
 When I print a date object it tell me the tiemzone offset is GMT-
0400.
 
 However when I get a date object and call its getTimezoneOffset 
 function I get 5hrs not 4hrs.
 
 The difference is daylight savings and yes I have in my (XPPro) 
system 
 I have checked to adjust for daylight savings.
 
 The problem this is causing is that some date calcualtions I need 
to 
 make where I have to adjust for the timezoneoffset are one hour off.
 
 Seems odd to me...
 
 But is there a way to find out the correct current tiemzone offset 
i.e. 
 the 4 hrs flex prints rather than the 5 hrs it returns from the 
method 
 call.
 
 tks





[flexcoders] Re: how to change the line's color??

2008-03-04 Thread Doug Lowder
I couldn't view your chart snapshot, but it sounds like you are 
talking about the grid lines.  Put something similar to the following 
into your LineChart declaration.

mx:backgroundElements
   mx:GridLines direction=horizontal
mx:horizontalFill
mx:SolidColor color=0xFF /
/mx:horizontalFill
/mx:GridLines
/mx:backgroundElements

Look at the GridLines class in the docs for more info.  The above is 
taken from the example there.

HTH,
Doug


--- In flexcoders@yahoogroups.com, luoxuanhuayelin 
[EMAIL PROTECTED] wrote:

 
  In a  linechart, if  the   backgroundColor of  Application  
is  not
 #ff,there will be  some  white horizontal lines in  the 
linechart.
 how to change the line's color??  thanks
 
 link to  a  snapshot of  my linechart
 http://bbs.blueidea.com/attachment.php?aid=80668noupdate=yes





[flexcoders] Re: Zero line drawn on plot chart

2008-02-26 Thread Doug Lowder
Check out the showLine style of AxisRenderer.  Seems like 
showLine=false ought to do what you want.

--- In flexcoders@yahoogroups.com, Geoffrey [EMAIL PROTECTED] wrote:

 Is there a way to turn off the line that gets drawn to show where 0
 (zero) is along the y axis?  My y axis is a LinearAxis with a minimum
 less than 0 (zero).  I have baseAtZero set to false, and autoAdjust
 set to false.
 
 Thanks,
   Geoff





[flexcoders] Re: Zero line drawn on plot chart

2008-02-26 Thread Doug Lowder
I see what you mean.  At least I think I do.  Try this in your 
mx:PlotChart declaration:

mx:backgroundElements
  mx:GridLines horizontalShowOrigin=false/
/mx:backgroundElements

There are other options with the GridLines class that you may want or 
need to set as well.

--- In flexcoders@yahoogroups.com, Geoffrey [EMAIL PROTECTED] wrote:

 That property actually removes the thick light blue line that is 
drawn
 between the chart body and the actual axis labels.  This is not the
 zero line.
 
 I'm using a PlotChart, so I've checked all of its properties and 
those
 of LinearAxis and DateTimeAxis.  Nothing stands out.
 
  ~Geoff
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
wrote:
 
  Check out the showLine style of AxisRenderer.  Seems like 
  showLine=false ought to do what you want.
  
  --- In flexcoders@yahoogroups.com, Geoffrey gtb104@ wrote:
  
   Is there a way to turn off the line that gets drawn to show 
where 0
   (zero) is along the y axis?  My y axis is a LinearAxis with a 
minimum
   less than 0 (zero).  I have baseAtZero set to false, and 
autoAdjust
   set to false.
   
   Thanks,
 Geoff
  
 





[flexcoders] Re: DateFormatter and Date Timezone Issue

2008-02-26 Thread Doug Lowder
Hi Phil,

You just have the wrong format string for your DateFormatter.  HH 
shows the hour as 1 through 24, which is one too many for 24-hour 
format (0-23).  You want the following:

mx:DateFormatter id=df formatString=MM/DD/YY JJ:NN /

JJ specifies the hour in 24-hour format.


--- In flexcoders@yahoogroups.com, Phil Heinz [EMAIL PROTECTED] wrote:

 To illustrate this issue, I have the following application:
 
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute creationComplete=init()
   mx:Script
   ![CDATA[
   private var _date:Date;
   
   private function init():void {
   _date = new Date();
   f1.text = _date.toString();
   f2.text = df.format(_date);
   }
   ]]
   /mx:Script
   mx:DateFormatter id=df formatString=MM/DD/YY HH:NN /
   mx:VBox
   mx:Text id=f1 /
   mx:Text id=f2 /
   /mx:VBox
 /mx:Application
 
 The output in the two fields shows:
 
 Tue Feb 26 16:16:32 GMT-0800 2008
 02/26/08 17:16
 
 Why does the date.toString show correct time, but the formatted date
 shows GMT-0700 instead? Don't they both use the client timezone?
 
 This is a pretty simple example, I would expect both outputs would 
be
 the same time (clients timezone).
 
 Any ideas?
 Thanks, Phil





[flexcoders] Re: What is the best way to add a day to a date?

2008-02-07 Thread Doug Lowder
It's not that simple, because of Daylight Savings Time.  Try the 
following on a machine with the timezone set to something that 
follows DST:

var ms:Number = 24*60*60*1000;
var d:String = 2008/11/02;
var newDate:Date = new Date(Date.parse(d)+ms);

You'll get the same day, 2008/11/02, because Nov 2 2008 will be a 25-
hour day in some locations due to the clocks being set back.  You'd 
need to convert to UTC before doing the math, or check the timezone 
of the dates with getTimezoneOffset() and adjust accordingly if 
needed.


--- In flexcoders@yahoogroups.com, Kevin Aebig [EMAIL PROTECTED] wrote:

 Yeah, that works too... =]
 
 !k
 
 -Original Message-
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Muzak
 Sent: Thursday, February 07, 2008 4:16 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] What is the best way to add a day to a 
date?
 
 or:
 
 var ms:Number = 24*60*60*1000;
 var d:String = 2008/12/20;
 var newDate:Date = new Date(Date.parse(d)+ms);
 
 
 - Original Message - 
 From: Kevin Aebig [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Thursday, February 07, 2008 6:19 PM
 Subject: RE: [flexcoders] What is the best way to add a day to a 
date?
 
 
  Create a date object with the string, than add the day to it like 
this:
  
  
  
  newDate = new Date(a[0], a[1], a[2]);
  
  newDate.seconds += 8640; // seconds in a day or (60*60*24)
  
  
  
  !k 
 
 
 
 --
 Flexcoders Mailing List
 FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com 
 Yahoo! Groups Links





[flexcoders] Re: IE cache

2008-01-08 Thread Doug Lowder
I use the following in my jsp pages.  It works quite nicely, even in 
IE over https.

  response.setHeader(Cache-Control, max-age=60, must-revalidate);


--- In flexcoders@yahoogroups.com, coder3 [EMAIL PROTECTED] wrote:

 
 i tried max-age header, also no-store, no-cache, must-revalidate,
 post-check=0, pre-check=0
 
 not working well on my IE.
 
 
 
 
 brent_trx wrote:
  
  If you are using SSL ... IE is really finicky when it comes to 
cache
  headers
  and SSL when used conjunction with plugins. You really need to be
  explicit,
  and should drop the Pragma and Expires headers and set Cache-
Control to
  no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  
  more info -
  http://booleanbetrayal.com/2007/06/20/ssl-ie-httpservices-cache-
prevention-annoyances/
  
  On Jan 6, 2008 5:51 PM, Scott Melby [EMAIL PROTECTED] wrote:
  
 Did you try the max-age header?
 
 
  Scott
 
  Scott Melby
  Founder, Fast Lane Software LLChttp://www.fastlanesw.com
 
 
 
  coder3 wrote:
 
 
  i tried to set the no-cache header in my jsp, somehow it didn't 
work. so
  i
  have to use garbage parameter to work around.
 
  thx
 
  Scott Melby-3 wrote:
  
   Are you using HTTPS? Check this post 
http://blog.fastlanesw.com/?p=9
   on my blog for a workaround.
  
   hth
   Scott
  
   Scott Melby
   Founder, Fast Lane Software LLC
   http://www.fastlanesw.com
  
  
  
   coder3 wrote:
  
  
   Hi All,
  
   I need an auto refresh feature in my flex application, my 
code is like
   this:
  
   var timedProcess:uint = setInterval(refreshResults, 30);
  
   it works fine on firefox. but looks like there is a cache 
problem on
   IE. the
   refreshResults() doesn't get called.
  
   i changed the IE cache settings to 1MB(minimum) but it 
doesn't work.
  
   any ideas?
  
   thanks
  
   --
   View this message in context:
   http://www.nabble.com/IE-cache-tp14591464p14591464.html
   http://www.nabble.com/IE-cache-tp14591464p14591464.html
   Sent from the FlexCoders mailing list archive at Nabble.com.
  
  
  
  
 
  --
  View this message in context:
  http://www.nabble.com/IE-cache-tp14591464p14623084.html
  Sent from the FlexCoders mailing list archive at Nabble.com.
 
 
 
  
  
 
 -- 
 View this message in context: http://www.nabble.com/IE-cache-
tp14591464p14702496.html
 Sent from the FlexCoders mailing list archive at Nabble.com.





[flexcoders] Re: File Download

2007-10-19 Thread Doug Lowder
One way to get the Open/Save dialog is to have your Flex control link 
to a server-side URL that sets the Content-Disposition header to 
something like attachment; filename=myFile.pdf.  You should also set 
the content type to the appropriate value based on the type of file 
ding downloaded.  How you set those headers depends on what server-side 
technology you're using - JSP, ASP, PHP, etc.  You can probably find 
some examples in the archives.

HTH,
Doug

--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 I want the user to be able to click on a link and download a file. 
 When they click on it, I want them to have to option to save the file
 or open it right there.
 
 I can use the file reference class so the users can click on the file
 and save it...but they have to navigate to that folder to open it. 
 Anyone know how to make the open dialog appear?
 
 Thanks,
 
 Nate





[flexcoders] Re: httpservice url decode problem

2007-10-18 Thread Doug Lowder

Have a look at encodeURIComponent()
http://livedocs.adobe.com/flex/2/langref/package.html#encodeURIComponen\
t()   in the docs.

I believe it would be something like the following:

srv.url = http://www.mydomain.com/eTraffic.cgi?target=; +
encodeURIComponent(/Fed-switchports/100/1006/16;range=d);


--- In flexcoders@yahoogroups.com, coder3 [EMAIL PROTECTED] wrote:


 Hi,

 i need to use an url that contains / in the parameters.

 like

 mx:httpService id=srv

url=http://www.mydomain.com/eTraffic.cgi?target=%2Fed-switchports%2F100\
%2F1006%2F16;range=d
 result=resultHandler(event)/


 i use unescapeMultiByte to convert first and then send it.

 srv.url = unescapeMultiByte(srv.url);
 srv.send();


 it still doesn't work. resultHandler(event) has not been called after
that.

 the data in result file has nothing wrong. what is the problem?

 --
 View this message in context:
http://www.nabble.com/httpservice-url-decode-problem-tf4649345.html#a132\
82349
 Sent from the FlexCoders mailing list archive at Nabble.com.





[flexcoders] Re: Return a person's age

2007-10-02 Thread Doug Lowder
Wouldn't that produce a negative number, given that birthDate 
probably comes before todayDate?

Discounting that, I think that would give you the person's age in 
milliseconds.


--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 Based on my reading of the docs, there is a simpler way:
 
 var age = new Date(birthDate.getTime() - todayDate.getTime);
 
 Untested.
 
 Tracy
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of JRBower
 Sent: Tuesday, October 02, 2007 2:29 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Return a person's age
 
  
 
 
 Doug,
 Thank you. I will give your code a go. :)
 
 Best Regards,
 James
 
 Doug Lowder wrote:
  
  Here's how I would do it:
  
  var age:Number = todayDate.fullYear - birthDate.fullYear;
  if (todayDate.month  birthDate.month || (todayDate.month == 
  birthDate.month  todayDate.date  birthDate.date)) age--;
  return age;
  
  
 
 -- 
 View this message in context:
 http://www.nabble.com/Return-a-person%27s-age-
tf4545118.html#a12993386
 http://www.nabble.com/Return-a-person%27s-age-
tf4545118.html#a12993386
 
 Sent from the FlexCoders mailing list archive at Nabble.com.





[flexcoders] Re: Return a person's age

2007-10-02 Thread Doug Lowder
Ah, but if the OP wants an answer in the form the person is X years 
old today, that's where the problem arises.  A good edge case is:

Birthday: 2/28/2000
Today: 2/27/2001

With the getTime() approach, new Date(2/27/2001).getTime() - new 
Date(2/28/2000).getTime() gives 3153600 (Jan 1, 1971 UTC), or 
365 days.  In this case the age is not 1 though, because that year 
was 366 days instead of 365.  That's why I would still choose to do 
the calculation without getTime(), and why I don't think those doc 
examples are particularly good ones - a day is not always 24 hours, a 
year is not always 365 days, etc.



And sorry for beating a dead horse so badly! :)

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 Oops, yes, the subtraction should be reversed.
 
  
 
 But one of the overloads of the Date constructor takes a single
 argument, the number of milliseconds from the reference date, the 
same
 reference date as the getTime() method.  The doc example shows this
 method for adding time to a date, but I expect it will work for
 subracting time as well.
 
  
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Doug Lowder
 Sent: Tuesday, October 02, 2007 3:37 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Return a person's age
 
  
 
 Wouldn't that produce a negative number, given that birthDate 
 probably comes before todayDate?
 
 Discounting that, I think that would give you the person's age in 
 milliseconds.
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 , Tracy Spratt tspratt@ wrote:
 
  Based on my reading of the docs, there is a simpler way:
  
  var age = new Date(birthDate.getTime() - todayDate.getTime);
  
  Untested.
  
  Tracy
  
  
  
  From: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 ] On
  Behalf Of JRBower
  Sent: Tuesday, October 02, 2007 2:29 AM
  To: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com 
  Subject: Re: [flexcoders] Return a person's age
  
  
  
  
  Doug,
  Thank you. I will give your code a go. :)
  
  Best Regards,
  James
  
  Doug Lowder wrote:
   
   Here's how I would do it:
   
   var age:Number = todayDate.fullYear - birthDate.fullYear;
   if (todayDate.month  birthDate.month || (todayDate.month == 
   birthDate.month  todayDate.date  birthDate.date)) age--;
   return age;
   
   
  
  -- 
  View this message in context:
  http://www.nabble.com/Return-a-person%27s-age-
 http://www.nabble.com/Return-a-person%27s-age- 
 tf4545118.html#a12993386
  http://www.nabble.com/Return-a-person%27s-age-
 http://www.nabble.com/Return-a-person%27s-age- 
 tf4545118.html#a12993386
  
  Sent from the FlexCoders mailing list archive at Nabble.com.
 





[flexcoders] Re: Is it possible to get a list of Shared Local Objects from my domain ?

2007-10-01 Thread Doug Lowder
Assuming you can read directories on the local client system, then 
sure.  Take a look at how Darron Schall's SolVE program does it:

http://solve.sourceforge.net/


--- In flexcoders@yahoogroups.com, helihobby [EMAIL PROTECTED] wrote:

 Hello,
 
 Is it possible to somehow get a list of all the available Shared 
Local 
 Objects that are saved on disk that belong to my domain ?
 
 
 Regards,
 
 Sean.
 
 Click below to view my ALON Design Pattern:
 
 http://www.helihobby.com/html/alon_desingpattern.html





[flexcoders] Re: Return a person's age

2007-10-01 Thread Doug Lowder
Here's how I would do it:

var age:Number = todayDate.fullYear - birthDate.fullYear;
if (todayDate.month  birthDate.month || (todayDate.month == 
birthDate.month  todayDate.date  birthDate.date)) age--;
return age;


--- In flexcoders@yahoogroups.com, JRBower [EMAIL PROTECTED] wrote:

 
 I have a form where I request a birthdate. I would like to 
automatically
 calculate a person's age (for another input) from the difference of 
today's
 date and the inputted birthdate. I'm not exactly sure how to write 
the
 function. I the following right?
 
 public function dateDiff(todayDate:Date, birhtDate:Date):void 
 { 
 var todayDate:Date(); 
 var birthDate:Date;
 var age = birthDate - todayDate;
 } 
 
 Thanks for your help,
 
 James
 -- 
 View this message in context: http://www.nabble.com/Return-a-person%
27s-age-tf4545118.html#a12970134
 Sent from the FlexCoders mailing list archive at Nabble.com.





[flexcoders] Re: How to see if method is implemented in class

2007-09-18 Thread Doug Lowder
Technically, if you plan to call the method wouldn't you also want to 
verify that it's a function?  Something like:

 if (validate in someObject  someObject[validate] is Function) 

I suppose it might depend on the possible instance types of 
someObject.

--- In flexcoders@yahoogroups.com, j_lentzz [EMAIL PROTECTED] wrote:

 Ok.  I see now.  Very nice.  Thanks a bunch.
 
 John
 --- In flexcoders@yahoogroups.com, Gordon Smith gosmith@ wrote:
 
  if (validate in someObject)
  
  
  
  From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
  Behalf Of Alex Harui
  Sent: Tuesday, September 18, 2007 8:10 AM
  To: flexcoders@yahoogroups.com
  Subject: RE: [flexcoders] How to see if method is implemented in 
class
  
  
  
  If (validate in someObject)
  
  
  
  From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
  Behalf Of j_lentzz
  Sent: Tuesday, September 18, 2007 7:26 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] How to see if method is implemented in class
  
  Hi,
  
  I've got a problem I'm trying to resolve concerning validating a 
page
  before submitting it to the server. I have a way to recursively 
get
  each child on the page. However, I can't figure out a way to see 
if
  the child has the validate() method implemented. Most of the
  components are extended from TextInputs, ComboBox, etc, where I've
  integrated a validator into each one that is custom for that 
type. So
  my custom components will have a validate method, however, other
  components - like Images, Buttons, etc - on the page don't have a
  validate method. Is there a way to test that a method exists, 
before
  trying to call it and causing an exception?
  
  Thanks,
  
  John
 





[flexcoders] Re: Cache-Control header not working in HTTPService

2007-09-17 Thread Doug Lowder
It's best to stay away from pragma no-cache entirely, since some 
browser versions don't handle it correctly.  I use max-age=0, must-
revalidate.

 http://tech.groups.yahoo.com/group/flexcoders/message/29418

- Doug

--- In flexcoders@yahoogroups.com, dario.drome [EMAIL PROTECTED] 
wrote:

 The http headers to control (and avoid the cache) come from the 
 server side, that is, it is not useful at all that you set the 
 headers from the client side.
 In order to avoid cache you need to set the header Pragma with 
the 
 value no-cache and also set Expires with -1 to give your 
 content an inmediate expiration, but remember: set these values 
from 
 the server, not from the client.
 
 Regards.
 
 --- In flexcoders@yahoogroups.com, Scott - FastLane smelby@ 
 wrote:
 
  If you have control of the server side of your project, you could 
 ask 
  them to include the cache in their response header... I believe 
 that is 
  the way it is supposed to work.  The server indicates that the 
 content 
  it is returning is dynamic in nature and should not be cached.  
 While 
  adding the current time to each of your requests as a parameter 
 will 
  avoid caching, it is a bit burdensome if you have a large system 
to 
  implement.  Note also that the no-cache response header is 
ignored 
 by 
  IE/flashplayer when your request is over https as described here 
  http://blog.fastlanesw.com/?p=9.  Note: I also describe the 
 workaround 
  that I use to get around this issue.
  
  hth
  Scott
  
  Dan Todor wrote:
  
   Try adding current system time as a parameter to your request, 
it 
 will 
   avoid caching.
   hth
  
   On 9/17/07, *Guido* ptevan@ mailto:ptevan@ wrote:
  
   Hi y'all,
  
   I've been having this problem for a while now, and I've 
went 
 by
   the docs on RPC components time and time again, getting no
   solution for this.
  
   I have an HTTP service and I need to guarantee that its 
 results
   are not cached by either the app or the browser.
  
   My last attempt on this is:
  
   mx:HTTPService id=myService
   concurrency=last
   headers={new URLRequestHeader(Cache-Control ,
   no-cache)}
   makeObjectsBindable=true
   requestTimeout=10
   showBusyCursor=true
   useProxy=false
   url={myServiceURL}/
  
   When debugging the app, the service's HTTP header property 
is
   populated by the URLRequestHeader, so I believe It's 
getting 
 built
   adequately. Also, when inspecting the AsyncToken returned by
   myService.send(), the message property has its headers also
   populated by the URLRequestHeader.
  
   The thing is that when I check for adequate reception on the
   server side, I don't get the Cache-Control header at all.
  
  
   Does anyone know how to make HTTP headers work for 
 HTTPServices?
  
   TIA,
  
   Guido.
  
  
  
  
   -- 
   All best,
   Dan
  
   Zen is like looking for the spectacles that are sitting on your 
 nose
  
 





[flexcoders] Re: How to parse objectProxy array vs. single items

2007-09-14 Thread Doug Lowder

You can use mx.utils.ArrayUtil.toArray()
http://livedocs.adobe.com/flex/201/langref/mx/utils/ArrayUtil.html#toAr\
ray()  to ensure you're dealing with an array.  Or perhaps testing with
if (testType is Array) would smell a little better.  :)


--- In flexcoders@yahoogroups.com, M@ Sheppard [EMAIL PROTECTED] wrote:

 I'm pretty sure I'm doing something wrong - I get an objectProxy back
 from a webservice with a list of items - sometimes the list is empty,
 sometimes it has 1 item, sometimes is has many.

 My code is working, but it smells bad - I have to check if the
 object in question has a .length property - and access it differently.

 I am currently parsing this array like this:

 // Parse the icons
 var testType:Object = op.item;
 if (testType != null)
 {
 if (testType.length != null) //more than one group
 {
 for( var i:int; iop.item; ++i)
 {
 foo( op.item[i]);
 }
 }
 else
 {
 foo(op.item);
 }
 }

 Thanks,
 M@





[flexcoders] Re: Detecting itemOpen event of a Tree

2007-09-12 Thread Doug Lowder

For a tree defined like so (treeData is an XMLListCollection):

   mx:Tree showRoot=false dataProvider={treeData}
   itemOpen=onTreeItemOpened(event)/

I use code similar to the following to determine which root node was
opened.

   private function onTreeItemOpened(event: TreeEvent) : void {
   if (event.item == treeData[0].children()[0]) {
 // the first root node, index 0, was opened
   }
   else if (event.item == treeData[0].children()[1]) {
 // the second root node, index 1, was opened
   }
   }

--- In flexcoders@yahoogroups.com, nhid [EMAIL PROTECTED] wrote:

 Hi,

 I have a tree with multiple root nodes, where the leaves will be
populated
 only when I click on the folder icon using the itemOpen event. That
call
 needs to pass the information of that particular root node to the
backend,
 how do I detect which root node I clicked?

 Thank you!






[flexcoders] Re: Announcing flexmdi: Robust, extensible MDI framework for Flex

2007-09-11 Thread Doug Lowder
Great work, this is really nice stuff!  I've worked on a couple of 
these myself, so I know how many details there are getting something 
like this implemented.  I have a few questions and comments:

. How is the performance with windows filled with content (say, a 
tree, grid, and/or chart) as opposed to empty windows?  I've run into 
serious performance issues with only a few windows, depending on the 
type and number of child controls, mostly due to the performance of 
using setStyle() on inherited properties like border color.

. You have solved a problem I've seen in pretty much every resize 
manager I've come across so far: Releasing the mouse button while the 
cursor is outside the browser window during a resize.  That problem 
seems to exist during window dragging though (i.e., start dragging a 
window, move the cursor outside the browser window and release the 
mouse button, then move the cursor back into the browser to start the 
strangeness).  Maybe that's a bug in TitleWindow, if that's what your 
MDI window extends.

. When a window is maximized, I see there are still drag events being 
broadcast, and I can even drag the maximized window up and down a few 
pixels.  Not sure if you intended for that to happen.  I admit that's 
getting nit-picky but I thought I'd mention it.

Again, great stuff overall.  Thanks for sharing this.

- Doug

--- In flexcoders@yahoogroups.com, ben.clinkinbeard 
[EMAIL PROTECTED] wrote:

 Hello all, just wanted to make you aware of a project that Brian
 Holmes, Brendan Meutzner and myself just launched. flexmdi is a
 framework for creating MDI interfaces in Flex that is open source,
 extensible and fairly comprehensive in its capabilities. I have 
posted
 the official announcement with some more details and links on my 
blog,
 so I will point interested parties there: 
 
 http://www.returnundefined.com/2007/09/announcing-flexmdi-robust-
extensible-mdi-framework-for-adobe-flex/
 
 If you just want to see it in action, here is a direct link to the
 examples explorer: http://www.returnundefined.com/flexmdi/explorer/
 
 Please send us feedback! Questions, comments, complaints, whatever.
 Feel free to do that here or on the related project sites and 
articles.
 
 Thanks!
 Ben





[flexcoders] Re: Announcing flexmdi: Robust, extensible MDI framework for Flex

2007-09-11 Thread Doug Lowder
So here is what I'm seeing with a freshly-loaded app in IE7 on 
Windows XP Pro, FlashPlayer 9.0.47.0:

I click and hold the mouse button on the titlebar of Window 2 to 
begin dragging.  Moving the cursor to any browser-window edge (I 
moved it left), Window 2 follows and stops when it's aligned with the 
browser edge (nice touch, btw).  So far so good.  If I continue 
moving the mouse outside the browser window completely (Window 2 has 
stopped following the mouse as it's already as far as it is allowed 
to be dragged, no problem there) and then release the mouse button, 
Window 2 will begin tracking the mouse again when it returns to the 
browser, even though the mouse button has been released.  Strangely, 
I can get back to normal behavior by either clicking the mouse OR 
moving the cursor outside the browser once more.

--- In flexcoders@yahoogroups.com, ben.clinkinbeard 
[EMAIL PROTECTED] wrote:

 Hi Doug,
 
 Thanks for the feedback and compliments!
 
 We actually had sample content in the windows for some of our 
testing
 but decided not to include it in the explorer. Maybe we should put 
it
 in there... Performance was pretty decent I think, but can't say for
 sure as I don't think I ever added 30 windows filled with content. I
 think I will try to get some content options in the explorer and 
then
 you can really pound on it and see for yourself :)
 
 I know the window dragging thing was a problem early on but I 
thought
 I had fixed it and am not seeing it in the version of the explorer
 that is posted. Any time you are dragging a window and release 
outside
 the browser it sticks? Or are you referring to it jumping towards
 where you release the mouse? Anyhow, the code that is supposed to 
fix
 those issues is to listen for the MOUSE_LEAVE event on
 systemManager.stage. Oh, and MDIWindow actually extends Panel.
 
 Congratulations, you've submitted our first bug report. :) Dragging
 should definitely be disabled whena window is maximized, so I am
 adding that to the issues list now.
 
 Thanks again!
 Ben




[flexcoders] Re: Announcing flexmdi: Robust, extensible MDI framework for Flex

2007-09-11 Thread Doug Lowder
Mike,

I should have said every free, open source resize manager I've come 
across.  :)  I haven't looked at very many for-purchase packages.

Yours is excellent!  I especially like the anchor indicators and 
resize effect.

--- In flexcoders@yahoogroups.com, Michael Schmalle 
[EMAIL PROTECTED] wrote:

 Doug,
 
  You have solved a problem I've seen in pretty much every resize
 manager I've come across so far:
 
 Did you see mine? :)
 
 You have to create a cleanUp method that will fire on mouseUp and 
mouse
 leave, the mouse leave can't execute the same code as mouseUp since 
the
 operation becomes invalid.
 
 Peace, Mike
 
 On 9/11/07, ben.clinkinbeard [EMAIL PROTECTED] wrote:
 
Hi Doug,
 
  Thanks for the feedback and compliments!
 
  We actually had sample content in the windows for some of our 
testing
  but decided not to include it in the explorer. Maybe we should 
put it
  in there... Performance was pretty decent I think, but can't say 
for
  sure as I don't think I ever added 30 windows filled with 
content. I
  think I will try to get some content options in the explorer and 
then
  you can really pound on it and see for yourself :)
 
  I know the window dragging thing was a problem early on but I 
thought
  I had fixed it and am not seeing it in the version of the explorer
  that is posted. Any time you are dragging a window and release 
outside
  the browser it sticks? Or are you referring to it jumping towards
  where you release the mouse? Anyhow, the code that is supposed to 
fix
  those issues is to listen for the MOUSE_LEAVE event on
  systemManager.stage. Oh, and MDIWindow actually extends Panel.
 
  Congratulations, you've submitted our first bug report. :) 
Dragging
  should definitely be disabled whena window is maximized, so I am
  adding that to the issues list now.
 
  Thanks again!
  Ben
 
 
  --- In flexcoders@yahoogroups.com flexcoders%
40yahoogroups.com, Doug
  Lowder douglowder@ wrote:
  
   Great work, this is really nice stuff! I've worked on a couple 
of
   these myself, so I know how many details there are getting 
something
   like this implemented. I have a few questions and comments:
  
   . How is the performance with windows filled with content (say, 
a
   tree, grid, and/or chart) as opposed to empty windows? I've run 
into
   serious performance issues with only a few windows, depending 
on the
   type and number of child controls, mostly due to the 
performance of
   using setStyle() on inherited properties like border color.
  
   . You have solved a problem I've seen in pretty much every 
resize
   manager I've come across so far: Releasing the mouse button 
while the
   cursor is outside the browser window during a resize. That 
problem
   seems to exist during window dragging though (i.e., start 
dragging a
   window, move the cursor outside the browser window and release 
the
   mouse button, then move the cursor back into the browser to 
start the
   strangeness). Maybe that's a bug in TitleWindow, if that's what 
your
   MDI window extends.
  
   . When a window is maximized, I see there are still drag events 
being
   broadcast, and I can even drag the maximized window up and down 
a few
   pixels. Not sure if you intended for that to happen. I admit 
that's
   getting nit-picky but I thought I'd mention it.
  
   Again, great stuff overall. Thanks for sharing this.
  
   - Doug
  
   --- In flexcoders@yahoogroups.com flexcoders%
40yahoogroups.com, 
  ben.clinkinbeard
   ben.clinkinbeard@ wrote:
   
Hello all, just wanted to make you aware of a project that 
Brian
Holmes, Brendan Meutzner and myself just launched. flexmdi is 
a
framework for creating MDI interfaces in Flex that is open 
source,
extensible and fairly comprehensive in its capabilities. I 
have
   posted
the official announcement with some more details and links on 
my
   blog,
so I will point interested parties there:
   
http://www.returnundefined.com/2007/09/announcing-flexmdi-
robust-
   extensible-mdi-framework-for-adobe-flex/
   
If you just want to see it in action, here is a direct link 
to the
examples explorer: 
http://www.returnundefined.com/flexmdi/explorer/
   
Please send us feedback! Questions, comments, complaints, 
whatever.
Feel free to do that here or on the related project sites and
   articles.
   
Thanks!
Ben
   
  
 
   
 
 
 
 
 -- 
 Teoti Graphix
 http://www.teotigraphix.com
 
 Blog - Flex2Components
 http://www.flex2components.com
 
 You can find more by solving the problem then by 'asking the 
question'.





[flexcoders] Re: swap two variables without temporary variable

2007-08-30 Thread Doug Lowder
What about:
...
swap(this, a, b);
...

private function swap(o: *, propnameA: String, propnameB: String) : 
void {
  // pseudocode for the swap
  temp = o[propnameA];
  o[propnameA] = o[propnameB];
  o[propnameB] = temp;
}

I guess it might depend on access to the variables within the object, 
but shouldn't that always work for o == this?

Doug

--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote:

 AS3 does not have references to ints. ints re always passed by 
value, so
 you cannot write a method like swap(a, b) to swap them. Just use a 
temp
 var.
  
 - Gordon
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Reid Priedhorsky
 Sent: Thursday, August 30, 2007 9:41 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: swap two variables without temporary 
variable
 
 
 
 carlos m wrote:
  Hey Reid,
  
  Don't think there is a built-in function that will do that for
  you--not that I am aware of anyway--but there is definitely a way 
of
  implementing it! Check out this blog post by the awesome guys at
  polygonal:
  http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/
 http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-
math/  .
  Specifically, check out the section labeled Swap integers without
  temporary variables using XOR.
  
  Lot's of goodies on that blog!
  
  Cliffnotes: 
  var t:int = a;
  a = b;
  b = t;
  
  //equals: 
  a ^= b;
  b ^= a;
  a ^= b;HTH!
 
 Hi Carlos,
 
 Thanks for the note -- I suppose I should have been more clear. I 
meant,
 
 how to swap two variables in one line: it's not about speed but 
rather 
 clarity. :)
 
 Reid





[flexcoders] Re: Number column in DataGrid

2007-06-14 Thread Doug Lowder
Top-level function parseFloat() might do the trick.  You may need to 
pass it a substring if your text input has a leading currency 
character.

--- In flexcoders@yahoogroups.com, headjoog [EMAIL PROTECTED] wrote:

 I'm stuck and making a dunce appeal - this can't be as difficult as 
I'm 
 making it:
 
 I have a Data Grid and a Form.  When an item is selected on the 
Data 
 Grid, it displays the selected item on the Form for editing.
 
 I'm using mx:Binding so changes on the form are reflected in the 
 grid.  With straight text values, life is good - it works fine.
 
 One column in the grid is a Number (actually currency) and when I 
try 
 to include that I get a type coercion error. (I'm saving this back 
to a 
 database via Hibernate where the column is a number).  I tried to 
use 
 Number(txtInput.text) in the mx:Binding destination tag and it 
 works, but I lose precision on the Number - it won't save 
decimals.  It 
 acts weird - when I type a decimal, it takes it, then backs it out 
if I 
 type more numbers.  
 
 I'm stuck on this conversion of the TextInput to a Number.  Do you 
have 
 to convert the TextInput to a Number via a function?  Can someone 
 clue me in?
 
 Thanks -joe





[flexcoders] Re: Flash/Flex and EXE

2007-06-09 Thread Doug Lowder
I don't think the Projector approach will work for your case.  I know 
with AS2, the browser was required for remoting calls using 
HTTPService and the like, and I haven't heard of anything changing 
with AS3.  It should be simple enough to test if you want to be 
absolutely sure.

--- In flexcoders@yahoogroups.com, André Rodrigues Pena 
[EMAIL PROTECTED] wrote:

 Hi, thanks for your reply Doug and Brendan.
 
 what about the sandbox? I need to access resources in the web. Is it
 possible to build an EXE application capable of that? I know I can 
do it
 with Apollo, but I'm thinking of a compiled approach
 
 On 6/8/07, Brendan Meutzner [EMAIL PROTECTED] wrote:
 
And then there are more powerful tools like Zinc :
  http://www.multidmedia.com/software/zinc/
 
 
  Brendan
 
 
  On 6/8/07, Doug Lowder [EMAIL PROTECTED] wrote:
  
 From the standalone Flash Player, you can select File-Create
   Projector... to create a .exe.
  
   --- In flexcoders@yahoogroups.com flexcoders%
40yahoogroups.com, André
   Rodrigues Pena
   andre.ufrj@ wrote:
   
Hello all,
I remember that when I programmed in Flash 8/AS2 there was a 
way I
could compile the movie into an EXE file.
My question is: Can I convert AS3 applications 
(Flex/Flash/Apollo)
into an EXE file?
thanks
   
--
André Rodrigues Pena
   
LOCUS
www.locus.com.br
   
  
  
 
 
  --
  Brendan Meutzner
  Stretch Media - RIA Adobe Flex Development
  [EMAIL PROTECTED]
  http://www.stretchmedia.ca
   
 
 
 
 
 -- 
 André Rodrigues Pena
 
 LOCUS
 www.locus.com.br
 
 Blog
 www.techbreak.org





[flexcoders] Re: Flex 1.5 dispatchEvent and addEventListener question

2007-06-09 Thread Doug Lowder
Hi Dave,

Are you getting an error with the addEventListener() call, or are you 
just not able to detect the event? The call looks correct so I don't 
see why that wouldn't work.  Also, if you are creating your 
components in mxml with mx:Repeater, you should be able to define 
the event handler in the declaration with 
eventThrown=myCompEventThrown(event.target).  Maybe you could post 
some code illustrating the problem.

--- In flexcoders@yahoogroups.com, Dave Turner [EMAIL PROTECTED] wrote:

 Hello 
 
 I am working on a 1.5 project and i have an mxml page that creates 
an
 Array of Components.  These Components are basically a Container 
that
 holds a few form elements. 
 
 if one of these components dispatches an event how would i set up 
the
 parent page to listen for the dispatched event?
 
 I have been able to successfully capture an event when i utilize the
 id attribute of the component but because its an array of objects 
in
 this case i cannot do that.  
 
 for instance i cannot do this.. 
 thing.addEventListener(eventThrown, Delegate.create(this, 
onEvent));
 
 Ive tried referencing the Repeater that generates the Array of 
Objects
 but that does not detect the event.. 
 
 I know this wouldn't be a problem in 2.x but I am unable to get the
 parent to detect the thrown event in 1.5.
 
 Any help with this matter would be greatly appreciated.
 
 thanks, 
 Dave





[flexcoders] Re: Flash/Flex and EXE

2007-06-09 Thread Doug Lowder
Interesting... The projector exe I created from my Flex 1.5/AS2 app 
runs fine up until I try to access a feature that makes a remote 
object call, and then the calls never return.  I thought it was 
because Flex 1.5 required a server.  Is that a distinction between 
Flex 1.5 as opposed to just AS2?

--- In flexcoders@yahoogroups.com, Muzak [EMAIL PROTECTED] wrote:

 I know with AS2, the browser was required for remoting calls using
 HTTPService and the like
 
 That is not correct.
 You can make remote calls/access resources on the web just fine 
from a standalone projector or an .exe created with a 3rd party 
 wrapper (like Zinc).
 
 regards,
 Muzak
 
 - Original Message - 
 From: Doug Lowder [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Saturday, June 09, 2007 5:04 PM
 Subject: [flexcoders] Re: Flash/Flex and EXE
 
 
 I don't think the Projector approach will work for your case.  I 
know
 with AS2, the browser was required for remoting calls using
 HTTPService and the like, and I haven't heard of anything changing
 with AS3.  It should be simple enough to test if you want to be
 absolutely sure.
 
 --- In flexcoders@yahoogroups.com, Andr Rodrigues Pena
 andre.ufrj@ wrote:
 
  Hi, thanks for your reply Doug and Brendan.
 
  what about the sandbox? I need to access resources in the web. Is 
it
  possible to build an EXE application capable of that? I know I can
 do it
  with Apollo, but I'm thinking of a compiled approach
 
  On 6/8/07, Brendan Meutzner bmeutzner@ wrote:
  
 And then there are more powerful tools like Zinc :
   http://www.multidmedia.com/software/zinc/
  
  
   Brendan
  
  
   On 6/8/07, Doug Lowder douglowder@ wrote:
   
  From the standalone Flash Player, you can select File-
Create
Projector... to create a .exe.
   
--- In flexcoders@yahoogroups.com flexcoders%
 40yahoogroups.com, Andr
Rodrigues Pena
andre.ufrj@ wrote:

 Hello all,
 I remember that when I programmed in Flash 8/AS2 there was a
 way I
 could compile the movie into an EXE file.
 My question is: Can I convert AS3 applications
 (Flex/Flash/Apollo)
 into an EXE file?
 thanks

 --
 Andr Rodrigues Pena

 LOCUS
 www.locus.com.br





[flexcoders] Re: Standalone Flash Player

2007-06-09 Thread Doug Lowder
I used the one in the Flex2 SDK install: 
SDK/Player/debug/SAFlashPlayer.exe

--- In flexcoders@yahoogroups.com, André Rodrigues Pena 
[EMAIL PROTECTED] wrote:

 Hi guys,
 I'm trying to download the standalone player for Flash 9 so that I can
 create Projector files but I simply can't find the page to download it
 help me please
 
 -- 
 André Rodrigues Pena
 
 LOCUS
 www.locus.com.br





[flexcoders] Re: Caching issue in HTTPService

2007-06-08 Thread Doug Lowder
On the *server*, set the Cache-Control header to max-age=0, must-
revalidate to disable caching of the resource.  Most server-side 
technologies (PHP, JSP, etc.) will allow you to specify header 
values.  The headers of the response, not the request, are what 
control client-side caching, which is why you need to set the values 
on the server instead of in the client-side HTTPService request.

Search the archives for Cache-Control and you'll find plenty of posts 
on the subject.  I remember seeing exampples for JSP, PHP, and CF.

--- In flexcoders@yahoogroups.com, Guido [EMAIL PROTECTED] wrote:

 Is there a way to specify the HTTPService to no-cache mode? If I 
access the
 URL with a browser I can get the *real* destination with CTRL+F5... 
I don't
 know how to make an HTTPService use this kind of request; I don't 
even know
 if it is possible. Anyone?
 
 On 6/7/07, Christopher Olsen [EMAIL PROTECTED] wrote:
 
Yeah from my experiences with the flash player it appears that 
it uses
  the browser for network connections to fetch files... and the 
browser
  does the caching
  I have a poor workaround i modify the httpservice url and keep 
appending
  a timestamp to the url but there must be a better way?
 
  -Christopher
 
  Guido wrote:
  
   I've had the same issue and I wasn't able to bypass it. In my 
case, I
   access an XML file throug HTTPService, and I always get the 
same XML
   even if I modify (or even delete!) the file from the server
  
   On 6/7/07, *Christopher Olsen* [EMAIL PROTECTED]cwolsen%
40domainatlantic.com
   mailto:[EMAIL PROTECTED] cwolsen%40domainatlantic.com
  wrote:
  
   Anyone ever have an issue where an HTTPService result gets 
cached?
  
   I'm use an httpservice to call a script which generates html 
however
   after the time run it's always returning the same results the 
*data*
   appears to be cached
  
   -Christopher
  
  
  
 
   
 





[flexcoders] Re: Flash/Flex and EXE

2007-06-08 Thread Doug Lowder
From the standalone Flash Player, you can select File-Create 
Projector... to create a .exe.

--- In flexcoders@yahoogroups.com, André Rodrigues Pena 
[EMAIL PROTECTED] wrote:

 Hello all,
 I remember that when I programmed in Flash 8/AS2 there was a way I
 could compile the movie into an EXE file.
 My question is: Can I convert AS3 applications (Flex/Flash/Apollo)
 into an EXE file?
 thanks
 
 -- 
 André Rodrigues Pena
 
 LOCUS
 www.locus.com.br





[flexcoders] Re: how to eliminate the grey background of a disabled TileList

2007-06-05 Thread Doug Lowder
Try:

  mx:TileList selectionDisabledColor=0xFF ... /

TileList inherits that style from ItemList.

--- In flexcoders@yahoogroups.com, Erik Price [EMAIL PROTECTED] wrote:

 Hi,
 
 Caveat: this question is for a Flex 1.5 app.
 
 Question: How do I prevent the TileList from creating a grey
 background color when I set enabled=false ?
 backgroundDisabledColor doesn't seem to apply to the selected 
item.
 
 What I have done so far:  In my app I have a TileList component, 
whose
 background color is normally #FF, that I have disabled by 
setting
 its enabled property to false in the MXML file.  This resulted 
in
 the entire TileList having a grey color over (or under) it, which is
 the default behavior for a disabled TileList.  I found the
 backgroundDisabledColor and set it to #FF, which ALMOST 
solves
 the problem.  The remaining issue is that the currently selected 
item
 in the TileList still has the grey background.  So, to paint a 
picture
 of what it looks like, my disabled TileList has a white background 
for
 all of the cells except the one that is selected.
 
 Any advice you can provide would be gratefully appreciated.
 
 Erik





[flexcoders] Re: 1.5 : components can't be cached ??

2007-06-04 Thread Doug Lowder
Old thread, but I just ran into this recently as well so thought I'd 
share.

Turns out the /WEB-INF/flex/generated directory in the Flex install 
area was not writable by the tomcat user.  Making that directory 
writable by tomcat got rid of the log messages.


--- In flexcoders@yahoogroups.com, Antoine Malpel [EMAIL PROTECTED] wrote:

 Hi there,
 
 I use Flex 1.5 /Tomcat 5.5 and I noticed that in my 
 {appRoot}/WEB-INF/flex/log/flex{x}.log there is thse messages :
 
 03/07 15:37:15 INFO Cached Component Loader: component Contact 
cannot be 
 cached.
 03/07 15:37:15 INFO Cached Component Loader: component BasDePage 
cannot 
 be cached.
 03/07 15:37:15 INFO Cached Component Loader: component CustomLycra 
 cannot be cached.
 03/07 15:37:15 INFO Cached Component Loader: component 
thumbnailProduct 
 cannot be cached.
 etc
 
 
 these components refers to all my mxml and as files I use in my 
 Application ...
 
 Does this mean my 'application' is compiled every time a client 
connect 
 to my App ?
 How can I resolve this, and can't find any information about that 
in 
 macromedia's doc ...
 (please Adobe continue support for Flex 1.5 as Flash 9 player is 
not 
 well diffused now)
 
 I've check the configuration files and except the fact I use 
production 
 mode to false (as I may set new versions sometimes without wanting 
to 
 restart my tomcat server)
 but everything else seems ok in my flex-config.xml
 
 for example :
 
 cache
 !-- cache compiled custom components as swo files --
 cache-swostrue/cache-swos
 
 !-- content cache for dynamically generated SWF, SWD, and 
HTML --
 content-size500/content-size
 
 !-- source cache for dynamically generated MXML (from 
JSP) --
 mxml-size500/mxml-size
 
 !-- force a check for validation of page freshness every 
XX 
 seconds --
 http-maximum-age1/http-maximum-age
 
 !-- check for changes to dependent files on disk every XX 
 seconds --
 !-- when production-mode is true, the file watcher runs 
once at 
 startup --
 file-watcher-interval1/file-watcher-interval
 /cache
 
 thanks if someone could clear my mind about this issue
 
 Antoine Malpel





[flexcoders] Re: How do you generate inactive icon states

2007-05-17 Thread Doug Lowder

ColorMatrixFilter is the right track.  Have a look at this:

http://www.ifbin.com/news/2005/09/flash-8-flashfilterscolormatrixfilter.\
html
http://www.ifbin.com/news/2005/09/flash-8-flashfilterscolormatrixfilter\
.html

Setting the RGB lists to [0.2, 0.2, 0.2, 0.2, 0] for each gives a nice
greyed-out appearance, and then you can adjust the alpha to suit.


--- In flexcoders@yahoogroups.com, Lincoln Mitchell [EMAIL PROTECTED]
wrote:

 There doesn't appear to be a grayscale filter. However, BlendMode and
 ColorMatrixFilter sound promising. I am I on the right track?



 Linc



 _

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of Petro Bochan
 Sent: Thursday, 17 May 2007 5:29 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] How do you generate inactive icon states



 ?xml version=1.0 encoding=utf-8?

 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 creationComplete=init(); layout=absolute

 mx:Script

 ![CDATA[

 private var pLoader:Loader;

 private var pUrl:URLRequest;



 private function init():void {

 pLoader = new Loader();

 pUrl = new URLRequest();



 pUrl.url =
 http://rols.ramesys.com/images/Ramesys/Adobe/Adobe-Logo.jpg;;


 pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
onLoadComplete);

 pLoader.load(pUrl);

 }



 private function
 onLoadComplete(anEvet:Event):void {

 var
 vDropShadowFilter:DropShadowFilter = new DropShadowFilter();



 pLoader.alpha = .5;

 pLoader.filters =
 [vDropShadowFilter];



 theStage.addChild(pLoader);

 }

 ]]

 /mx:Script



 mx:SWFLoader id=theStage height=100% width=100%/

 /mx:Application



 _

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of Lincoln Mitchell
 Sent: Thursday, May 17, 2007 11:43 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How do you generate inactive icon states



 I am trying to generate an inactive icon state from an original color
png
 file. It needs to be 50% alpha=0.5 and grey scale.

 Can this be done in code, if so how?

 TIA

 Linc





[flexcoders] Re: Filtering Best Practices Question

2007-05-17 Thread Doug Lowder
If your list is already sorted, the performance of a binary search is 
pretty hard to beat.  It'd probably still be a good choice even if 
you have to perform the sort first.

You could also check out an associative array or dictionary, but I 
don't know how well that will perform with thousands of properties.  
One iteration through the first list to build the array, then a 
single check to find an item.


--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 The server I am running on is a 900mhz machine while the desktops at
 work are 3.0 Pentium 4s.  I figured client side would be quicker.
 
 I am filtering off on a string.  I there wasn't a nice computer
 sciencey way to do it I was going to use pointers to jump around in
 the sorted list.  
 
 Any one else have any ideas?
 
 
 --- In flexcoders@yahoogroups.com, Bjorn Schultheiss
 bjorn.schultheiss@ wrote:
 
  With a complex objects list this is difficult.
  I would suggest doing it server side.
  
  If the lists contained numerical or string items  you could rely 
on  
  sorting to make your iteration process shorter.
  
  
  Bjorn
  
  
  On 17/05/2007, at 4:36 AM, Nate Pearson wrote:
  
   What's the best practice when you have to compare two large 
lists? My
   main list is 9000 objects long. I have to compare this to 
another
   list which might have 4000 objects in it.
  
   Right now I'm doing it the WRONG way. For each row in the Main 
list i
   iterate through every item in the 4000 objects. As soon as I 
hit a
   match I return a true and that exits the iteration. This is 
still a
   very slow process.
  
   Both lists are dynamic.
  
   Any ideas on the right way to do this?
  
   Thanks,
  
   Nate
  
  
  
 





[flexcoders] Re: Require urgent help

2007-05-10 Thread Doug Lowder
There is a gauge component for Flex 1.5 on Peter Ent's blog.  The 
principles should be the same for Flex 2.

http://weblogs.macromedia.com/pent/images/GaugeSamples.jpg

Source:
http://weblogs.macromedia.com/pent/archives/flex/solutions/gaugeCompon
ent.zip

http://weblogs.macromedia.com/pent/archives/2004/12/gauge_component.cf
m

--- In flexcoders@yahoogroups.com, Rajesh Deshmukh 
[EMAIL PROTECTED] wrote:

 Hi All,
 
  
 
 I am new to this group.
 
 I have a small problem which I need to resolve as soon as possible.
 
 I am working for one project where I need to implement the Meter in 
an
 application for Flex.
 
 It's like I am having some dynamic data (which changes on the user
 interaction).
 
 I am having a meter init which is like we have for our vehicles.
 
 It changes as per the user interaction.
 
 I am confused over it about how to implement it.
 
 Whether I can do it in Flex? If yes how can I do that?
 
 Or will I have to take help for some other applications.
 
 Please help me as soon as possible.
 
  
 
 Waiting for your replies...
 
  
 
 Regards,
 
 Rajesh Deshmukh





[flexcoders] Re: I need a display suggestion.

2007-05-09 Thread Doug Lowder

Instead of changing the alpha property, what about using something like
ColorUtil.adjustBrightness() on the color style to fade the canceled
events?

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
http://www.adobe.com/2006/mxml 

 mx:Script
 ![CDATA[
 import mx.utils.ColorUtil;
 [Bindable]
 private var lblColor: uint = 0x202020;
 ]]
 /mx:Script

 mx:Label text=Normal text color={lblColor} /
 mx:Label text=De-emphasized text
color={ColorUtil.adjustBrightness(lblColor, 90)}/

/mx:Application

--- In flexcoders@yahoogroups.com, Ian Skinner [EMAIL PROTECTED] wrote:

 I have been working on a calendar of events flex application as most
 anybody who monitors these flex lists probably has noticed. This is a
 reworking of an existing [D]HTML/CFML application. Part of the current
 display is that canceled events are displayed with a strike-through
text
 decoration.

 I am trying to convey this same information in the flex version. I
have
 tried using a strike-through decoration, but my attempts to use
htmlText
 functionality in flex did not produce any results. I then tried to use
 the alpha property to fade the canceled events. After embedding a font
 so that the alpha effect would take effect, the results where less
then
 desirable, it was just not clear enough.

 Any suggestions on a simple but effective way to display the canceled
 events? It should be noted that the events are color coded to indicate
 which of four areas to which they belong. This color coded information
 needs to be maintained for canceled events and I am reluctant to try
and
 create four canceled colors. This is a quite a colorful, busy,
 information packed screen as it is.

 Is there an easy way I could apply an image/graphic/effect to create
 some kind of diagonal lines mask/background of the box containing the
 canceled drive information?





[flexcoders] Re: I need a display suggestion.

2007-05-09 Thread Doug Lowder

So true.  A very quick and dirty starting point: StrikeLabel.mxml

?xml version=1.0 encoding=utf-8?
mx:Label xmlns:mx=http://www.adobe.com/2006/mxml
http://www.adobe.com/2006/mxml  creationComplete=drawStrike()

 mx:Script
 ![CDATA[
 import flash.display.Graphics;

 private function drawStrike() : void {
 var g: Graphics = graphics;
 g.clear();
 g.lineStyle(0, 0, 1);
 g.moveTo(0, height / 2);
 g.lineTo(width, height / 2);
 }
 ]]
 /mx:Script

/mx:Label


In the app, use StrikeLabel text=Strikethrough text / along with
xmlns=* in the Application tag.  Like I said, it's a starting point so
you'll probably want to set the line color, alpha, width, height, etc.
as appropriate.


--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 Yes. Even if, like me, you are not a Flash/graphics guy, do not be
 afraid of the graphics class. It is amazingly simple to add lines to
 controls and to otherwise extend them visually. I just created some
 components that can conditionally be put in an editable state which
 shows a border using the graphics class, and adds several buttons and
a
 drag handle header (a Canvas, if you can believe that!), all tacked
onto
 the control using addChild. Just amazing.



 I started using some code posted by Alex Harui here on flexcoders for
a
 component named CloseResizeImage. I also posted some of my own
 modifications to thaqt code on flexcomponents, under the subject,
 Extend Image, add button, resize handle.



 A graphics line through your display text sounds like the simplest
 approach.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of Douglas Knudsen
 Sent: Wednesday, May 09, 2007 1:07 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] I need a display suggestion.



 I'm going to answer in a popular way around here, write a custom
 component. Assuming its possible in Flash 9, It would not be too hard
 to write say IanLabel.as that extends Label.as adding a publicly
 accessible boolean flag strikethrough. Over ride one of the methods,
 which is not so clear to me at the moment sorry got deadlines, adding
a
 check
 if( strikethrough) {
 ///use graphics api to draw a line
 }

 There's not huge amount of literature on custom component yet, but the
 Adobe one 'Creating and Extending Flex Components' is available and
 free. I'm far from a master on this topic, but squeezing in what I can
 between deadlines. HTH!


 DK

 On 5/9/07, Ian Skinner [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:

 You will soon learn not to listen to carefully to UI advice from me,
but
 how about an alpha'd Cancelled diagonally across the text?



 Well, using the word Cancelled may be a bit of a sell. But I presume
 if I could get the word to be alph'd across the text, I could also
do
 that with a diagonal line graphic or other options.



 What I need is a basic suggestion on how to do this? How do I
 conditionally add something on top | under | through a given event box
 based on the status property of the event element in the array
 collection.





 Confidentiality Notice: This message including any attachments is for
 the sole use of the intended recipient(s) and may contain confidential
 and privileged information. Any unauthorized review, use, disclosure
or
 distribution is prohibited. If you are not the intended recipient,
 please contact the sender and delete any copies of this message.



 -- Forwarded message --
 From: Alex Harui [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ,
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 Date: Wed, 9 May 2007 09:35:17 -0700
 Subject: RE: [flexcoders] I need a display suggestion.

 You will soon learn not to listen to carefully to UI advice from me,
but
 how about an alpha'd Cancelled diagonally across the text?



 

 From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com
 http://yahoogroups.com ] On Behalf Of Ian Skinner
 Sent: Wednesday, May 09, 2007 9:28 AM
 To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ;
 flexcoders@yahoogroups.com
 Subject: [flexcoders] I need a display suggestion.

 I have been working on a calendar of events flex application as most
 anybody who monitors these flex lists probably has noticed. This is a
 reworking of an existing [D]HTML/CFML application. Part of the current
 display is that canceled events are displayed with a strike-through
text

 decoration.

 I am trying to convey this same information in the flex version. I
have
 tried using a strike-through decoration, but my attempts to use
htmlText

 functionality in flex did not produce any results. I then tried to use
 the alpha property to fade the canceled events. After embedding a font
 so that the alpha effect would take effect, the results 

[flexcoders] Re: Pin a single child element to the bottom of a parent VBox?

2007-05-07 Thread Doug Lowder
One way you could do this is with a Spacer before the last child box to 
push it to the bottom.  Nice 'n' easy in static mxml.

mx:Spacer height=100% /

--- In flexcoders@yahoogroups.com, Ian Skinner [EMAIL PROTECTED] wrote:

 Is this possible in a standard 'vertical' layout VBox, or does one 
have 
 to go 'absolute' layout?
 
 I have a VBox displaying 1-N child boxes, and I want one to be pinned 
to 
 the bottom.  Is this possible or do I need to wrap an absolute layout 
 around this?





[flexcoders] Re: Actionscript - copy constructor/ assignment operator question

2007-05-04 Thread Doug Lowder
The String class does that though, doesn't it?  For example, 

var sid1 :String = new String(ID_101-102-103);
var sid2 :String = ID_101-102-103;
var sid3 :String = new String(sid1);

are all legal.  Maybe there is a reason why String can't be extended 
(I haven't tried it), but it might be worth looking into.


--- In flexcoders@yahoogroups.com, Michael Schmalle 
[EMAIL PROTECTED] wrote:

 Hi,
 
  var sid2 :StringId = ID_101-102-103;
 
 There is no way you can do that. AS3 uses typing and that is all 
you are
 doing.
 
 The  is the string constructor and there is no way to change that.
 
 If I understand what you are asking there is something you can use 
so you
 don't have to use toString().
 
 
 public function StringId(stringId :Object)
 {
if (stringid is StringId)
   this.guid = stringId.toString();
else if(stringid is String)
   this.guid = stringid;
else
   throw new Error(Incorrect argument type. Must be of type 
String or
 StringId);
 }
 
 
 On 5/4/07, Sebastian Feher [EMAIL PROTECTED] wrote:
 
I need a class that contains one string that has some 
constrains when
  is created.
 
  package mypackage
  {
  public class StringId
  {
  private var stringId :String;
 
  public function StringId(stringId :Id)
  {
  this.guid = stringId;
  }
  }
  }
 
  This works fine:
  var sid1 :StringId = new StringId(ID_101-102-103);
 
  but I would like to be able to type also:
  var sid2 :StringId = ID_101-102-103;
 
  and:
  var sid3 :StringId = new StringId(sid1);
 
  Is there any copy constructor / assignment operator / multiple
  constructors trick that I can use?
 
  The last one I can either replace with:
  var sid3 :StringId = new StringId(sid1.toString());
 
  or have the constructor make the distinction between the String 
and
  StringId being passed in.
 
  Any ideas/hints ?
 
  Thanks,
  Sebastian
 
   
 
 
 
 
 -- 
 Teoti Graphix
 http://www.teotigraphix.com
 
 Blog - Flex2Components
 http://www.flex2components.com
 
 You can find more by solving the problem then by 'asking the 
question'.





[flexcoders] Re: how manipulate servlet image stream

2007-05-02 Thread Doug Lowder
Hi,

In your mxml application, simply use:

mx:Image source=http://localhost:8080/seamservices/GetImage; /

Of course, you'll need to change localhost to the server name if 
you want to be able to access the image from somewhere other than the 
local host system.

--- In flexcoders@yahoogroups.com, lruinelli [EMAIL PROTECTED] wrote:

 Hello,
 
 I have a servlet which return a stream of a jpg image:
 
 ...the url is the following: 
http://localhost:8080/seamservices/GetImage
 
 Using this url in a browser the image is correctly loaded!
 
 How can I load the image form a flex client?
 
 
 ...thanks!
 Saluti 
 Lorenzo





[flexcoders] Re: Is it possible to buile a parameter list programatically

2007-04-26 Thread Doug Lowder
Sounds like you may be able to use ...rest for that.
http://livedocs.adobe.com/flex/201/langref/statements.html#..._(rest)
_parameter


--- In flexcoders@yahoogroups.com, hank williams [EMAIL PROTECTED] 
wrote:

 I want to call a function, call it foo in a circumstance where, 
at compile
 time, I dont know what the parameters to foo are going to be. In 
the past
 perhaps I could have used something like Eval to construct the 
call, but
 that is no longer available.
 
 As an example, in one circumstance I might want to call:
 
 foo(a);
 
 and in another circumstance I would want to call
 
 foo(a,b)
 
 but in each case the exact number of parameters is indeterminate 
and must be
 constructed on the fly. Unfortunately, I cannot pass an array into 
foo, I
 must actually have an independent parameter for each passed value.
 
 Any ideas?
 
 Thanks,
 Hank





[flexcoders] Re: Setting the $title field in index .template.html

2007-04-26 Thread Doug Lowder
You can set it via the pageTitle property of the Application tag.  Are 
you specifically looking for something other than that?


--- In flexcoders@yahoogroups.com, simonjpalmer [EMAIL PROTECTED] 
wrote:

 where do I set the field $title which is referred to at the top of the
 template filed used to generate index.html?





[flexcoders] Re: Extending a component

2007-04-25 Thread Doug Lowder
All you need to do is have your MXML component reference the class 
you want to extend and set the XML namespace to the extended class's 
location.  For example, if your resizable title window class 
is ./mycomponents/ResizableTitleWindow.as, you could have:

mine:ResizableTitleWindow xmlns:mine=mycomponents.* ...
...
/mine:ResizableTitleWindow

OR:

ResizableTitleWindow xmlns=mycomponents.* ...
/ResizableTitleWindow

If ResizableTitleWindow.as is in the same directory as your 
application, then the namespace location to use is simply *.

BTW, this is the same thing that happens when you declare something 
like mx:TitleWindow .../.  TitleWindow.as is an AS3 file in the mx 
namespace that extends Panel (defined in Panel.as).  Also, I don't 
think it matters if the class you are extending is defined in AS or 
MXML; either should be fine.

HTH,
Doug

--- In flexcoders@yahoogroups.com, André Rodrigues Pena 
[EMAIL PROTECTED] wrote:

 Hi all,
 
 My problem is:
 
 I have a MXML component (already implemented) that extendeds 
TitleWindow
 
 its code was something like
 
 ListOperations.mxml
 
 ?xml version=1.0 encoding=utf-8?
 mx:TitleWindow
   xmlns:mx=http://www.adobe.com/2006/mxml;
   layout=vertical
   width=700
   height=400
   title=List Operations
   showCloseButton=true
   initialize=init()
 
 MY CODE HERE
 /mx:TitleWindow
 
 OK, but I needed a resizable TitleWindow, so I took a look in google
 and I found an actionscript implementation of TitleWindow that 
allows
 resizing, so I made some modifications and finally I got exactly 
what
 I was looking for.
 
 Although I still have a problem. I have my own TitleWindow
 implementation but now I need my MXML component above to extend MY
 TITLEWINDOW, which is in AS3 shape, not the standard TitleWindow.
 
 Is there a way to do this? Or will I be forced to re-implement my
 component extending my own TitleWindow?
 
 Thanksss
 
 -- 
 André Rodrigues Pena
 
 LOCUS
 www.locus.com.br





[flexcoders] Re: Open new browser popup

2007-04-25 Thread Doug Lowder
If you have access to the server, you can write a server-side page 
that wraps your service logic and bitstreams the pdf content directly 
to the client.  In Flex, access the server-side page with 
navigateToURL(), ExternalInterface, URLLoader(), etc.  With the right 
headers and content-type set on the server-side page, you can have 
the user see a dialog that will allow them to launch their PDF viewer.

--- In flexcoders@yahoogroups.com, Peter [EMAIL PROTECTED] 
wrote:

 Gentlepeople,
 
  
 
 Related to this, would there be a way to redirect the output of
 HTTPService to a new browser window.
 
  
 
 I have a service that is invoked through HTTPService and that 
generates a
 pdf. I would like to return that pdf on the HTTPService call, but I 
am not
 sure who I can then invoke the pdf viewer on the client machine.
 
  
 
 Thanks,
 
  
 
 Peter
 
  
 
   _  
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Jaap Cammeraat
 Sent: Monday, April 23, 2007 11:36 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Open new browser popup
 
  
 
 Thanks, this is working!
 
  
 
 Regards,
 
 Jaap
 
  
 
 Op 23-apr-2007, om 9:44 heeft Roman Protsiuk het volgende 
geschreven:
 
 
 
 
 
  
 http://skovalyov.blogspot.com/2007/01/how-to-prevent-pop-up-
blocking-in.htm
 l This might help you.
 
 R.
 
 On 4/23/07, Jaap Cammeraat   mailto:[EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
 
 Thanks for your answer, but it isn't working in Flex201.
 
 Is there another example of opening a popupwindow?
 
 eorgia; font-size: 13px; line-height: 15px; 
 
  
 
  
 
  
 
 Op 20-apr-2007, om 14:38 heeft ramp_of_remo het volgende geschreven:
 
 
 
 
 
 --- In  mailto:flexcoders%40yahoogroups.com 
flexcoders@yahoogroups.com,
 Jaap Cammeraat flexcoders@ ... 
 wrote:
 
  Hi all,
   Can somebody tell me how I can open a sized window in the users 
 browser?
  At this moment I'm using navigateToURL( u,_blank) to font-
family:
 Georgia; font-size: 13px; line-height: 15px; new
 
 
  window but I want a new window with special sizes.
  
  Regards,
  Jaap Cammeraat
 
 
 Hi Jaap,
 
 Wish the following code snippet will be a solution for your 
question.
 
 ?xml version=1.0 encoding=utf-8? 
 mx:Application xmlns:mx= http://www.macromedia.com/2003/mxml
 http://www.macromed http://ia.com/2003/ ia.com/2003/ mxml 
 mx:Script![CDATA[ 
 private function openNewBrowser( ):Void 
 { 
 var sURL:String = 'javascri SPAN,null,' + 
 taArguments.text + ');void(0);'; 
 getURL(sURL); 
 }// 
 ]]/mx: 
 mx:TextArea id=taArguments width=200 height=100 
 text=height=200,width= 
400,status=yes,toolbar=no,menubar=no,location= 
 no / 
 mx:Button label=Open new Browser Window 
 click=openNewBrowser() /
 
 
 
 
 Cheers,
 Mahesh Reddy.





[flexcoders] Re: Open new browser popup

2007-04-25 Thread Doug Lowder
On the client side (Flex), take a look at URLLoader and URLRequest in 
the docs.  URLRequest has a method property that you can set 
to POST to fit your needs.

For the server side, here is an example in JSP (ignore the 
HTTPService portion) that is close to what you will need:
http://tech.groups.yahoo.com/group/flexcoders/message/43818
And something similar for PHP:
http://tech.groups.yahoo.com/group/flexcoders/message/16370

Take notice of the content-type and content-disposition header, and 
be sure to handle any exceptions that may occur.  If your server-side 
page accepts GET as well as POST, you can easily test it by typing 
the URL into a browser; once that works it's just a matter of hooking 
it up to the URLLoader in your Flex app.  One round-trip instead of 
two, a nice dialog with Open and Save options for the end-user, 
and as long as you can deal with the pdf as a stream instead of a pre-
created file, no leftover temp files to clean up.

--- In flexcoders@yahoogroups.com, Peter [EMAIL PROTECTED] 
wrote:

 Thanks for the reply.
 
  
 
 In my case, I have to POST a bit of data to a servlet which will 
generate
 the pdf. On the server side I can basically do whatever it takes, 
but it is
 unclear to me what that is and it is even less clear what I need to 
do on
 the client side.
 
  
 
 For now I use a HTTPService post. This generates the pdf in a temp 
directory
 and returns a handle to this pdf file to the client. In a second 
request,
 the client invokes  (per the gentle help of the people in this 
thread)
 
  
 
 ExternalInterface.call(window.open, pdfUrl, _blank, );
 
  
 
 That basically gives me what I want, except for the fact that I 
need to save
 the pdf to a temp file and that it requires 2 requests to the 
server.
 
  
 
 Would any of your possible scenario's below get me where I want in 
one round
 trip?
 
  
 
 If so, would you be kind enough to give me a hint as how to proceed.
 
  
 
 Many thanks indeed!
 
  
 
 Peter
 




[flexcoders] Re: Code Behind Woes

2007-04-25 Thread Doug Lowder
Tracy, I'm assuming you have class MIPApplication defined in a file 
named MIPApplication.as.  The original poster was defining class 
myClass in file myClassBase.as, which I don't think will compile; 
correct?


--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 you cannot extend Application , no, you can defintely do this.  
The
 limitation is that the subclass can only appear at the root of an 
mxml
 file.
 
 I don't see what is wrong in the posted code.  This is an example 
tht is
 very similar and is working for me:
 
 ?xml version=1.0 encoding=utf-8?
 mipc:MIPApplication 
 xmlns:mx=http://www.adobe.com/2006/mxml;
 xmlns:mipc=MIPContainers.* 
 app={this} 
 mx:Style source=mip.css /
 /mipc:MIPApplication
 
 And MIPApplication.as starts off like this:
 package MIPContainers
 {
   import mx.core.Application;
 ...
 public class MIPApplication extends le_MIP
 {
 le_MIP is an mxml application.  Hmm, I am always extending an mxml
 application, not the Application class, I wonder if that is the
 difference?
 Tracy
 
 -Original Message-
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Dimitrios Gianninas
 Sent: Tuesday, April 24, 2007 11:47 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Code Behind Woes
 
 I believe Doug is right, you will have to make sure the name of your
 MXML component and AS class are different. But even at that, you 
cannot
 extend Application because by doing so it will not generate the
 appropriate hidden code at compile time to make your app work. What 
u
 should do is extends Box, Panel, etc... and then drop those into 
your
 app.
 
 Dimitrios Gianninas
 Optimal Payments Inc.
 
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com on behalf of Doug Lowder
 Sent: Tue 4/24/2007 5:37 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Code Behind Woes
  
 File name/class name mismatch?  I think you'll need to either 
change 
 your class name to myClassBase, or change the filename 
 to myClass.as.
 
 --- In flexcoders@yahoogroups.com, Jim Grinsfelder jim@ wrote:
 
  I'm confused again.  I read Ted's thing on Code Behind and got 
all 
 excited.
  
  
   
  
  Now I'm getting Unable to locate specified base 
 class 'app.myClass' for
  component class 'myClass' when I build the following:
  
   
  
   
  
  [file: myClassBase.as]
  
  package app
  
  {
  
  import mx.core.Application;
  
   
  
  public class myClass extends Application
  
  {
  
  }
  
  }
  
   
  
   
  
  [file: myclass.mxml]
  
  ?xml version=1.0 encoding=utf-8?
  
  app:myClass xmlns:app=app.* 
 xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=absolute
  
  
  
  /app:myClass
  
   
  
   
  
  What did I neglect to do?
 





[flexcoders] Re: encode +

2007-04-24 Thread Doug Lowder
How about encodeURIComponent(dude man+) ?  The + character, as well 
as some others, is a reserved character in URIs.

--- In flexcoders@yahoogroups.com, Jesse Warden [EMAIL PROTECTED] 
wrote:

 Weird... encodeURI does the same thing.  Check it:
 
 var str:String = encodeURI(dude man+);
 
 Notice that with encode or encodeURI, you'll get:
 
 dude%20man+
 
 ...bleh!  That dang + should be %2D instead.
 
 BTW, for background context, I'm first base64'ing some XML, and then
 encoding it to send as a GET request param.  If you know of a better
 way, I'm all ears.
 
 On 4/24/07, Jesse Warden [EMAIL PROTECTED] wrote:
  Nope.  I'm using encode.
 
  On 4/24/07, Michael Wills [EMAIL PROTECTED] wrote:
  
  
  
  
  
  
Are you using encodeURI? You may need to use 
encodeURIComponent instead.
   Just checking briefly on the JS versions.
  
Michael
  
Jesse Warden wrote:
  
  
  
   Running encode on a String seems to be missing the +. For 
example, a
space   becomes %20 like expected. But, a + is not becoming %
2D...
anyone know why?
  
  

 





[flexcoders] Re: encode +

2007-04-24 Thread Doug Lowder
Yes, that's it exactly and Adobe got it right.  The + is listed as a 
non-encoded character in the docs for encodeURI().  So what needs to 
be done is call encodeURIComponent() on the substring, which *will* 
encode the + since it isn't a non-encoded character for that 
function, and then tack that onto an encodeURI()'d string.

--- In flexcoders@yahoogroups.com, Paul DeCoursey [EMAIL PROTECTED] wrote:

 I think the problem is that the + should not be encoded. You must
 encode it before adding it to the URI.  It is a reserved character 
and
 it has special meaning in certain places in the URI.  It should not 
be
 encoded in those places.  As a result I am speculating that an 
encode
 function will not encode it.  An example of a special meaning is 
that
 it can be used in place of spaces in a URL, it is just as common to
 use %20 for a space, but a + is more readable.
 
 Paul
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
wrote:
 
  How about encodeURIComponent(dude man+) ?  The + character, as 
well 
  as some others, is a reserved character in URIs.
  
  --- In flexcoders@yahoogroups.com, Jesse Warden jesse.warden@ 
  wrote:
  
   Weird... encodeURI does the same thing.  Check it:
   
   var str:String = encodeURI(dude man+);
   
   Notice that with encode or encodeURI, you'll get:
   
   dude%20man+
   
   ...bleh!  That dang + should be %2D instead.
   
   BTW, for background context, I'm first base64'ing some XML, and 
then
   encoding it to send as a GET request param.  If you know of a 
better
   way, I'm all ears.
   
   On 4/24/07, Jesse Warden jesse.warden@ wrote:
Nope.  I'm using encode.
   
On 4/24/07, Michael Wills michael@ wrote:






  Are you using encodeURI? You may need to use 
  encodeURIComponent instead.
 Just checking briefly on the JS versions.

  Michael

  Jesse Warden wrote:



 Running encode on a String seems to be missing the +. For 
  example, a
  space   becomes %20 like expected. But, a + is not 
becoming %
  2D...
  anyone know why?


  
   
  
 





[flexcoders] Re: Help on the syntax for function set blah(param:String)

2007-04-24 Thread Doug Lowder
See:
http://livedocs.adobe.com/flex/201/html/basic_as_139_08.html#166714

Search for getter or setter on livedocs for more.


--- In flexcoders@yahoogroups.com, tjcox1969 [EMAIL PROTECTED] wrote:

 I have read the section on functions in the Adobe Programming
 Actionscript manual, but I see no reference to this type of syntax:
 
 [Bindable]
 public function set statesNames(value:ListCollectionView):void {
   _statesNames = value;
 }
   
 public function get statesNames():ListCollectionView {
   return _statesNames;
 }
 
 Can someone point me to some documentation on this or give a brief
 explanation.  I am looking at a sample I found and it works, but I
 want to know why and when to use this type of function set blah()
 syntax over function setBlah()
 
 Thanks!





[flexcoders] Re: Code Behind Woes

2007-04-24 Thread Doug Lowder
File name/class name mismatch?  I think you'll need to either change 
your class name to myClassBase, or change the filename 
to myClass.as.

--- In flexcoders@yahoogroups.com, Jim Grinsfelder [EMAIL PROTECTED] wrote:

 I'm confused again.  I read Ted's thing on Code Behind and got all 
excited.
 
 
  
 
 Now I'm getting Unable to locate specified base 
class 'app.myClass' for
 component class 'myClass' when I build the following:
 
  
 
  
 
 [file: myClassBase.as]
 
 package app
 
 {
 
 import mx.core.Application;
 
  
 
 public class myClass extends Application
 
 {
 
 }
 
 }
 
  
 
  
 
 [file: myclass.mxml]
 
 ?xml version=1.0 encoding=utf-8?
 
 app:myClass xmlns:app=app.* 
xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
 
 
 
 /app:myClass
 
  
 
  
 
 What did I neglect to do?





[flexcoders] Re: How to measure text?

2007-04-23 Thread Doug Lowder
I'm currently looking into using the TextLineMetrics class for this.  
If your object has a getLineMetrics() method, TextLineMetrics.width 
might be an option.

--- In flexcoders@yahoogroups.com, Shaun [EMAIL PROTECTED] wrote:

 Does anyone know of an equivalent to the TextFormat.getTextExtent() 
 method of AS2 in AS3?
 
 I have a fixed size box that I place text in.  If the text doesn't 
fit, 
 I want to programmatically adjust the font size so that it does (if 
 possible).
 
 So does anyone know a way of getting the size of a string of text 
that 
 accounts for the format/font of the text?
 
 Thanks,
 shaun





[flexcoders] Re: vSlider onRelease?

2007-04-18 Thread Doug Lowder
I think the change event is a better choice.  ThumbRelease won't fire 
if the slider value changes via keyboard interaction.

--- In flexcoders@yahoogroups.com, mapper2255 [EMAIL PROTECTED] wrote:

 found this: thumbRelease  Dispatches when the user releases the mouse 
 pointer after a thumbPress event occurs.
  
 
 --- In flexcoders@yahoogroups.com, mapper2255 mapper2255@ wrote:
 
  Hello,
  
  Can someone send me a link on using a vSlider to load up a Box with 
  new data? Would you use onRelease?
  
  Thanks.
 





[flexcoders] Re: problem with displaying data in the tree control

2007-04-17 Thread Doug Lowder
You didn't set the dataProvider property of the tree control.  Also, 
I think the XMLListCollection entity should be declared on its own 
rather than as a child of the tree.

mx:Tree x=0 y=0 id=tree height=294 width=230
creationComplete=newxmlHttp.send() labelFunction=treeLabel
visible=true labelField=@name dataProvider=dirxml

/mx:Tree

mx:XMLListCollection id=dirxml
source={newxmlHttp.lastResult.DirectoryTree.Directory}

/mx:XMLListCollection


--- In flexcoders@yahoogroups.com, paranoid_santhosh [EMAIL PROTECTED] 
wrote:

 
 I am having a problem in displaying  the data in tree control
 
 
 mx:HTTPService url=http://localhost:9090/Portalserver/newxml.jsp; 
 id=newxmlHttp useProxy=false method=POST 
showBusyCursor=true/
 
 //newxml.jsp is returning me this xml.
 
 DirectoryTree
 
 Directory Did=6 Dname=santhosh 
   File Fid=84 name=abcd /
   File Fid=85 name=efgh /
   File Fid=86 name=ijkl /
 
 /Directory
 
 
 Directory Did=7 name=java 
   File Fid=87 name=reflection /
   File Fid=88 name=container /
   File Fid=89 name=component /
 
 /Directory
 
 Directory Did=8 name=flex 
   File Fid=90 name=controls /
   File Fid=91 name=apollo /
   File Fid=92 name=asp /
 
 /Directory
 
 /DirectoryTree
 
 
 and in the mxml file...
 i have used.
 
 mx:Tree x=0 y=0 id=tree   height=294 width=230  
 creationComplete=newxmlHttp.send()   labelFunction=treeLabel 
 visible=true labelField=@name
 
 mx:XMLListCollection id=dirxml 
 source={newxmlHttp.lastResult.DirectoryTree.Directory}
   
 /mx:XMLListCollection
 
 /mx:Tree
 
 
 and in the action script i have written ..
 
 private function treeLabel(item:Object):String
 {
   if(item == null)
   Alert.show(item null);
 var node:XML = XML(item);
 if( node.localName() == Directory )
 
 return [EMAIL PROTECTED];
 else
 return [EMAIL PROTECTED];
 }





[flexcoders] Re: Flex crashes if no sound card present

2007-04-17 Thread Doug Lowder
Have you seen this thread?

http://tech.groups.yahoo.com/group/flexcoders/message/66211

--- In flexcoders@yahoogroups.com, Danko Kozar [EMAIL PROTECTED] 
wrote:

 This is a serious Flex bug! I run a Flex application on a corporate 
 computer that doesn't have a sound card and the application crashed. 
 Using Flash player debugging version I realized that the problem was 
 in playing sound.





[flexcoders] Re: problem with displaying data in the tree control

2007-04-17 Thread Doug Lowder
Time to debug.  Instead of binding the source of your XMLListCollection 
directly to the HTTPService result, use a result handler in your 
service.  Verify you are getting the XML you are expecting, and then 
you can go from there.

--- In flexcoders@yahoogroups.com, paranoid_santhosh [EMAIL PROTECTED] 
wrote:

 thanks a lot.. the errors have gone..
 
 but I am still not able to find out why the data is not getting 
 displayed in the tree.





[flexcoders] Re: PDF Preview

2007-04-16 Thread Doug Lowder
Related to option 2, you can use FlashPaper:

Batch Convert PDF files to FlashPaper 2
http://www.darronschall.com/weblog/archives/000250.cfm

How to load FlashPaper Documents in Flex 2
http://www.darronschall.com/weblog/archives/000249.cfm

--- In flexcoders@yahoogroups.com, Kevin [EMAIL PROTECTED] wrote:

 I know this has been asked before, but I haven't seen many 
solutions  
 posted.
 
 Is there a way to preview a PDF in Flex?  As far as I can tell 
there  
 are two possible options:
 
 1) Preview the PDF in an iFrame (Has anyone tried this? Does it 
work  
 cross platform?)
 
 2) Convert the PDF to SWF  load in Flex. (Is there existing 
server  
 code for this conversion? This seems rather processor intensive 
for  
 large PDF's)
 
 I am still struggling with printable document creation using 
Flex.   
 Has anyone heard whether Adobe is interested in building a basic  
 Print Preview Component (similar to the Acrobat Reader Plugin) for  
 Flex?  Seems like this would be a valuable asset to the Flex 
community.
 
 - Kevin





[flexcoders] Re: Problems using SSL

2007-04-13 Thread Doug Lowder
Credit for that solution goes to the guys at Cynergy.

The max-age value lets a cached version sit on the client for x 
seconds for cases where you want to read new data periodically, but 
not necessarily on every visit.  Perfect for my needs.

--- In [EMAIL PROTECTED], iko_knyphausen [EMAIL PROTECTED] wrote:

 
 First of all, thanks much to everyone for helping out. You saved me 
a
 lot of head-ache. I ended up with the latest suggestion from Doug
 
 Response.CacheControl = max-age=0, must-revalidate   (this is
 ASP/VBscript)
 
 This seems to do the trick ...
 -Iko
 
 
 --- In [EMAIL PROTECTED], Doug Lowder douglowder@ 
wrote:
 
  Ran into the same problem here. The root issue is a bug in some
  versions of IE. You can apply an MS patch at all clients (likely 
not
  a feasible solution), or set the cache-control header to max-
age=0,
  must-revalidate. That header seems to work across all browsers,
  with or without SSL.
 
  --- In [EMAIL PROTECTED], iko_knyphausen iko@ wrote:
  
  
   It works ok in FF but not in IE. Peter Farland kindly had a long
   exchange with me offline, and it seems in my case that the 
offending
   HTTP response is in the header pragma CacheControl = No-cache.
  Problem
   is, without the pragma I am not getting up-to-date data from my
   HTTPService requests.
  
   So the problem has been isolated, but not solved just yet.
  
  
   --- In [EMAIL PROTECTED], Tom Chiverton 
tom.chiverton@
   wrote:
   
On Sunday 08 Apr 2007, iko_knyphausen wrote:
 in relative URL calls. And I think it does, because the web 
site
   accepts
 both SSL and non-SSL, and the errors I am receiving don't 
happen
   when I
 load the same app from the same location without https.
   
Are you using IE ? Does Firefox work fine on the SSL site ?
If you use a network traffic sniffer, what is going on ?
   
   
--
Tom Chiverton
Helping to vitalistically administrate cutting-edge products
on: http://thefalken.livejournal.com
   

   
This email is sent for and on behalf of Halliwells LLP.
   
Halliwells LLP is a limited liability partnership registered 
in
   England and Wales under registered number OC307980 whose 
registered
   office address is at St James's Court Brown Street Manchester M2
  2JF. A
   list of members is available for inspection at the registered
  office.
   Any reference to a partner in relation to Halliwells LLP means a
  member
   of Halliwells LLP. Regulated by the Law Society.
   
CONFIDENTIALITY
   
This email is intended only for the use of the addressee named
  above
   and may be confidential or legally privileged. If you are not 
the
   addressee you must not read it and must not use any information
   contained in nor copy it nor inform any person other than
  Halliwells LLP
   or the addressee of its existence or contents. If you have 
received
  this
   email in error please delete it and notify Halliwells LLP IT
  Department
   on 0870 365 8008.
   
For more information about Halliwells LLP visit
  www.halliwells.com.
   
  
 





[flexcoders] Re: Evaluating JSON String

2007-04-13 Thread Doug Lowder
I believe you can use a for..in statement to access the property 
names.  Something like:

for (var name in myJsonObj) {
  trace(name +  :  + myJsonObj[name]);
}

http://livedocs.adobe.com/flex/201/langref/statements.html#for..in


--- In [EMAIL PROTECTED], eric_mahe [EMAIL PROTECTED] wrote:

 Hi all,
 
 I am using the com.adobe.serialization.json library to parse a 
dynamic
 JSON String like this one:
 {list:[1,2,3],valid:O,id:file}
 It's working pretty well.
 
 The JSON.decode method create an object in which one the  
(list,valid,
 id) are becoming dynamic variables:
 
 Object
   list = Array
 [0] = 1:Number
 [1] = 2:Number
 [2] = 3:Number
   valid = O:String
   id = file:String
 
 
 The problem is that i need to display the name of the variables 
names
 (list, valid, id in this case) and values in order to allow the user
 to change the values in a flex application.
 
 Have anyone experienced the same issue? Any Idea?
 Thanks for your help!
 
 P.S.: Note that the JSON string is dynamic, so i need to evaluate 
the
 names of the variables at runtime.
 
 Eric





[flexcoders] Re: timezone and dateformatter

2007-04-13 Thread Doug Lowder
That's correct though, isn't it?  If I'm a user in CST and I access 
your app on 4/30 at 9PM, I'd probably be wondering How could my LAST 
billing date be 5/1, which isn't until tomorrow?

But if that's what you want, you can add the timezone offset to the 
date being formatted.  If item.lastBillingDate is Date object, 

return df.format( new Date( item.lastBillingDate.getTime() + 
item.lastBillingDate.getTimezoneOffset()*6 ) );

Your Java code should be returning a date in UTC.  If it isn't, 
you'll have to adjust for that offset as well.


--- In [EMAIL PROTECTED], Dimitrios Gianninas 
[EMAIL PROTECTED] wrote:

 Just wondering if anyone experienced this, but we have a VO coming 
from Java that contains a date field. Well I format the field using 
the coe below:
  
 mx:DateFormatter id=df formatString=-MM-DD /
  
 private function displayLastBillingDate( item:Object, 
column:DataGridColumn ):String {
 
   return df.format( item.lastBillingDate );
 
 }
 
 And what happens is that this code works almost to well. It takes 
into account the end-users PC timezone! So the date coming back from 
the server is 2007-05-01 00:00:00, so for someone in EST it shows 
properly as 2007-05-01 (cause we are in EST) but for someone in CST 
is shows 2007-04-30... anything we can do about this? How do I get 
the end-user timezone setting ?
 
 Dimitrios Gianninas
 Developer
 Optimal Payments Inc.
  
 
 -- 
 WARNING
 ---
 This electronic message and its attachments may contain 
confidential, proprietary or legally privileged information, which is 
solely for the use of the intended recipient.  No privilege or other 
rights are waived by any unintended transmission or unauthorized 
retransmission of this message.  If you are not the intended 
recipient of this message, or if you have received it in error, you 
should immediately stop reading this message and delete it and all 
attachments from your system.  The reading, distribution, copying or 
other use of this message or its attachments by unintended recipients 
is unauthorized and may be unlawful.  If you have received this e-
mail in error, please notify the sender.
 
 AVIS IMPORTANT
 --
 Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés 
destinés au seul usage du destinataire visé.  L'expéditeur original 
ne renonce à aucun privilège ou à aucun autre droit si le présent 
message a été transmis involontairement ou s'il est retransmis sans 
son autorisation.  Si vous n'êtes pas le destinataire visé du présent 
message ou si vous l'avez reçu par erreur, veuillez cesser 
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces 
jointes, de votre système.  La lecture, la distribution, la copie ou 
tout autre usage du présent message ou de ses pièces jointes par des 
personnes autres que le destinataire visé ne sont pas autorisés et 
pourraient être illégaux.  Si vous avez reçu ce courrier électronique 
par erreur, veuillez en aviser l'expéditeur.





[flexcoders] Re: timezone and dateformatter

2007-04-13 Thread Doug Lowder
I thought the Player got the timezone from the underlying OS.

--- In [EMAIL PROTECTED], Douglas Knudsen 
[EMAIL PROTECTED] wrote:

 yes, we had big issues with a app in Flex 1.5 and now 2.0 because 
of this.
 We coded around it by massaging the dates in AS with the clients 
timezone
 offset.  Works well, except for those folks living in Arizona.  For 
some
 reason the Flash Player does NOT pick up their offset correctly.  
Outside of
 the Navajo Nation, Arizona does not follow day light savings, yet 
the Flash
 player seems to think they do.
 
 DK
 
 On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas 
 [EMAIL PROTECTED] wrote:
 
 Just wondering if anyone experienced this, but we have a VO 
coming from
  Java that contains a date field. Well I format the field using 
the coe
  below:
 
  mx:DateFormatter id=df formatString=-MM-DD /
 
  *
 
  private
  * *function* displayLastBillingDate( item:Object, 
column:DataGridColumn
  ):String {
 
  *  return* df.format( item.lastBillingDate );
 
  }
 
  And what happens is that this code works almost to well. It takes 
into
  account the end-users PC timezone! So the date coming back from 
the server
  is 2007-05-01 00:00:00, so for someone in EST it shows properly as
  2007-05-01 (cause we are in EST) but for someone in CST is shows
  2007-04-30... anything we can do about this? How do I get the end-
user
  timezone setting ?
  *Dimitrios Gianninas*
  *Developer*
  *Optimal Payments Inc.*
 
 
  *AVIS IMPORTANT*
 
  *WARNING*
 
  Ce message électronique et ses pièces jointes peuvent contenir des
  renseignements confidentiels, exclusifs ou légalement privilégiés 
destinés
  au seul usage du destinataire visé. L'expéditeur original ne 
renonce à aucun
  privilège ou à aucun autre droit si le présent message a été 
transmis
  involontairement ou s'il est retransmis sans son autorisation. Si 
vous
  n'êtes pas le destinataire visé du présent message ou si vous 
l'avez reçu
  par erreur, veuillez cesser immédiatement de le lire et le 
supprimer, ainsi
  que toutes ses pièces jointes, de votre système. La lecture, la
  distribution, la copie ou tout autre usage du présent message ou 
de ses
  pièces jointes par des personnes autres que le destinataire visé 
ne sont pas
  autorisés et pourraient être illégaux. Si vous avez reçu ce 
courrier
  électronique par erreur, veuillez en aviser l'expéditeur.
 
  This electronic message and its attachments may contain 
confidential,
  proprietary or legally privileged information, which is solely 
for the use
  of the intended recipient. No privilege or other rights are 
waived by any
  unintended transmission or unauthorized retransmission of this 
message. If
  you are not the intended recipient of this message, or if you 
have received
  it in error, you should immediately stop reading this message and 
delete it
  and all attachments from your system. The reading, distribution, 
copying or
  other use of this message or its attachments by unintended 
recipients is
  unauthorized and may be unlawful. If you have received this e-
mail in error,
  please notify the sender.

 
 
 
 
 -- 
 Douglas Knudsen
 http://www.cubicleman.com
 this is my signature, like it?





[flexcoders] Re: timezone and dateformatter

2007-04-13 Thread Doug Lowder
Weird.  Do you have any confirmation this is a bug in the Player?

--- In [EMAIL PROTECTED], Douglas Knudsen 
[EMAIL PROTECTED] wrote:

 yes, but for some reason we see a difference for these AZ users.  
Their
 windows clock is correct, but the offset is off a hour in FP during 
DST.
 
 DK
 
 On 13 Apr 2007 11:42:41 -0700, Doug Lowder [EMAIL PROTECTED] wrote:
 
I thought the Player got the timezone from the underlying OS.
 
  --- In [EMAIL PROTECTED] flexcoders%
40yahoogroups.com, Douglas
  Knudsen
  douglasknudsen@ wrote:
  
   yes, we had big issues with a app in Flex 1.5 and now 2.0 
because
  of this.
   We coded around it by massaging the dates in AS with the clients
  timezone
   offset. Works well, except for those folks living in Arizona. 
For
  some
   reason the Flash Player does NOT pick up their offset correctly.
  Outside of
   the Navajo Nation, Arizona does not follow day light savings, 
yet
  the Flash
   player seems to think they do.
  
   DK
  
   On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas 
   dimitrios.gianninas@ wrote:
   
Just wondering if anyone experienced this, but we have a VO
  coming from
Java that contains a date field. Well I format the field using
  the coe
below:
   
mx:DateFormatter id=df formatString=-MM-DD /
   
*
   
private
* *function* displayLastBillingDate( item:Object,
  column:DataGridColumn
):String {
   
* return* df.format( item.lastBillingDate );
   
}
   
And what happens is that this code works almost to well. It 
takes
  into
account the end-users PC timezone! So the date coming back 
from
  the server
is 2007-05-01 00:00:00, so for someone in EST it shows 
properly as
2007-05-01 (cause we are in EST) but for someone in CST is 
shows
2007-04-30... anything we can do about this? How do I get the 
end-
  user
timezone setting ?
*Dimitrios Gianninas*
*Developer*
*Optimal Payments Inc.*
   
   
*AVIS IMPORTANT*
   
*WARNING*
   
Ce message électronique et ses pièces jointes peuvent 
contenir des
renseignements confidentiels, exclusifs ou légalement 
privilégiés
  destinés
au seul usage du destinataire visé. L'expéditeur original ne
  renonce à aucun
privilège ou à aucun autre droit si le présent message a été
  transmis
involontairement ou s'il est retransmis sans son 
autorisation. Si
  vous
n'êtes pas le destinataire visé du présent message ou si vous
  l'avez reçu
par erreur, veuillez cesser immédiatement de le lire et le
  supprimer, ainsi
que toutes ses pièces jointes, de votre système. La lecture, 
la
distribution, la copie ou tout autre usage du présent message 
ou
  de ses
pièces jointes par des personnes autres que le destinataire 
visé
  ne sont pas
autorisés et pourraient être illégaux. Si vous avez reçu ce
  courrier
électronique par erreur, veuillez en aviser l'expéditeur.
   
This electronic message and its attachments may contain
  confidential,
proprietary or legally privileged information, which is solely
  for the use
of the intended recipient. No privilege or other rights are
  waived by any
unintended transmission or unauthorized retransmission of this
  message. If
you are not the intended recipient of this message, or if you
  have received
it in error, you should immediately stop reading this message 
and
  delete it
and all attachments from your system. The reading, 
distribution,
  copying or
other use of this message or its attachments by unintended
  recipients is
unauthorized and may be unlawful. If you have received this e-
  mail in error,
please notify the sender.
   
  
  
  
  
   --
   Douglas Knudsen
   http://www.cubicleman.com
   this is my signature, like it?
  
 
   
 
 
 
 
 -- 
 Douglas Knudsen
 http://www.cubicleman.com
 this is my signature, like it?





[flexcoders] Re: timezone and dateformatter

2007-04-13 Thread Doug Lowder
Sounds like some of our legacy tables, where someone decided to store 
dates as formatted varchar strings instead of something more 
appropriate like Date or Timestamp.  What a pain.

If you're forced to use the existing datetime column, I guess there 
isn't much you can do.  If not, maybe you could add a numeric column 
and store the dates as milliseconds since epoch.  That would make 
retrieving ( new Date(valFromDb) ) and sending ( myDate.getTime() ) 
pseudo-date values easier.

--- In [EMAIL PROTECTED], Sam Shrefler [EMAIL PROTECTED] 
wrote:

 I've also ran accross this, not so much a bug though.  It works 
properly in
 its use case.  The problem is, there are other use cases with 
timezones.
 Here is my scenario:
 
 I work with a legacy database.  Unfortunately, all datetimes are 
saved into
 the database as UTC, but as the clients time zone.
 
 So say someone in the EST -5 UTC and someone at PST -8 UTC both 
saved at the
 same moment in time (5am EST).  The database would have saved the 
dates as
 following:
 
 EST - 05:00
 PST - 02:00
 
 I can't change the behavior due to only being one piece in the 
grand scheme
 of the application.  The problem is, the databse doesnt' know what 
timezone
 these are.  The system was designed to just show that datetime to 
the user
 if they ask for it.  Flash/Flex always converts AMF Dates to the 
local
 timezone.  I've asked for a way to hook into that deserialization, 
but I
 haven't gotten a response.
 
 Therefore, I massage every date I receive and every date I send 
using the
 following...
 
 *
 
 public* *static* *function* getUTCDate(myDate:Date):Date
 
 {
 
 *if* (myDate == *null*)
 
 *return* *null*;
 
 *else
 *
 
 *return* *new* Date(myDate.fullYearUTC, myDate.monthUTC, 
myDate.dateUTC,
 myDate.hoursUTC, myDate.minutesUTC, myDate.secondsUTC,
 myDate.millisecondsUTC);
 
 }
 
 *public* *static* *function* sendUTCDate(myDate:Date):Date
 
 {
 
 *if* (myDate == *null*)
 
 *return* *null*;
 
 *else
 *
 
 {
 
 *var* sDate:Date = *new* Date(Date.UTC(myDate.fullYear, 
myDate.month,
 myDate.date, myDate.hours, myDate.minutes, myDate.seconds,
 myDate.milliseconds));
 
 *return* sDate;
 
 }
 
 }
 
 Hope this helps, but I hope even more there is a better solution out
 there
 
 Sam
 
 
 
 On 13 Apr 2007 12:23:01 -0700, Douglas Knudsen [EMAIL PROTECTED]
 wrote:
 
nope.  I can't find any mention of this anywhere.  Might be 
known to
  some flash pros, but a flash pro I am not.  I suppose this is 
only a issue
  if you want times always displayed based on a fixed timezone 
regardless of
  where the user is.  I have not confirmed this behavior using 
coldfusion on
  the back end, just Java.
 
  In our case, we are able to code around this by using rationals 
instead of
  date fields, a soon to be used fix.  We just need a start time 
and end time
  between 6am to 10pm and have a separate field with only the 
date.  so we can
  refactor to use some rational between 6 and 22.
 
 
 
  DK
 
  On 13 Apr 2007 12:05:00 -0700, Doug Lowder [EMAIL PROTECTED] wrote:
  
 Weird. Do you have any confirmation this is a bug in the 
Player?
  
   --- In [EMAIL PROTECTED] flexcoders%
40yahoogroups.com,
   Douglas Knudsen
   douglasknudsen@ wrote:
   
yes, but for some reason we see a difference for these AZ 
users.
   Their
windows clock is correct, but the offset is off a hour in FP 
during
   DST.
   
DK
   
On 13 Apr 2007 11:42:41 -0700, Doug Lowder douglowder@ 
wrote:

 I thought the Player got the timezone from the underlying 
OS.

 --- In [EMAIL PROTECTED] flexcoders%
40yahoogroups.comflexcoders%
   40yahoogroups.com, Douglas
  
 Knudsen
 douglasknudsen@ wrote:
 
  yes, we had big issues with a app in Flex 1.5 and now 2.0
   because
 of this.
  We coded around it by massaging the dates in AS with the 
clients
 timezone
  offset. Works well, except for those folks living in 
Arizona.
   For
 some
  reason the Flash Player does NOT pick up their offset 
correctly.
 Outside of
  the Navajo Nation, Arizona does not follow day light 
savings,
   yet
 the Flash
  player seems to think they do.
 
  DK
 
  On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas 
  dimitrios.gianninas@ wrote:
  
   Just wondering if anyone experienced this, but we have 
a VO
 coming from
   Java that contains a date field. Well I format the 
field using
 the coe
   below:
  
   mx:DateFormatter id=df formatString=-MM-DD /
  
   *
  
   private
   * *function* displayLastBillingDate( item:Object,
 column:DataGridColumn
   ):String {
  
   * return* df.format( item.lastBillingDate );
  
   }
  
   And what happens is that this code works almost to 
well. It
   takes
 into
   account the end-users PC timezone! So the date coming 
back
   from
 the server
   is 2007-05-01 00:00:00, so for someone

[flexcoders] Re: Noob Querystring questions

2007-04-13 Thread Doug Lowder
You can also use a bit of JavaScript code to simply pass whatever URL 
parameters have been specified for the HTML on to your SWF, if that's 
what you're after.  I usually edit the HTML template and include the 
following:

// In the Globals area near the top
var myvars = new String(document.location).split('?')[1];

// the line in AC_FL_RunContent that specifies flashvars
flashvars,'historyUrl=history.htm%3Flconid=' + lc_id + '' + 
myvars,


--- In [EMAIL PROTECTED], Tracy Spratt [EMAIL PROTECTED] wrote:

 Nate, sorry it is not quite that easy.  You are passing a parameter 
to
 an html file.  The html file has no way to see that arg and pass it 
to
 the Player instance.
 
  
 
 This will work if you call the .swf directly, with the querystring
 parameter.  Use Application.application.parameters.test.
 
  
 
 To do this in a production environment (if the parameters are 
dynamic)
 you will need to have a server platform generate the html file.
 
  
 
 The easiest way to do this is to look at the generated html file 
that
 FlexBuilder creates.  In the javascript call, you will need to add 
your
 parameters to the flashvars line in AC_FL_RunContent(...  like:
 
 flashvars,'historyUrl=history.htm%3Flconid=' + lc_id 
+ test=system
 + '',
 
  
 
 Of course you will have the server (asp, jsp...) output the actual 
value
 you want for system.
 
  
 
 Tracy
 
  
 
 
 
 From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Nate Pearson
 Sent: Friday, April 13, 2007 6:19 PM
 To: [EMAIL PROTECTED]
 Subject: [flexcoders] Noob Querystring questions
 
  
 
 I'm trying to pass in variable via the URL.
 
 I have:
 var QueryString:String = this.parameters.test
 
 http://myserver.com/myapp.html?test=systems
 http://myserver.com/myapp.html?test=systems 
 
 I always get nullWhere is my problem?
 
 (I have also tried Application.application.parameters.test)





[flexcoders] Re: Problems using SSL

2007-04-12 Thread Doug Lowder
Ran into the same problem here.  The root issue is a bug in some 
versions of IE.  You can apply an MS patch at all clients (likely not 
a feasible solution), or set the cache-control header to max-age=0, 
must-revalidate.  That header seems to work across all browsers, 
with or without SSL.

--- In [EMAIL PROTECTED], iko_knyphausen [EMAIL PROTECTED] wrote:

 
 It works ok in FF but not in IE. Peter Farland kindly had a long
 exchange with me offline, and it seems in my case that the offending
 HTTP response is in the header pragma CacheControl = No-cache. 
Problem
 is, without the pragma I am not getting up-to-date data from my
 HTTPService requests.
 
 So the problem has been isolated, but not solved just yet.
 
 
 --- In [EMAIL PROTECTED], Tom Chiverton tom.chiverton@
 wrote:
 
  On Sunday 08 Apr 2007, iko_knyphausen wrote:
   in relative URL calls. And I think it does, because the web site
 accepts
   both SSL and non-SSL, and the errors I am receiving don't happen
 when I
   load the same app from the same location without https.
 
  Are you using IE ? Does Firefox work fine on the SSL site ?
  If you use a network traffic sniffer, what is going on ?
 
 
  --
  Tom Chiverton
  Helping to vitalistically administrate cutting-edge products
  on: http://thefalken.livejournal.com
 
  
 
  This email is sent for and on behalf of Halliwells LLP.
 
  Halliwells LLP is a limited liability partnership registered in
 England and Wales under registered number OC307980 whose registered
 office address is at St James's Court Brown Street Manchester M2 
2JF. A
 list of members is available for inspection at the registered 
office.
 Any reference to a partner in relation to Halliwells LLP means a 
member
 of Halliwells LLP. Regulated by the Law Society.
 
  CONFIDENTIALITY
 
  This email is intended only for the use of the addressee named 
above
 and may be confidential or legally privileged. If you are not the
 addressee you must not read it and must not use any information
 contained in nor copy it nor inform any person other than 
Halliwells LLP
 or the addressee of its existence or contents. If you have received 
this
 email in error please delete it and notify Halliwells LLP IT 
Department
 on 0870 365 8008.
 
  For more information about Halliwells LLP visit 
www.halliwells.com.
 





[flexcoders] Re: Changing a string to reference an ID of an Object

2007-04-11 Thread Doug Lowder
Hi Nate,

The id property of mxml components just tells the compiler what to name 
the instance variable when it generates the actionscript code.  So, 
your mxml object with id item1 can be referenced in script as simply 
item1:

item1.htmlText = TEST;

Search the archives for more info; there are some really good posts on 
this topic direct from the Adobe folks.


--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 I am calling a webservice to get text for an item(RichTextEditor) that
 I am adding dynamically.
 
 If i set the ID of the rte to item1 how do I reference that in my
 webservice handler?  I have the string pass through so that the
 handler knows that the ID should be item1.
 
 I've tried:
 RichTextEditor(item1).htmlText = TEST
 
 and
 
 RichTextEditor(this.getChildByName(item1)).htmlText = TEST
 
 but neither work.  Any help is greatly appreciated.





[flexcoders] Re: Flex 1.5 Question

2007-04-11 Thread Doug Lowder
In 1.5, you can do this directly from the datagrid with the 
setPropertiesAt() method - no cell renderer required.

myGrid.setPropertiesAt(rowIndex, {backgroundColor: 0xFF});

If you must use a cellrenderer, just set the background of your 
container (canvas, hbox, or what have you) in the setValue() method, 
based on the row data.

--- In flexcoders@yahoogroups.com, Jatin Nanda [EMAIL PROTECTED] 
wrote:

 Dear All,
 
 I need to know how you use a custom cell renderer to change the
 background colour of a cell in a grid.
 
 Plenty of exampled for Flex 2.0, but I need to do it in Flex 1.5
 
 Know anyone who might have an answer?
 
 Thanks in advance,
 
 
 J





[flexcoders] Re: Changing a string to reference an ID of an Object

2007-04-11 Thread Doug Lowder
Reference it as obj[myID], where obj is the object where the myID 
instance exists.  If obj is the current object, use this[myID].

--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 Yes, but if item1 gets passed back as a string in my result event 
I
 don't know how to reference it.
 I.E.
 
 var myID:String = String(event.result[0])
 
 Now how do I reference the RTE with that ID? 
  
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
wrote:
 
  Hi Nate,
  
  The id property of mxml components just tells the compiler what 
to name 
  the instance variable when it generates the actionscript code.  
So, 
  your mxml object with id item1 can be referenced in script as 
simply 
  item1:
  
  item1.htmlText = TEST;
  
  Search the archives for more info; there are some really good 
posts on 
  this topic direct from the Adobe folks.
  
  
  --- In flexcoders@yahoogroups.com, Nate Pearson napearson99@ 
  wrote:
  
   I am calling a webservice to get text for an item
(RichTextEditor) that
   I am adding dynamically.
   
   If i set the ID of the rte to item1 how do I reference that 
in my
   webservice handler?  I have the string pass through so that the
   handler knows that the ID should be item1.
   
   I've tried:
   RichTextEditor(item1).htmlText = TEST
   
   and
   
   RichTextEditor(this.getChildByName(item1)).htmlText = TEST
   
   but neither work.  Any help is greatly appreciated.
  
 





[flexcoders] Re: Changing a string to reference an ID of an Object

2007-04-11 Thread Doug Lowder
See Tracy's reply  :)

--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 I'm sorry, I don't understand.  Could you give me a line or two of
 code please?
 The string that has the id is stored in event.result[0]
 
 Sorry for my ignorance.  Thanks
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
wrote:
 
  Reference it as obj[myID], where obj is the object where the 
myID 
  instance exists.  If obj is the current object, use this[myID].
  
  --- In flexcoders@yahoogroups.com, Nate Pearson napearson99@ 
  wrote:
  
   Yes, but if item1 gets passed back as a string in my result 
event 
  I
   don't know how to reference it.
   I.E.
   
   var myID:String = String(event.result[0])
   
   Now how do I reference the RTE with that ID? 

   
   --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
  wrote:
   
Hi Nate,

The id property of mxml components just tells the compiler 
what 
  to name 
the instance variable when it generates the actionscript 
code.  
  So, 
your mxml object with id item1 can be referenced in script 
as 
  simply 
item1:

item1.htmlText = TEST;

Search the archives for more info; there are some really good 
  posts on 
this topic direct from the Adobe folks.


--- In flexcoders@yahoogroups.com, Nate Pearson 
napearson99@ 
wrote:

 I am calling a webservice to get text for an item
  (RichTextEditor) that
 I am adding dynamically.
 
 If i set the ID of the rte to item1 how do I reference 
that 
  in my
 webservice handler?  I have the string pass through so that 
the
 handler knows that the ID should be item1.
 
 I've tried:
 RichTextEditor(item1).htmlText = TEST
 
 and
 
 RichTextEditor(this.getChildByName(item1)).htmlText 
= TEST
 
 but neither work.  Any help is greatly appreciated.

   
  
 





[flexcoders] Re: Changing a string to reference an ID of an Object

2007-04-11 Thread Doug Lowder
Setting the id property of an object created in script serves no 
purpose.  It's like knocking on your own front door to see whether 
you're home or not.  Or something.  Anyway, you can ditch 
the 'myRTE.id = item1 ' line.  The rest of the changes would be 
similar to:

private var _resultID:String = myRTE;
...
this[_resultID].htmltext = _resultText

--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 if i do that i get:  ReferenceError: Error #1069: Property item1 not
 found on Systems and there is no default value.
 
 I made a sample app that demonstrates the problem.  THanks so much 
for
 your guys' replies.
 
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 creationComplete=onLoad() layout=absolute
   mx:Script
   ![CDATA[
   import mx.rpc.events.ResultEvent;
   import mx.controls.*;
  //fake webservice result data
   private var _resultID:String = item1
   private var _resultText:String = Text I want
   
   private function onLoad():void{
   var myRTE:RichTextEditor = new RichTextEditor;
   myRTE.percentWidth=100
   myRTE.id = item1
   myRTE.percentHeight=100
   myRTE.styleName = rte
   addChild(myRTE);
 
   //call .NET webservice.  We can fake 
the handler.
   wsHandler()
   }
   private function wsHandler():void{
   //Here i want to get the result text into the 
RTE i made above.
   //Rules:  the item1 text is dynamic, so you 
cant just do
 item1.htmltext = _resultText
   //In the real app the RTEs are nested 
pretty deep, so
 getChildByName doesnt work unless
   //you can reference the parent container.
 
   //
   //var myID:String = String(_resultID);
   //var rte:RichTextEditor = this[myID];
   //rte.htmlText = TEST;
   }
   ]]
   /mx:Script
 /mx:Application
 
 
  
 
 --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote:
 
  Jumping in:
 c
  
   
  
  Tracy
  
   
  
  
  
  From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
  Behalf Of Nate Pearson
  Sent: Wednesday, April 11, 2007 4:37 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Re: Changing a string to reference an ID of 
an
  Object
  
   
  
  Yes, but if item1 gets passed back as a string in my result 
event I
  don't know how to reference it.
  I.E.
  
  var myID:String = String(event.result[0])
  
  Now how do I reference the RTE with that ID? 
  
  
  --- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
  , Doug Lowder douglowder@ wrote:
  
   Hi Nate,
   
   The id property of mxml components just tells the compiler what 
to
  name 
   the instance variable when it generates the actionscript code. 
So, 
   your mxml object with id item1 can be referenced in script as 
simply
  
   item1:
   
   item1.htmlText = TEST;
   
   Search the archives for more info; there are some really good 
posts on
  
   this topic direct from the Adobe folks.
   
   
   --- In flexcoders@yahoogroups.com
  mailto:flexcoders%40yahoogroups.com , Nate Pearson 
napearson99@ 
   wrote:
   
I am calling a webservice to get text for an item
(RichTextEditor)
  that
I am adding dynamically.

If i set the ID of the rte to item1 how do I reference that 
in my
webservice handler? I have the string pass through so that the
handler knows that the ID should be item1.

I've tried:
RichTextEditor(item1).htmlText = TEST

and

RichTextEditor(this.getChildByName(item1)).htmlText = TEST

but neither work. Any help is greatly appreciated.
   
  
 





[flexcoders] Re: Changing a string to reference an ID of an Object

2007-04-11 Thread Doug Lowder
Oh, and you'll need to declare the myRTE variable outside of the 
onLoad() function instead of within it.

--- In flexcoders@yahoogroups.com, Doug Lowder [EMAIL PROTECTED] 
wrote:

 Setting the id property of an object created in script serves no 
 purpose.  It's like knocking on your own front door to see whether 
 you're home or not.  Or something.  Anyway, you can ditch 
 the 'myRTE.id = item1 ' line.  The rest of the changes would be 
 similar to:
 
 private var _resultID:String = myRTE;
 ...
 this[_resultID].htmltext = _resultText
 
 --- In flexcoders@yahoogroups.com, Nate Pearson napearson99@ 
 wrote:
 
  if i do that i get:  ReferenceError: Error #1069: Property item1 
not
  found on Systems and there is no default value.
  
  I made a sample app that demonstrates the problem.  THanks so 
much 
 for
  your guys' replies.
  
  
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  creationComplete=onLoad() layout=absolute
  mx:Script
  ![CDATA[
  import mx.rpc.events.ResultEvent;
  import mx.controls.*;
 //fake webservice result data
  private var _resultID:String = item1
  private var _resultText:String = Text I want
  
  private function onLoad():void{
  var myRTE:RichTextEditor = new RichTextEditor;
  myRTE.percentWidth=100
  myRTE.id = item1
  myRTE.percentHeight=100
  myRTE.styleName = rte
  addChild(myRTE);
  
  //call .NET webservice.  We can fake 
 the handler.
  wsHandler()
  }
  private function wsHandler():void{
  //Here i want to get the result text into the 
 RTE i made above.
  //Rules:  the item1 text is dynamic, so you 
 cant just do
  item1.htmltext = _resultText
  //In the real app the RTEs are nested 
 pretty deep, so
  getChildByName doesnt work unless
  //you can reference the parent container.

  //
  //var myID:String = String(_resultID);
  //var rte:RichTextEditor = this[myID];
  //rte.htmlText = TEST;
  }
  ]]
  /mx:Script
  /mx:Application
  
  
   
  
  --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ 
wrote:
  
   Jumping in:
  c
   

   
   Tracy
   

   
   
   
   From: flexcoders@yahoogroups.com 
 [mailto:[EMAIL PROTECTED] On
   Behalf Of Nate Pearson
   Sent: Wednesday, April 11, 2007 4:37 PM
   To: flexcoders@yahoogroups.com
   Subject: [flexcoders] Re: Changing a string to reference an ID 
of 
 an
   Object
   

   
   Yes, but if item1 gets passed back as a string in my result 
 event I
   don't know how to reference it.
   I.E.
   
   var myID:String = String(event.result[0])
   
   Now how do I reference the RTE with that ID? 
   
   
   --- In flexcoders@yahoogroups.com mailto:flexcoders%
 40yahoogroups.com
   , Doug Lowder douglowder@ wrote:
   
Hi Nate,

The id property of mxml components just tells the compiler 
what 
 to
   name 
the instance variable when it generates the actionscript 
code. 
 So, 
your mxml object with id item1 can be referenced in script 
as 
 simply
   
item1:

item1.htmlText = TEST;

Search the archives for more info; there are some really good 
 posts on
   
this topic direct from the Adobe folks.


--- In flexcoders@yahoogroups.com
   mailto:flexcoders%40yahoogroups.com , Nate Pearson 
 napearson99@ 
wrote:

 I am calling a webservice to get text for an item
 (RichTextEditor)
   that
 I am adding dynamically.
 
 If i set the ID of the rte to item1 how do I reference 
that 
 in my
 webservice handler? I have the string pass through so that 
the
 handler knows that the ID should be item1.
 
 I've tried:
 RichTextEditor(item1).htmlText = TEST
 
 and
 
 RichTextEditor(this.getChildByName(item1)).htmlText 
= TEST
 
 but neither work. Any help is greatly appreciated.

   
  
 





[flexcoders] Re: Changing a string to reference an ID of an Object

2007-04-11 Thread Doug Lowder
You can still create the instances dynamically, but you'll need a non-
local variable to store the *references* to the instances so you can 
get at them later on in your WS handler.  Maybe an Array would work?  
You could push the dynamically-created RTE instance onto the Array 
and then pass an array index integer in addition to a string 
equivalent to the name of the array variable.  You could then access 
the RTE instance in your handler as:

var theArray: Array = this[_resultID];
var myDynamicRTE: RichTextEditor = RichTextEditor(theArray
[_resultIndex]);

Hopefully this is all making sense to you.  There are probably other 
(better?) approaches as well; possibly a custom event for you service.

--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] 
wrote:

 These RTEs are dynamic.  Some times they are removed and sometimes
 they are added.  There will at least be 9 on different tabs.  these
 will be added and removed based on user interaction.  If I declare 
my
 variable out side of that function it will link the .html text
 property to all of my RTEs.
 
 
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
wrote:
 
  Oh, and you'll need to declare the myRTE variable outside of the 
  onLoad() function instead of within it.
  
  --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
  wrote:
  
   Setting the id property of an object created in script serves 
no 
   purpose.  It's like knocking on your own front door to see 
whether 
   you're home or not.  Or something.  Anyway, you can ditch 
   the 'myRTE.id = item1 ' line.  The rest of the changes would 
be 
   similar to:
   
   private var _resultID:String = myRTE;
   ...
   this[_resultID].htmltext = _resultText
   
   --- In flexcoders@yahoogroups.com, Nate Pearson 
napearson99@ 
   wrote:
   
if i do that i get:  ReferenceError: Error #1069: Property 
item1 
  not
found on Systems and there is no default value.

I made a sample app that demonstrates the problem.  THanks so 
  much 
   for
your guys' replies.


?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=onLoad() layout=absolute
mx:Script
![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.*;
   //fake webservice result data
private var _resultID:String = item1
private var _resultText:String = Text I want

private function onLoad():void{
var myRTE:RichTextEditor = new 
RichTextEditor;
myRTE.percentWidth=100
myRTE.id = item1
myRTE.percentHeight=100
myRTE.styleName = rte
addChild(myRTE);

//call .NET webservice.  We 
can fake 
   the handler.
wsHandler()
}
private function wsHandler():void{
//Here i want to get the result text 
into the 
   RTE i made above.
//Rules:  the item1 text is dynamic, 
so you 
   cant just do
item1.htmltext = _resultText
//In the real app the RTEs 
are nested 
   pretty deep, so
getChildByName doesnt work unless
//you can reference the parent 
container.
  
//
//var myID:String = String(_resultID);
//var rte:RichTextEditor = this[myID];
//rte.htmlText = TEST;
}
]]
/mx:Script
/mx:Application


 

--- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ 
  wrote:

 Jumping in:
c
 
  
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
   [mailto:[EMAIL PROTECTED] On
 Behalf Of Nate Pearson
 Sent: Wednesday, April 11, 2007 4:37 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Changing a string to reference an 
ID 
  of 
   an
 Object
 
  
 
 Yes, but if item1 gets passed back as a string in my 
result 
   event I
 don't know how to reference it.
 I.E.
 
 var myID:String = String(event.result[0])
 
 Now how do I reference the RTE with that ID? 
 
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%
   40yahoogroups.com
 , Doug Lowder douglowder@ wrote:
 
  Hi Nate,
  
  The id property of mxml components just tells the 
compiler 
  what 
   to
 name 
  the instance variable when it generates the actionscript 
  code. 
   So

[flexcoders] Re: Flex 1.5 Question

2007-04-11 Thread Doug Lowder
Ah, sorry, I missed the fact that it was for a single cell instead of
the entire row.

So do you already have a cell renderer based on something like HBox,
and if so have you tried setting the backgroundColor property?  What
happened?  I would think that should work.  I'll see if I can put
together a working example.

--- In flexcoders@yahoogroups.com, Jatin Nanda [EMAIL PROTECTED] wrote:

 HI Doug,
 
 Thanks for the tip - but unfortunately it affects the whole row, not
just
 one cell ...
 
 Tried changing the bgcolor, which doesn't seem to work either. Any other
 thoughts?
 
 Thanks in advance,
 
 J
 
 On 11 Apr 2007 12:58:15 -0700, Doug Lowder [EMAIL PROTECTED] wrote:
 
In 1.5, you can do this directly from the datagrid with the
  setPropertiesAt() method - no cell renderer required.
 
  myGrid.setPropertiesAt(rowIndex, {backgroundColor: 0xFF});
 
  If you must use a cellrenderer, just set the background of your
  container (canvas, hbox, or what have you) in the setValue() method,
  based on the row data.
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
Jatin
  Nanda jatin.nanda@
 
  wrote:
  
   Dear All,
  
   I need to know how you use a custom cell renderer to change the
   background colour of a cell in a grid.
  
   Plenty of exampled for Flex 2.0, but I need to do it in Flex 1.5
  
   Know anyone who might have an answer?
  
   Thanks in advance,
  
  
   J
  
 
   
 





[flexcoders] Re: AS3 encryption

2007-04-10 Thread Doug Lowder
True about that.  I assumed the poster was talking about 
usernames/passwords alone, but maybe that isn't the case.

I guess I'm wondering why anyone would want to essentially re-
implement portions of SSL.  As a user, I certainly wouldn't trust any 
site that was loaded over HTTP instead of HTTPS, whether they claimed 
to have their own security scheme implemented or not.


--- In flexcoders@yahoogroups.com, Alias™ [EMAIL PROTECTED] wrote:

 MD5 is a one-way encryption algorithm, so it won't be any use for 
encrypting
 data in the way you want - it's only for hashing and passwords, 
really.
 
 If you need additional encryption to https, you could try 
encrypting the
 data with TEA
 http://www.simonshepherd.supanet.com/tea.htm
 
 There's an implementation in AS1 here, should be pretty trivial to 
port to
 AS3.
 http://www.simonshepherd.supanet.com/TEAflash.txt
 
 HTH,
 Alias
 
 On 09 Apr 2007 09:43:33 -0700, Doug Lowder [EMAIL PROTECTED] wrote:
 
The AS3 corelib has an MD5 algorithm implemented.
 
 
  
http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:lib
raries
 
  Probably the safest way to send data, though, would be to send 
over HTTPS
  rather than HTTP.  If your data really are of a sensitive nature, 
then your
  server should be configured to accept HTTPS/SSL connections.  
Part of
  security is also verifying that the server you are communicating 
with is who
  you think it is; data encryption alone won't accomplish that, but 
SSL will.
 
  HTH,
  Doug
 
 
  --- In flexcoders@yahoogroups.com, André Rodrigues Pena 
andre.ufrj@
  wrote:
  
   Hi all,
  
   I'm looking for someway to encrypt the information I'm sending 
through
   HTTPService via POST.
  
   I need this information to be decrypted inside a JSP script at 
the
   back-end. So I need a encryption method that has a corresponding
   decryption method at server-side (Java)
  
   I'm not experienced with cryptography. If you already solved 
some
   problem like that. Please help.
  
   --
   André Rodrigues Pena
  
 
   
 





[flexcoders] Re: Help !!! How to decode URL encoding

2007-04-10 Thread Doug Lowder
There's a top-level decodeURI() function:

http://livedocs.adobe.com/flex/201/langref/package.html#decodeURI()


--- In flexcoders@yahoogroups.com, mgrayfmr [EMAIL PROTECTED] wrote:

 Hi Guys:
 
 I am trying to parse a string that is URL encoded, and I want to 
 remove, or decode it.
 I was surprised that there wasn't something available in a utility 
 class already in AS3.
 Anyone ever run into this ?
 
 I saw a post that had a link to some code that sounds like it would 
 solve my problem:
 http://tech.groups.yahoo.com/group/flexcoders/message/55312
 But the post is missing any code snippets.
 
 If anyone has any ideas, please let me know !!!
 Thanks,
 Mike





[flexcoders] Re: AS3 encryption

2007-04-09 Thread Doug Lowder

The AS3 corelib has an MD5 algorithm implemented.

http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libra\
ries
http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libr\
aries

Probably the safest way to send data, though, would be to send over
HTTPS rather than HTTP.  If your data really are of a sensitive nature,
then your server should be configured to accept HTTPS/SSL connections. 
Part of security is also verifying that the server you are communicating
with is who you think it is; data encryption alone won't accomplish
that, but SSL will.

HTH,
Doug


--- In flexcoders@yahoogroups.com, André Rodrigues Pena
[EMAIL PROTECTED] wrote:

 Hi all,

 I'm looking for someway to encrypt the information I'm sending through
 HTTPService via POST.

 I need this information to be decrypted inside a JSP script at the
 back-end. So I need a encryption method that has a corresponding
 decryption method at server-side (Java)

 I'm not experienced with cryptography. If you already solved some
 problem like that. Please help.

 --
 André Rodrigues Pena





[flexcoders] Re: ComboBox.selectedItem within a Repeater

2007-04-09 Thread Doug Lowder
You might be able to use the repeater's currentIndex property in your 
button's click handler to access the ComboBox instance.  Try:

... click=trace('selected sport:'+ this['cb_sports' + 
rp_brands.currentIndex].selectedItem)

--- In flexcoders@yahoogroups.com, t8.chad [EMAIL PROTECTED] wrote:

 I have a ComboBox within a repeater and I need to get the selected 
item
 of the ComboBox.  The problem is that the id of the ComboBox is 
really a
 pointer to an array of ComboBoxs within the Repeater.
 
 mx:TabNavigator
  mx:Repeater id=rp_brands
  mx:ComboBox id=cb_sports
 dataProvider={rp_brands.currentItem.sports/
  mx:Button label=TEST click=trace('selected sport:
 '+cb_sports.selectedItem)/
  
 
 
 cb_sports.selectedItem is a null reference, which makes sense since 
the
 cb_sports ComboBox is an array of ComboBoxes within the Repeater.  
How
 can I get the selectedItem of the ComboBox?  I cannot use the 
rp_brands
 Repeater's currentItem or currentIndex property as an index to the
 cb_sports ComboBox Array because this is being executed in an event
 (Repeater is not executing error).
 
 Thanks.





[flexcoders] Re: ComboBox.selectedItem within a Repeater

2007-04-09 Thread Doug Lowder
Actually, I think that should be cb_sports
[rp_brands.currentIndex].selectedItem instead of this
['...'].selectedItem, but I think you get the picture.  Debug as 
necessary.  :)

--- In flexcoders@yahoogroups.com, Doug Lowder [EMAIL PROTECTED] 
wrote:

 You might be able to use the repeater's currentIndex property in 
your 
 button's click handler to access the ComboBox instance.  Try:
 
 ... click=trace('selected sport:'+ this['cb_sports' + 
 rp_brands.currentIndex].selectedItem)
 
 --- In flexcoders@yahoogroups.com, t8.chad chad@ wrote:
 
  I have a ComboBox within a repeater and I need to get the 
selected 
 item
  of the ComboBox.  The problem is that the id of the ComboBox is 
 really a
  pointer to an array of ComboBoxs within the Repeater.
  
  mx:TabNavigator
   mx:Repeater id=rp_brands
   mx:ComboBox id=cb_sports
  dataProvider={rp_brands.currentItem.sports/
   mx:Button label=TEST click=trace('selected sport:
  '+cb_sports.selectedItem)/
   
  
  
  cb_sports.selectedItem is a null reference, which makes sense 
since 
 the
  cb_sports ComboBox is an array of ComboBoxes within the 
Repeater.  
 How
  can I get the selectedItem of the ComboBox?  I cannot use the 
 rp_brands
  Repeater's currentItem or currentIndex property as an index to the
  cb_sports ComboBox Array because this is being executed in an 
event
  (Repeater is not executing error).
  
  Thanks.
 





[flexcoders] Re: DateField Bug

2007-04-03 Thread Doug Lowder
That's the default bahavior (unfortunately) for DateField, last I 
heard.  See this thread:

http://tech.groups.yahoo.com/group/flexcoders/message/28095


--- In flexcoders@yahoogroups.com, billy_d_white [EMAIL PROTECTED] 
wrote:

 I ran into this exact same issue the other day.  I have a form with 
a
 datefield/datepicker component and I found that if it is set to, say
 today's date, and you then expand the date chooser and reselect the
 same date, it comes back with NaN/NaN/NaN as the selected date. 
 Anyone else seen this or know what might be causing it?
 
 
 --- In flexcoders@yahoogroups.com, Chad Callahan chad@ wrote:
 
  When selecting the date that the DateField object is already set 
to, the
  DateField text display becomes empty.  Does selecting the same 
date as
  is already selected cause the new selected date to become null?  
Is
  there a property I can set to disable this feature? 
  
   
  
   
  
   
  
  CHAD CALLAHAN
  PROGRAMMER
  
  T8DESIGN.COM | P 319.266.7574 - x195 | 877.T8IDEAS | F 
888.290.4675
  
  
  This e-mail, including attachments, is covered by the Electronic
  Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, 
and
  may be legally privileged. If you are not the intended recipient, 
you
  are hereby notified that any retention, dissemination, 
distribution, or
  copying of this communication is strictly prohibited. Please 
reply to
  the sender that you have received the message in error, and then 
please
  delete it. Thank you.
  
  
 





[flexcoders] Re: Help with finding days between a start and end date

2007-04-02 Thread Doug Lowder
Your math is OK, but for timezones that support Daylight Savings Time 
your logic isn't.  In those timezones, not every day will be exactly 
24 hours long.  A quick way to verify is to make the following change:

   hListArray.addItem(lastDate.toUTCString());

If you need dates converted to local time, you'll have to adjust for 
the timezone offset of the date in question.  I think the following 
should work:

   var lastDate:Date = new Date(nextDay);
   lastDate.setTime(lastDate.getTime() - lastDate.getTimezoneOffset()
*6);
   hListArray.addItem(lastDate.toLocaleString());

You may also have a few issues to sort out regarding the timezone of 
the stored dates, and how those stored values are initially converted 
to local dates.


--- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] wrote:

 I'm having some problems with my, I think, math for getting all the 
 days into an arrayCollection.  It works well on items with less 
time 
 between start and end dates such as a few days or months apart.  
But 
 when it gets up to about 200+ days something strange happens, it 
 changes from Date Sun Nov 5 2006 12:00:00 AM to Sun Nov 5 2006 
 11:00:00 PM.  Then a few months down it will switch back to 12.  
So 
 I guess that's why I think it may be my Math.  I'd like someone to 
 double check what I'm doing because I can't see the error.  The 
 dates are stored like 2007,12,25
 
 
 
 var StartDate:String = item.startDate;
 var startResults:Array = StartDate.split(,);
 var nsd:Date = new Date(startResults[0],startResults[1]-
 1,startResults[2],0,0,0,0);
 trace(SD   + nsd);
 //
 var ENDDate:String = item.endDate;
 var ENDResults:Array = ENDDate.split(,);
 var ned:Date = new Date(ENDResults[0],ENDResults[1]-1,ENDResults
 [2],0,0,0,0);
 trace(ED   + ned);
 // test for all days
 var millisecondsPerDay:int = 1000 * 60 * 60 * 24 //8640;
 var totalDays:Number = (ned.getTime() - nsd.getTime
 ())/millisecondsPerDay+1;
 trace(total  + totalDays);
 var nextDay:Number = nsd.getTime();
 
 hListArray.removeAll();
 for(var i:int = 0; itotalDays; i++){
   var lastDate:Date = new Date(nextDay)
   hListArray.addItem(lastDate.toLocaleString());
   nextDay += millisecondsPerDay;
 }





[flexcoders] Re: Opening file after download

2007-03-30 Thread Doug Lowder
You may need to involve the server to accomplish this.  I typically 
get this behavior by streaming content through a server side page 
that sets the Content-Disposition header to attachment; 
filename=someFile.txt.  That header is what lets the browser know it 
should display the [Save][Open] dialog.  Ont the Flex side, I just 
invoke the server-side page with navigateToURL().

HTH,
Doug

--- In flexcoders@yahoogroups.com, Battershall, Jeff 
[EMAIL PROTECTED] wrote:

 Hello,
 
 I'm downloading a file using FileReference.download(), which 
prompts for
 a save location. What IE/FF provides is the ability to open after
 download, is there any way to replicate that behavior??? Many of my
 users would like to open immediately, not have to browse to the
 downloaded file location.
 
 Jeff Battershall
 Application Architect
 Dow Jones Indexes
 [EMAIL PROTECTED]
 (609) 520-5637 (p)
 (484) 477-9900 (c)





[flexcoders] Re: HELP!!! Custom events in Flex bug?

2007-03-30 Thread Doug Lowder
Aren't you missing a definition for LoginEvent.LOGIN in your 
LoginEvent class?  Something like:

public static const LOGIN:String = login;


--- In flexcoders@yahoogroups.com, parker77rocks [EMAIL PROTECTED] 
wrote:

 Ok this is weird. I create a custom flex component that has custom 
 events.  I initialize the component in actionscript (and throw it 
to 
 good ol PopUp Manager for popup effect) and then try to use 
 addEventListener to register the custom event as i would with any 
 other flash/flex object created with actionscript. Problem is I 
keep 
 getting this error - 1119: Access of possibly undefined property 
 LOGIN through a reference with static type Class. Events are 
 registered and work fine if i initialize the component with mxml 
but 
 then i can't make it a popup (or maybe i can but it seems simpler 
in 
 as). Is this a bug or am i the bug? 
 
 
 
 // Creating a custom event in a flex component as such:
 
 mx:Metadata
 [Event(name=loginComplete, type=flash.events.Event)]
 /mx:Metadata
 
 
 private componentFunction():void
 {
var login:Login = new Login();
login.username = usernameInput.text;
login.password = passwordInput.text;
var event:LoginEvent = new LoginEvent(login, login);
dispatchEvent(event);
 }
 
 
 //Application function - onCreationComplete function...
 
 private function onCreationComplete = function():void
 {
loginWizard = new LoginWizard();
loginWizard.addEventListener(LoginEvent.LOGIN, doLogin);
 }
 
 
 //.. and event handler
 
 private function doLogin(event:LoginEvent):void
 {
   trace(event.type);
 }
 
 
 // LoginEvent
 package ts.events
 {
   import flash.events.Event;
   import ts.dto.Login;
   
   public class LoginEvent extends Event
   {
   public var data:Login;
   
   public function LoginEvent(type:String, 
 data:Login):void
   {
   super(type);
   this.data = data
   }
   
   override public function clone():Event
   {
   return new LoginEvent(type, data);
   }
   }
 }
 
 // Login data transfer
 package ts.dto
 {
   
   public class Login
   {
   public var username:String;
   public var password:String;
   
   public function Login()
   {
   
   }
   }
 }





[flexcoders] Re: TextArea htmltext parsing

2007-03-28 Thread Doug Lowder
There's a String.split() method that might be what you're looking for.

var eachPieceArray: Array = myTextArea.htmlText.split( );


--- In flexcoders@yahoogroups.com, jmfillman [EMAIL PROTECTED] wrote:

 How would I go about taking the htmltext of a TextArea and parsing it 
 based on a space and assigning each piece to an Array or 
 ArrayCollection?





[flexcoders] Re: SelectedIndex bug after removing an element !!

2007-03-15 Thread Doug Lowder
Try:

  grid.selectedIndex = x - 1;

The selectedIndex property is zero-based, so in general you need to 
set it to (N - 1) to select the Nth line.


--- In flexcoders@yahoogroups.com, bobrene07 [EMAIL PROTECTED] wrote:

 hello,
 
 
 I have a problem with the selecting index after i removed an 
element.
 
 when i do the following: 
 
 var x:int = grid.selectedIndex;
 
 if (x != -1) {
   grid.dataProvider.removeItemAt(x);
  grid.selectedIndex = x;
 }
 
 if x equal 4 it select the fift line.
 
 does anyone knows how to fix it ??
 
 thx
 
 Bob





[flexcoders] Re: How to resize the flex1.5 screen according to the screen resolution

2007-03-14 Thread Doug Lowder
Maybe I'm missing a subtle detail, but it sounds like you should be 
able to set the height properties of the containers to accomplish 
this.  Set the top and bottom HBox heights to a fixed value, and the 
ViewStack's height to 100%.  Give that a try and post back if you 
still have problems.

HTH,
Doug

--- In flexcoders@yahoogroups.com, Yasovardhan Babu 
[EMAIL PROTECTED] wrote:

 Can somebody Please help me on this issue?
 
 Thanks and Regards,
 Yasovardhan.
 --- In flexcoders@yahoogroups.com, Yasovardhan Babu 
 yasovardhanbabu@ wrote:
 
  Hi All,
  
  I have a Flex1.5 screen in which I have one HBox in top and 
 another 
  HBox in Bottom. In between I have a View stack, which contains 
two 
  VBoxes.
  My requirement is that the screen ( with viewstack) should resize 
  according to the different screen resolutions. That is,
  The vertical scrollbar should be starting from the end of first 
 HBox
  (in top) to the beginning of the second HBox(in the bottom), 
  irrespective of screen resolution. The vertical scroll bar should 
  disappear if the in between screen has enough height.
  How to do this? Please help me as this needs to be addressed 
 urgently.
  
  Thanks and Regards,
  Yasovardhan.
 





[flexcoders] Re: Strange List behaviour

2007-03-07 Thread Doug Lowder
It seems to me that you need to specify a property of the model as 
the list's dataprovider, instead of using the model itself.  I 
haven't tested this, but I'd be curious to see what happens if you 
try the following changes:

mx:Model id=listData
  things{listService.lastResult.things.thing}/things
/mx:Model

mx:List
id=list
dataProvider={listData.things}
labelField=name /


--- In flexcoders@yahoogroups.com, g_odds [EMAIL PROTECTED] wrote:

 I am attempting to populate a List from Model filled by the result 
of
 an HTTPService.  However, the list only shows one entry as [object
 Object], [object Object],...  As far as I am aware that is the 
result
 of a toString() on a collection.  But why is the List not using that
 collection to populate itself properly (as I want it to, hehe).
 
 Thanks in advance for any help.
 
 Graham
 
 
 The code:
 
 ...
 mx:HTTPService 
 id=listService
 url=...
 /
 mx:Model id=listData
{listService.lastResult.things.thing}
 /mx:Model
 mx:List
 id=list
 dataProvider={listData}
 labelField=name
 /
 ...
 
 
 and the XML that results from the HTTPService send:
 
 things
   thing
 nameMyName/name
 valueMyValue/value
   thing
   ...
 things





[flexcoders] Re: How do I prevent the user from selecting text in a text area component?

2007-02-28 Thread Doug Lowder
You may find some helpful tips in this thread:

http://tech.groups.yahoo.com/group/flexcoders/message/44779

Unfortunately, it looks like the sample code may not be available at 
the moment.

--- In flexcoders@yahoogroups.com, beecee1977 [EMAIL PROTECTED] 
wrote:

 Yes, but that doesn't stop the user from selecting the text 
(dragging 
 mouse over and highlighting)... Is there an easy way to prevent 
that? 
 (Other than disabling the component)
 
 Bill
 
 --- In flexcoders@yahoogroups.com, Brian Holmes bholme@ wrote:
 
  editable=false
  
  
  
  From: flexcoders@yahoogroups.com 
 [mailto:[EMAIL PROTECTED] On
  Behalf Of Robin Burrer
  Sent: Monday, February 26, 2007 6:08 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] How do I prevent the user from selecting 
text 
 in a
  text area component?
  
  
  
  Hi there,
  
   
  
  How do I prevent the user from selecting text in a text area 
 component?
  
  
  I noticed that it does not have a selectable property and does 
not
  derive from the Text object either.
  
   
  
   
  
  Robin
  
   
  
  
  ***
  The information in this e-mail is confidential and intended 
solely 
 for the individual or entity to whom it is addressed.  If you have 
 received this e-mail in error please notify the sender by return e-
 mail delete this e-mail and refrain from any disclosure or action 
 based on the information.
  ***
 





[flexcoders] Re: Custom Collection Sorting Challenge

2007-02-28 Thread Doug Lowder
Are you setting aSort.fields to an Array before calling push()?  Try 
the following before you push the sort fields:

 aSort.fields = [];

--- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote:

 
 Hi all,
 
 more questions on custom collection sorting... I have a
 XMLListCollection dataprovider, which I am sorting using a sort 
object.
 The sorting works as expected, when I use the following syntax to 
define
 the array of SortFields:
 
 aSort.fields = [sfSortField, sfLevel];
 
 However, I would like to assemble the fields array dynamically,
 depending on column position, or what have you, so my first 
thought was
 to use the array.push() method to add the individual SortFields, 
but
 this fails without an exception being thrown...
 
 i = aSort.fields.push(sfSortField);
 i = aSort.fields.push(sfLevel);
 
 Any ideas? Thanks





[flexcoders] Re: DataGridColumn showDataTips problem

2007-02-22 Thread Doug Lowder
Are you also setting the dataTipFunction property?  That would cause 
the bahavior you're seeing.


--- In flexcoders@yahoogroups.com, Robert Chyko [EMAIL PROTECTED] wrote:

 I am trying to use the showDataTips property of the 
DataGridColumn.  The
 documentation states:
  
 Datatips are tooltips designed to show the text that is too long 
for
 the row. 
  
 I swear that in Flash, the similar functionality (whatever it was 
called
 - not showDataTips) would only show the toolTip for a cell if the 
text
 in the cell was wider than the width of the cell.
  
 The behavior I am seeing is that if I set showDataTips to true, the
 toolTip is always being shown, regardless of whether or not the 
cells
 text is longer than the cell.
  
 Can anyone confirm/deny?  Or am I just that thick...
  
 Thanks
   
 Bob Chyko





  1   2   3   4   5   >