[flexcoders] Re: Animated dashed lines

2008-07-21 Thread havardfl
--- In flexcoders@yahoogroups.com, "havardfl" <[EMAIL PROTECTED]> wrote:
>
> In a project I'm working on I would like to represent data flowing
> through the system with dashed/dotted lines moving between two or more
> points.
> 
> I've done one implementation using the lineGradientStyle function to
> create dashes. This works, but I'm not pleased with the CPU load while
> the script is running. I'd like to draw 100+ lines, and my method of
> doing it isn't cutting it.
> 
> Does anyone know a great way of drawing animated dashed/dotted lines
> without using much CPU time?
>

This is my implementation btw:

static public function DrawStippledShape2(g:Graphics,
points:Array, pattern:Array=null, alphas:Array=null,
colors:Array=null, thicknesses:Array=null, offset:Number=0):void
{
  g.moveTo(points[0].x, points[0].y);
  var pat2:Array = [];
  var patsum:Number = 0;
  for each (var p:Number in pattern){
patsum += p;
  }
  for (var i:int = 0 ; i < pattern.length ; i++){
pat2[i] = pattern[i] / patsum * 255;
  }
  
  for (var i:int = 1 ; i 

[flexcoders] Re: SoundMixer.computeSpectrum

2008-07-21 Thread Shaq
Have no one else ran into this problem?

-Shaq

--- In flexcoders@yahoogroups.com, "Shaq" <[EMAIL PROTECTED]> wrote:
>
> Say I have two soundchannel objects each playing different
> music/files.  Is there a way to call computeSpectrum on each channel
> instead of a global computeSpectrum?
> 
> I would like to display the spectrum for both channels in two
> different graphs.
> 
> Any suggestions would be appreciated.
> 
> -Shaq
>




Re: [flexcoders] accessing styles of children

2008-07-21 Thread [EMAIL PROTECTED]
for (var i:int = 0; i < numChildren; i++) {
StyleClient(videoButtonBox.getChildAt(i)).setStyle("backgroundColor","#FF")
}

1180: Call to a possibly undefined method StyleClient.

Thanks, but I don't get it. Please explain.

Alex Harui wrote:
 >
 > It is if you cast everything correctly
 >
 >
 >
 > IStyleClient(videoButtonBox.getChildAt(i)).setStyle(…).
 >
 >
 >
 > The compile is trying to help you out so the return types of methods 
and properties are important
 >
 >
 >
 > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of [EMAIL PROTECTED]
 > Sent: Monday, July 21, 2008 10:14 PM
 > To: flexcoders@yahoogroups.com
 > Subject: [flexcoders] accessing styles of children
 >
 >
 >
 > videoButtonBox. is an VBox with HBoxes for children.
 > How do I change styles as I iterate thru children?
 > videoButtonBox.getChildAt(i).setStyle() is not a function.
 >
 > var numChildren:Number = videoButtonBox.numChildren;
 > for (var i:int = 0; i < numChildren; i++) {
 > videoButtonBox.getChildAt(i)
 > }
 >
 > This page talks about rawChildren as a way to access styles, but I have
 > read it 10 times and I have no idea what they are trying to describe.
 >





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
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:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

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



[flexcoders] (unknown)

2008-07-21 Thread venkat eswar
How can i develop sound recorder (like windows sound recorder) in flash. The 
user speaks from mic/headphone and flash record the sound.


  

RE: [flexcoders] Understanding DataGridColumn#sortCompareFunction with composite custom classes

2008-07-21 Thread Alex Harui
If the property identified by the column's dataField doesn't actually
exist, I think that's when you get this error.  A sortCompareFunction on
a column specifies a SortField's compare function.  You can also specify
a custom Sort with a global compareFunction that shouldn't check for the
existence of fields.  You would get the HEADER_RELEASE event, call
preventDefault() and set the collection's Sort accordingly

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of florian.salihovic
Sent: Monday, July 21, 2008 5:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Understanding DataGridColumn#sortCompareFunction
with composite custom classes

 

I'm currently working with a custom classes which are composites. I
display the needed 
data via custom ItemRenderer which extends the mx.controls.Text
component. It works 
pretty nice and is pretty flexible. But i need to sort my data as well.
After some researches 
i learned to implement a custom sortCompareFunction. My current
implementation works 
just like the following in a class subclassing 
mx.controls.dataGridClasses.DataGridColumn:

/* Begin */

protected function compare(arg1:CustomClass, arg2: CustomClass):int {
if (!super.dataField) {
return 0;
}
return 1;
if (arg1.hasOwnProperty(super.dataField) &&
arg2.hasOwnProperty(super.dataField)) {
return ObjectUtil.stringCompare(arg1[super.dataField].toString(),
arg2[super.dataField].toString(), true);
}
//  is a known property of the custom class
if (arg1..hasOwnProperty(super.dataField) &&
arg2..hasOwnProperty(super.dataField)) {
return 
ObjectUtil.stringCompare(arg1[super.dataField].toString(),
arg2.[super.dataField].toString(), true);
} 
return 0;
}

/* End */

But i get the error message:
Error: Find criteria must contain at least one sort field value.

Where do i have to set it?

Any examples of sorting custom object hierachies in DataGrid controls
would be 
appreciated.

Best regards!

 



RE: [flexcoders] how to set lineScrollSize of scrollbar in HorizontalList?

2008-07-21 Thread Alex Harui
Try overriding configureScrollBars and set lineScrollSize if the
horizontalScrollBar exists

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Yochikoh Haruomi
Sent: Monday, July 21, 2008 6:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to set lineScrollSize of scrollbar in
HorizontalList?

 

Sorry for the typo in the previous email.
I meant to say HorizontalList instead of Horizontal scroll list.

Here is the question:


For HorizontalList, when the scrollbar's arrow is clicked, one item is
moved at a time.
Is there a way to set the horizontal lineScrollSize?  I want to be able
to have more than one item move at a time .

Thanks!
Yoko

 

 



RE: [flexcoders] accessing styles of children

2008-07-21 Thread Alex Harui
It is if you cast everything correctly

 

IStyleClient(videoButtonBox.getChildAt(i)).setStyle(...).

 

The compile is trying to help you out so the return types of methods and
properties are important

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, July 21, 2008 10:14 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] accessing styles of children

 

videoButtonBox. is an VBox with HBoxes for children.
How do I change styles as I iterate thru children?
videoButtonBox.getChildAt(i).setStyle() is not a function.

var numChildren:Number = videoButtonBox.numChildren;
for (var i:int = 0; i < numChildren; i++) {
videoButtonBox.getChildAt(i)
}

This page talks about rawChildren as a way to access styles, but I have 
read it 10 times and I have no idea what they are trying to describe.

 



[flexcoders] accessing styles of children

2008-07-21 Thread [EMAIL PROTECTED]
videoButtonBox. is an VBox with HBoxes for children.
How do I change styles as I iterate thru children?
videoButtonBox.getChildAt(i).setStyle() is not a function.

var numChildren:Number = videoButtonBox.numChildren;
for (var i:int = 0; i < numChildren; i++) {
  videoButtonBox.getChildAt(i)
}

This page talks about rawChildren as a way to access styles, but I have 
read it 10 times and I have no idea what they are trying to describe.


[flexcoders] what is vellum in flex4?

2008-07-21 Thread Sherif Abdou


 the namespace is vellum:http://vellum/prerelease, i spent an hour trying to 
just see what i can do with it but nothing is going up on the screen. it looks 
like html tags that are native in flash player but i have no idea how to use it 
since i searched and there is nothing on it. Anyone know how to use it? and 
also the xmlns:edit="text.edit.*" namespace tried and nothing goes on screen.   
 


  

[flexcoders] runtime localization

2008-07-21 Thread Parag Metha
Hi All,

 

I am working on runtime localization. I am using Flex 3 and LCDS 2.5.

 

I have few resource bundles specific to application along with some resource
bundles in Flex SDK and LCDS.

 

When compile all resource bundles (specific to my app, Flex, LCDS) into a
single swf/swc, the application is works properly even in runtime it is able
to find all resource bundles.

 

But, When compile only application specific resource bundles into a swf/swc
and keeping Flex and LCDS locale related swc on server and try to run the
application it is giving error;

 

Error: Could not find resource bundle data

At
mx.resources::ResourceBundle$/getResourceBundle()[C:\Work\flex\sdk\framework
s\projects\framework\src\mx\resources\ResourceBundle.as:143]

at mx.data.utils::ResourceTranslator$cinit()

at
global$init()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data
\utils\ResourceTranslator.as:30]

at mx.data.utils::SerializationProxy$cinit()

at
global$init()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data
\utils\SerializationProxy.as:51]

at _RIA_FlexInit$/init()

at
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFr
ameHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\Syst
emManager.as:2324]

 

I am looking for compiling only application specific resource bundle and
want to use Flex and LCDS locale specific resource bundle as it is.  

 

Have any one came across such situation. Any help will be appreciated.

 

Thanks in advance.

 

Regards,

Parag 

 

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.


[flexcoders] display code won't work outside of the mx:State and mx:AddChild

2008-07-21 Thread Scott
I'm not sure why this is not working but I can't seem to get it to work
correctly...

 

I've got the following code:

 



  


(this one displays the logo correctly)

  

  



  

  



  



 

  

  



 

I changed the login class so that it will work in all states.  So in
other words, I want to move the login controller outside of the main
state handling and always displayed.  It will show a button to log in, a
login screen, and a welcome with a logout button depending on the state
within the login controller.

 

Anyway, if I move the:

 

  

 

 

outside of the state then it will not display.  I also tried to create a
vbox/hbox like this:



(singleton class)

... 

...



  

  

  

   (tried with/without location x/y)



  





  

Etc.

 

Also, the FT.gif does not display when it's outside the mx:States area.


 

Any ideas on why this is happening?

 

Thanks!



[flexcoders] LogAxis and LineChart does not work

2008-07-21 Thread ilikeflex
Hi Team

I am trying to use LogAxis with the LineChart. I have attached the 
piece of code. If i change the axis to Linear Axis it works but if i 
chnage to LogAxis it fails. Can anybody let me know why

Thanks
ilikeflex



http://www.adobe. com/2006/ mxml">
































[flexcoders] rtmp, videodisplay and _definst_

2008-07-21 Thread grimmwerks
I'm curious - has anyone had any experience pulling in a limelight  
feed into flex?

I've written a flash player that uses NSConnection and successfully  
pulls in the stream; but in trying to pull this same stream into flex  
-- there's no connection/display whatsoever.




[flexcoders] how to set lineScrollSize of scrollbar in HorizontalList?

2008-07-21 Thread Yochikoh Haruomi
Sorry for the typo in the previous email.
I meant to say HorizontalList instead of Horizontal scroll list.

Here is the question:


For HorizontalList, when the scrollbar's arrow is clicked, one item is moved at 
a time.
Is there a way to set the horizontal lineScrollSize?  I want to be able to have 
more than one item move at a time .

Thanks!
Yoko



  

[flexcoders] how to set lineScrollSize of a scrollbar in HorizontalList ?

2008-07-21 Thread Yochikoh Haruomi
Dear list,
For Horizontal scroll list, when the scrollbar's arrow is clicked, one item is 
moved at a time.
Is there a way to set the horizontal lineScrollSize?  I want to be able to have 
more than one item to move at a time .

Thanks!
Yoko




  

Re: [flexcoders] HBox verticalGap

2008-07-21 Thread [EMAIL PROTECTED]
I thought of that but since my box has a border it won't work. I guess I 
could wrap it in another box but I was hoping to avoid that.

Alex Harui wrote:
 >
 > paddingTop
 >
 >
 >


[flexcoders] Layout challenge

2008-07-21 Thread Richard Rodseth
Here's what I need:

A single "row" containing a right-aligned PopUpButton and to its left,
an mx:Label that fills the remaining space. The label has
truncateToFit=true ad should display an ellipsis when necessary (the
label can have very long contents).

Ideally the PopUpButton could be of variable width based on it's label
length, but with a minimum.

Any suggestions for the best approach to this layout? Also, I'm
finding that truncateToFit doesn't seem to be working when the
mx:Label is of varying size. The case I was trying assumed a fixed
width for the PopupButton, and used "left=" and "right=" constraints
on the mx:Label.

Thanks.


[flexcoders] Understanding DataGridColumn#sortCompareFunction with composite custom classes

2008-07-21 Thread florian.salihovic
I'm currently working with a custom classes which are composites. I display the 
needed 
data via custom ItemRenderer which extends the mx.controls.Text component. It 
works 
pretty nice and is pretty flexible. But i need to sort my data as well. After 
some researches 
i learned to implement a custom sortCompareFunction. My current implementation 
works 
just like the following in a class subclassing 
mx.controls.dataGridClasses.DataGridColumn:

 /* Begin */

protected function compare(arg1:CustomClass, arg2: 
CustomClass):int {
if (!super.dataField) {
return 0;
}
return 1;
if (arg1.hasOwnProperty(super.dataField) &&
arg2.hasOwnProperty(super.dataField)) {
return 
ObjectUtil.stringCompare(arg1[super.dataField].toString(),

arg2[super.dataField].toString(), true);
}
//  is a known property of the custom class
if (arg1..hasOwnProperty(super.dataField) &&

arg2..hasOwnProperty(super.dataField)) {
return 
ObjectUtil.stringCompare(arg1[super.dataField].toString(),

arg2.[super.dataField].toString(), true);
} 
return 0;
}

/* End */

But i get the error message:
Error: Find criteria must contain at least one sort field value.

Where do i have to set it?

Any examples of sorting custom object hierachies in DataGrid controls would be 
appreciated.

Best regards!



[flexcoders] referencing embedded images inside AdvancedDataGridGroupItemRenderer

2008-07-21 Thread Brandon Krakowsky
I've embedded some images like so:

[Embed(source="images/image1.png")]
private var image1:Class;

[Embed(source="images/image2.png")]
private var image2:Class;

I can't seem to reference these class names from a String like so:

override public function set data(value:Object):void {
img = new Image;
img.source = getDefinitionByName(value.icon) as Class; 
//getDefinitionByName is part of flash.utils package
img.width = 22;
img.height = 22;
addChild(img);
}

I also tried the following:
value.icon as Class
Class(value.icon)

Thanks,
Brandon



  

Re: [flexcoders] HBox verticalGap

2008-07-21 Thread [EMAIL PROTECTED]
I meant

 I have an application with horizontal layout I want an HBox to have a 20
 topmargin. How do I do that?

[EMAIL PROTECTED] wrote:
 >
 > Thanks.
 >
 > I got it to accept verticalGap, but it didn't do what I wanted.
 > I have an application with vertical layout I want an HBox to have a 20
 > topmargin. How do I do that?
 >
 > I have also tried topMargin=20 , and y=20
 >
 > Alex Harui wrote:
 > >
 > > It is a style so you have to use setStyle()
 > >
 > >
 > >
 > > --
 > >
 > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 > > *On Behalf Of [EMAIL PROTECTED]
 > > *Sent:* Monday, July 21, 2008 11:57 AM
 > > *To:* flexcoders@yahoogroups.com
 > > *Subject:* [flexcoders] HBox verticalGap
 > >
 > >
 > >
 > > How come when I create an HBox in view mode, it allows verticalGap=30
 > >
 > > but when I create an HBox dymanically it says there is no such property
 > > movieBox.verticalGap=30;
 > > 1119: Access of possibly undefined property verticalGap through a
 > > reference with static type mx.containers:HBox.
 > >
 > > Also, I asked this before and didn't get an answer, Why does the style
 > > explorer not have Hbox or Vbox ?
 > > 
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#
 > > 

 > >
 > >
 > > No virus found in this incoming message.
 > > Checked by AVG - http://www.avg.com
 > > Version: 8.0.138 / Virus Database: 270.5.3/1564 - Release Date: 
7/21/2008 6:42 AM
 > >
 >
 > 
 > No virus found in this incoming message.
 > Checked by AVG - http://www.avg.com
 > Version: 8.0.138 / Virus Database: 270.5.3/1564 - Release Date: 
7/21/2008 6:42 AM



RE: [flexcoders] Re: Populate label with item from combobox

2008-07-21 Thread Alex Harui
In MXML, you might have

 





 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Cathal
Sent: Monday, July 21, 2008 3:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Populate label with item from combobox

 

Hi Alex,

How do I achieve this?

I've tryed doing lbl.text = selectedItem.projectname but I beleave
this needs an event first, no? Any suggestions?

Thanks,
Cathal

--- In flexcoders@yahoogroups.com 
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Tyr binding the label to the combobox's selectedItem.projectname
> 

 



RE: [flexcoders] HBox verticalGap

2008-07-21 Thread Alex Harui
paddingTop

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, July 21, 2008 3:48 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] HBox verticalGap

 

Thanks.

I got it to accept verticalGap, but it didn't do what I wanted.
I have an application with vertical layout I want an HBox to have a 20 
topmargin. How do I do that?

I have also tried topMargin=20 , and y=20

Alex Harui wrote:
>
> It is a style so you have to use setStyle()
>
> 
>
> --
>
> *From:* flexcoders@yahoogroups.com

[mailto:flexcoders@yahoogroups.com 
] 
> *On Behalf Of [EMAIL PROTECTED]  
> *Sent:* Monday, July 21, 2008 11:57 AM
> *To:* flexcoders@yahoogroups.com 

> *Subject:* [flexcoders] HBox verticalGap
>
> 
>
> How come when I create an HBox in view mode, it allows verticalGap=30
>
> but when I create an HBox dymanically it says there is no such
property
> movieBox.verticalGap=30;
> 1119: Access of possibly undefined property verticalGap through a
> reference with static type mx.containers:HBox.
>
> Also, I asked this before and didn't get an answer, Why does the style
> explorer not have Hbox or Vbox ?
>
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplo
rer.html#
  
>
 >
>
> 
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com   
> Version: 8.0.138 / Virus Database: 270.5.3/1564 - Release Date:
7/21/2008 6:42 AM
> 

 



RE: [flexcoders] air sqlite image loading

2008-07-21 Thread Jim Hayes
I'm not sure why you're using Base64Encoder/Base64Decoder here, tbh (perhaps 
you really need to send over the net as text at some point?).
Unless it's because you are using only a string for the insert statement?

You can insert binary data into a blob field in the AIR database directly, 
though you probably do have to use a different syntax for the query:

try using sqlStatement parameters instead of a concatenated string : e.g

var sql:SQLStatement = new SQLStatement();

sql.sqlConnection = someSqlConnectionInstance;

var sqlInsert:String = "INSERT INTO Person VALUES(:personName ,:personEmail 
,:personImageData);";

sql.text = sqlInsert;

sql.attributes[":personName"] = person.name;
sql.attributes[":personEmail"] = person.email;
sql.attributes[":personImageData"] = person.image_As_ByteArray; // (however you 
get that).


(There are other good reasons for using sqlStatement parameters, but I'll leave 
for now).

I know you can store the image as a byteArray (perhaps encode a bitmapData with 
JPEGEncoder or PNGEncoder ?) and read that back out, I'm guessing that it would 
also take a BitmapData (though you would get no compression with that. It may 
be easier to stuff it back into an image component, however).

If storing as a byteArray of a PNG or JPEG image rather than a bitmapData (*if* 
storing a BitmapData is possible, that is) then you may need to extract the 
image from that byteArray using Loader .
(I'm unsure as to whether the Image component accepts an encoded byteArray as 
content in flex3, I know it did not in flex2)

Apologies if any of the above is incorrect, it's from memory and from about a 
year ago at that.

I'd take it all back to the very simplest test project if I were you, and just 
test the simplest thing that will/won't work before taking it further.
I found all the image storage / display stuff a bit of a struggle initially, 
that approach helped me a lot (together with reading the docs in depth!).



-Original Message-
From: flexcoders@yahoogroups.com on behalf of sudha_bsb
Sent: Mon 21/07/2008 20:55
To: flexcoders@yahoogroups.com
Subject: [flexcoders] air sqlite image loading
 
Hi,

I am trying to store an image into Sqlite database from an air
application and also trying to display the image by reading data from
the database. I am using blob datatype for this. I am getting the
following error while doing it...

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is
an unknown type.

This is what i am doing while loading the image from
database...resultData is the array result from database

var imgData:String = resultData[i].image;
trace('imgData'+imgData);
var decoder:Base64Decoder = new
Base64Decoder();
decoder.decode(imgData);
var byteArr:ByteArray = decoder.toByteArray();
trace('bytearr'+byteArr);
var img:Image = new Image();
img.load(byteArr);
obj.image = img
personData.push(obj);

Similary while inserting the data...

var byteArr:ByteArray = new ByteArray();
byteArr.writeObject(person.image);
var encoder:Base64Encoder = new Base64Encoder();
encoder.encodeBytes(byteArr);
var encoded:String = encoder.toString()
trace('encoder string'+encoded);
var sqlInsert:String = "insert into Person
values('"+person.name+"','"+person.email+"','"+encoded+"');";
   
Please help

Thanks & Regards,
Sudha.



__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__<>

[flexcoders] Re: Populate label with item from combobox

2008-07-21 Thread Cathal
Hi Alex,

How do I achieve this?

I've tryed doing lbl.text = selectedItem.projectname but I beleave
this needs an event first, no? Any suggestions?

Thanks,
Cathal

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Tyr binding the label to the combobox's selectedItem.projectname
> 





Re: [flexcoders] HBox verticalGap

2008-07-21 Thread [EMAIL PROTECTED]
Thanks.

I got it to accept verticalGap, but it didn't do what I wanted.
I have an application with vertical layout I want an HBox to have a 20 
topmargin. How do I do that?

I have also tried topMargin=20 , and y=20

Alex Harui wrote:
>
> It is a style so you have to use setStyle()
>
>  
>
> 
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
> *On Behalf Of [EMAIL PROTECTED]
> *Sent:* Monday, July 21, 2008 11:57 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] HBox verticalGap
>
>  
>
> How come when I create an HBox in view mode, it allows verticalGap=30
>
> but when I create an HBox dymanically it says there is no such property
> movieBox.verticalGap=30;
> 1119: Access of possibly undefined property verticalGap through a
> reference with static type mx.containers:HBox.
>
> Also, I asked this before and didn't get an answer, Why does the style
> explorer not have Hbox or Vbox ?
> http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#
>  
> 
>
> 
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.138 / Virus Database: 270.5.3/1564 - Release Date: 7/21/2008 
> 6:42 AM
>   



Re: [flexcoders] Gumbo

2008-07-21 Thread Michael Schmalle
Nice to see the recipe being altered to taste.

This shows some good cooks in the kitchen.

Peace,
Mike

On Mon, Jul 21, 2008 at 6:06 PM, Gordon Smith <[EMAIL PROTECTED]> wrote:

>No breath-holding, please... Gumbo isn't even alpha yet and we haven't
> announced any ship date! But you'll be able to watch us develop it
> checkin-by-checkin, and try it out. You can build it now, or download
> builds. We worked on a private branch for a few months while we figured out
> the high-level goals for the Gumbo release, but now everything we're doing
> in the Flex SDK is being done in public.
>
>
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Vivian Richard
> *Sent:* Monday, July 21, 2008 2:51 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Gumbo
>
>
>
>
>
> Wow!!! Great Gordon. I feel link suspend my project till Flex 4
> comes out. :-)). Really liked Ely's demo.
>
>
>  On Mon, Jul 21, 2008 at 1:07 PM, Gordon Smith <[EMAIL PROTECTED]> wrote:
>
> Want to know what we've got cookin' for the next major release of Flex,
> codenamed "Gumbo"? Take a look at
>
>
>
> http://opensource.adobe.com/wiki/display/flexsdk/Gumbo
>
>
>
> Deepa's whitepaper on the new Gumbo Component Architecture
>
>
>
>
> http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture
>
>
>
> is a good overview.
>
>
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>
>
>
>
>   
>



-- 
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the question'.


RE: [flexcoders] Gumbo

2008-07-21 Thread Gordon Smith
No breath-holding, please... Gumbo isn't even alpha yet and we haven't
announced any ship date! But you'll be able to watch us develop it
checkin-by-checkin, and try it out. You can build it now, or download
builds. We worked on a private branch for a few months while we figured
out the high-level goals for the Gumbo release, but now everything we're
doing in the Flex SDK is being done in public.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Vivian Richard
Sent: Monday, July 21, 2008 2:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Gumbo

 



Wow!!! Great Gordon. I feel link suspend my project till Flex 4
comes out. :-)). Really liked Ely's demo. 




On Mon, Jul 21, 2008 at 1:07 PM, Gordon Smith <[EMAIL PROTECTED]> wrote:

Want to know what we've got cookin' for the next major release of Flex,
codenamed "Gumbo"? Take a look at

 

http://opensource.adobe.com/wiki/display/flexsdk/Gumbo

 

Deepa's whitepaper on the new Gumbo Component Architecture

 

 
http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Archite
cture

 

is a good overview.

 

Gordon Smith

Adobe Flex SDK Team

 

 

 



RE: [flexcoders] Re: TextArea - changing backgroundColor on MouseOver when used in an ItemRenderer

2008-07-21 Thread Alex Harui
I am recommending that you modify your renderer in Actionscript instead
of MXML.  It will be much more efficient, and you can use
ListItemRenderer as a template, and borrow background modification code
from the examples on my blog for DataGridItemRenderer (which is a
TextField).

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of djohnson29
Sent: Monday, July 21, 2008 2:41 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: TextArea - changing backgroundColor on
MouseOver when used in an ItemRenderer

 

Thanks for the reply Alex - Most of the examples I see are using the
DataGrid and working with the DataGridItemRenderer. Do you have any
specific examples using ListItemRenderer and a List? I have been
googling "modifying ListItemRenderer" but can't seem to see any
examples. The only examples I can seem to find with List use the
 tag with child components laid out in the same way
that I have in my code.

It's not clear to me what exactly I would need to modify in
ListItemRenderer. And if the ListItemRenderer uses TextFields which
are more efficient, how would I specify these in the mxml? Also, how
would I be able to specify the Image that I need? Currently the mxml
looks like this:


mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> I'd copy and modify the code from ListItemRenderer and not use
> Canvas/Label/TextArea. It uses textFields which you can more easily
> control backgrounds and your renderer will be much smaller and faster.
> You can see some of the ways I do this on my blog
> (blogs.adobe.com/aharui).
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com 
] On
> Behalf Of djohnson29
> Sent: Friday, July 18, 2008 1:06 PM
> To: flexcoders@yahoogroups.com  
> Subject: [flexcoders] Re: TextArea - changing backgroundColor on
> MouseOver when used in an ItemRenderer
> 
> 
> 
> Arghgh...sorry folks - posted my question before finishing it...
> 
> My question is: How can I change the backgroundColor of a TextArea
> that is used within an itemRenderer when the MouseOver event fires?
> 
> I have the following code:
> 
>  width="250" height="160" >
> 
> 
>  
> 
>  text="{data.Address}" editable="false" 
> borderStyle="none" /> 
> 
>  
>  
>  
> 
> 
> When the user hovers the mouse over the List, the default behaviour is
> to highlight the background color of each cell in the List. Since I
> am using a TextArea, the background of this particular control stays
> white and stands out.
> 
> The TextArea component has a backgroundColor property and a MouseOver
> event, so I figured that I could call an function from within the
> MouseOver event to set the TextArea's background color.
> 
> I have been unsuccessful - I can't get a reference to the textArea,
> even though it has an ID, and if I try to call the function inline
> from the mouseOver event in the TextArea's mxml, I get a compiler
area.
> 
> Thanks.
>

 



[flexcoders] changing project settings

2008-07-21 Thread [p e r c e p t i c o n]
Hi all,
i started a project and at the time i didn't need a server, but now i do.
is there a way to modify the settings to use a server after the fact?
thanks and
cheers
percy


[flexcoders] ArrayCollection filterFunction only gets called on root item

2008-07-21 Thread Greg Hess
Hi All,

I have a tree control who's data provider is an ArrayCollection
holding a single File object I defined. The File object represents the
root of a remote file system hierarchy that has children getter that
supports the tree control and each child is rendered in the tree with
an ItemRenderer.

The tree control displays the File hierarchy well and it traverses the
data providers children as expected. However, filter does not. I
wanted to apply a filter to the data provider so only directory items
are displayed. I specified the filterFunction and refresh the
dataProvider but it only gets called on the first root node and not
the data model hierarchy and each item that gets rendered in the tree.

Should I have implemented a special interface so the tree or data
provider can properly filter the object hierarchy?

What am I doing wrong?

Any help much appreciated.

-Greg


[flexcoders] Highlight cell from context menu

2008-07-21 Thread markgoldin_2000
Is there a way of highlighting a cell that was right mouse clicked on 
right before contextmenu showed up?

Thanks



Re: [flexcoders] Gumbo

2008-07-21 Thread Vivian Richard
Wow!!! Great Gordon. I feel link suspend my project till Flex 4
comes out. :-)). Really liked Ely's demo.



On Mon, Jul 21, 2008 at 1:07 PM, Gordon Smith <[EMAIL PROTECTED]> wrote:

>Want to know what we've got cookin' for the next major release of Flex,
> codenamed "Gumbo"? Take a look at
>
>
>
> http://opensource.adobe.com/wiki/display/flexsdk/Gumbo
>
>
>
> Deepa's whitepaper on the new Gumbo Component Architecture
>
>
>
>
> http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture
>
>
>
> is a good overview.
>
>
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>
>  
>


[flexcoders] Re: TextArea - changing backgroundColor on MouseOver when used in an ItemRenderer

2008-07-21 Thread djohnson29
Thanks for the reply Alex - Most of the examples I see are using the
DataGrid and working with the DataGridItemRenderer.  Do you have any
specific examples using ListItemRenderer and a List?  I have been
googling "modifying ListItemRenderer" but can't seem to see any
examples.  The only examples I can seem to find with List use the
 tag with child components laid out in the same way
that I have in my code.

It's not clear to me what exactly I would need to modify in
ListItemRenderer.  And if the ListItemRenderer uses TextFields which
are more efficient, how would I specify these in the mxml?  Also, how
would I be able to specify the Image that I need?  Currently the mxml
looks like this:


  wrote:
>
> I'd copy and modify the code from ListItemRenderer and not use
> Canvas/Label/TextArea.  It uses textFields which you can more easily
> control backgrounds and your renderer will be much smaller and faster.
> You can see some of the ways I do this on my blog
> (blogs.adobe.com/aharui).
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of djohnson29
> Sent: Friday, July 18, 2008 1:06 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: TextArea - changing backgroundColor on
> MouseOver when used in an ItemRenderer
> 
>  
> 
> Arghgh...sorry folks - posted my question before finishing it...
> 
> My question is: How can I change the backgroundColor of a TextArea
> that is used within an itemRenderer when the MouseOver event fires?
> 
> I have the following code:
> 
>  width="250" height="160" >
> 
> 
>  
> 
>  text="{data.Address}" editable="false" 
> borderStyle="none" /> 
> 
>  
>  
>  
> 
> 
> When the user hovers the mouse over the List, the default behaviour is
> to highlight the background color of each cell in the List. Since I
> am using a TextArea, the background of this particular control stays
> white and stands out.
> 
> The TextArea component has a backgroundColor property and a MouseOver
> event, so I figured that I could call an function from within the
> MouseOver event to set the TextArea's background color.
> 
> I have been unsuccessful - I can't get a reference to the textArea,
> even though it has an ID, and if I try to call the function inline
> from the mouseOver event in the TextArea's mxml, I get a compiler area.
> 
> Thanks.
>




[flexcoders] I do not like flex 3 any more!!!!

2008-07-21 Thread hworke

  See this presentation by Ely. You will know why: 
 
http://tv.adobe.com/#v=http%3A//adobe.edgeboss.net/flash/adobe/adobetvprod/adc_presents/64_adc_018.flv%3Frss_feedid%3D1216%26xmlvers%3D2



[flexcoders] Re: Tile Component // Mutliple Drag Selection

2008-07-21 Thread artur_desig2dev
just to clarify..

im not talking about the ability to drag around multiple tiles.

im looking to select multiple tiles via click&drag.
while at the same time generating a selection box over the tiles.

thanks



[flexcoders] Re: mouseOverHandler and itemRollOver Listener

2008-07-21 Thread markgoldin_2000
Yes, that was the problem. Thanks!

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Did you call super.mouseOverHandler?
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of markgoldin_2000
> Sent: Monday, July 21, 2008 1:31 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] mouseOverHandler and itemRollOver Listener
> 
>  
> 
> It looks like if I implement mouseOverHandler then itemRollOver 
event 
> is not fireing, or at least it's not getitng into its handler.Can I 
use 
> both events somehow?
> 
> Thanks
>




RE: [flexcoders] attaching one instance of a displayobject to multiple containers

2008-07-21 Thread Alex Harui
Can't.  You might have two parents, but display objects can only have
one.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of blc187
Sent: Monday, July 21, 2008 1:31 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] attaching one instance of a displayobject to
multiple containers

 

Is there a way to attach a displayobject to more than one container?
I have a canvas that I instantiated and drew onto, but I want to attach 
it onto two separate containers without having 2 separate instances of 
it.

When I do this:

var obj:MyCanvas = new MyCanvas();
container1.addChild(obj);
container2.addChild(obj);

it only shows up as attached to the second container.
How can I attach it to two without having to instantiate two versions 
of it?

 



RE: [flexcoders] mouseOverHandler and itemRollOver Listener

2008-07-21 Thread Alex Harui
Did you call super.mouseOverHandler?

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of markgoldin_2000
Sent: Monday, July 21, 2008 1:31 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] mouseOverHandler and itemRollOver Listener

 

It looks like if I implement mouseOverHandler then itemRollOver event 
is not fireing, or at least it's not getitng into its handler.Can I use 
both events somehow?

Thanks

 



RE: [flexcoders] Tile Component // Mutliple Drag Selection

2008-07-21 Thread Alex Harui
So when you set to true, what happens?

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, July 21, 2008 12:46 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Tile Component // Mutliple Drag Selection

 

>From line 559 of ScheduleViewer:

[Bindable]

public function get allowMultipleSelection() :
Boolean

{

return
entryViewer.allowMultipleSelection;

}



public function set allowMultipleSelection(
value : Boolean ) : void

{

entryViewer.allowMultipleSelection =
value;

}



 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Monday, July 21, 2008 3:32 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Tile Component // Mutliple Drag Selection

 

TileList with allowMutipleSelection=true?

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of artur_desig2dev
Sent: Monday, July 21, 2008 11:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tile Component // Mutliple Drag Selection

 

is something like this possible in Flex 3?

http://www.design2dev.com/dragSelect.jpg
 

has anyone successfully achieved this?

if so..any direction would be greatly appreciated.

thanks

artur

 



Re: [flexcoders] attaching one instance of a displayobject to multiple containers

2008-07-21 Thread Daniel Gold
A display object can only have a single parent, so you will have to have two
instances.

On Mon, Jul 21, 2008 at 3:31 PM, blc187 <[EMAIL PROTECTED]> wrote:

>   Is there a way to attach a displayobject to more than one container?
> I have a canvas that I instantiated and drew onto, but I want to attach
> it onto two separate containers without having 2 separate instances of
> it.
>
> When I do this:
>
> var obj:MyCanvas = new MyCanvas();
> container1.addChild(obj);
> container2.addChild(obj);
>
> it only shows up as attached to the second container.
> How can I attach it to two without having to instantiate two versions
> of it?
>
>  
>


[flexcoders] attaching one instance of a displayobject to multiple containers

2008-07-21 Thread blc187
Is there a way to attach a displayobject to more than one container?
I have a canvas that I instantiated and drew onto, but I want to attach 
it onto two separate containers without having 2 separate instances of 
it.

When I do this:

var obj:MyCanvas = new MyCanvas();
container1.addChild(obj);
container2.addChild(obj);

it only shows up as attached to the second container.
How can I attach it to two without having to instantiate two versions 
of it?



[flexcoders] mouseOverHandler and itemRollOver Listener

2008-07-21 Thread markgoldin_2000
It looks like if I implement mouseOverHandler then itemRollOver event 
is not fireing, or at least it's not getitng into its handler.Can I use 
both events somehow?

Thanks



[flexcoders] Gumbo

2008-07-21 Thread Gordon Smith
Want to know what we've got cookin' for the next major release of Flex,
codenamed "Gumbo"? Take a look at

 

http://opensource.adobe.com/wiki/display/flexsdk/Gumbo

 

Deepa's whitepaper on the new Gumbo Component Architecture

 

 
http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Archite
cture

 

is a good overview.

 

Gordon Smith

Adobe Flex SDK Team

 



[flexcoders] air sqlite image loading

2008-07-21 Thread sudha_bsb
Hi,

I am trying to store an image into Sqlite database from an air
application and also trying to display the image by reading data from
the database. I am using blob datatype for this. I am getting the
following error while doing it...

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is
an unknown type.

This is what i am doing while loading the image from
database...resultData is the array result from database

var imgData:String = resultData[i].image;
trace('imgData'+imgData);
var decoder:Base64Decoder = new
Base64Decoder();
decoder.decode(imgData);
var byteArr:ByteArray = decoder.toByteArray();
trace('bytearr'+byteArr);
var img:Image = new Image();
img.load(byteArr);
obj.image = img
personData.push(obj);

Similary while inserting the data...

var byteArr:ByteArray = new ByteArray();
byteArr.writeObject(person.image);
var encoder:Base64Encoder = new Base64Encoder();
encoder.encodeBytes(byteArr);
var encoded:String = encoder.toString()
trace('encoder string'+encoded);
var sqlInsert:String = "insert into Person
values('"+person.name+"','"+person.email+"','"+encoded+"');";
   
Please help

Thanks & Regards,
Sudha.



Re: [flexcoders] How to display a total row on a DataGrid

2008-07-21 Thread Sean Clark Hess
Your examples were some of the first I looked at.  I don't remember now why
I thought I couldn't use them.  I'll try the Flex 3 DataGrid Footers post
again and see if I run into the same problems I'm experiencing (mismatched
column widths, 100% width not working).
Thanks for the reminder

On Mon, Jul 21, 2008 at 1:23 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>There's a footer example on my blog
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Sean Clark Hess
> *Sent:* Monday, July 21, 2008 11:33 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] How to display a total row on a DataGrid
>
>
>
> Hello All,
>
>
>
> Well, I'm stuck.  I've approached this about 3 different ways and have run
> into (different) dead ends on all of them. I've tried using multiple
> datagrids, which I got working fabulously, but setting the datagrid to width
> 100% does really wacky things with the column sizes.  I've also tried to use
> the built-in Summary classes with the AdvancedDataGrid, but they seem only
> to work with Grouped data. I could hack a collection to do it, but that
> would screw up my pagination and wouldn't show unless I scrolled to the
> bottom.
>
>
>
> I just want a footer that displays the total of each column.  Is there any
> good way to do this?  The Summary and Grouping classes were disappointing.
>
>
>
> Thanks
>
> ~sean
>
>
>
>
>
>  
>


RE: [flexcoders] Inline EventListener in MXML tags - confusing description in Developers guide.

2008-07-21 Thread Gordon Smith
> Why can't i just call removeEventListener in ActionScript on the type
of event declared in MXML?

 

Because you don't know what to pass for the handler reference. When you
write MXML code like

 



 

the MXML compiler autogenerates an event handler method whose body
containts the statements in the attribute value, and you don't have
access to this method.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of florian.salihovic
Sent: Monday, July 21, 2008 1:20 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Inline EventListener in MXML tags - confusing
description in Developers guide.

 

Quoted from Adobe Flex Developers Guide, page 78

"However, it is best practice to use the addEventListener() method.
This method gives you greater control over the event by letting
you configure the priority and capturing settings, and use event
constants.
In addition, if you use addEventListener() to add an event handler, you
can
use removeEventListener() to remove the handler when you no longer need
it. If you add an event handler inline, you cannot call
removeEventListener()
on that handler."

- End of Quote -

What i think is a little bit confusing is, that it's said that inline
EventListener can't be 
removed? Or is it just a little bit unluckily expressed? Why can't i
just call 
removeEventListener in ActionScript on the type of event declared in
MXML?

Best regards from Germany

 



RE: [flexcoders] Tile Component // Mutliple Drag Selection

2008-07-21 Thread terryflexcoders
>From line 559 of ScheduleViewer:

[Bindable]

public function get allowMultipleSelection() :
Boolean

{

return
entryViewer.allowMultipleSelection;

}



public function set allowMultipleSelection( value :
Boolean ) : void

{

entryViewer.allowMultipleSelection =
value;

}



 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Monday, July 21, 2008 3:32 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Tile Component // Mutliple Drag Selection

 

TileList with allowMutipleSelection=true?

 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of artur_desig2dev
Sent: Monday, July 21, 2008 11:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tile Component // Mutliple Drag Selection

 

is something like this possible in Flex 3?

http://www.design2d 
ev.com/dragSelect.jpg

has anyone successfully achieved this?

if so..any direction would be greatly appreciated.

thanks

artur

 



RE: [flexcoders] getting absolute height from component

2008-07-21 Thread Gordon Smith
You're accessing the 'height' property before the LayoutManager has
determined what its height should be. You need to wait at least until
the component has dispatched an updateComplete event.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ibo
Sent: Monday, July 21, 2008 12:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] getting absolute height from component

 

If I have a canvas with height set to 100%, how do I get its absolute
height? (in pixels)
the height attribute is giving me 0.

 



[flexcoders] getting absolute height from component

2008-07-21 Thread ibo
If I have a canvas with height set to 100%, how do I get its absolute height? 
(in pixels)
the height attribute is giving me 0.


RE: [flexcoders] How to make Tree only display branch nodes without filters

2008-07-21 Thread Alex Harui
In theory, you can override createItemRenderer and return different
kinds of renderers based on the data

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Greg Hess
Sent: Monday, July 21, 2008 12:06 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to make Tree only display branch nodes without
filters

 

Hi All,

My application has a global data model representing a file system. I
have a tree control allowing users to navigate the file system
directories. I am using a global data model so that rename, delete,
add operations automatically propogate to other UIComponents bound to
file children collections.

So I need my trees data provider to be bound to a collection with
branch and leaf nodes but only display ItemRenderers for branch nodes.
I needed a custom TreeIR and I thought I could just set its visible
and includeInLayout properties but it is not working. I think I can do
this in the TreeIR by overriding createChildren(), updateDisplayList
and measure to do nothing with a leaf node but it feels like I should
be using a custom Tree impl to actualy just ignore those leaf nodes.

I also tried to use itemToItemRenderer and return null for leafs but
they are still drawn...

Any help is much appreciated.

Thanks,

Greg

 



RE: [flexcoders] Populate label with item from combobox

2008-07-21 Thread Alex Harui
Tyr binding the label to the combobox's selectedItem.projectname

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Cathal
Sent: Monday, July 21, 2008 11:26 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Populate label with item from combobox

 

Hi,

I have a combobox which is populate by an XML file and works fine.

code:
 

Once, the combo box is changed it fills a label with the value selected.

code:
private function setCompanyName(evt:Event):void
{
lblCompanyName.text = evt.currentTarget.selectedItem.projectname;
}

The problem is what if only one item exists in the combobox. There
cannot be any change. I want the label to be filled by default item in
the combobox and also on any chnage, I've tryed with selectedItem and
selectedIndex but with no luck. Any suggestions is appreciated.

Kind Regards,
Cathal O'Brien 

 



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

2008-07-21 Thread valdhor
Looking at the ASP .NET Date Tutorial at
http://www.easerve.com/developer/tutorials/asp-net-tutorials-dates.aspx
you can figure out how the dates work. Using that I came up with the
following which should help you out:


http://www.adobe.com/2006/mxml";
  width="100%" height="100%" backgroundSize="100%" layout="vertical"
horizontalAlign="left"
  creationComplete="onComplete(event)" backgroundColor="#BB" >
 
 
 
 





--- 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:
>
>
> 
>   Dateline Standard Time
>   Dateline Daylight Time
>   Dateline Standard Time
>   (GMT-12:00) International Date Line
> West
>   -4320
>   633516008019218750
>   false
> 
>
>
>
>
>
> --- 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@
> >
>



RE: [flexcoders] HBox verticalGap

2008-07-21 Thread Alex Harui
It is a style so you have to use setStyle()

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, July 21, 2008 11:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] HBox verticalGap

 

How come when I create an HBox in view mode, it allows verticalGap=30

but when I create an HBox dymanically it says there is no such property
movieBox.verticalGap=30;
1119: Access of possibly undefined property verticalGap through a 
reference with static type mx.containers:HBox.

Also, I asked this before and didn't get an answer, Why does the style 
explorer not have Hbox or Vbox ?
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplo
rer.html#
 

 



[flexcoders] Re: Flex Dashboard

2008-07-21 Thread gjessup1
Added a code project for those interested
http://code.google.com/p/flex-dashboard/

--- In flexcoders@yahoogroups.com, "gjessup1" <[EMAIL PROTECTED]> wrote:
>
> Hey all,
> I have been watching this group for a while and figured many of you
> could benefit from a project I started called the Flex Dashboard.
> The google group is  http://groups.google.com/group/flex-dashboard
> 
> Its basically a database driven module loader. It is currently using
> MSSQL Server as the DB, but the table script is available online, so
> could easily be changed to use the DB of your choice. Its a work in
> progress, but getting a community involved usually helps a project
> grow much faster.
> 
> I am  using Weborb to invoke the DB calls using C#. This could be
> changed. Would like to see it become very dynamic over time.
> 
> Please head over and have a look. Looking to create a community that
> can make this a great product everyone can use. 
> 
> 
> http://groups.google.com/group/flex-dashboard
>




RE: [flexcoders] Tile Component // Mutliple Drag Selection

2008-07-21 Thread Alex Harui
TileList with allowMutipleSelection=true?

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of artur_desig2dev
Sent: Monday, July 21, 2008 11:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tile Component // Mutliple Drag Selection

 

is something like this possible in Flex 3?

http://www.design2dev.com/dragSelect.jpg
 

has anyone successfully achieved this?

if so..any direction would be greatly appreciated.

thanks

artur

 



RE: [flexcoders] How to display a total row on a DataGrid

2008-07-21 Thread Alex Harui
There's a footer example on my blog

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Sean Clark Hess
Sent: Monday, July 21, 2008 11:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display a total row on a DataGrid

 

Hello All, 

 

Well, I'm stuck.  I've approached this about 3 different ways and have
run into (different) dead ends on all of them. I've tried using multiple
datagrids, which I got working fabulously, but setting the datagrid to
width 100% does really wacky things with the column sizes.  I've also
tried to use the built-in Summary classes with the AdvancedDataGrid, but
they seem only to work with Grouped data. I could hack a collection to
do it, but that would screw up my pagination and wouldn't show unless I
scrolled to the bottom. 

 

I just want a footer that displays the total of each column.  Is there
any good way to do this?  The Summary and Grouping classes were
disappointing. 

 

Thanks

~sean

 

 

 



[flexcoders] How to make Tree only display branch nodes without filters

2008-07-21 Thread Greg Hess
Hi All,

My application has a global data model representing a file system. I
have a tree control allowing users to navigate the file system
directories. I am using a global data model so that rename, delete,
add operations automatically propogate to other UIComponents bound to
file children collections.

So I need my trees data provider to be bound to a collection with
branch and leaf nodes but only display ItemRenderers for branch nodes.
I needed a custom TreeIR and I thought I could just set its visible
and includeInLayout properties but it is not working. I think I can do
this in the TreeIR by overriding createChildren(), updateDisplayList
and measure to do nothing with a leaf node but it feels like I should
be using a custom Tree impl to actualy just ignore those leaf nodes.

I also tried to use itemToItemRenderer and return null for leafs but
they are still drawn...

Any help is much appreciated.

Thanks,

Greg


[flexcoders] Populate label with item from combobox

2008-07-21 Thread Cathal
Hi,

I have a combobox which is populate by an XML file and works fine.

code:
 

Once, the combo box is changed it fills a label with the value selected.

code:
private function setCompanyName(evt:Event):void
{
lblCompanyName.text = evt.currentTarget.selectedItem.projectname;
}

The problem is what if only one item exists in the combobox. There
cannot be any change. I want the label to be filled by default item in
the combobox and also on any chnage, I've tryed with selectedItem and
selectedIndex but with no luck. Any suggestions is appreciated.

Kind Regards,
Cathal O'Brien 



[flexcoders] HBox verticalGap

2008-07-21 Thread [EMAIL PROTECTED]
How come when I create an HBox in view mode, it allows verticalGap=30

but when I create an HBox dymanically it says there is no such property
movieBox.verticalGap=30;
1119: Access of possibly undefined property verticalGap through a 
reference with static type mx.containers:HBox.

Also, I asked this before and didn't get an answer, Why does the style 
explorer not have Hbox or Vbox ?
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#


[flexcoders] Tile Component // Mutliple Drag Selection

2008-07-21 Thread artur_desig2dev
is something like this possible in Flex 3?

http://www.design2dev.com/dragSelect.jpg

has anyone successfully achieved this?

if so..any direction would be greatly appreciated.


thanks

artur



[flexcoders] How to display a total row on a DataGrid

2008-07-21 Thread Sean Clark Hess
Hello All,
Well, I'm stuck.  I've approached this about 3 different ways and have run
into (different) dead ends on all of them. I've tried using multiple
datagrids, which I got working fabulously, but setting the datagrid to width
100% does really wacky things with the column sizes.  I've also tried to use
the built-in Summary classes with the AdvancedDataGrid, but they seem only
to work with Grouped data. I could hack a collection to do it, but that
would screw up my pagination and wouldn't show unless I scrolled to the
bottom.

I just want a footer that displays the total of each column.  Is there any
good way to do this?  The Summary and Grouping classes were disappointing.

Thanks
~sean


[flexcoders] annotations on flex charts?

2008-07-21 Thread blc187
I am using chart annotations like the following example:

var annotationElement:MyAnnotationElement = new MyAnnotationElement();
myChart.annotationElements = [annotationElement];

The problem is, I need the annotations to start a few pixels above my 
chart's dataRegion.

Does anybody know how to modify this? I tried moving the 
_annotationElementHolder.y up a few pixels but then it doesn't cover 
all the way down to the axis, and changing the height value does 
nothing.  Any suggestions?



Re: [flexcoders] Filter an ArrayCollection into an ItemRender

2008-07-21 Thread Scott Bachman
The syntax you tried is e4x (ECMAscript for XML) and only works with XML
data. For an ArrayCollection you could use a filterFunction to filter the
data. Check out, for instance,
http://www.boyzoid.com/blog/index.cfm/2006/10/19/Filtering-Data-in-Flex
or the filterFunction property of ArrayCollection in the Flex documentation.

Scott



On Mon, Jul 21, 2008 at 9:28 AM, luis_roman_am <[EMAIL PROTECTED]>
wrote:

>   Hi people! Situation as follows:
>
> MYARRAYCOLLECTION (Example fields)
> - TITLE
> - URL
>
> INDEX.MXML
> - TILELIST
> - DataProvider="{MyArrayCollection}"
> - ItemRenderer ="MyRenderer"
>
> MYRENDERER.MXML
> - LABEL (data.TITLE) (WORKS FINE)
> - LINECHART
> -DataProvider="Application.application.MyArrayCollection}
> (PROBLEM HERE)
>
> THe problem is: How can i filter linechart inside MYRENDERER.MXML the
> dataprovider to receive only data for the items with his URL?
>
> I tried something like:
>
> -DataProvider="Application.application.MyArrayCollection.(@Url=data.Url)}
>
> but this throws me the following error:
>
> Error #1123: Filter operator not supported on type mx.arraycollections.
>
> Please Help!!
>
>  
>


[flexcoders] Re: Numeric values drawn from a database, always int?

2008-07-21 Thread bredwards358
Bingo, thanks that I believe was exactly what I needed, it would seem
that when I'm making the database tables, it would be best to use REAL
and/or NUMBER as opposed to NUMERIC and/or INTEGER to best utilize
numbers with decimal points.

Brian Ross Edwards
Tech-Connect LLC

--- In flexcoders@yahoogroups.com, "Jim Hayes" <[EMAIL PROTECTED]> wrote:
>
> I think you can find the answers here :
>  
> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/?localDatabase
> SQLSupport.html#dataTypes
>  
> (I'd been meaning to look this up in any case, you just prompted me! Not
> finished reading it all as yet.)
>  
>  
>  
>  




[flexcoders] Re: Bake XML File into ActionScript

2008-07-21 Thread edlueze
Genius - it works - thanks Tim!

--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Hi,
> 
> Here's a way that you can embed an external xml file into your app:
> 
> [Embed('/data/myStubData.xml')]
> private var myStubDataXML : Class;
> 
> private function onInitialize() : void {
>  var myXML : XML = new XML( myStubDataXML.data );
> }
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "edlueze"  wrote:
> >
> > Yeah - that's what I'm currently doing. But that's a runtime solution
> > - I was hoping for a compile-time solution.
> >
> > Thanks anyway!!
> >
> > --- In flexcoders@yahoogroups.com, "Randy Martin" randy@ wrote:
> > >
> > > I'd just read the XML file in using HttpService.
> > >
> > > ~randy
> > >
> > >
> > > _
> > >
> > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> On
> > > Behalf Of edlueze
> > > Sent: Sunday, July 20, 2008 1:22 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] Re: Bake XML File into ActionScript
> > >
> > >
> > >
> > > Hi Randy - thanks for the feedback!
> > >
> > > I was hoping to find a way to preserve the XML file without
> > > contaminating it with the "private var novel:XML = " bit. That way I
> > > can create the XML file using my favorite XML generator (and use a
> > > validating XSD schema to make sure everything is correct). When the
> > > XML file looks good I can simply drop it into my Flex project -
> > > overriding the previous XML file - and everything should just
> compile.
> > >
> > > That approach would work if I was working in MXML using the  > > id="MyBooks" source="books.-xml"/> tag. I was hoping there was an
> > > equivalent way to do it when working purely with ActionScript .as
> files.
> > >
> > > Any ideas?
> > >
> > > --- In HYPERLINK
> > > "mailto:flexcoders%40yahoogroups.com"flexcoders@, "Randy
> > > Martin"  wrote:
> > > >
> > > > You can include an ActionScript file in it's own script block.
> Then
> > > in the
> > > > .as file, you could just have the XML defined and nothing else.
> > > >
> > > > // put this in books.as -- or whatever filename you choose
> > > > private var novel:XML = -My Book-;
> > > >
> > > > 
> > > > http://www.adobe.com/2006/mxml"http://www.adobe.-com/2006/-mxml";
> > > layout="absolute"->
> > > > 
> > > >
> > > > ... rest of your code
> > > >
> > > > 
> > > >
> > > > HTH,
> > > > ~randy
> > > >
> > > >
> > > > _
> > > >
> > > > From: HYPERLINK
> > > "mailto:flexcoders%40yahoogroups.com"flexcoders@
> > > [mailto:HYPERLINK
> > > "mailto:flexcoders%40yahoogroups.com"[EMAIL PROTECTED] On
> > > > Behalf Of edlueze
> > > > Sent: Sunday, July 20, 2008 11:02 AM
> > > > To: HYPERLINK
> > > "mailto:flexcoders%40yahoogroups.com"flexcoders@
> > > > Subject: [flexcoders] Bake XML File into ActionScript
> > > >
> > > >
> > > >
> > > > What's the best way to compile an XML file directly into
> ActionScript?
> > > >
> > > > You can assign an XML literal to a variable as such:
> > > >
> > > > var novel:XML = --My Book--
> > > >
> > > > But it would be much better to have the XML in an externally
> managed
> > > > file. I'd much prefer to do something like:
> > > >
> > > > var novel:XML = {include "Books.xml";--};
> > > >
> > > > But this doesn't seem to be allowed.
> > > >
> > > > I could load the XML file at runtime but then I'd have to deal
> with
> > > > the asynchronous nature of the loading and I'd have to handle any
> > > > runtime errors if there was a problem - yuck!
> > > >
> > > > If I was working in MXML I'd be able to do something very elegant
> such
> > > > as using the compile-time tag  > source="books.--xml"/>
> > > >
> > > > So how do I include XML into ActionScript in a way that is as
> elegant
> > > > as it is for MXML?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > No virus found in this outgoing message.
> > > > Checked by AVG.
> > > > Version: 7.5.523 / Virus Database: 270.5.2/1562 - Release Date:
> > > 7/19/2008
> > > > 2:01 PM
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG.
> > > Version: 7.5.523 / Virus Database: 270.5.2/1562 - Release Date:
> > 7/19/2008
> > > 2:01 PM
> > >
> >
>




RE: [flexcoders] Re: Runtime CSS and "SWF is not a loadable module"

2008-07-21 Thread Alex Harui
I'm unable to download those files.  Try to find another way to make
them available.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jamalwally
Sent: Monday, July 21, 2008 5:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Runtime CSS and "SWF is not a loadable module"

 

Was anybody able to view the css styles swf that I posted earlier? I'm
still unable to 
implement runtime css because of the "SWF is not a loadable module"
error. Any further 
help would be greatly appreciated.

Thank you,
--j

--- In flexcoders@yahoogroups.com 
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Post the swf.
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com 
] On
> Behalf Of jamalwally
> Sent: Wednesday, July 16, 2008 11:37 AM
> To: flexcoders@yahoogroups.com  
> Subject: [flexcoders] Re: Runtime CSS and "SWF is not a loadable
module"
> 
> 
> 
> Hi Tracy,
> 
> I'm confident that FB3 can find the style swf since the following is
> printed to the console:
> 
> [SWF] Users:jbattat:Documents:Flex Builder
> 3:testRuntimeCss:assets:style1.swf - 11,294 
> bytes after decompression
> 
> Still not sure how to verify that the style1.swf is actually a style
swf
> (though I have no 
> reason to believe that it is not).
> 
> James
> 
> --- In flexcoders@yahoogroups.com


> , "Tracy Spratt"  wrote:
> >
> > Make sure the compiled css swf is actually where you expect.
> > 
> > 
> > 
> > I am having problems with FB3 where the compiler misplaces the css
> swf,
> > into a deeply nested folder structure under the bin folder, and I
> always
> > have to copy it to the correct location. I plan to post a question
on
> > this some time soon.
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com


> [mailto:flexcoders@yahoogroups.com


> ] On
> > Behalf Of jamalwally
> > Sent: Wednesday, July 16, 2008 12:45 AM
> > To: flexcoders@yahoogroups.com 
 
> > Subject: [flexcoders] Runtime CSS and "SWF is not a loadable module"
> > 
> > 
> > 
> > Hello,
> > 
> > I'm trying to implement runtime css in my flex application. I have
> > compiled my css file 
> > into a swf with mxmlc
> > > mxmlc style1.css
> > 
> > Then I load the resulting style1.swf on Application
creationComplete:
> > 
> > http://www.adobe.com/2006/mxml
 
>  > 
> > 
 > > "
> layout="vertical"
> >
>
creationComplete="StyleManager.loadStyleDeclarations('../assets/style1.s
> > wf', true, 
> > true)">
> > 
> > But when I debug this in Flex Builder 3, I get an error (see below)
> > saying that my 
> > style1.swf is not a loadable module. I looked around online and in
> this
> > forum and it seems 
> > that this message is security-based, which is puzzling to me because
> all
> > files are local in 
> > my example. I am not loading a style file from another domain.
> > 
> > My directory structure (on OS X Leopard) is:
> > testRuntimeCss\
> > assets\
> > style1.css
> > style1.swf
> > src\
> > testRuntimeCss.mxml
> > 
> > I have tried this with the "Compile CSS to SWF" option both checked
> and
> > unchecked (right 
> > click on style1.css). 
> > 
> > What gives?
> > 
> > [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:bin-
> > debug:testRuntimeCss.swf - 582,620 bytes after decompression
> > [SWF] Users:jbattat:Documents:Flex Builder
> > 3:testRuntimeCss:assets:style1.swf - 11,294 
> > bytes after decompression
> > Error: Unable to load style(SWF is not a loadable module):
> > ../assets/style1.swf.
> > at 
> >
>
()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\styles\S
> > tyleManag
> > erImpl.as:858]
> > at flash.events::EventDispatcher/dispatchEventFunction()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at 
> >
>
ModuleInfoProxy/moduleEventHandler()[E:\dev\3.0.x\frameworks\projects\fr
> > amework\src
> > \mx\modules\ModuleManager.as:1027]
> > at flash.events::EventDispatcher/dispatchEventFunction()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at 
> >
>
ModuleInfo/initHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\
> > mx\modules\
> > ModuleManager.as:631]
> >
>

 



[flexcoders] Re: Anyone have a good resource on singletons?

2008-07-21 Thread Rick Winscot
With regard  to Troy's comment on "making it *impossible* to create
multiple instances..." - I would add.. multiple instances shouldn't be
a huge problem unless you are using modules in your app. If you are -
it is quite important to make sure you watch that like a hawk.

http://www.quilix.com/node/5

Rick Winscot



On Mon, Jul 21, 2008 at 10:04 AM, Troy Gilbert <[EMAIL PROTECTED]> wrote:
>>> I'm trying to find information on using singletons in AS3/Flex. I've
>>> got an .AS file set up but I'm having issues calling the data/functions
>>> within that function in other classes. Does anyone have a good resource
>>> on the web for creating and using singletons?
>
> As others have probably pointed out, it sounds like you may be trying
> to use a singleton to solve an architectural issue possibly not best
> solved with a singleton. But, if singleton is appropriate...
>
> Don't make it more complicated than it needs to be. Everyone seems to
> do that with singletons, which is unfortunate since singletons should
> be so rarely used anyway. Just create a class that creates and returns
> an instance on first access, then returns that instance on further
> access. If you're worried about other developers constructing multiple
> instances of your class, then just include a test in the constructor
> and have it throw an error or assert.
>
> Don't worry about making it *impossible* to create multiple
> instances... it's just not worth the effort. If people are determined
> to use your classes incorrectly and disregard warnings and errors,
> etc, then they're digging their own grave.
>
> Here's the implementation I use:
>
> public class Singleton {
>
> private static _instance:Singleton;
>
> public function get instance():Singleton {
> if (_instance == null) _instance = new Singleton();
> return _instance;
> }
>
> public function Singleton() {
> if (_instance != null) throw new Error("This class is a singleton.
> Instance already created.");
> }
> }
>
> Troy.
>
> 


RE: [flexcoders] Re: PopUpManager

2008-07-21 Thread Alex Harui
Background of the popup?  You specify that by making a selector of the
name of the MXML file that defines the popup.

 

 Backgorund of the app behind the popup?  You have to specify the
modalTransparency and related styles

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of tchredeemed
Sent: Monday, July 21, 2008 7:58 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: PopUpManager

 

also, i can use global {}, but id rather use a popupmanager specific
style... might not be possible?

--- In flexcoders@yahoogroups.com 
, "tchredeemed" <[EMAIL PROTECTED]> wrote:
>
> are you allowed to say that on a yahoo forum?
> 
> ps. I was looking at google when I found this, so yes, google is my
> friend!
> 
> --- In flexcoders@yahoogroups.com
 , "David Gironella"  wrote:
> >
> > Here can find information:
> > 
> >
>
http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls-
blur
 
> > -transparency-and-transparency-color/
> > 
> > Google is your friend!!!
> > 
> > Giro.
> > 
> > -Mensaje original-
> > De: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com 
]
> En nombre
> > de tchredeemed
> > Enviado el: lunes, 21 de julio de 2008 16:42
> > Para: flexcoders@yahoogroups.com
 
> > Asunto: [flexcoders] PopUpManager
> > 
> > Does anyone know how to change the color/alpha of the background
when
> > using a popupmanager to add a popup to the screen?
> > 
> > Not being able to do this has caused me to create my own popups,
which
> > might not be the best way to do it :)
> > 
> > HALP!
> > 
> > 
> > 
> > 
> > --
> > Flexcoders Mailing List
> > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
 !
> Groups Links
> >
>

 



[flexcoders] Re: Drag and drop. From an image to a box

2008-07-21 Thread Fernando Wermus
I solved it doing this,

backgroundColor="#FF" backgroundAlpha="0"

in the box.

It is not nice! But works. Why is this behavior?

On Mon, Jul 21, 2008 at 7:43 AM, Fernando Wermus <[EMAIL PROTECTED]>
wrote:

> I have a strange behavior for me as a newbie. I have an image which I drop
> to a box. The image is accepted if only if the box is white. I cannot figure
> it out the reason of this behavior.
>
> The code,
>
>
> 
> http://www.adobe.com/2006/mxml"; height="641">
> 
> 
> 
> Fernando
> 16
> 100%
> imagenes/foto.jpg
> 
> 
> Agustin
> 10
> 90%
> imagenes/foto.jpg
> 
> 
> Ezequiel
> 1
> 10%
> imagenes/foto.jpg
> 
> 
> 
> 
> 
> 
> 
> 
>  source="imagenes/partido.jpg" />
>  height="28" x="290" y="104" mouseMove="mouseMove(event);" />
>  height="344" id="canchaDelantera" dragEnter="dragEnterHandler(event);" />
>
> 
> 
> 
> 
>
>
> 
>
> Thanks in advance.
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
> http://mientretiempo.blogspot.com/
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


[flexcoders] Flex Dashboard

2008-07-21 Thread gjessup1
Hey all,
I have been watching this group for a while and figured many of you
could benefit from a project I started called the Flex Dashboard.
The google group is  http://groups.google.com/group/flex-dashboard

Its basically a database driven module loader. It is currently using
MSSQL Server as the DB, but the table script is available online, so
could easily be changed to use the DB of your choice. Its a work in
progress, but getting a community involved usually helps a project
grow much faster.

I am  using Weborb to invoke the DB calls using C#. This could be
changed. Would like to see it become very dynamic over time.

Please head over and have a look. Looking to create a community that
can make this a great product everyone can use. 


http://groups.google.com/group/flex-dashboard



[flexcoders] Drag and drop. From an image to a box

2008-07-21 Thread Fernando Wermus
I have a strange behavior for me as a newbie. I have an image which I drop
to a box. The image is accepted if only if the box is white. I cannot figure
it out the reason of this behavior.

The code,



http://www.adobe.com/2006/mxml"; height="641">



Fernando
16
100%
imagenes/foto.jpg


Agustin
10
90%
imagenes/foto.jpg


Ezequiel
1
10%
imagenes/foto.jpg




















Thanks in advance.

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


[flexcoders] Re: LCDS 2.6 - problem in samples

2008-07-21 Thread dstanten01
Hi Zdenek:
I was able to reproduce this and have logged a bug for it.
We will look into it.  Thanx for bringing it to our attention.
-David Stanten
 LCDS QE

--- In flexcoders@yahoogroups.com, Zdenek Mikan <[EMAIL PROTECTED]> wrote:
>
> I have just downloaded LCDS 2.6, installed it on Tomcat 6.0.16 (not 
> using the integrated Tomcat). Then I installed JOTM 2.0.10 into Tomcat 
> and tried to run the CRM sample. Unfortunately when I added new item 
> (company or employee), it crashed every time with strange java 
> exception. After some digging on web I found that this is caused by 
> conflicting library commons-logging.jar in lcds-samples/WEB-INF/lib 
> folder - when I removed this jar file, the CRM sample started to
work. I 
> wonder if this problem is also in the integrated Tomcat.
>




[flexcoders] Blank Images

2008-07-21 Thread archtechcomputers
I am testing something with Flex3 and need some guidance.

I have a security camera that I can only see as a jpeg 320x240 and I
am trying to get a flex program to display an image every 3 seconds.

I have used the  control and created a timer event to refresh
the image every 5 seconds.  
The problem is that the image blanks out during the reload, so in
effect I get a 2 second image, 3 second blank.

What would be a good solution to remove the blank times?
URLLoader?, is there some part of the image controls to remove the
blank during load?

Thanks

Joe



[flexcoders] Re: PopUpManager

2008-07-21 Thread tchredeemed
also, i can use global {}, but id rather use a popupmanager specific
style... might not be possible?

--- In flexcoders@yahoogroups.com, "tchredeemed" <[EMAIL PROTECTED]> wrote:
>
> are you allowed to say that on a yahoo forum?
> 
> ps. I was looking at google when I found this, so yes, google is my
> friend!
> 
> --- In flexcoders@yahoogroups.com, "David Gironella"  wrote:
> >
> > Here can find information:
> > 
> >
>
http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls-blur
> > -transparency-and-transparency-color/
> > 
> > Google is your friend!!!
> > 
> > Giro.
> > 
> > -Mensaje original-
> > De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> En nombre
> > de tchredeemed
> > Enviado el: lunes, 21 de julio de 2008 16:42
> > Para: flexcoders@yahoogroups.com
> > Asunto: [flexcoders] PopUpManager
> > 
> > Does anyone know how to change the color/alpha of the background when
> > using a popupmanager to add a popup to the screen?
> > 
> > Not being able to do this has caused me to create my own popups, which
> > might not be the best way to do it :)
> > 
> > HALP!
> > 
> > 
> > 
> > 
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
> Groups Links
> >
>




[flexcoders] Re: PopUpManager

2008-07-21 Thread tchredeemed
actually, i dont see how to use that with the popupmanager, that works
with alerts, and the solution below steps into mx_internal, which I
would rather avoid...

--- In flexcoders@yahoogroups.com, "tchredeemed" <[EMAIL PROTECTED]> wrote:
>
> are you allowed to say that on a yahoo forum?
> 
> ps. I was looking at google when I found this, so yes, google is my
> friend!
> 
> --- In flexcoders@yahoogroups.com, "David Gironella"  wrote:
> >
> > Here can find information:
> > 
> >
>
http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls-blur
> > -transparency-and-transparency-color/
> > 
> > Google is your friend!!!
> > 
> > Giro.
> > 
> > -Mensaje original-
> > De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> En nombre
> > de tchredeemed
> > Enviado el: lunes, 21 de julio de 2008 16:42
> > Para: flexcoders@yahoogroups.com
> > Asunto: [flexcoders] PopUpManager
> > 
> > Does anyone know how to change the color/alpha of the background when
> > using a popupmanager to add a popup to the screen?
> > 
> > Not being able to do this has caused me to create my own popups, which
> > might not be the best way to do it :)
> > 
> > HALP!
> > 
> > 
> > 
> > 
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
> Groups Links
> >
>




RE: [flexcoders] PopUpManager

2008-07-21 Thread David Gironella
Here can find information:

http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls-blur
-transparency-and-transparency-color/

Google is your friend!!!

Giro.

-Mensaje original-
De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre
de tchredeemed
Enviado el: lunes, 21 de julio de 2008 16:42
Para: flexcoders@yahoogroups.com
Asunto: [flexcoders] PopUpManager

Does anyone know how to change the color/alpha of the background when
using a popupmanager to add a popup to the screen?

Not being able to do this has caused me to create my own popups, which
might not be the best way to do it :)

HALP!




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links





[flexcoders] Re: PopUpManager

2008-07-21 Thread tchredeemed
are you allowed to say that on a yahoo forum?

ps. I was looking at google when I found this, so yes, google is my
friend!

--- In flexcoders@yahoogroups.com, "David Gironella" <[EMAIL PROTECTED]> wrote:
>
> Here can find information:
> 
>
http://blog.flexexamples.com/2007/08/14/changing-a-modal-alert-controls-blur
> -transparency-and-transparency-color/
> 
> Google is your friend!!!
> 
> Giro.
> 
> -Mensaje original-
> De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
En nombre
> de tchredeemed
> Enviado el: lunes, 21 de julio de 2008 16:42
> Para: flexcoders@yahoogroups.com
> Asunto: [flexcoders] PopUpManager
> 
> Does anyone know how to change the color/alpha of the background when
> using a popupmanager to add a popup to the screen?
> 
> Not being able to do this has caused me to create my own popups, which
> might not be the best way to do it :)
> 
> HALP!
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
Groups Links
>




[flexcoders] PopUpManager

2008-07-21 Thread tchredeemed
Does anyone know how to change the color/alpha of the background when
using a popupmanager to add a popup to the screen?

Not being able to do this has caused me to create my own popups, which
might not be the best way to do it :)

HALP!



[flexcoders] Re: Would like to create a dynamic form

2008-07-21 Thread valdhor
Tim

Yes, it can be done but it ain't easy.

I have just completed an application that creates form items on the
fly from a database. The PHP code returns value objects with fields
including FieldName, FieldLabel, FieldType etc.

So, first, I create a custom class that extends Form. Then, in the
constructor, I ask for the field data with a RemoteObject call. Once I
get the data back, I loop through the value objects and create a form
field as specified...

for(var i:int ; i < FormFieldsArrColl.length ; i++)
{
   var theFormItem:FormItem = new FormItem();
   switch(currentFormField.FieldType) // currentFormField is my VO type
   {
  case "textinput":
 var theTextInputItem:TextInput = new TextInput();
 addTextInputFormItem(theFormItem, theTextInputItem,
currentFormField);
   }
}

The addTextInputFormItem function looks like this...

private function addTextInputFormItem(aFormItem:FormItem,
aTextInputItem:TextInput, theFormField:MyFormField):void
{
   if(theFormField.Required) {aFormItem.required = true;}
   aFormItem.setStyle("fontWeight", "bold");
   aTextInputItem.setStyle("fontWeight", "normal");
   aTextInputItem.id = theFormField.FieldName;
   aTextInputItem.width = 300;
   aFormItem.label = theFormField.FieldLabel + ":";
   aTextInputItem.text = theFormField.FieldDefaultText;
   aFormItem.addChild(aTextInputItem);
   this.addChild(aFormItem);
}

There are case items and functions for all the other field types
(TextArea, Checkbox and RadioButtons) but I will leave those
definitions for you to figure out ;-}

Then, once everything has been set up you need to add a submit button
and then loop through all the fields and validate them (Correct data
type, Values specified for required fields etc) and finally send all
this data back to the server.

Of course, I have extended mine even more with fields that depend on
other fields and animation to show different fields.

--- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote:
>
> Can a Repeater be done in ActionScript?  Can a form be created in
> ActionScript?
> 
> Thanks for the help,
> timgerr





Re: [flexcoders] Re: Anyone have a good resource on singletons?

2008-07-21 Thread Troy Gilbert
>> I'm trying to find information on using singletons in AS3/Flex. I've
>> got an .AS file set up but I'm having issues calling the data/functions
>> within that function in other classes. Does anyone have a good resource
>> on the web for creating and using singletons?

As others have probably pointed out, it sounds like you may be trying
to use a singleton to solve an architectural issue possibly not best
solved with a singleton. But, if singleton is appropriate...

Don't make it more complicated than it needs to be. Everyone seems to
do that with singletons, which is unfortunate since singletons should
be so rarely used anyway. Just create a class that creates and returns
an instance on first access, then returns that instance on further
access. If you're worried about other developers constructing multiple
instances of your class, then just include a test in the constructor
and have it throw an error or assert.

Don't worry about making it *impossible* to create multiple
instances... it's just not worth the effort. If people are determined
to use your classes incorrectly and disregard warnings and errors,
etc, then they're digging their own grave.

Here's the implementation I use:

public class Singleton {

  private static _instance:Singleton;

  public function get instance():Singleton {
if (_instance == null) _instance = new Singleton();
return _instance;
  }

  public function Singleton() {
if (_instance != null) throw new Error("This class is a singleton.
Instance already created.");
  }
}

Troy.


[flexcoders] Re: Inline EventListener in MXML tags - confusing description in Developers guid

2008-07-21 Thread Amy
--- In flexcoders@yahoogroups.com, "Johannes Nel" <[EMAIL PROTECTED]> 
wrote:
>
> you could compile with the -keep option to see what is output 
underneath the
> covers.
> and then what i think might be the case
> pure speculation follows
> consider that the mxml gets converted to as. now in mxml you could 
have
>  or
>  or...
> now if i was to write a converter for something like this i would 
wrap the
> function which invokes whatever the user specified (i am not 
certain if this
> is the case) in order to make my approach as flexible as possible
> 

One difference between adding a listener inline and adding a listener 
in AS3 is that inline you have a choice of arguments...you can have 
no argument, an arbitrary argument, or send the event.  In AS3, the 
event is always passed.   If your function doesn't expect to get the 
event as its one and only argument, you will get a runtime error.

This does imply that whatever goes on in addEventListener, it is way 
stricter than what happens when you add the listener inline.  It 
would be nice if the finer points were documented.

HTH;

Amy



[flexcoders] Filter an ArrayCollection into an ItemRender

2008-07-21 Thread luis_roman_am
Hi people!  Situation as follows:

MYARRAYCOLLECTION (Example fields)
- TITLE 
- URL

INDEX.MXML
- TILELIST
  - DataProvider="{MyArrayCollection}"
  - ItemRenderer ="MyRenderer"


MYRENDERER.MXML
- LABEL (data.TITLE) (WORKS FINE)
- LINECHART
-DataProvider="Application.application.MyArrayCollection}
(PROBLEM HERE)

THe problem is: How can i filter linechart inside MYRENDERER.MXML the
  dataprovider to receive only data for the items with his URL?

I tried something like:

-DataProvider="Application.application.MyArrayCollection.(@Url=data.Url)}

but this throws me the following error:

Error #1123: Filter operator not supported on type mx.arraycollections.

Please Help!!



[flexcoders] Re: Set attributes and methods of dynamically added controls

2008-07-21 Thread daddyo_buckeye
Amy,

I got the results I wanted prior to my post with states, but the code 
is extremely unwieldy and limiting. I'll check out the repeater and 
post my results back here.

Sherm

--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> --- In flexcoders@yahoogroups.com, "daddyo_buckeye"  
> wrote:
> >
> > I was just experimenting with using the 'for' loop to add them 
> > dynamically just to see how it's done. I'm pulling the number of 
> > colorpickers needed from an XML file, and I need them to run a 
> > function to color specific items from that XML file. 
> 
> Then you're definitely better off using either a Repeater or a List 
> Based control.
> 
> HTH;
> 
> Amy
>




[flexcoders] Animated dashed lines

2008-07-21 Thread havardfl
In a project I'm working on I would like to represent data flowing
through the system with dashed/dotted lines moving between two or more
points.

I've done one implementation using the lineGradientStyle function to
create dashes. This works, but I'm not pleased with the CPU load while
the script is running. I'd like to draw 100+ lines, and my method of
doing it isn't cutting it.

Does anyone know a great way of drawing animated dashed/dotted lines
without using much CPU time?



[flexcoders] Re: Runtime CSS and "SWF is not a loadable module"

2008-07-21 Thread jamalwally
Was anybody able to view the css styles swf that I posted earlier?  I'm still 
unable to 
implement runtime css because of the "SWF is not a loadable module" error.  Any 
further 
help would be greatly appreciated.

Thank you,
--j


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Post the swf.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of jamalwally
> Sent: Wednesday, July 16, 2008 11:37 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Runtime CSS and "SWF is not a loadable module"
> 
>  
> 
> Hi Tracy,
> 
> I'm confident that FB3 can find the style swf since the following is
> printed to the console:
> 
> [SWF] Users:jbattat:Documents:Flex Builder
> 3:testRuntimeCss:assets:style1.swf - 11,294 
> bytes after decompression
> 
> Still not sure how to verify that the style1.swf is actually a style swf
> (though I have no 
> reason to believe that it is not).
> 
> James
> 
> --- In flexcoders@yahoogroups.com 
> , "Tracy Spratt"  wrote:
> >
> > Make sure the compiled css swf is actually where you expect.
> > 
> > 
> > 
> > I am having problems with FB3 where the compiler misplaces the css
> swf,
> > into a deeply nested folder structure under the bin folder, and I
> always
> > have to copy it to the correct location. I plan to post a question on
> > this some time soon.
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com 
> ] On
> > Behalf Of jamalwally
> > Sent: Wednesday, July 16, 2008 12:45 AM
> > To: flexcoders@yahoogroups.com  
> > Subject: [flexcoders] Runtime CSS and "SWF is not a loadable module"
> > 
> > 
> > 
> > Hello,
> > 
> > I'm trying to implement runtime css in my flex application. I have
> > compiled my css file 
> > into a swf with mxmlc
> > > mxmlc style1.css
> > 
> > Then I load the resulting style1.swf on Application creationComplete:
> > 
> > http://www.adobe.com/2006/mxml
>  
> >  > "
> layout="vertical"
> >
> creationComplete="StyleManager.loadStyleDeclarations('../assets/style1.s
> > wf', true, 
> > true)">
> > 
> > But when I debug this in Flex Builder 3, I get an error (see below)
> > saying that my 
> > style1.swf is not a loadable module. I looked around online and in
> this
> > forum and it seems 
> > that this message is security-based, which is puzzling to me because
> all
> > files are local in 
> > my example. I am not loading a style file from another domain.
> > 
> > My directory structure (on OS X Leopard) is:
> > testRuntimeCss\
> > assets\
> > style1.css
> > style1.swf
> > src\
> > testRuntimeCss.mxml
> > 
> > I have tried this with the "Compile CSS to SWF" option both checked
> and
> > unchecked (right 
> > click on style1.css). 
> > 
> > What gives?
> > 
> > [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:bin-
> > debug:testRuntimeCss.swf - 582,620 bytes after decompression
> > [SWF] Users:jbattat:Documents:Flex Builder
> > 3:testRuntimeCss:assets:style1.swf - 11,294 
> > bytes after decompression
> > Error: Unable to load style(SWF is not a loadable module):
> > ../assets/style1.swf.
> > at 
> >
> ()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\styles\S
> > tyleManag
> > erImpl.as:858]
> > at flash.events::EventDispatcher/dispatchEventFunction()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at 
> >
> ModuleInfoProxy/moduleEventHandler()[E:\dev\3.0.x\frameworks\projects\fr
> > amework\src
> > \mx\modules\ModuleManager.as:1027]
> > at flash.events::EventDispatcher/dispatchEventFunction()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at 
> >
> ModuleInfo/initHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\
> > mx\modules\
> > ModuleManager.as:631]
> >
>





RE: [flexcoders] Numeric values drawn from a database, always int?

2008-07-21 Thread Jim Hayes
I think you can find the answers here :
 
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/?localDatabase
SQLSupport.html#dataTypes
 
(I'd been meaning to look this up in any case, you just prompted me! Not
finished reading it all as yet.)
 
 
 
 
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of bredwards358
Sent: 21 July 2008 13:25
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Numeric values drawn from a database, always int?
 
So far so good in the application currently in development, I feel
like I'm in the home stretch. However something has come up which
could prove to be a roadblock in the near future. There are some
values which need to be totaled up and some of those need decimals.
Now I realize that the int datatype doesn't deal with that, and the
only thing I've seen thus far which fills the same purpose as a double
datatype is the Number datatype. However when I try something like this:

for(var i:int; i < n; i++)
{
total2 += dgProvider[i].ProductList;
total3 += dgProvider[i].Cost;
}

If total2 and total3 are of the Number datatype, the result will
display as NaN or "Not a Number". This works fine however if total2
and total3 are declared as int. What I'm wondering is, are numeric
values drawn from a database (SQL Lite here) automatically cast as
int? Even if the database has them as NUMERIC and not INTEGER? If so,
then would I be able to work around this by doing something like this?

for(var i:int; i < n; i++)
{
total2 += Number(dgProvider[i].ProductList);
total3 += Number(dgProvider[i].Cost);
}

I'm just asking for some clarification on this before I finally get
around to it after finishing up a few things on this project. Thanks
in advance,

Brian Ross Edwards
Tech-Connect LLC
 

__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__

Re: [flexcoders] Re: Numbers gone crazy: 5 - 4.8 = 0.2000000000000018 ?

2008-07-21 Thread Alen Balja
Yes, toFixed() is a better option. It still does not solve the problem as we
don't know to what value to fix the numbers to achieve consistent behavior.
In practice using something like toFixed(8) for every Number should do the
job, but then again we can't be sure.

I also found this blog that seems useful:

http://www.zeuslabs.us/2007/01/30/flash-floating-point-number-errors/






On Mon, Jul 21, 2008 at 3:33 PM, Kuldeep Atil <[EMAIL PROTECTED]>
wrote:

>   well, u can use number.tofixed(2);
>
>
> --- In flexcoders@yahoogroups.com , "b_alen"
> <[EMAIL PROTECTED]> wrote:
> >
> > Here is how I arrived at this:
> >
> > var res:Number;
> >
> > var a:Number = 5;
> > var b:Number = 4.8;
> >
> > res = a - b;
> > trace("result: " + res + ", a: " + a + ", b: " + b);
> >
> >
> > The trace clearly shows that the value of a is 5, and the value of b
> > is 4.8. However the end result is clearly shown as
> 0.2018.
> >
> > Ok, I wanted to create a workaround where I will make sure that b is
> > really 4.8, and I used toPecision() method.
> >
> > var b1:String = b.toPrecision(2);
> > var b2:Number = Number(b1);
> > trace("b1: " + b1 + ", b2: " + b2);
> >
> > res = a - b2;
> > trace("result: " + res + ", b1: " + b1 + ", b2: " + b2);
> >
> >
> > Again with same result. b2 was traced as 4.8, but the end result
> still
> > showing 0.2018. As this can of course break all further
> > calculations I had to make sure result is really holding a value
> that
> > it should, based on all mathematical logic. So I did this:
> >
> > var res1:String = res.toPrecision(2);
> > res = Number(res1);
> >
> > trace("result: " + res);
> >
> > I got the expected result and the value of res is now 0.2.
> >
> > This is however very ugly, in case I'm not doing something wrong.
> > Every time we expect a floating point value in our calculation we
> have
> > to handle it to ensure the proper value is calculated, because what
> > Flash calculates is just wrong. Also, every intermediate calculation
> > has to be stored in a variable converted to String with toPrecision
> > and back to Number for future use. I really don't know how to
> properly
> > handle this and would appreciate any advice. Imagine the shopping
> cart
> > system with this sort of unpredictable behavior.
> >
> > For the end, here's one more weirdness:
> >
> > var c:Number = 488.8;
> >
> > trace("c: " + c + " , c.toPrec: " + c.toPrecision(2));
> >
> >
> > Traces out c: 4.8, c.toPrec: 4.9e+2
> >
> >
> >
> >
> > Thanks,
> >
> > Alen
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > var c:Number = 488.8;
> >
>
>  
>


[flexcoders] Numeric values drawn from a database, always int?

2008-07-21 Thread bredwards358
So far so good in the application currently in development, I feel
like I'm in the home stretch. However something has come up which
could prove to be a roadblock in the near future. There are some
values which need to be totaled up and some of those need decimals.
Now I realize that the int datatype doesn't deal with that, and the
only thing I've seen thus far which fills the same purpose as a double
datatype is the Number datatype. However when I try something like this:

for(var i:int; i < n; i++)
{
total2 += dgProvider[i].ProductList;
total3 += dgProvider[i].Cost;
}

If total2 and total3 are of the Number datatype, the result will
display as NaN or "Not a Number". This works fine however if total2
and total3 are declared as int. What I'm wondering is, are numeric
values drawn from a database (SQL Lite here) automatically cast as
int? Even if the database has them as NUMERIC and not INTEGER? If so,
then would I be able to work around this by doing something like this?

for(var i:int; i < n; i++)
{
total2 += Number(dgProvider[i].ProductList);
total3 += Number(dgProvider[i].Cost);
}

I'm just asking for some clarification on this before I finally get
around to it after finishing up a few things on this project. Thanks
in advance,

Brian Ross Edwards
Tech-Connect LLC



[flexcoders] Re: Anyone have a good resource on singletons?

2008-07-21 Thread zwetank
Hi,

here I got a way to do it here
http://code.google.com/p/maashaack/wiki/Singleton

note that a lot of people will debate on how to define singleton in AS3,
I don't say that the solution I mention above is the best but imho
it's the most standard-way to do it and the closest to the AS3
language (and if someone want to debate that come with good arguments,
just saying "duh Java use getInstance() so we should do the same" that
will not qualify as a good argument)

cheers,
zwetan

--- In flexcoders@yahoogroups.com, "Scott" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to find information on using singletons in AS3/Flex.  I've
> got an .AS file set up but I'm having issues calling the data/functions
> within that function in other classes.  Does anyone have a good resource
> on the web for creating and using singletons?
> 
>  
> 
> Thanks!
>




[flexcoders] Re: Numbers gone crazy: 5 - 4.8 = 0.2000000000000018 ?

2008-07-21 Thread JWOpitz
My buddy Mike had just written a blog posting on this -
http://mikeorth.com/?p=8

--- In flexcoders@yahoogroups.com, "Johannes Nel" <[EMAIL PROTECTED]>
wrote:
>
> this is well discussed and a side effect of dealing with Floats
> 
> On Mon, Jul 21, 2008 at 12:03 PM, Kuldeep Atil <[EMAIL PROTECTED]>
> wrote:
> 
> >   well, u can use number.tofixed(2);
> >
> >
> > --- In flexcoders@yahoogroups.com ,
"b_alen"
> >  wrote:
> > >
> > > Here is how I arrived at this:
> > >
> > > var res:Number;
> > >
> > > var a:Number = 5;
> > > var b:Number = 4.8;
> > >
> > > res = a - b;
> > > trace("result: " + res + ", a: " + a + ", b: " + b);
> > >
> > >
> > > The trace clearly shows that the value of a is 5, and the value of b
> > > is 4.8. However the end result is clearly shown as
> > 0.2018.
> > >
> > > Ok, I wanted to create a workaround where I will make sure that b is
> > > really 4.8, and I used toPecision() method.
> > >
> > > var b1:String = b.toPrecision(2);
> > > var b2:Number = Number(b1);
> > > trace("b1: " + b1 + ", b2: " + b2);
> > >
> > > res = a - b2;
> > > trace("result: " + res + ", b1: " + b1 + ", b2: " + b2);
> > >
> > >
> > > Again with same result. b2 was traced as 4.8, but the end result
> > still
> > > showing 0.2018. As this can of course break all further
> > > calculations I had to make sure result is really holding a value
> > that
> > > it should, based on all mathematical logic. So I did this:
> > >
> > > var res1:String = res.toPrecision(2);
> > > res = Number(res1);
> > >
> > > trace("result: " + res);
> > >
> > > I got the expected result and the value of res is now 0.2.
> > >
> > > This is however very ugly, in case I'm not doing something wrong.
> > > Every time we expect a floating point value in our calculation we
> > have
> > > to handle it to ensure the proper value is calculated, because what
> > > Flash calculates is just wrong. Also, every intermediate calculation
> > > has to be stored in a variable converted to String with toPrecision
> > > and back to Number for future use. I really don't know how to
> > properly
> > > handle this and would appreciate any advice. Imagine the shopping
> > cart
> > > system with this sort of unpredictable behavior.
> > >
> > > For the end, here's one more weirdness:
> > >
> > > var c:Number = 488.8;
> > >
> > > trace("c: " + c + " , c.toPrec: " + c.toPrecision(2));
> > >
> > >
> > > Traces out c: 4.8, c.toPrec: 4.9e+2
> > >
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Alen
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > var c:Number = 488.8;
> > >
> >
> >  
> >
> 
> 
> 
> -- 
> j:pn
> \\no comment
>




RE: [flexcoders] air sqlite example with BLOB datatype

2008-07-21 Thread Jim Hayes
I don't have an example to hand, but from memory :
 
Storing images is a question of reading the original image file as a
bytearray and inserting that byteArray varaible into a blob field in the
database.
 
Reading is much the same, select the record and read/cast it into a
byteArray.
 
It's then possible to use Loader to convert that into an image (Some
details on that @  http://ifeedme.com/blog/ )
 
Hope that's enough to get you going (it all worked fine for me)
 
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sudha_bsb
Sent: 20 July 2008 19:56
To: flexcoders@yahoogroups.com
Subject: [flexcoders] air sqlite example with BLOB datatype
 
Hi,

Can someone share a simple example on how to store and retrieve the
BLOB data from SqLite using AIR. I want to store images in the
database using BLOB type, retrieve them and show them as images.

Please help,

Thanks,
Sudha.
 

__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__

Re: [flexcoders] Re: Numbers gone crazy: 5 - 4.8 = 0.2000000000000018 ?

2008-07-21 Thread Johannes Nel
this is well discussed and a side effect of dealing with Floats

On Mon, Jul 21, 2008 at 12:03 PM, Kuldeep Atil <[EMAIL PROTECTED]>
wrote:

>   well, u can use number.tofixed(2);
>
>
> --- In flexcoders@yahoogroups.com , "b_alen"
> <[EMAIL PROTECTED]> wrote:
> >
> > Here is how I arrived at this:
> >
> > var res:Number;
> >
> > var a:Number = 5;
> > var b:Number = 4.8;
> >
> > res = a - b;
> > trace("result: " + res + ", a: " + a + ", b: " + b);
> >
> >
> > The trace clearly shows that the value of a is 5, and the value of b
> > is 4.8. However the end result is clearly shown as
> 0.2018.
> >
> > Ok, I wanted to create a workaround where I will make sure that b is
> > really 4.8, and I used toPecision() method.
> >
> > var b1:String = b.toPrecision(2);
> > var b2:Number = Number(b1);
> > trace("b1: " + b1 + ", b2: " + b2);
> >
> > res = a - b2;
> > trace("result: " + res + ", b1: " + b1 + ", b2: " + b2);
> >
> >
> > Again with same result. b2 was traced as 4.8, but the end result
> still
> > showing 0.2018. As this can of course break all further
> > calculations I had to make sure result is really holding a value
> that
> > it should, based on all mathematical logic. So I did this:
> >
> > var res1:String = res.toPrecision(2);
> > res = Number(res1);
> >
> > trace("result: " + res);
> >
> > I got the expected result and the value of res is now 0.2.
> >
> > This is however very ugly, in case I'm not doing something wrong.
> > Every time we expect a floating point value in our calculation we
> have
> > to handle it to ensure the proper value is calculated, because what
> > Flash calculates is just wrong. Also, every intermediate calculation
> > has to be stored in a variable converted to String with toPrecision
> > and back to Number for future use. I really don't know how to
> properly
> > handle this and would appreciate any advice. Imagine the shopping
> cart
> > system with this sort of unpredictable behavior.
> >
> > For the end, here's one more weirdness:
> >
> > var c:Number = 488.8;
> >
> > trace("c: " + c + " , c.toPrec: " + c.toPrecision(2));
> >
> >
> > Traces out c: 4.8, c.toPrec: 4.9e+2
> >
> >
> >
> >
> > Thanks,
> >
> > Alen
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > var c:Number = 488.8;
> >
>
>  
>



-- 
j:pn
\\no comment


Re: [flexcoders] Re: Inline EventListener in MXML tags - confusing description in Developers guid

2008-07-21 Thread Johannes Nel
you could compile with the -keep option to see what is output underneath the
covers.
and then what i think might be the case
pure speculation follows
consider that the mxml gets converted to as. now in mxml you could have
 wrote:

>   Instead of waiting for an answer i just ran a lil' test:
> 
>  xmlns:mx="http://www.adobe.com/2006/mxml";>
> 
> 
> 
> 
>
> I was surprised that the FlexEvent.CREATION_COMPLETE can't be removed. This
> is quite
> shocking...
>
> Best regards.
>
> --- In flexcoders@yahoogroups.com ,
> "florian.salihovic" <[EMAIL PROTECTED]> wrote:
> >
> > Quoted from Adobe Flex Developers Guide, page 78
> >
> > "However, it is best practice to use the addEventListener() method.
> > This method gives you greater control over the event by letting
> > you configure the priority and capturing settings, and use event
> constants.
> > In addition, if you use addEventListener() to add an event handler, you
> can
> > use removeEventListener() to remove the handler when you no longer need
> > it. If you add an event handler inline, you cannot call
> removeEventListener()
> > on that handler."
> >
> > - End of Quote -
> >
> > What i think is a little bit confusing is, that it's said that inline
> EventListener can't be
> > removed? Or is it just a little bit unluckily expressed? Why can't i just
> call
> > removeEventListener in ActionScript on the type of event declared in
> MXML?
> >
> > Best regards from Germany
> >
>
>  
>



-- 
j:pn
\\no comment


[flexcoders] Re: Inline EventListener in MXML tags - confusing description in Developers guid

2008-07-21 Thread florian.salihovic
Instead of waiting for an answer i just ran a lil' test:

http://www.adobe.com/2006/mxml";>
  

  


I was surprised that the FlexEvent.CREATION_COMPLETE can't be removed. This is 
quite 
shocking...

Best regards.

--- In flexcoders@yahoogroups.com, "florian.salihovic" <[EMAIL PROTECTED]> 
wrote:
>
> Quoted from Adobe Flex Developers Guide, page 78
> 
> "However, it is best practice to use the addEventListener() method.
> This method gives you greater control over the event by letting
> you configure the priority and capturing settings, and use event constants.
> In addition, if you use addEventListener() to add an event handler, you can
> use removeEventListener() to remove the handler when you no longer need
> it. If you add an event handler inline, you cannot call removeEventListener()
> on that handler."
> 
>  - End of Quote -
> 
> What i think is a little bit confusing is, that it's said that inline 
> EventListener can't be 
> removed? Or is it just a little bit unluckily expressed? Why can't i just 
> call 
> removeEventListener in ActionScript on the type of event declared in MXML?
> 
> Best regards from Germany
>



[flexcoders] Re: Numbers gone crazy: 5 - 4.8 = 0.2000000000000018 ?

2008-07-21 Thread Kuldeep Atil
well, u can use number.tofixed(2);

--- In flexcoders@yahoogroups.com, "b_alen" <[EMAIL PROTECTED]> wrote:
>
> Here is how I arrived at this:
> 
> var res:Number;
> 
> var a:Number = 5;
> var b:Number = 4.8;
> 
> res = a - b;
> trace("result: " + res + ", a: " + a + ", b: " + b);
> 
> 
> The trace clearly shows that the value of a is 5, and the value of b
> is 4.8. However the end result is clearly shown as 
0.2018.
> 
> Ok, I wanted to create a workaround where I will make sure that b is
> really 4.8, and I used toPecision() method.
> 
> var b1:String = b.toPrecision(2);
> var b2:Number = Number(b1);
> trace("b1: " + b1 + ", b2: " + b2);
> 
> res = a - b2;
> trace("result: " + res + ", b1: " + b1 + ", b2: " + b2);
> 
> 
> Again with same result. b2 was traced as 4.8, but the end result 
still
> showing 0.2018. As this can of course break all further
> calculations I had to make sure result is really holding a value 
that
> it should, based on all mathematical logic. So I did this:
> 
> var res1:String = res.toPrecision(2);
> res = Number(res1);
> 
> trace("result: " + res);
> 
> I got the expected result and the value of res is now 0.2.
> 
> This is however very ugly, in case I'm not doing something wrong.
> Every time we expect a floating point value in our calculation we 
have
> to handle it to ensure the proper value is calculated, because what
> Flash calculates is just wrong. Also, every intermediate calculation
> has to be stored in a variable converted to String with toPrecision
> and back to Number for future use. I really don't know how to 
properly
> handle this and would appreciate any advice. Imagine the shopping 
cart
> system with this sort of unpredictable behavior. 
> 
> For the end, here's one more weirdness:
> 
> var c:Number = 488.8;
> 
> trace("c: " + c + " , c.toPrec: " + c.toPrecision(2));
> 
> 
> Traces out c: 4.8, c.toPrec: 4.9e+2
> 
> 
> 
> 
> Thanks,
> 
> Alen
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> var c:Number = 488.8;
>




[flexcoders] Numbers gone crazy: 5 - 4.8 = 0.2000000000000018 ?

2008-07-21 Thread b_alen
Here is how I arrived at this:

var res:Number;

var a:Number = 5;
var b:Number = 4.8;

res = a - b;
trace("result: " + res + ", a: " + a + ", b: " + b);


The trace clearly shows that the value of a is 5, and the value of b
is 4.8. However the end result is clearly shown as 0.2018.

Ok, I wanted to create a workaround where I will make sure that b is
really 4.8, and I used toPecision() method.

var b1:String = b.toPrecision(2);
var b2:Number = Number(b1);
trace("b1: " + b1 + ", b2: " + b2);

res = a - b2;
trace("result: " + res + ", b1: " + b1 + ", b2: " + b2);


Again with same result. b2 was traced as 4.8, but the end result still
showing 0.2018. As this can of course break all further
calculations I had to make sure result is really holding a value that
it should, based on all mathematical logic. So I did this:

var res1:String = res.toPrecision(2);
res = Number(res1);

trace("result: " + res);

I got the expected result and the value of res is now 0.2.

This is however very ugly, in case I'm not doing something wrong.
Every time we expect a floating point value in our calculation we have
to handle it to ensure the proper value is calculated, because what
Flash calculates is just wrong. Also, every intermediate calculation
has to be stored in a variable converted to String with toPrecision
and back to Number for future use. I really don't know how to properly
handle this and would appreciate any advice. Imagine the shopping cart
system with this sort of unpredictable behavior. 

For the end, here's one more weirdness:

var c:Number = 488.8;

trace("c: " + c + " , c.toPrec: " + c.toPrecision(2));


Traces out c: 4.8, c.toPrec: 4.9e+2




Thanks,

Alen










var c:Number = 488.8;



[flexcoders] AdvancedDataGrid + printing issue

2008-07-21 Thread Kuldeep Atil
Hi All,

Is there any way(method) by which we can get the expanded nodes of 
advanceddatagrid while printing irrespective of the current (expanded) 
state of advanceddatagrid.

i.e. lets say i a collapsed ADG but when i click print button the 
printed ADG must have all the nodes expanded without really expanding 
the nodes of ADG in my application.

Thanks and Regards,
Kuldeep Atil



[flexcoders] Mapping LCDS from Java to AS

2008-07-21 Thread berenger_kc

Hello,




I use LCDS 2.6 and JBoss 4.2.2, I start to work with these technologies
and have a problem with the data mapping between java and actionscript.




I will try to be as clear as possible to express my problem :



Server side, I use the java.util.Vector class and my design is

OBECT_A extends Vector

OBJECT_B  /*this object has an attribute called anObjectDList  with the
type OBJECT_C*/

OBJECT_C extends Vector

OBJECT_D



If from the client side I use the arraycollection type, this mean that
anObjectDList is not like an OBJECT_C type and the fill method fill an
object that is an ArrayCollection and not an OBJECT_A type. Then,
everything happened well, but I loose all my design. In fact the
OBJECT_A and OBJECT_B type are no more useful in the client side.



Then what I did is to extends the OBJECT_A et OBJECT_C to the
ArrayCollection. But now the problem occurs, I can see the content of
the Object_A and Object_B, but the Object_C is now empty. There is a
conversion error : conversion from mx.collections::ArrayCollection to
test.datamodel.OBJECT_C impossible



Does it mean that the mapping could not exist with object extended from
ArrayCollection ? DO we have to use strictly the ArrayCollection type, I
mean no inherited classes from this type ?


Thanks for your answer.


[flexcoders] Inline EventListener in MXML tags - confusing description in Developers guide.

2008-07-21 Thread florian.salihovic
Quoted from Adobe Flex Developers Guide, page 78

"However, it is best practice to use the addEventListener() method.
This method gives you greater control over the event by letting
you configure the priority and capturing settings, and use event constants.
In addition, if you use addEventListener() to add an event handler, you can
use removeEventListener() to remove the handler when you no longer need
it. If you add an event handler inline, you cannot call removeEventListener()
on that handler."

 - End of Quote -

What i think is a little bit confusing is, that it's said that inline 
EventListener can't be 
removed? Or is it just a little bit unluckily expressed? Why can't i just call 
removeEventListener in ActionScript on the type of event declared in MXML?

Best regards from Germany



[flexcoders] Re: TabNaviigator tabBar index doesn't update on selectedIndex change

2008-07-21 Thread rleuthold
Hi Jeff,

Have you found a solution to this, cause I'm having exactly the same problem, 
and didn't 
found a way to solve it.

_rico


--- In flexcoders@yahoogroups.com, "Battershall, Jeff" <[EMAIL PROTECTED]> 
wrote:
>
> I'm using Flex 3 Beta 3.  I have a TabNavigator component where the
> children are created dynamically from a Repeater.  When the dataProvider
> of the repeater changes, the tab labels update accordingly, EXCEPT the
> tabBar index of the component doesn't visually update.  I would just set
> myTabNav.tabBar.selectedIndex = whatever, except that the tabBar is a
> protected member.
> 
> I can work around this by extending the component (I think) but I
> shouldn't have to do this - perhaps I'm missing something on how to best
> approach it.
> 
> Jeff Battershall
> Application Architect
> Dow Jones Indexes
> [EMAIL PROTECTED]
> (609) 520-5637 (p)
> (484) 477-9900 (c)
>





  1   2   >