[flexcoders] Matching colors between Photoshop and Flash/Flex

2009-09-30 Thread Charlie Hubbard
So I'm having some trouble matching colors between Photoshop and Flash.  As
I understand Flash is sRGB, and I believe my photoshop file is sRGB (not
totally sure).  However, obviously something is off because the colors
aren't matching.  I can't seem to find any information about matching Flex
and Photoshop colors.  I'm seeing problems with the hex values I pick up
from the interface as well as an image I export.  So what's the secret
sauce?  I'm sure this is simple, but I'm new to this matching color junk.

Thanks
Charlie


Re: [flexcoders] Re: Problems with Julian Dates with AIR percision?

2009-07-05 Thread Charlie Hubbard
Yarg!  I figure it out, and it was not related to precision after all.  It
was the portion of my query unrelated to the datetime treatment.

Thanks for the reply,

Charlie

On Sat, Jul 4, 2009 at 12:06 PM, jason_williams_mm jwilli...@macromedia.com
 wrote:



 Hi Charlie,
 Can you post an example of the code that you are using? It would help to
 see an example table definition along with the AS code you are using.

 Thanks,
 jw


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Charlie
 Hubbard charlie.hubb...@... wrote:
 
  I'm writing some unit tests for my database, and I'm having a real
 problem
  with Julian date comparisons in the SQLite database. I'm trying to load
  records by the following query:
 
  select * from Table where created_at  ?
 
  If my given Date is less than stored dates by 100ms SQLite fails to hand
  them back. I've taken the times stored in SQLite and put them into
  coversion programs to convert them to unix epoch longs, and millisecond
  percision is stored in the number. SQLIte does have percision down to the
  millisecond, but when I do a sql query they fail to compare correctly.
 I've
  also confirmed that I do get back the milliseconds correctly stored in
 the
  actionscript's Date object. Has anyone else had trouble like this? Should
  I just store them as unix epoch integers rather than SQLite's Julian?
 These
  timestamps are important and I want them to be as precise as possible so
  while I could chalk it up to only have second precision that increases
 the
  likelyhood of mistakes if operations occur within that second.
 
  Charlie
 

  



[flexcoders] Problems with Julian Dates with AIR percision?

2009-07-03 Thread Charlie Hubbard
I'm writing some unit tests for my database, and I'm having a real problem
with Julian date comparisons in the SQLite database.  I'm trying to load
records by the following query:

select * from Table where created_at  ?

If my given Date is less than stored dates by 100ms SQLite fails to hand
them back.  I've taken the times stored in SQLite and put them into
coversion programs to convert them to unix epoch longs, and millisecond
percision is stored in the number.  SQLIte does have percision down to the
millisecond, but when I do a sql query they fail to compare correctly.  I've
also confirmed that I do get back the milliseconds correctly stored in the
actionscript's Date object.  Has anyone else had trouble like this?  Should
I just store them as unix epoch integers rather than SQLite's Julian?  These
timestamps are important and I want them to be as precise as possible so
while I could chalk it up to only have second precision that increases the
likelyhood of mistakes if operations occur within that second.

Charlie


[flexcoders] Getting started with Fluint

2009-06-24 Thread Charlie Hubbard
I'm trying to setup my project to use Fluint for unit testing, and I've read
the documentation.  I'm doing an AIR app so I've trying to test my sqlite db
layer, and model objects using Fluint.  However, the details of how get a
simple test running are very vague.  There's a whole discussion around
defining your testsuites in a module that the Air runner then loads in order
to execute your tests.  Sounds good, but how do I get that running in
FlexBuilder 3?  I've defined my module and I see in bin-debug my module's
swf.  So how do I run my tests?  Can I easily setup some run/debug
configuration to fire off my unit tests?  Is there something in the fluint
swc that I configure as another Application?

Thanks
Charlie


Re: [flexcoders] Re: Passing data providers to drop-in item editors/renderers

2009-02-25 Thread Charlie Hubbard
You can access the instance members of your surrounding document using a
special property *outerDocument*  from within the mx:Component tag when
using inline renderers.
mx:Component
  mx:ComboBox dataModel={outerDocument.choices}/
/mx:Component

outerDocument allows you to access any special data or functions you've
defined outside the mx:Component.  It works nicely when you need to inject
data/behavior that is not associated with the data field from the model.
 Remember itemRenders/editors are unique per row so there's no way to inject
data into them since you're not in control of constructing them.  This is
the only way I've found around this little snafu.

If you don't use inline components you can always wrap your custom component
inside an inline and pass data form the outerDocument in as properties to
your custom component thus keeping the code nice and straight forward.  No
tricky code.

Charlie

On Wed, Feb 25, 2009 at 1:36 PM, Tyler Kocheran rfkroc...@gmail.com wrote:

   Does anyone know how to do this? I'm really confused on this one, and I
 honestly need some help. I resorted to using a static variable to get the
 data to where it needs to be, but I just can't make it work. Here's some
 more info.

 I'm creating an editable DataGrid for the purpose of associating Interest
 objects with a User object. The Interest object has a realm property which
 references the id of a Realm object which I've created. I need to basically
 create these Interest objects on what the user has input in each DataGrid
 row. As one of my editors, I need a ComboBox which will reference the Realm
 objects and use each Realm's name property for a label, and each Realm's
 id property for a data field, because I ultimately need to pull that info
 into Interest objects which use a Realm's id property as their own realm
 properties.

 Basically, I just need to supply a list of Realm objects to my itemeditor
 ComboBox. This is seeming pretty impossible to me at the moment,
 unfortunately.

 On Tue, Feb 24, 2009 at 6:11 PM, Tyler Kocheran rfkroc...@gmail.comwrote:

 I need to pass in data to one of my item editors for a data grid column. I
 have an array of data objects that are loaded at runtime and I need to pass
 that collection to item editors so they can use it as a data provider.
 Here's an example of what I need to do. I'm loading a bunch of TKImage
 objects which define a few properties like name and id. I need to use
 the id property as each individual item's data field, and apply the name
 as each individual item's label field. I know it's possible to do something
 like this statically at compile time with a nested mx:dataProvider tag and
 I know it's also possible to use a static property to pass the data along,
 but I'm trying to avoid those two things because my application has the need
 to be dynamic, and I don't like global variables too much ;)

  What I need is for something like this to function:
 mx:DataGrid editable=true
 mx:columns
   mx:DataGridColumn
mx:Component
mx:ComboBox dataProvider={myDataProvider}/
/mx:Component
   /mx:DataGridColumn
 /mx:columns
 /mx:DataGrid

 --
 And do this, knowing the time, that now it is high time to awake out of
 sleep;
 for now our salvation is nearer than when we first believed.




 --
 And do this, knowing the time, that now it is high time to awake out of
 sleep;
 for now our salvation is nearer than when we first believed.

  



Re: [flexcoders] Re: Working with images of varying proportions

2009-02-25 Thread Charlie Hubbard
I seem to remember encountering this problem as well a while back.  I think
the problem is that you are accessing the loader's info before the loader
has a chance to finishing loading them.

If you're inside complete event dispatcher you might try callLater() and see
if that works.  I wish I could remember the solution, but it's something
like that.

Charlie


On Wed, Feb 25, 2009 at 10:12 AM, byte.sensei byte.sen...@yahoo.com wrote:

   OK, this works great when I run the application locally, but when I
 upload to the server and run it from there the images aren't being
 resized (no error message - nothing happens). I tracked the problem
 down to:


 var img_width:int = img.content.loaderInfo.width;
 var img_height:int = img.content.loaderInfo.height;

 These statements work fine when running the Flex app locally, but
 they cause the function to stop execution when executing the Flex app
 from the web server. If I place an Alert before these statements it
 displays fine, but if I place an Alert after these statements it
 never shows up.

 Any ideas why the content.loaderInfo would work fine locally but end
 up null or undefined when running from the web server? Why the
 difference? What can I do to ensure this works on the server?

 Thanks!

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 byte.sensei byte.sen...@...
 wrote:
 
  Thanks for the insight. I did something very similar, although I'm
  using HBox/VBox components to layout my app so I had to put a VBox
  wrapper around the image like this:
 
  mx:VBox id=image_01_wrapper width=100
  height=100% verticalAlign=middle horizontalAlign=center
  mx:Image id=image_01
  source={'http://media.basspro.com/'+current_product.image_url_01}
  complete={image_resize(image_01,100,75)} alpha=0/
  /mx:VBox
 
  Then my image_resize() function takes an Image object and desired
  width/height as parameters:
 
  private function image_resize
  (img:Image,w:int,h:int):void {
  var img_width:int =
  img.content.loaderInfo.width;
  var img_height:int =
  img.content.loaderInfo.height;
 
  if (img_width/img_height = w/h) {
  //image is wider than box
  proportions - resize based on width
  img.width = w;
  img.height = w/img_width*img_height;
  } else {
  //image is taller than box
  proportions - resize based on height
  img.height = h;
  img.width = h/img_height*img_width;
  }
  //Alert.show(img.width.toString() + x +
  img.height.toString());
 
  var fade_in:Fade = new Fade();
  fade_in.target = img;
  fade_in.alphaFrom = 0;
  fade_in.alphaTo = 1;
  fade_in.play();
 
  }
 
 
  I also added the fade in tween so that the images gradually fade in
  when they have been resized. Anyway, your code below got me going.
  Thanks!
 
  -Dan
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Fotis
 Chatzinikos
  fotis.chatzinikos@ wrote:
  
   For something similar i do the following, you should be able to
  change it to
   do what you want quite easily..:
  
   mx:Image
   id=selectedProductImageID
   verticalCenter=0
   complete=imageLoaded()
   source={selectedPhoto}
   left=5
   /
  
   Now the important bit is the complete=imageLoaded():
  
   and the imageLoaded function:
  
   private function imageLoaded():void
   {
   if
 (selectedProductImageID.content.loaderInfo.width
  =
   selectedProductImageID.content.loaderInfo.height)
   {
   selectedProductImageID.width = 330;
   selectedProductImageID.height =
  
 
 330*selectedProductImageID.content.loaderInfo.height/selectedProductIm
  ageID.content.loaderInfo.width
   ;
   }
   else
   {
   selectedProductImageID.height = 330 ;
   selectedProductImageID.width =
  
 
 330*selectedProductImageID.content.loaderInfo.width/selectedProductIma
  geID.content.loaderInfo.height;
   }
   }
  
   On Mon, Feb 23, 2009 at 9:36 PM, byte.sensei byte.sensei@
  wrote:
  
I have an app that loads several images into mx:Image tags
 with
scaleContent=true and width=160 / height=120. The problem is
 not
  all of
my images have these proportions, and for odd sized images they
  end up
being loaded into the upper left hand corner instead of
 centered
  in the
restricting image box.
   
All I'm trying to do is have a box 160x120 pixels, then load in
  images
of various sizes dynamically and have them 1) scale to fit
 within
  this
box, and 2) render centered vertically/horizontally in this
 box.
  Is
there any way I can do this not knowing the actual image sizes
  (and
using images of different proportions)?
   
Thanks!
   
   
   
  
  
  
   --
   Fotis Chatzinikos, Ph.D.
   Founder,
   Phinnovation
   Fotis.Chatzinikos@,
  
 

  



Re: [flexcoders] Playing Mp4 audio with Sound class?

2009-01-16 Thread Charlie Hubbard
That's cool.  I've heard of Merapi, but I didn't know what it was.
The only problem I see with it is how to install the java application,
and run it when AIR is started?  The Merapi website doesn't seem to
have much information on installing, and setup.  I really like the AIR
badge and AIR installation process how does that change with Merapi?

Charlie

On Thu, Jan 15, 2009 at 4:48 PM, Nate Beck n...@tldstudio.com wrote:
 Hey... another situation that can be solved with Merapi
 (http://merapiproject.net/)

 I'm not on the Merapi team... but maybe I should be :D

 On Thu, Jan 15, 2009 at 1:45 PM, Charlie Hubbard charlie.hubb...@gmail.com
 wrote:

 No can do.  I'm in an AIR app so I'm trying not to rely on the server
 for this type of operation.

 Uggg.  Adobe...

 Any chance you know what's the Jira Issue number?  I'd like to bump up
 the vote on it.

 Charlie

 On Thu, Jan 15, 2009 at 3:46 PM, Ryan Graham ryan.gra...@phoenix.edu
 wrote:
  I believe that is the case. You can only use extract on mp3 files with
  the
  Sound object and not on  streams with Netstream – unfortunately this
  feature
  didn't make it into FP10 (hopefully FP11?). Depending on your setup, one
  option might be to use a tool like ffmpeg to convert the mp4 to an mp3
  server-side, and then load that into a Sound object to do the
  extraction.
 
 
 
  HTH,
 
  Ryan
 
 
 
  From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
  Behalf Of Charlie Hubbard
  Sent: Thursday, January 15, 2009 1:14 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Playing Mp4 audio with Sound class?
 
 
 
  So I'm trying to play Mp4 audio files with Sound, but it doesn't seem
  to work. I have gotten it working with NetStream class, but I'd
  really like to use the extract() method to get the underlying samples
  form the mp4 files just as I can with mp3. Am I correct in that Sound
  class doesn't support mp4, but only mp3?
 
  What's the deal with that? Is Sound a wrapper around NetStream? If
  so how could I get the samples?
 
  Charlie
 
  This message is private and confidential. If you have received it in
  error,
  please notify the sender and remove it from your system.
 
 

 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links






 --

 Cheers,
 Nate
 
 http://blog.natebeck.net


 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:flexcoders-dig...@yahoogroups.com 
mailto:flexcoders-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
flexcoders-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[flexcoders] Playing Mp4 audio with Sound class?

2009-01-15 Thread Charlie Hubbard
So I'm trying to play Mp4 audio files with Sound, but it doesn't seem
to work.  I have gotten it working with NetStream class, but I'd
really like to use the extract() method to get the underlying samples
form the mp4 files just as I can with mp3.  Am I correct in that Sound
class doesn't support mp4, but only mp3?

What's the deal with that?  Is Sound a wrapper around NetStream?  If
so how could I get the samples?

Charlie


Re: [flexcoders] Playing Mp4 audio with Sound class?

2009-01-15 Thread Charlie Hubbard
No can do.  I'm in an AIR app so I'm trying not to rely on the server
for this type of operation.

Uggg.  Adobe...

Any chance you know what's the Jira Issue number?  I'd like to bump up
the vote on it.

Charlie

On Thu, Jan 15, 2009 at 3:46 PM, Ryan Graham ryan.gra...@phoenix.edu wrote:
 I believe that is the case. You can only use extract on mp3 files with the
 Sound object and not on  streams with Netstream – unfortunately this feature
 didn't make it into FP10 (hopefully FP11?). Depending on your setup, one
 option might be to use a tool like ffmpeg to convert the mp4 to an mp3
 server-side, and then load that into a Sound object to do the extraction.



 HTH,

 Ryan



 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of Charlie Hubbard
 Sent: Thursday, January 15, 2009 1:14 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Playing Mp4 audio with Sound class?



 So I'm trying to play Mp4 audio files with Sound, but it doesn't seem
 to work. I have gotten it working with NetStream class, but I'd
 really like to use the extract() method to get the underlying samples
 form the mp4 files just as I can with mp3. Am I correct in that Sound
 class doesn't support mp4, but only mp3?

 What's the deal with that? Is Sound a wrapper around NetStream? If
 so how could I get the samples?

 Charlie

 This message is private and confidential. If you have received it in error,
 please notify the sender and remove it from your system.

 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:flexcoders-dig...@yahoogroups.com 
mailto:flexcoders-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
flexcoders-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[flexcoders] Performance and UI failing to update?

2008-12-23 Thread Charlie Hubbard
I'm writing an AIR application where I have a very long operation that
I need to run in the background.  I know Actionscript doesn't have
threads so I'm trying to simulate that using cooperative multi-tasking
by breaking up my job into smaller pieces.  I'm basically trying to
parse an XML file, iterating over the nodes in that XML document,
parsing the file that node refers to, add an entry to the SQL lite DB.
 The parsing of the XML is done separately from the iteration, and
each iteration of the loop over the nodes is done using
UIComponent.callLater().  So my algorithm looks pretty close to
something of this form:

function doIteration( currentIndex : int, totalIndex: int ) : void {
   var current : Object = objects[ currentIndex ];
   doSomething( current );
   callLater( doIteration, [ currentIndex + 1, totalIndex ] );
}

My expectation is that by using callLater that will allow my UI to
paint and update between each iteration of my loop.  However, that
doesn't seem to be the case.  When my application starts this process
it updates very infrequently, and freezes most of the time.  I can put
trace statements in my loop and see that it's processing loads of
files very quickly, but the UI never gets updated.

How does Flash behave when it's under a load like this?  It runs as 12
frames/s, and I know that callLater is done at the end of each frame.
What happens if that process run is longer than 80ms/frame (1000ms/s
divided by 12 frames / s)?  Does it ever catch up?

Thanks
Charlie


Re: [flexcoders] Performance and UI failing to update?

2008-12-23 Thread Charlie Hubbard
Tracy,


Before I started parsing the file it actually worked simply iterating
over the files and adding them to the DB without processing them.
After I started parsing the files I started getting this halting of
the UI.

Do you have any more details about how your technique was different?
Maybe a quick excerpt of code could help clarify your technique.

Thanks,
Charlie


On Tue, Dec 23, 2008 at 10:26 AM, Tracy Spratt tspr...@lariatinc.com wrote:
 I have used this technique to break up long running processes.



 But I use two functions and two instance variables so that the function of
 the iterator is entirely separate from the processor.



 The way you are doing it , essentially recursively, may be causing the
 problem.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of Charlie Hubbard
 Sent: Tuesday, December 23, 2008 8:35 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Performance and UI failing to update?



 I'm writing an AIR application where I have a very long operation that
 I need to run in the background. I know Actionscript doesn't have
 threads so I'm trying to simulate that using cooperative multi-tasking
 by breaking up my job into smaller pieces. I'm basically trying to
 parse an XML file, iterating over the nodes in that XML document,
 parsing the file that node refers to, add an entry to the SQL lite DB.
 The parsing of the XML is done separately from the iteration, and
 each iteration of the loop over the nodes is done using
 UIComponent.callLater(). So my algorithm looks pretty close to
 something of this form:

 function doIteration( currentIndex : int, totalIndex: int ) : void {
 var current : Object = objects[ currentIndex ];
 doSomething( current );
 callLater( doIteration, [ currentIndex + 1, totalIndex ] );
 }

 My expectation is that by using callLater that will allow my UI to
 paint and update between each iteration of my loop. However, that
 doesn't seem to be the case. When my application starts this process
 it updates very infrequently, and freezes most of the time. I can put
 trace statements in my loop and see that it's processing loads of
 files very quickly, but the UI never gets updated.

 How does Flash behave when it's under a load like this? It runs as 12
 frames/s, and I know that callLater is done at the end of each frame.
 What happens if that process run is longer than 80ms/frame (1000ms/s
 divided by 12 frames / s)? Does it ever catch up?

 Thanks
 Charlie

 


Re: [flexcoders] Performance and UI failing to update?

2008-12-23 Thread Charlie Hubbard
Manish,

Thanks that's more like the info I was looking for.  Just some details
as to how Flash events and frame rates work in relation to
callLater().  Using a timer has one distinct advantage that you can
control how fast something is running where my technique ran every
frame (or so I thought).  Right now the processor is being killed so
maybe if I use a high cycle timer I can control that better.

Charlie

On Tue, Dec 23, 2008 at 11:16 AM, Manish Jethani
manish.jeth...@gmail.com wrote:
 On Tue, Dec 23, 2008 at 7:05 PM, Charlie Hubbard
 charlie.hubb...@gmail.com wrote:

 The parsing of the XML is done separately from the iteration, and
 each iteration of the loop over the nodes is done using
 UIComponent.callLater(). So my algorithm looks pretty close to
 something of this form:

 function doIteration( currentIndex : int, totalIndex: int ) : void {
 var current : Object = objects[ currentIndex ];
 doSomething( current );
 callLater( doIteration, [ currentIndex + 1, totalIndex ] );
 }


 You should consider a timer-based approach rather than a frame-based one.

 I remember looking at this library and thinking it was nice:

 http://blog.generalrelativity.org/?p=29

 Oh, and I believe the Flash Player drops frames if it can't keep up.
 Some more gyaan on this:

 http://www.kaourantin.net/2006/05/frame-rates-in-flash-player.html

 --
 manishjethani.com
 


Re: [flexcoders] Re: AIR SQLLite, ints, and NULLs

2008-11-26 Thread Charlie Hubbard
Ok thanks Johannes.  Very good point.  Number's can't really be NULL either.
 However, it just so happens that NaN is interpreted as NULL to the datatype
conversion layer in AIR and it just happens to work out.  Maybe this slight
difference between NaN and NULL doesn't really matter, but it's good to know
that it exists.
My temptation is to write a real object that encapsulates int's as a true
Object data type that can really be NULL, but the draw back here is that it
would be incompatible with AIR's handy databinding (itemClass on
SQLStatement since AIR will convert database integers to Numbers instead of
my abstraction).

I guess more investigation is needed in these matters.

Charlie

On Mon, Nov 24, 2008 at 2:26 PM, Johannes Nel [EMAIL PROTECTED]wrote:

   on debug level it evaluates to NaN, which should insert as NULL.
 but then remember
 var n:Number; // == NaN
 var p:Number = n + 1;//==NaN

 var q:int = n+1;//==0


 On Mon, Nov 24, 2008 at 9:01 PM, Charlie Hubbard 
 [EMAIL PROTECTED] wrote:

   So if I can sum up your email very clearly.  I'd say:

 DO NOT use int, use Number, because that's what Air's database connection
 layer is going to return you.

 If you use int data type for fields you'll get zeros.  With Number it's
 will propagate NULLs correctly.

 Thanks,
 Charlie

 On Mon, Nov 24, 2008 at 12:18 AM, jason_williams_mm 
 [EMAIL PROTECTED] wrote:

   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 Charlie Hubbard
 [EMAIL PROTECTED] wrote:
 
  I've read over all of the docs on Air, but there seems to be a missing
  discussion around NULL values in SQLLite and how those map back to
  datatypes. What I've found is that if I have an int field type I
 can't get
  a NULL value to ever get inserted into the SQLLite. It just ends up
  inserting 0 (zero). In Java we'd just convert to using a true
 Object like
  Integer class, and that would handle this problem for us. What is the
  equivalent with Actionscript? If you want NULLs and numbers what is an
  object and a number, and will Air convert between the two correctly?
 
  Thanks
  Charlie
 

 It would help to see the code that you are using, however, the
 following code gives the same results in both 1.5 and 1.1:

 ?xml version=1.0 encoding=utf-8?
 mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute creationComplete=run()
 mx:Script
 ![CDATA[
 import mx.utils.ObjectUtil;

 private function run():void
 {
 trace(NativeApplication.nativeApplication.runtimeVersion);
 var con:SQLConnection = new SQLConnection();
 con.open(File.applicationStorageDirectory.resolvePath(nulltesting.db));
 var sql:SQLStatement = new SQLStatement();
 sql.sqlConnection = con;
 sql.text = CREATE TABLE test (id integer);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(null);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(1);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(2);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(3);;
 sql.execute();

 sql.text = SELECT * FROM test;;
 sql.execute();
 trace(ObjectUtil.toString(sql.getResult().data));
 }
 ]]
 /mx:Script
 /mx:WindowedApplication

 -- trace output --

 (Array)#0
 [0] (Object)#1
 id = (null)
 [1] (Object)#2
 id = 1
 [2] (Object)#3
 id = 2
 [3] (Object)#4
 id = 3

 Each of the values returned in the object is a Number. Hope that
 helps some.

 jw





 --
 j:pn
 \\no comment

  



Re: [flexcoders] Re: AIR SQLLite, ints, and NULLs

2008-11-24 Thread Charlie Hubbard
So if I can sum up your email very clearly.  I'd say:

DO NOT use int, use Number, because that's what Air's database connection
layer is going to return you.

If you use int data type for fields you'll get zeros.  With Number it's will
propagate NULLs correctly.

Thanks,
Charlie

On Mon, Nov 24, 2008 at 12:18 AM, jason_williams_mm 
[EMAIL PROTECTED] wrote:

   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 Charlie Hubbard
 [EMAIL PROTECTED] wrote:
 
  I've read over all of the docs on Air, but there seems to be a missing
  discussion around NULL values in SQLLite and how those map back to
  datatypes. What I've found is that if I have an int field type I
 can't get
  a NULL value to ever get inserted into the SQLLite. It just ends up
  inserting 0 (zero). In Java we'd just convert to using a true
 Object like
  Integer class, and that would handle this problem for us. What is the
  equivalent with Actionscript? If you want NULLs and numbers what is an
  object and a number, and will Air convert between the two correctly?
 
  Thanks
  Charlie
 

 It would help to see the code that you are using, however, the
 following code gives the same results in both 1.5 and 1.1:

 ?xml version=1.0 encoding=utf-8?
 mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute creationComplete=run()
 mx:Script
 ![CDATA[
 import mx.utils.ObjectUtil;

 private function run():void
 {
 trace(NativeApplication.nativeApplication.runtimeVersion);
 var con:SQLConnection = new SQLConnection();
 con.open(File.applicationStorageDirectory.resolvePath(nulltesting.db));
 var sql:SQLStatement = new SQLStatement();
 sql.sqlConnection = con;
 sql.text = CREATE TABLE test (id integer);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(null);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(1);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(2);;
 sql.execute();

 sql.text = INSERT INTO test VALUES(3);;
 sql.execute();

 sql.text = SELECT * FROM test;;
 sql.execute();
 trace(ObjectUtil.toString(sql.getResult().data));
 }
 ]]
 /mx:Script
 /mx:WindowedApplication

 -- trace output --

 (Array)#0
 [0] (Object)#1
 id = (null)
 [1] (Object)#2
 id = 1
 [2] (Object)#3
 id = 2
 [3] (Object)#4
 id = 3

 Each of the values returned in the object is a Number. Hope that
 helps some.

 jw

  



Re: [flexcoders] Re: AIR SQLLite, ints, and NULLs

2008-11-23 Thread Charlie Hubbard
Thanks Amy, but I was really asking for what I can use as a substitute data
type for an int since you can't have NULLs for an int.  So far from what I'm
finding is I can use Number in place of int and also get a null value for a
Number into the DB.  At least it seems that way so far.  If I change all of
my int's to Number's then I start getting NULLs as expected for values that
are unset.  So I guess I really trying to validate that fact with other
Actionscripters out there to see if this is acceptable or if not is there a
better option.  Can I use Number place of int and not run into any problems
down the road?

Charlie

On Sun, Nov 23, 2008 at 1:37 PM, Amy [EMAIL PROTECTED] wrote:

   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 Charlie Hubbard
 [EMAIL PROTECTED] wrote:
 
  I've read over all of the docs on Air, but there seems to be a missing
  discussion around NULL values in SQLLite and how those map back to
  datatypes. What I've found is that if I have an int field type I
 can't get
  a NULL value to ever get inserted into the SQLLite. It just ends up
  inserting 0 (zero). In Java we'd just convert to using a true Object
 like
  Integer class, and that would handle this problem for us. What is the
  equivalent with Actionscript? If you want NULLs and numbers what is
 an
  object and a number, and will Air convert between the two correctly?

 I don't believe null is an acceptable value for an int in Actionscript
 3, so as long as you're using an int datatype, you'll have to check for
 maybe undefined or something and insert null vs. the actual variable
 value. Check the docs for the specifics of what the empty value is
 for int.

 HTH;

 Amy

  



[flexcoders] AIR SQLLite, ints, and NULLs

2008-11-22 Thread Charlie Hubbard
I've read over all of the docs on Air, but there seems to be a missing
discussion around NULL values in SQLLite and how those map back to
datatypes.  What I've found is that if I have an int field type I can't get
a NULL value to ever get inserted into the SQLLite.  It just ends up
inserting 0 (zero).  In Java we'd just convert to using a true Object like
Integer class, and that would handle this problem for us.  What is the
equivalent with Actionscript?  If you want NULLs and numbers what is an
object and a number, and will Air convert between the two correctly?

Thanks
Charlie


[flexcoders] FileReference's DataEvent.UPLOAD_COMPLETE_DATA event being dropped randomly

2008-10-07 Thread Charlie Hubbard
I'm having trouble getting a DataEvent.UPLOAD_COMPLETE_DATA event when
uploading many FileReferences.  It randomly drops events, but I get all of
the progress events, and Event.COMPLETE.  I only get some of
UPLOAD_COMPLETE_DATA.  I'm aware that UPLOAD_COMPLETE_DATA is not sent if
the server doesn't return any data, but I'm sending data for all of these
uploads (because it all traverses through he same code).  So if I get even
one callback I should get all of them in theory. My first theory was that my
server process was taking too long and flash timed out the response so I
offloaded what was taking so long, but that didn't improve anything.


Any idea what's going on here?  Any other ideas on what I can try?  I'm
using a Ruby on Rails server backend.


Charlie


Re: [flexcoders] FileReference's DataEvent.UPLOAD_COMPLETE_DATA event being dropped randomly

2008-10-07 Thread Charlie Hubbard
Thanks Jeff.  That just might work for what I'm doing.  What a pain in the
ass, but your suggestion is pragmatic.  I'm sure others have encountered
this problem.  Any explanation about why Flex/Flash is not upholding it's
end of the bargain?  Is it just a simple issue of Flash's URLRequest timing
out waiting on the serverr?  My server is responding in about 500ms on the
low end at around 200ms on the upper end.  But, it still just drops some of
the requests.
Charlie

On Tue, Oct 7, 2008 at 9:59 AM, Battershall, Jeff 
[EMAIL PROTECTED] wrote:

Charlie,

 I spent a lot of time on this.  In my case it was only when using FireFox
 and when HTTPs was being used.  Basically the long requests time out - it is
 upload file size dependent.  What I ended up doing is listening for the
 COMPLETE event and then round-tripping to the server to retreive the data I
 wanted about the upload.  When I did my upload, I passed a UUID so I had a
 common thread I could count on.

 Even though your issue may be slightly different, using a UUID in your
 URLRequest object may help you workaround the issue.

 Jeff

  -Original Message-
 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Charlie Hubbard
 *Sent:* Tuesday, October 07, 2008 7:34 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] FileReference's DataEvent.UPLOAD_COMPLETE_DATA
 event being dropped randomly


  I'm having trouble getting a DataEvent.UPLOAD_COMPLETE_DATA event when
 uploading many FileReferences.  It randomly drops events, but I get all of
 the progress events, and Event.COMPLETE.  I only get some of
 UPLOAD_COMPLETE_DATA.  I'm aware that UPLOAD_COMPLETE_DATA is not sent if
 the server doesn't return any data, but I'm sending data for all of these
 uploads (because it all traverses through he same code).  So if I get even
 one callback I should get all of them in theory. My first theory was that my
 server process was taking too long and flash timed out the response so I
 offloaded what was taking so long, but that didn't improve anything.


 Any idea what's going on here?  Any other ideas on what I can try?  I'm
 using a Ruby on Rails server backend.


 Charlie

  



[flexcoders] Programatically Edit a Tree Node

2008-09-09 Thread Charlie Hubbard
I've googled and googled for this, but I could never find out how to invoke
the itemEditor on a Tree programatically.  This seems like such a simple
thing.  How do you do it?

Thanks
Charlie


[flexcoders] Getting an ItemEditEnd event to fire from a customer itemEditor (Focus?)

2008-08-13 Thread Charlie Hubbard
Hi,

I have a customer item editor that handles a 5 star rating system.  If the
user clicks on the component it will rate it 1-5 stars.  I've gotten
everything working except I can't get the DataGrid to fire an itemEditEnd
event when I click on the component.  I figured it would work similar to
CheckBox, but I think my missing piece is that CheckBox is focusable where
my HBox with 5 Image components is probably not.  What actually triggers the
DataGrid to know when an editor is done editting?  Should my customer editor
fire the itemEditEnd event?  Or is that DataGrid's responsibility?  If it
is, what event can I fire to force DataGrid to fire it's ItemEditEnd event?

Thanks
Charlie


[flexcoders] Stump the Flex Nerd: Getting reference to the set method of a property

2008-07-09 Thread Charlie Hubbard
Ok, I think I've got a pretty difficult question here.  I want to the setter
method given a string containing the name of a property.  With normal
methods I can always do something like obj.myFunction to get a reference to
that function, then I can invoke that function with a func.call().  However,
if you do obj.someProperty that calls the get method.   I already tried obj[
propertyName ] which returned null so that's out.

It's almost like you need another language feature.  obj-property= and
obj-property for ( reference to setter and getter of this property).

Charlie


Re: [flexcoders] Stump the Flex Nerd: Getting reference to the set method of a property

2008-07-09 Thread Charlie Hubbard
Well that was a quick answer thanks.  Too bad you can't do this :-(  I
noticed in my debugger if I drop a breakpoint inside the set property
function it reports the name of the function as set property with a
space.  I haven't tested if obj[set property] would really return that
function or not, but I guess not.

I'm trying to save myself extra typing by going meta with my framework.
I'm trying to map the results coming back from say a RemoteObject onto a a
model's property inside the object receiving the server's response.  It's
really just trying to save myself the extra work of writing a bunch of tiny
little functions that just do a property set.  For example:

var token : AsyncToken = parent.getAllUsers( orderBy );
token.addResponder( new AsyncResponder( generateEvent(usersLoaded, users
), generateError(usersFailed), token ) );
return token;

The meat of this example is the generateEvent() and generateError()
methods.  These methods simply return a listener function that will generate
the event specified in the first parameter, and in the case of generateEvent
it will assign the results from the server to the property users.  This
allows the model to load the data form the server asynchronously, then when
the results arrive back it fires a domain level event so the Controller can
grab that event and respond to it, or just use simple Bindable on the
property to update the view if it's a simple response.

My work around is the following:

var token : AsyncToken = parent.getAllUsers( orderBy );
token.addResponder( new AsyncResponder( generateEvent(usersLoaded,
function( result : Object ) : void { users = result as ArrayCollection; }),
generateError(usersFailed), token ) );
return token;

It just saves me from having to inline an anonymous function that sets the
result onto the property.  Makes it slightly cleaner.  I'll probably
refactor the whole addResponder mess so that it's even less messy, but I
won't be able to reduce the inline function needed to route the result onto
the property.

Charlie


On Wed, Jul 9, 2008 at 4:40 PM, Gordon Smith [EMAIL PROTECTED] wrote:

There is no way in AS3 to get a reference of type Function to a getter
 or setter. What is your use case for needing such a reference?



 Gordon Smith

 Adobe Flex SDK Team


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Charlie Hubbard
 *Sent:* Wednesday, July 09, 2008 12:44 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Stump the Flex Nerd: Getting reference to the set
 method of a property




 Ok, I think I've got a pretty difficult question here.  I want to the
 setter method given a string containing the name of a property.  With normal
 methods I can always do something like obj.myFunction to get a reference to
 that function, then I can invoke that function with a func.call().  However,
 if you do obj.someProperty that calls the get method.   I already tried obj[
 propertyName ] which returned null so that's out.

 It's almost like you need another language feature.  obj-property= and
 obj-property for ( reference to setter and getter of this property).

 Charlie





Re: [flexcoders] New to flex, wonder why one works and the other doesn't...

2008-06-01 Thread Charlie Hubbard
Right.  Image is a UIComponent, and TextArea is a UIComponent.
UIComponent's can't contain other UIComponents without being a
subclass of Container or implementing the IContainer interface.  Not a
simple task.

addChild() is defined in DisplayObject which apart of the Flash API
not the Flex API.  BitmapAsset is a sublcass of DisplayObject and not
UIComponent.  So you can add it to the text area directly using this
code:

var img : BitmapAsset = new imgCls() as BitmapAsset;
img.x = txtArea.mouseX;
img.y = txtArea.mouseY;
txtArea.addChild( img );

Now, try that out, and you'll start to see some issues that you'll
have to asess if this is going to work for what you're trying to do.
Since the bitmap is not apart of the document in the TextArea you are
going to get clipping or scrolling.  If you want to do that you'll
have to get really dirty with the TextArea API.  Probably even
ditching TextArea altogether and writing your own, or modifying rich
text editor.

Charlie


On Thu, May 29, 2008 at 5:37 PM, aarhac [EMAIL PROTECTED] wrote:
 Hello,

 I have figured out how to work around my problem, but I do wonder why
 one of the following methods works, and the other doesn't. I would be
 grateful if someone could explain the error in the failing method.

 The code is pasted below (Below the line of dashes) in it's entirety,
 and is commented as to which works and which doesn't.

 The image referenced in this case is a 32x32 pixel png file on my
 local system. I am attempting to display the image on a text area.

 Using the default example from the flex documentation to embed an
 image, I cannot get the image to show up when added to the text area's
 display list, but it does show just fine when added to the root
 display list. I also added the image to the textArea using
 addChildAt(txtIcon, txtArea.numChildren) with no change in effect.

 The second method works just fine. I imagine that the problem has
 something to do with applying the image as a byte array to
 image.source, but I wonder why exactly? Is this a bug?

 Thanks in advance,

 --Aaron

 

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

 !--Works--
 mx:Image id=txtIcon source=@Embed(source='c:/icon.png')/

 mx:TextArea id=txtArea width=400 height=200 click=addImage()/

 mx:Script
 ![CDATA[
 import mx.controls.Image;
 import mx.core.BitmapAsset;

 // Doesn't work
 [Embed(source=c:/icon.png)]
 [Bindable]
 public var imgCls:Class;

 public function addImage():void
 {
 // Doesn't work
 var loadedImg:Image = new Image();
 loadedImg.source = new imgCls() as BitmapAsset;

 loadedImg.x = 10;
 loadedImg.y = 10;
 txtArea.addChild(loadedImg);

 // Note: While the above doesn't work, adding the
 // image to the root display list does work:
 //addChild(loadedImg);

 // Works
 txtIcon.x = 50;
 txtIcon.y = 10;
 txtArea.addChild(txtIcon);
 }
 ]]
 /mx:Script

 /mx:Application

 


Re: [flexcoders] New to flex, wonder why one works and the other doesn't...

2008-06-01 Thread Charlie Hubbard
Damn.  Sorry the last paragraph should read:

Since the bitmap is not apart of the document in the TextArea you
aren't going to get clipping or scrolling of that image.

Charlie

On Sun, Jun 1, 2008 at 10:52 AM, Charlie Hubbard
[EMAIL PROTECTED] wrote:
 Right.  Image is a UIComponent, and TextArea is a UIComponent.
 UIComponent's can't contain other UIComponents without being a
 subclass of Container or implementing the IContainer interface.  Not a
 simple task.

 addChild() is defined in DisplayObject which apart of the Flash API
 not the Flex API.  BitmapAsset is a sublcass of DisplayObject and not
 UIComponent.  So you can add it to the text area directly using this
 code:

var img : BitmapAsset = new imgCls() as BitmapAsset;
img.x = txtArea.mouseX;
img.y = txtArea.mouseY;
txtArea.addChild( img );

 Now, try that out, and you'll start to see some issues that you'll
 have to asess if this is going to work for what you're trying to do.
 Since the bitmap is not apart of the document in the TextArea you are
 going to get clipping or scrolling.  If you want to do that you'll
 have to get really dirty with the TextArea API.  Probably even
 ditching TextArea altogether and writing your own, or modifying rich
 text editor.

 Charlie


 On Thu, May 29, 2008 at 5:37 PM, aarhac [EMAIL PROTECTED] wrote:
 Hello,

 I have figured out how to work around my problem, but I do wonder why
 one of the following methods works, and the other doesn't. I would be
 grateful if someone could explain the error in the failing method.

 The code is pasted below (Below the line of dashes) in it's entirety,
 and is commented as to which works and which doesn't.

 The image referenced in this case is a 32x32 pixel png file on my
 local system. I am attempting to display the image on a text area.

 Using the default example from the flex documentation to embed an
 image, I cannot get the image to show up when added to the text area's
 display list, but it does show just fine when added to the root
 display list. I also added the image to the textArea using
 addChildAt(txtIcon, txtArea.numChildren) with no change in effect.

 The second method works just fine. I imagine that the problem has
 something to do with applying the image as a byte array to
 image.source, but I wonder why exactly? Is this a bug?

 Thanks in advance,

 --Aaron

 

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

 !--Works--
 mx:Image id=txtIcon source=@Embed(source='c:/icon.png')/

 mx:TextArea id=txtArea width=400 height=200 click=addImage()/

 mx:Script
 ![CDATA[
 import mx.controls.Image;
 import mx.core.BitmapAsset;

 // Doesn't work
 [Embed(source=c:/icon.png)]
 [Bindable]
 public var imgCls:Class;

 public function addImage():void
 {
 // Doesn't work
 var loadedImg:Image = new Image();
 loadedImg.source = new imgCls() as BitmapAsset;

 loadedImg.x = 10;
 loadedImg.y = 10;
 txtArea.addChild(loadedImg);

 // Note: While the above doesn't work, adding the
 // image to the root display list does work:
 //addChild(loadedImg);

 // Works
 txtIcon.x = 50;
 txtIcon.y = 10;
 txtArea.addChild(txtIcon);
 }
 ]]
 /mx:Script

 /mx:Application

 



Re: [flexcoders] Drilldown ideas

2008-06-01 Thread Charlie Hubbard
I think you're asking what's the best UI metaphor for displaying
hierarchal data from a dataGrid.  While popup windows are cheap and
easy.  This work well if your user will be edtting the data once they
see it.  The Ok-Cancel metaphor on the popup window makes editing easy
to use.  Adding editing with these other options can be difficult.
However, I think navigating around in data they are pain, plus the pop
always is smaller than your screen real estate of your main window.

I favor more a fluid UI by dividing the UI into the dataGrid on top
and the content on bottom.  Click a row displays the data in the
bottom panel.  You can orient the two areas anyway you like.  Left and
right if your data lends itself to being displayed easily that way.
But, with tables they always seem less cramped if it's a top bottom
orientation.  This way your users can quickly navigate through the
data and see the content with one window.  If the bottom portion
doesn't have enough space.  Surround your table in a tab UI, then
allow them to open up the content in a sibling tab so that they have
all the screen space they need.  And, that allows for a quick bookmark
like work flow allowing the user to refer back to previously found
objects.

TreeTable grids work if the columns of the table match the columns
you'll display when you drill down on a row.  If the UI shown for
drill down has different data requirements than the table's you'll
find it too limiting or akward to display other types of data in the
table.  Ultimately, TreeTables can limit your ability to modify the UI
in the future.

Charlie

On Wed, May 21, 2008 at 8:20 AM, 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.

 


Re: [flexcoders] Panel with no borders. How To?

2008-06-01 Thread Charlie Hubbard
I know this has been said, but if  you want a panel without any
borders then you really probably want a Canvas not a Panel.  The only
real difference between the border functionality of Panel has two
layout modes and absolute positioning is not the default.  Canvas only
supports absolute positioning.

Charlie

On Sat, May 31, 2008 at 6:11 AM, Manu Dhanda [EMAIL PROTECTED] wrote:

 Hii

 I need a panel with no border or say with border with ZERO width.

 How can I get this done?

 Thanks.
 --
 View this message in context:
 http://www.nabble.com/Panel-with-no-borders.-How-To--tp17573772p17573772.html
 Sent from the FlexCoders mailing list archive at Nabble.com.

 


Re: [flexcoders] Scaling via Streaming???

2008-05-30 Thread Charlie Hubbard
Streaming is the ability to jump around a video stream without having
to download the prior content.  The user clicks play and then jumps 1
hour into the video.  Streaming will allow you to jump to the hour
mark without downloading the first hour.  You have to use a special
server to do this though.  You have two options Flash Media Server
(commercial and it starts at $5K and goes up depending on how many
clients you have), or you can try Red5 server (open source).  Red5
team has done a heck of a job reverse engineering rtmp protocols, and
figuring out adobe's proprietary code, but it's still pretty early on
and in beta.

The other alternative is progressive downloads which means you
download just a little bit of the video and start playing it once you
have enough that won't cause a skip in playback.  The idea is that if
you give the downloader a head start he can continue to download the
video fast enough that the playhead won't catch up to the video being
played.  To contrast this with streaming it means that if you haven't
downloaded the the first 1hour  you can't jump past it.  You can only
jump around in the portion you have downloaded, and the download
progresses linearly (i.e. it downloads the 1st hour, the 2nd hour, etc
).   This is the youtube approach, and it doesn't require any exotic
technologies to accomplish this.  A plain ole web server is all you
need, and properly encoded video. (i.e. the meta data in the video
stream that tells you how long a video is, etc has to be located in
the front of the video stream).  Most encoders will move that data up
to the front for you.

Personally, streaming I think sucks from a user's experience
perspective.  With streaming you can't cache the video that you
download.  Once the play head has passed that block rewinding is
treated as another request for a different part in the stream so that
means back to the server and wait while it buffers up the request.
There's a lot of hurry up and wait with streaming that makes it worse
that progressive downloading.  Plus if you don't need to jump around
in the stream then it's not worth it to you, and you get the crappy
experience with it.

I think what you want is a combination between the two which there is
no just plug and play technology that satisfies what you want.  But,
if you cut up your streams along smaller boundaries (i.e. between the
interactive parts) that would allow you to do progressive download on
video they currently want to watch.  When the interactive part starts,
then you download the next segment they want to watch.  Provided you
can fetch that segment relatively quickly then the user will only have
to wait say 5s before the next portion starts.  If you really wanted
to get fancy with it you could download all possible next scenarios
while they are watching the current segment.

As for can 36 students simultaneously watch/download the episode over
a DSL.  I can't say.  But as a test, try getting those 36 students to
download the same video from youtube and see what happens.  You're
using a nice P2P distributed model which is going to help you a lot
since students at a location won't need to go out the DSL to get
episodes another students has already downloaded.

Charlie

Charlie
On Mon, Apr 28, 2008 at 2:39 PM, r_v_boyd [EMAIL PROTECTED] wrote:
 We provide online educational applications to schools and use Java2D
 and jxta for P2P. Think of it as a combo on education with mini-game
 like environment. A large activity may contain over 200 questions and
 approach 200MB in audio and images. We use Peer2Peer (jxta) to
 download jars to one student ... then the other (~35) students
 download from the first student. This is to reduce bandwidth strain on
 DSL or T-1 pipe often running on older (i.e., slower) PC equipment. We
 are looking at Flex. Our application is dynamic in the sense that the
 next scene/question will vary depending on how a student answers a
 question. That is, it is not a straight, linear video ... but an
 interactive QA session. We read that Flex supports streaming.
 QUESTION -- Is this streaming only for linear video clips ... or
 can it act as lazy loading whereby a student just begins downloading
 what he needs at the moment without trying to download clips he will
 not need until later? ALSO, I can see how this streaming would be
 great for one user ... but how would it work if there were 36
 users/students all trying to stream through the same relatively
 small pipe (DSL or T-1)? Or is there some way to cache these
 audio/image resources so that the first student downloads it, and
 remaining students do not do remote download from server, but download
 from first student ... i.e., P2P-like? BOTTOM LINE -- Would Flex
 streaming work on a DSL or T-1 for 36 simultaneous users/students
 trying to pull down a lot of MBs of audio and image resources?

 


[flexcoders] Netstream.play() arguments and caching video

2008-05-30 Thread Charlie Hubbard
Hi,

I'm trying to download a video up front and cache it in memory before
playing it.  I understand how to use the Netstream.play() and passing
it a URL.  However, I want to download a video stream up front before
playing it and cache it either in memory or the filesystem (I know
this is probably not possible).  Then at the right time pass that
cached copy to the netstream to play it back.  The documentation says
play() can take several args, of unknown type, but they don't really
explain what are all the possible types that can be passed.  And, the
examples only show it passing strings to urls.  The docs do say you
can tell it a local file, but I haven't seen any examples of that.

Anyone have any information on how I could do this?

Charlie


[flexcoders] Infinite Scrolling component?

2008-05-30 Thread Charlie Hubbard
Hi,

I have a component that I'm working on right now, and I'm using the
scrollRect to provide me a sliding window over a component.  The only
problem with this is that while I can make it scroll back and forth
using this.  I have to provide a fix width in order for it to work.
What I'd really like to create is something that would allow me to
scroll infinitely in either direction.  How could I got about doing
that?  I know I might have to give up scrollRect in order to do this.
Or maybe I could simply increase the size of the component as I got
closer to the edges.

Charlie


[flexcoders] Flexbuilder 2 wont' rebuild my project

2008-04-15 Thread Charlie Hubbard
I have a project in Flexbuilder 2 that won't rebuild the html and swfs
under bin.  I've done a clean on the project, and even tried to build
it manually.  I can see in the progress view it starts to build it,
but then quickly quits building it.  It's like a flash then it's gone.
 I can't tell what it's doing or really not doing.  Anyone else seen
this problem?

Charlie


[flexcoders] After exiting Fullscreen flex doesn't repaint

2008-04-03 Thread Charlie Hubbard
Hi,

I'm having problems after leaving full-screen in that my application
doesn't repaint.  I get a grey rectangle that I have to click or
scroll the browser frame in order to get it to redraw.  I tried
executing an invalidateDisplayList() on my screen, but it didn't work.
 The only thing that seems to work is clicking the app, or scrolling
when it's in a grey rectangle.  I do have a problem where sometimes
where the flash player just disappears all together, and no matter
what I do the app doesn't redraw.

I'm testing on Firefox on Mac, IE on Vista, and Firefox on Windows
with the latest version of the flash player.

Thanks
Charlie


Re: [flexcoders] Flex Builder and Ant

2008-03-28 Thread Charlie Hubbard
We use both Flexbuilder and ant to build our projects.  Mainly so that
we can script our builds with Ant for both automated builds, and so
it's easy to build the entire application (web, flex, etc), and deploy
it to our servers.  Ant has great support for doing secure copy so we
can push our builds to our development servers, and production servers
all from ant.  When you say combine what exactly are you
envisioning?  Are you just asking how to build your projects with ant?

Charlie

On Fri, Mar 28, 2008 at 9:34 AM, Weyert de Boer [EMAIL PROTECTED] wrote:






 Does anyone know how I can combine the use of Flex Builder and Ant to
  compile Flex/AIR projects?

  


Re: [flexcoders] Shared Object in Flex 2

2008-03-05 Thread Charlie Hubbard
What's exactly not working about this?  I copied your code into an
mxml doc, added the missing import, and ran it.  It looked like it
worked to me.

Charlie

On Wed, Mar 5, 2008 at 12:32 PM, nelson_geoff [EMAIL PROTECTED] wrote:

 Can anyone help me figure out why this won't work?

  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=vertical
  mx:Script
  ![CDATA[

  private function storeVisitDate():void
  {
  var visitDate:SharedObject = SharedObject.getLocal
  (userVisitedDate);
  if(visitDate.data.lastVisitedDate != null)
  {
  Alert.show(Welcome back, you visited last on 
  + visitDate.data.lastVisitedDate);
  }
  visitDate.data.lastVisitedDate = new Date();
  visitDate.flush();
  }
  ]]
  /mx:Script
  mx:Button label=Click Me click=storeVisitDate()/
  /mx:Application

  


Re: [flexcoders] Re: Passing Parameters to flash file

2008-03-03 Thread Charlie Hubbard
Examples in HTML would be something like the following:

Object tag would be something like:

PARAM NAME=FlashVars VALUE=param1=blahparam2=blekparam3=gloub+koll

Embed tag would be something like:

EMBED src=display.swf
FlashVars=param1=blahparam2=blekparam3=gloub+koll ... (other
parameters)/EMBED

In your flex application you would do:

var param1 : String = Application.application.parameters.param1;
var param2 : String = Application.application.parameters.param2;
var param3 : String = Application.application.parameters.param3;

Things to remember is that values must be URL encoded such that values
containing ampersands, spaces, etc must be encoded to prevent
confusing flex.

You can read about it at adobe's KB here:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417sliceId=2

Charlie

On Sun, Mar 2, 2008 at 8:59 PM, Manjith [EMAIL PROTECTED] wrote:






 Hi Hob,

  Can you please send me a code sample. I tired with parameter string
  in HTML. But it didn't work.

  Thanks

  Manjith
  --- In flexcoders@yahoogroups.com, Hob Spillane [EMAIL PROTECTED]
  wrote:

  
   You can pass parameters to your SWF using the flashVars variable in
   your HTML wrapper. The parameters are formatted querystring
  style.
  
   Once in your flex app, you can access your parameters using:
  
  
  Application.application.parameters.yourParamNameHere
  
   -Hob
  
  
   --- In flexcoders@yahoogroups.com, Manjith manjith155@ wrote:
   
I want to pass a parameter to a flsh file and access that value
  within
the code to decide a path of a xml file loacted.
   
Could anyone suggest how to do this in flex.
   
   
Thanks
   
Manjith