Re: [flexcoders] Intriguing AMFPHP sample

2008-08-21 Thread Rick Winscot
On the loader complete event... The Œcontent¹ ._is_. The swf.

var foo:Object = loader.content;

What this looks like... Is that someone is saying that hitting a page like
foo.php could actually provide Flex with foo.swf. So... The url request
target would probably be ³foo.php.²

Rick Winscot



On 8/21/08 7:27 PM, "Jim Hayes" <[EMAIL PROTECTED]> wrote:

>  
>  
> 
>> >How would you convert that ByteArray of the swf file back to a
>> >MovieClip/SWFLoader/something displayable ??
> 
> I guess use Loader.loadBytes and type the resultant contents as a MovieClip?
> But that is guessing, I hasten to add.
> 
> -Original Message-
> From: flexcoders@yahoogroups.com   on
> behalf of Kevin Aebig
> Sent: Thu 21/08/2008 21:10
> To: flexcoders@yahoogroups.com 
> Subject: RE: [flexcoders] Intriguing AMFPHP sample
>  
> If it's going to an Air application, than it can write the bytes
> temporarily, load the Movie and delete the temporary file. I did that years
> ago with C# and Flash and it worked really well.
> 
> !k
> 
> From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com  ] On
> Behalf Of Nik Derewianka
> Sent: Wednesday, August 20, 2008 9:22 AM
> To: flexcoders@yahoogroups.com 
> Subject: [flexcoders] Intriguing AMFPHP sample
> 
> Hi,
> 
> Was just looking through some blogs on AMFPHP and came across a php
> snippet that showed:
> 
> function getSwf()
> {
> return new ByteArray(file_get_contents("my.swf"));
> }
> 
> But no sample of what to do on the Flex side to turn it back into
> something useable.
> 
> How would you convert that ByteArray of the swf file back to a
> MovieClip/SWFLoader/something displayable ??
> 
> Thanks,
> Nik
> 
> __
> 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] KeyEvent in Application and in component

2008-08-21 Thread jitendra jain
Thanks Alex, '+' and '-' keys . How would i enforce the browser to stop eating 
those ??

 Thanks,

with Regards,
Jitendra Jain





- Original Message 
From: Alex Harui <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Friday, August 22, 2008 11:55:26 AM
Subject: RE: [flexcoders] KeyEvent in Application and in component


Which keys?  Many are eaten by the browser
and you only get the KEY_UPs
 


 
From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf 
Of jitendra jain
Sent: Thursday, August 21, 2008
9:39 PM
To: flex group flex
Subject: [flexcoders] KeyEvent in
Application and in component
 
Hi Friends,

I have a key down listener in my application and also in my
component that is childeren of this main application.
But when i press a key, it doesn't fire any event. But when i change this to
key up listener it is firing. I know that the key precedence starts with
childern. Please help!!!
 
Thanks,

with Regards,
Jitendra Jain


 
 


  

Re: [flexcoders] Template architecture

2008-08-21 Thread Rick Winscot
Just a .02 clink... Alex is recommending a hallmark architectural pattern
for building an application from constituent parts
(http://tinyurl.com/9js2e). One of the hurdles in implementing this in Flex
has to deal with how creation policy plays with loosely tied models; if it
hasn¹t been touched yet ­ it doesn¹t exist, visual updates fail, and runtime
errors usually follow.

On a couple occasions I had to resort to have the template base listen for
any data changes on the model and when data change events fire ­ to pull
those changes local and update internal bindable variables that are used in
the template and drive the UI. Duplication you say? Yes... sadly there is
duplication involved.

Why do it this way? I¹ve found that no matter how Œlate¹ you try and capture
a data event... That there are times when controls like the view stack just
don¹t play nice. Fiddling with creationPolicy can help but doesn¹t address
the root cause. So... tight coupling within the template with loose coupling
to the model was a reasonable approach.

Rick Winscot


On 8/22/08 12:27 AM, "Alex Harui" <[EMAIL PROTECTED]> wrote:

>  
>  
> 
> creationCOmplete is a better bet, but pushing stuff into the template is
> potentially bad design.  It means you know something about the template and
> have broken encapsulation.  Other designs like model/view would have the
> template pull from a data model.  Other designs would have an interface to the
> template that abstracts what children do what.  That¹s how many of our
> components work and they use the lifecycle events and methods to validate
> properties ³later²
>  
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
> Of Richard Rodseth
> Sent: Thursday, August 21, 2008 2:28 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Template architecture
>  
> 
> I'm prototyping a system where a view is built dynamically from an XML
> description (converted to VOs). The description refers to a template
> (hard-coded in MXML). The dynamic view observes the description (which is a
> part of its model) , and creates a child (the template) and adds it as a
> child. However, it also needs to "fill in" the template which involves
> accessing some of its children by id (eg. template["slot1"], template["slot2"]
> ).
> 
> If I construct the template via new Template1(), the children are not yet
> created. Their ids show up in the debugger, but the values are null. Should I
> add a listener for creationComplete, or is this a case where callLater() could
> be put to good effect?
>  
> 




Re: [flexcoders] DataGridColumn trouble...

2008-08-21 Thread Sefi Ninio
Hi Tracy,

I know I get the Item, and that's what I currently use.
The problem is (and I probably should have mentioned it), that the other
columns labelFunctions make a complex calculation themselves, and I am
reluctant to do it again in the third column labelFunction if there's a way
to get to the already calculated values within the DataGrid.

I also thought of keeping the calculation results in an external map, but
there must be a simpler solution...
I can't believe there is no way to get from the DataGridColumn to the grid
itself.

Sefi

On Fri, Aug 22, 2008 at 2:53 AM, Tracy Spratt <[EMAIL PROTECTED]> wrote:

>labelFunction gets two arguments.  One is a reference to the *entire*
> dataProvider item, the other to the dataGridColumn.  Since you have a
> reference to the whole item, you can easily build your return string.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Sefi Ninio
> *Sent:* Thursday, August 21, 2008 4:15 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] DataGridColumn trouble...
>
>
>
> Hi.
>
> I have a DataGrid, and a few DataGridColumns in it.
> One of them has a labelFunction, that should return a value that depends on
> the values of two of the other columns.
>
> example:
> |  name  |  start  |  end  |  diff  |
> |  xxx |   5 |   7 |   2|
> |   yyy|   10|  100  |   90  |
>
> etc...
>
> I can't find a way to get a reference to the DataGrid or the other
> DataGridColumns inside it from the labelFunction - using it's DataGridColumn
> argument...
>
> Any help would be greatly appreciated..
>
> Sefi
>
>  
>


RE: [flexcoders] KeyEvent in Application and in component

2008-08-21 Thread Alex Harui
Which keys?  Many are eaten by the browser and you only get the KEY_UPs

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jitendra jain
Sent: Thursday, August 21, 2008 9:39 PM
To: flex group flex
Subject: [flexcoders] KeyEvent in Application and in component

 

Hi Friends,

I have a key down listener in my application and also in my
component that is childeren of this main application.
But when i press a key, it doesn't fire any event. But when i change
this to key up listener it is firing. I know that the key precedence
starts with childern. Please help!!!

 

Thanks,

with Regards,
Jitendra Jain



 

 

 



RE: [flexcoders] Re: Error styling datagrids

2008-08-21 Thread Alex Harui
Yes, there is a different mindset.  We don't' really have a 'dumb'
datagrid.  It recycles its renderers to save memory when scaled to large
data sets.  You can read more about it in the item renderers section on
my blog (blogs.adobe.com/aharui)

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of pixelgeek
Sent: Thursday, August 21, 2008 2:26 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Error styling datagrids

 


> It sounds like maybe you're just not resetting things when the data 
> property changes.

That may very well be the case. If it is then I am at a loss to see
why the 12th item in a datagrid even gets styled when I style the
second and why I would then have to reset the style when the grid gets
drawn

It might also be the case that there a much, much different mindset
that I need to develop when I code in Flex.

Its still very odd that I need to go to these extremes but perhaps I
will have to redesign the logic and use one of the many cell styling
examples that are available instead.

 



Re: [flexcoders] Template architecture

2008-08-21 Thread Richard Rodseth
Hmm. The way I have it, the templates are dead simple to write and can have
any Container as the root, eg.

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


 and all that's exposed is the names of the containers "Left" and "Right"
(via an implemented interface I've omitted above). But I suppose I could
provide a template base class (probably a subclass of Box) with a
contentSpec property and an init function to build out the containers - much
like what the LiveDocs call templates, a pattern I use elsewhere. Only
downside is if the template wants non-Box behaviour at the top level it must
nest a Canvas or whatever. No biggie.



On Thu, Aug 21, 2008 at 9:27 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>creationCOmplete is a better bet, but pushing stuff into the template
> is potentially bad design.  It means you know something about the template
> and have broken encapsulation.  Other designs like model/view would have the
> template pull from a data model.  Other designs would have an interface to
> the template that abstracts what children do what.  That's how many of our
> components work and they use the lifecycle events and methods to validate
> properties "later"
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Rodseth
> *Sent:* Thursday, August 21, 2008 2:28 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] Template architecture
>
>
>
> I'm prototyping a system where a view is built dynamically from an XML
> description (converted to VOs). The description refers to a template
> (hard-coded in MXML). The dynamic view observes the description (which is a
> part of its model) , and creates a child (the template) and adds it as a
> child. However, it also needs to "fill in" the template which involves
> accessing some of its children by id (eg. template["slot1"],
> template["slot2"] ).
>
> If I construct the template via new Template1(), the children are not yet
> created. Their ids show up in the debugger, but the values are null. Should
> I add a listener for creationComplete, or is this a case where callLater()
> could be put to good effect?
>
>  
>


[flexcoders] Re: global replace with strings

2008-08-21 Thread aceoohay
The reason I didn't want to use regex is in the real program the 
string to replace is variable.

I finally broke down and used a regex.

Paul

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> And in case he really does not want to use regular expressions, 
there is
> always the Array split/join approach.
> 
>  
> 
>   public static function replace(sString:String, sFind:String,
> sReplace:String):String
> 
>   {
> 
> return sString.split( sFind ).join( sReplace ); 
> 
>   }
> 
>  
> 
> Tracy
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Guy Morton
> Sent: Friday, August 15, 2008 7:06 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] global replace with strings
> 
>  
> 
> I think the point is he's not aware that the way to do what he 
wants is
> to create a RegEx with the g flag. eg
> 
>  
> 
> var strTest:String = "This is a test string";
> 
> var reggy:RegExp = new RegExp("t", "g");
> 
> trace(strTest.replace(reggy,"s"));
> 
> 
> 
> >This is a sess ssring
> 
>  
> 
> HTH
> 
>  
> 
> On 16/08/2008, at 3:23 AM, Alex Harui wrote:
> 
> 
> 
> 
> 
>  
> 
> Why can't you use RegEx?  A much slower way would be something like:
> 
>  
> 
> var inString:String = strTest;
> 
> while (true))
> 
> {
> 
> var outString:String;
> 
> outString = inString.replace("t", "s");
> 
> if (outString == inString)
> 
> break;
> 
> inString = outString;
> 
> }
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of aceoohay
> Sent: Friday, August 15, 2008 9:31 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] global replace with strings
> 
>  
> 
> Is there a way of replacing all occurences of one string with 
another 
> without using regular expressions?
> 
> var strTest = "this is a test"
> 
> trace strTest.replace("t","s");
> 
> returns "shis is a test" I want "shis is a sess".
> 
> Paul
>




[flexcoders] Re: Keydownhandler fires twice for each keystroke

2008-08-21 Thread aceoohay
Since creating a test case would be challenging I am posting the 
component ValidatedComboBox.as. The problem I am having is that it 
appears to call the keyDownHandler(event:KeyboardEvent):void function 
twice for each keystroke. I have commented out most of that 
function's code, as it used to handle all input there but now I only 
handle the backspace there this is a patch to get it to function 
somewhat.


package Classes.Input
{
import flash.events.Event;
import mx.controls.ComboBox;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.events.FocusEvent;
import flash.events.MouseEvent;

/**
 * Create an extended version of the ComboBox that allows the 
definition of invalid indexes.
 * 
 * The developer defines one or more invalid indexes in a 
comma separated list using the property badIndexes.
 * Most commonly the developer would specify "0" which is the 
first element in the list.
 * 
 * New properties are;
 * badIndexes - A string that allows the developer to define 
a comma separated list of invalid indexes.
 * isVald - A boolean that defines whether the field is valid.
 * 
 * New Methods are;
 * validateData() - This method checks if the data is valid 
and returns true if valid, false if invalid.
 * 
 */
public class ValidatedComboBox extends ComboBox
{
/** Bad indexes - A comma separated list of invalid 
indexes. */
private var _badIndexes:String = "";

/** Has this field passed validation */
private var _isValid:Boolean = true;

/** value */
private var _value:Object;

/** should we validate data */
private var _doValidateData:Boolean = true;

/** promptLabel */
private var _promptLabel:String;

/** toolTipField */
private var _toolTipField:String = "";

/** Default value A literal that represents the value 
that will replace the "value"
 * property when the method setDefault is executed */
private var _defaultValue:String = "";

private var _eventHandler:Function = this
["checkData"];

private var _typedText:String = "";

public function ValidatedComboBox()
{
//TODO: implement function
super();
this.addEventListener
(Event.CHANGE,_eventHandler)
}

/**
 * Add a new inspectable property so the user can 
enter the Bad Indexesn 
 *  at authortime via the properties panel.
 * 
 * @return the specified bad indexes
 */
[Inspectable( type="String" , defaultValue="" )]
public function get badIndexes():String 
{
return this._badIndexes;
} 
/**
 * Sets the the specified bad indexes
 */
public function set badIndexes( 
badIndexes:String ):void 
{
this._badIndexes = badIndexes;
}

/**
 * Add a new inspectable property so the user can 
enter the promptLabel for the field 
 *  at authortime via the properties panel.
 * 
 * @return the specified promptLabel
 */
[Inspectable( type="String" , defaultValue="" )]
public function get promptLabel():String 
{
return this._promptLabel;
} 
/**
 * Sets the the specified promptLabel
 */
public function set promptLabel( 
promptLabel:String ):void 
{
this._promptLabel = promptLabel;
}

/**
 * Add a new inspectable property so the user can 
specify the whether this field should be validated 
 * via the properties panel.
 * 
 * @return the specified validate data flag.
 */
[Inspectable( type="Boolean" , defaultValue=false, 
enumeration="true,false" )]
public function get doValidateData():Boolean 
{
return this._doValidateData;
}

/**
 * Sets the specified validate data flag.

[flexcoders] KeyEvent in Application and in component

2008-08-21 Thread jitendra jain
Hi Friends,

I have a key down listener in my application and also in my component that 
is childeren of this main application.
But when i press a key, it doesn't fire any event. But when i change this to 
key up listener it is firing. I know that the key precedence starts with 
childern. Please help!!!

 Thanks,

with Regards,
Jitendra Jain


  

RE: [flexcoders] Context Menus on TextArea/TextField in AIR

2008-08-21 Thread Alex Harui
IIRC, AIR has a different ContextMenu API

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Derrick Grigg
Sent: Thursday, August 21, 2008 1:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Context Menus on TextArea/TextField in AIR

 

Hey everyone,

I am pulling my hair out trying to get a custom context menu to work
on a TextArea or TextField. In a normal Flex project, it's easy,
create a new ContextMenu and assign it the TextArea, everything works
fine. I take the exact same code, put it in an Air project and
nothing, the normal 'edit,copy,paste,select all' is the only thing I
get inside any TextArea or TextField.

Has anyone run across this issue and found a solution.

Thanks,

Derrick

 



RE: [flexcoders] Template architecture

2008-08-21 Thread Alex Harui
creationCOmplete is a better bet, but pushing stuff into the template is
potentially bad design.  It means you know something about the template
and have broken encapsulation.  Other designs like model/view would have
the template pull from a data model.  Other designs would have an
interface to the template that abstracts what children do what.  That's
how many of our components work and they use the lifecycle events and
methods to validate properties "later"

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Richard Rodseth
Sent: Thursday, August 21, 2008 2:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Template architecture

 

I'm prototyping a system where a view is built dynamically from an XML
description (converted to VOs). The description refers to a template
(hard-coded in MXML). The dynamic view observes the description (which
is a part of its model) , and creates a child (the template) and adds it
as a child. However, it also needs to "fill in" the template which
involves accessing some of its children by id (eg. template["slot1"],
template["slot2"] ).

If I construct the template via new Template1(), the children are not
yet created. Their ids show up in the debugger, but the values are null.
Should I add a listener for creationComplete, or is this a case where
callLater() could be put to good effect?

 



RE: [flexcoders] creating component that has change event

2008-08-21 Thread Alex Harui
What does it mean to not be valid?  Are you getting an error?  Are you
missing [Event()] metadata?

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of grimmwerks
Sent: Thursday, August 21, 2008 3:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] creating component that has change event

 

Hey all -

I'm creating a searchBox component that's sort of like Safari's search 
(ie a button to delete the current text input) -- I'd like it to 
implement a change event for it in the larger app (ie 
change={fireStuff(event)}

And I do have it dispatching an Event.CHANGE but it doesn't seem to be 
valid.

Can anyone point out any docs on this? I'm even trying to trawl 
through the frameworks to see what I can discover...

 



RE: [flexcoders] Dictionary or Array or Linked list?

2008-08-21 Thread Alex Harui
No specific recommendations here, but In a model/view architecture, the
views(MCs) listen for changes to the data, not the other way around.

 

The list classes have a free list where unused renderers hang out until
needed.  A collectionChange event causes the list to re-apply data to
the list of renderers and put extra ones on the free list or create
others if the free list is empty

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of flexaustin
Sent: Thursday, August 21, 2008 4:24 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Dictionary or Array or Linked list?

 

I was wondering if anyone has had to do something like this before?

(FYI these are AS3 objects not mxml)

I have a collection of MC's (which contain a title and two images).
These MC's are created dynamically depending on data brough in via
httpservice (xml). 

I was wondering how do I keep track of these items so I can update
them if the data changes? 

Right now I cache the data the first time I get it from the server
then the n+1 times I go to the certain screen it skips the httpservice
call and pulls from my cached data (array). That all works OK.

But now I want to first populate the MC's with the cache then call the
httpservice and when it comes back update my MC's so their title and
images change, but I also need to add any new MC's if new to the world
data exists or remove old MC's that have no data? Oh, and they all
need to remain in alphabetical order.

Is there a term for this kind of data container? I have been looking
at Linked List but not sure if something else would be better. 
I looked at Object Pools, but I don't want to store the objects
because of memory issues as I have 500 plus MC's on screen at once so
OP's won't work here.

If you can point me in the right direction I would appreciate it.

THanks, J

 



RE: [flexcoders] this.addEventListener() in MXML

2008-08-21 Thread Alex Harui
Because VBox doesn't have uiEvent, your subclass does.  Maybe we should
be smart about that, but we aren't now

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Richard Rodseth
Sent: Thursday, August 21, 2008 4:51 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] this.addEventListener() in MXML

 

I'm puzzled why this is OK:


http://www.adobe.com/2006/mxml
 "
initialize="init()"/>

but this is not:

http://www.adobe.com/2006/mxml
 "
uiEvent="handleUIEvent()"/>


   [Event(name="uiEvent",type="com.xyz.common.UIEvent")]


UIEvent bubbles, and I wish to avoid adding a listener manually to each
of the dynamically-added children. I can add another container level or
handle the event in the controller, but it seemed like I should be able
to add a listener to "this" in MXML.

 



RE: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Alex Harui
I don't think timer or EnterFrame will work either.  AS is
single-threaded.

 

You could add a check on every event property getter to test the target,
but that will kill performance

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Josh McDonald
Sent: Thursday, August 21, 2008 5:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Can an event know when it is dispatched?

 

Hey guys,

I want to know if there's a (nice, probably secret) way to for an event
to know when it's dispatched? I could hook into a timer or ENTER_FRAME
and have it check for a valid target, but that's not very nice :)

I haven't overloaded function set target, but I imagine that'll give me
either a compile-time error or a verifier error since Event is
Player-native, and I don't know what namespace to put it in to begin
with. I know about the mx_internal static hook in UIComponent, but I
want to catch certain events being dispatched from non-visual components
and complain about it (just to make life easier for developers using my
framework).

Cheers,
-Josh

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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]  

 



[flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread dbronk
I've done this:

var myResponder : IResponder = new Responder(addAsync(handleSuccess,
1000 ), handleFault);

I actually have my own responder that extends Responder so the above I
new MyResponder, but it works great for me.  I then just pass in the
newly created responder.

Dale


--- In flexcoders@yahoogroups.com, "Richard Rodseth" <[EMAIL PROTECTED]> wrote:
>
> As I mentioned, the service (delegate) method I am calling has an
IResponder
> callback - it doesn't dispatch events.
> 
> On Thu, Aug 21, 2008 at 1:27 PM, Ralf Bokelberg
<[EMAIL PROTECTED]>wrote:
> 
> >   Say you are waiting for an object myDispatcher to dispatch an event
> > myEvent.
> > Then you call myDispatcher.addEventListener("myEvent", addAsync(
> > handleSuccess, 1000 ));
> > Inside handleSuccess you can assert as usually. If handleSuccess is
> > not called within 1000 ms, the test fails.
> >
> > Cheers
> > Ralf.
> >  
> >
>




[flexcoders] Debugging events and listeners

2008-08-21 Thread Shane Dosch
Hi everyone,

I am trying to debug a dispatchEvent call and not having much luck.  I have
assigned event listeners to an object.  I then dispatch an event, with the
proper event type, and then pf...nothing.  Anyone to know in the Flex
Builder debugger how to add a watch for listeners?  This would really help
me in determining if an object is properly listening, or is the event is
somehow not being captured.

Thanks in advance,
Shane


[flexcoders] Re: Error styling datagrids

2008-08-21 Thread pixelgeek

> It sounds like maybe you're just not resetting things when the data 
> property changes.

That may very well be the case. If it is then I am at a loss to see
why the 12th item in a datagrid even gets styled when I style the
second and why I would then have to reset the style when the grid gets
drawn

It might also be the case that there a much, much different mindset
that I need to develop when I code in Flex.

Its still very odd that I need to go to these extremes but perhaps I
will have to redesign the logic and use one of the many cell styling
examples that are available instead.



[flexcoders] Debugging events and listeners

2008-08-21 Thread shanedosch
Hi everyone,

I am trying to debug a dispatchEvent call and not having much luck.  I
have assigned event listeners to an object.  I then dispatch an event,
with the proper event type, and then pf...nothing.  Anyone to know
in the Flex Builder debugger how to add a watch for listeners?  This
would really help me in determining if an object is properly
listening, or is the event is somehow not being captured.

Thanks in advance,
Shane



[flexcoders] htmlText: LI element, replace bullet w/ image?

2008-08-21 Thread baton22

Hi,
I am using the htmlText attribute to populate a LI bullet list of items in a
TextArea.

I would like to replace the circle bullets with a small custom image.

I tried using the CSS style: list-style-image:
url('/assets/img/myImage.png') to no avail. Does anyone have an example of
this working in flex?
-- 
View this message in context: 
http://www.nabble.com/htmlText%3A-LI-element%2C-replace-bullet-w--image--tp19098343p19098343.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Flex Panel: how to get label text to wrap?

2008-08-21 Thread baton22

Hi,
New to flex and one of the more common issues I am running into is the
apparent lack of wrapping text for various controls. For example. I have a
panel who's title I would like to be two lines of text. But when I enter in
a sentence that is longer than the width of the panel, it just truncates the
text.

How can I achieve this?
-- 
View this message in context: 
http://www.nabble.com/Flex-Panel%3A-how-to-get-label-text-to-wrap--tp19098315p19098315.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Re: XMLList to ArrayCollection

2008-08-21 Thread sdl1326
Honestly, I do not know as I have not worked with XMLListCollections.
I just need to be able to access the data easily and have only used
Array Collections. It looks like an XMLListCollection might work. Is
there a benefit of using one over the other?
--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> Could you use an XMLListCollection instead of an ArrayCollection?
> 
>  
> 
> Gordon Smith
> 
> Adobe Flex SDK Team
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Tracy Spratt
> Sent: Thursday, August 21, 2008 4:52 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] XMLList to ArrayCollection
> 
>  
> 
> Sure, but you have to do it manually.  Loop over the nodes, then use the
> attributes() to loop over the attributes.  If I recall correctly,
> attribute[n] will give you the attr value, and attribute[n].name() will
> give you the attr name. XML.name() (or localName()) will give you the
> name of the node.
> 
>  
> 
> Tracy
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of sdl1326
> Sent: Thursday, August 21, 2008 5:56 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] XMLList to ArrayCollection
> 
>  
> 
> I am retrieving the following xml via httpsService with the result
> format being 'e4x'. 
> 
>   
>user="AA">Q3
>user="AA">Q4
>user="AA">Q3
>user="BB">Q4
>user="BB">Q3
>user="CC">Q3
>user="CC">Q3
>user="CC">Q3
>   
> 
> What's the best way to convert an XMLList to an ArrayCollection?  Is it
> possible to do so without knowing the names of the attributes?
> 
> Thanks for the assistance.
>




RE: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Gordon Smith
Oops... I forgot that there is no 'target' setter to override, only a
'target' getter.

 

Two other possibilities...

 

1. If you know all the classes that might be dispatching the wrong
event, have them override dispatchEvent().

 

2. Put capture handlers on the SystemManager for these events and
inspect their 'target' to see if it is appropriate.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Josh McDonald
Sent: Thursday, August 21, 2008 8:11 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Can an event know when it is dispatched?

 

You missed the original point, that there is no Event.as - it's part of
Player.

On Fri, Aug 22, 2008 at 12:47 PM, yigit <[EMAIL PROTECTED]
 > wrote:

But u can public a super's protected. and that is the thing i mentioned
in my post

   " I hope the underlying variable which keeps the reference to the
target
   is protected, not private;"

sorry, dont have the sdk to check now, so if the underlying variable
(e.g. _target) is private, sorry for you.

yigit


Josh McDonald wrote:
> That was just an example. You can't public a super's private variable,
> nor can you read-write a super's read-only variable.
>
> -Josh
>
> On Fri, Aug 22, 2008 at 12:21 PM, yigit <[EMAIL PROTECTED]
 

>  >> wrote:
>
> I think gordon's point was not
> e.target = this;
>
> you will implement your own Event class which will extend original
> Event
> class .
> I hope the underlying variable which keeps the reference to the
target
> is protected, not private;
> so you can edit that value from your subclass.
>
> yigit
>
> Josh McDonald wrote:
> > Nope :( I get 1059: Property is read-only when compiling this:
> >
> > var e : Event = new Event();
> > e.target = this;
> >
> > -Josh
> >
> > On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith
> <[EMAIL PROTECTED] 
 >

> > 
 >>> wrote:
> >
> > You should be able to override the setter for 'target' in a
> > subclass of Event. There should be nothing special about it;
> it's
> > just a public getter/setter.
> >
> >
> >
> > Gordon Smith
> >
> > Adobe Flex SDK Team
> >
> >
> >
> >
>

> >
> > *From:* flexcoders@yahoogroups.com
 
>  >
> >  
>  >>

> > [mailto:flexcoders@yahoogroups.com
 

>  >
> >  
>  >>] *On Behalf Of *Josh McDonald
> > *Sent:* Thursday, August 21, 2008 5:44 PM
> > *To:* flexcoders@yahoogroups.com
 
>  >
>  
>  >>

> > *Subject:* [flexcoders] Can an event know when it is
dispatched?
> >
> >
> >
> > Hey guys,
> >
> > I want to know if there's a (nice, probably secret) way to
> for an
> > event to know when it's dispatched? I could hook into a
timer or
> > ENTER_FRAME and have it check for a valid target, but that's
not
> > very nice :)
> >
> > I haven't overloaded function set target, but I imagine
that'll
> > give me either a compile-time error or a verifier error
since
> > Event is Player-native, and I don't know what namespace to
> put it
> > in to begin with. I know about the mx_internal static hook
in
> > UIComponent, but I want to catch certain events being
dispatched
> > from non-visual components and complain about it (just to
make
> > life easier for developers using my framework).
> >
> > Cheers,
> > -Josh
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It
> tolls for
> > thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED]
 

> 

Re: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Josh McDonald
You missed the original point, that there is no Event.as - it's part of
Player.

On Fri, Aug 22, 2008 at 12:47 PM, yigit <[EMAIL PROTECTED]> wrote:

> But u can public a super's protected. and that is the thing i mentioned
> in my post
> " I hope the underlying variable which keeps the reference to the
> target
>is protected, not private;"
>
> sorry, dont have the sdk to check now, so if the underlying variable
> (e.g. _target) is private, sorry for you.
>
> yigit
>
> Josh McDonald wrote:
> > That was just an example. You can't public a super's private variable,
> > nor can you read-write a super's read-only variable.
> >
> > -Josh
> >
> > On Fri, Aug 22, 2008 at 12:21 PM, yigit <[EMAIL PROTECTED]
> > > wrote:
> >
> > I think gordon's point was not
> > e.target = this;
> >
> > you will implement your own Event class which will extend original
> > Event
> > class .
> > I hope the underlying variable which keeps the reference to the
> target
> > is protected, not private;
> > so you can edit that value from your subclass.
> >
> > yigit
> >
> > Josh McDonald wrote:
> > > Nope :( I get 1059: Property is read-only when compiling this:
> > >
> > > var e : Event = new Event();
> > > e.target = this;
> > >
> > > -Josh
> > >
> > > On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith
> > <[EMAIL PROTECTED] 
> > > >> wrote:
> > >
> > > You should be able to override the setter for 'target' in a
> > > subclass of Event. There should be nothing special about it;
> > it's
> > > just a public getter/setter.
> > >
> > >
> > >
> > > Gordon Smith
> > >
> > > Adobe Flex SDK Team
> > >
> > >
> > >
> > >
> >
> 
> > >
> > > *From:* flexcoders@yahoogroups.com
> > 
> > >  > >
> > > [mailto:flexcoders@yahoogroups.com
> > 
> > >  > >] *On Behalf Of *Josh McDonald
> > > *Sent:* Thursday, August 21, 2008 5:44 PM
> > > *To:* flexcoders@yahoogroups.com
> > 
> >  > >
> > > *Subject:* [flexcoders] Can an event know when it is
> dispatched?
> > >
> > >
> > >
> > > Hey guys,
> > >
> > > I want to know if there's a (nice, probably secret) way to
> > for an
> > > event to know when it's dispatched? I could hook into a timer
> or
> > > ENTER_FRAME and have it check for a valid target, but that's
> not
> > > very nice :)
> > >
> > > I haven't overloaded function set target, but I imagine that'll
> > > give me either a compile-time error or a verifier error since
> > > Event is Player-native, and I don't know what namespace to
> > put it
> > > in to begin with. I know about the mx_internal static hook in
> > > UIComponent, but I want to catch certain events being
> dispatched
> > > from non-visual components and complain about it (just to make
> > > life easier for developers using my framework).
> > >
> > > Cheers,
> > > -Josh
> > >
> > > --
> > > "Therefore, send not to know For whom the bell tolls. It
> > tolls for
> > > thee."
> > >
> > > :: Josh 'G-Funk' McDonald
> > > :: 0437 221 380 :: [EMAIL PROTECTED]
> >   > >
> > >
> > >
> > >
> > >
> > > --
> > > "Therefore, send not to know For whom the bell tolls. It tolls
> > for thee."
> > >
> > > :: Josh 'G-Funk' McDonald
> > > :: 0437 221 380 :: [EMAIL PROTECTED] 
> > >
> > >
> >
> >
> > 
> >
> > --
> > 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
> >
> >
> >(Yahoo! ID required)
> >
> >mailto:[EMAIL PROTECTED]
> > 
> >
> >
> >
> >
> >
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It tolls for thee."
> >
> > :: Josh 'G-Fun

Re: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread yigit
But u can public a super's protected. and that is the thing i mentioned 
in my post
" I hope the underlying variable which keeps the reference to the target
is protected, not private;"

sorry, dont have the sdk to check now, so if the underlying variable 
(e.g. _target) is private, sorry for you.

yigit

Josh McDonald wrote:
> That was just an example. You can't public a super's private variable, 
> nor can you read-write a super's read-only variable.
>
> -Josh
>
> On Fri, Aug 22, 2008 at 12:21 PM, yigit <[EMAIL PROTECTED] 
> > wrote:
>
> I think gordon's point was not
> e.target = this;
>
> you will implement your own Event class which will extend original
> Event
> class .
> I hope the underlying variable which keeps the reference to the target
> is protected, not private;
> so you can edit that value from your subclass.
>
> yigit
>
> Josh McDonald wrote:
> > Nope :( I get 1059: Property is read-only when compiling this:
> >
> > var e : Event = new Event();
> > e.target = this;
> >
> > -Josh
> >
> > On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith
> <[EMAIL PROTECTED] 
> > >> wrote:
> >
> > You should be able to override the setter for 'target' in a
> > subclass of Event. There should be nothing special about it;
> it's
> > just a public getter/setter.
> >
> >
> >
> > Gordon Smith
> >
> > Adobe Flex SDK Team
> >
> >
> >
> >
> 
> >
> > *From:* flexcoders@yahoogroups.com
> 
> >  >
> > [mailto:flexcoders@yahoogroups.com
> 
> >  >] *On Behalf Of *Josh McDonald
> > *Sent:* Thursday, August 21, 2008 5:44 PM
> > *To:* flexcoders@yahoogroups.com
> 
>  >
> > *Subject:* [flexcoders] Can an event know when it is dispatched?
> >
> >
> >
> > Hey guys,
> >
> > I want to know if there's a (nice, probably secret) way to
> for an
> > event to know when it's dispatched? I could hook into a timer or
> > ENTER_FRAME and have it check for a valid target, but that's not
> > very nice :)
> >
> > I haven't overloaded function set target, but I imagine that'll
> > give me either a compile-time error or a verifier error since
> > Event is Player-native, and I don't know what namespace to
> put it
> > in to begin with. I know about the mx_internal static hook in
> > UIComponent, but I want to catch certain events being dispatched
> > from non-visual components and complain about it (just to make
> > life easier for developers using my framework).
> >
> > Cheers,
> > -Josh
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It
> tolls for
> > thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED]
>   >
> >
> >
> >
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It tolls
> for thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED] 
> >
> >
>
>
> 
>
> --
> 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
>
>
>(Yahoo! ID required)
>
>mailto:[EMAIL PROTECTED]
> 
>
>
>
>
>
>
> -- 
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED] 
>  



Re: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread yigit
I think gordon's point was not
e.target = this;

you will implement your own Event class which will extend original Event 
class .
I hope the underlying variable which keeps the reference to the target 
is protected, not private;
so you can edit that value from your subclass.

yigit

Josh McDonald wrote:
> Nope :( I get 1059: Property is read-only when compiling this:
>
> var e : Event = new Event();
> e.target = this;
>
> -Josh
>
> On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith <[EMAIL PROTECTED] 
> > wrote:
>
> You should be able to override the setter for 'target' in a
> subclass of Event. There should be nothing special about it; it's
> just a public getter/setter.
>
>  
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>  
>
> 
>
> *From:* flexcoders@yahoogroups.com
> 
> [mailto:flexcoders@yahoogroups.com
> ] *On Behalf Of *Josh McDonald
> *Sent:* Thursday, August 21, 2008 5:44 PM
> *To:* flexcoders@yahoogroups.com 
> *Subject:* [flexcoders] Can an event know when it is dispatched?
>
>  
>
> Hey guys,
>
> I want to know if there's a (nice, probably secret) way to for an
> event to know when it's dispatched? I could hook into a timer or
> ENTER_FRAME and have it check for a valid target, but that's not
> very nice :)
>
> I haven't overloaded function set target, but I imagine that'll
> give me either a compile-time error or a verifier error since
> Event is Player-native, and I don't know what namespace to put it
> in to begin with. I know about the mx_internal static hook in
> UIComponent, but I want to catch certain events being dispatched
> from non-visual components and complain about it (just to make
> life easier for developers using my framework).
>
> Cheers,
> -Josh
>
> -- 
> "Therefore, send not to know For whom the bell tolls. It tolls for
> thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED] 
>
>
>
>
> -- 
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED] 
>  



Re: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Josh McDonald
That was just an example. You can't public a super's private variable, nor
can you read-write a super's read-only variable.

-Josh

On Fri, Aug 22, 2008 at 12:21 PM, yigit <[EMAIL PROTECTED]> wrote:

> I think gordon's point was not
> e.target = this;
>
> you will implement your own Event class which will extend original Event
> class .
> I hope the underlying variable which keeps the reference to the target
> is protected, not private;
> so you can edit that value from your subclass.
>
> yigit
>
> Josh McDonald wrote:
> > Nope :( I get 1059: Property is read-only when compiling this:
> >
> > var e : Event = new Event();
> > e.target = this;
> >
> > -Josh
> >
> > On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith <[EMAIL PROTECTED]
> > > wrote:
> >
> > You should be able to override the setter for 'target' in a
> > subclass of Event. There should be nothing special about it; it's
> > just a public getter/setter.
> >
> >
> >
> > Gordon Smith
> >
> > Adobe Flex SDK Team
> >
> >
> >
> >
> 
> >
> > *From:* flexcoders@yahoogroups.com
> > 
> > [mailto:flexcoders@yahoogroups.com
> > ] *On Behalf Of *Josh McDonald
> > *Sent:* Thursday, August 21, 2008 5:44 PM
> > *To:* flexcoders@yahoogroups.com 
> > *Subject:* [flexcoders] Can an event know when it is dispatched?
> >
> >
> >
> > Hey guys,
> >
> > I want to know if there's a (nice, probably secret) way to for an
> > event to know when it's dispatched? I could hook into a timer or
> > ENTER_FRAME and have it check for a valid target, but that's not
> > very nice :)
> >
> > I haven't overloaded function set target, but I imagine that'll
> > give me either a compile-time error or a verifier error since
> > Event is Player-native, and I don't know what namespace to put it
> > in to begin with. I know about the mx_internal static hook in
> > UIComponent, but I want to catch certain events being dispatched
> > from non-visual components and complain about it (just to make
> > life easier for developers using my framework).
> >
> > Cheers,
> > -Josh
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It tolls for
> > thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED] 
> >
> >
> >
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It tolls for thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED] 
> >
>
>
> 
>
> --
> 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
>
>
>
>


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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


Re: [flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Howard Fore
If you're not going to change the column names when you change
dataproviders, a third option might be to create a database view to query
against. Have the view stitch together the appropriate columns from each
table into the view's columns (probably via that Union query), then query
the view to get the data that is filled into the dataprovider. That way you
leave the complexity where it already is, in the the database, you wouldn't
need logic to switch out the dataproviders, etc.

On Thu, Aug 21, 2008 at 2:51 PM, Blair Cox <[EMAIL PROTECTED]> wrote:

>  Hi Amy,
>
> Well, I have complete control over the database. This where we might have a
> problem, it seemed at the time that creating a table with around 200 columns
> would be unreasonable. A table was created to handle each of the products.
> Each product has as many as 20-30 columns and for the most part, do not
> relate to each other. I pondered over normalization for over a week. But now
> look at the issue...
>
> Hmm, what would be the issue in creating a single arrayCollection from all
> sources? How would this differ in any way from loading a single enormous
> array directly from the db? Looks like I'm down to two options, recreate the
> db and over half the constructed application to deal with the changes in
> code, or figure out a way to combine the tables within the application or
> the Union query as you suggested.
>



-- 
Howard Fore, [EMAIL PROTECTED]
"The universe tends toward maximum irony. Don't push it." - Jeff Atwood


[flexcoders] Re: XMLList to ArrayCollection

2008-08-21 Thread sdl1326
Thanks. Is there a 'quick and dirty' way to convert to array
collection if you know the names of the attributes, etc.

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Sure, but you have to do it manually.  Loop over the nodes, then use the
> attributes() to loop over the attributes.  If I recall correctly,
> attribute[n] will give you the attr value, and attribute[n].name() will
> give you the attr name. XML.name() (or localName()) will give you the
> name of the node.
> 
>  
> 
> Tracy
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of sdl1326
> Sent: Thursday, August 21, 2008 5:56 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] XMLList to ArrayCollection
> 
>  
> 
> I am retrieving the following xml via httpsService with the result
> format being 'e4x'. 
> 
>   
>user="AA">Q3
>user="AA">Q4
>user="AA">Q3
>user="BB">Q4
>user="BB">Q3
>user="CC">Q3
>user="CC">Q3
>user="CC">Q3
>   
> 
> What's the best way to convert an XMLList to an ArrayCollection?  Is it
> possible to do so without knowing the names of the attributes?
> 
> Thanks for the assistance.
>




Re: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Josh McDonald
Nope :( I get 1059: Property is read-only when compiling this:

var e : Event = new Event();
e.target = this;

-Josh

On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith <[EMAIL PROTECTED]> wrote:

>  You should be able to override the setter for 'target' in a subclass of
> Event. There should be nothing special about it; it's just a public
> getter/setter.
>
>
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Josh McDonald
> *Sent:* Thursday, August 21, 2008 5:44 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] Can an event know when it is dispatched?
>
>
>
> Hey guys,
>
> I want to know if there's a (nice, probably secret) way to for an event to
> know when it's dispatched? I could hook into a timer or ENTER_FRAME and have
> it check for a valid target, but that's not very nice :)
>
> I haven't overloaded function set target, but I imagine that'll give me
> either a compile-time error or a verifier error since Event is
> Player-native, and I don't know what namespace to put it in to begin with. I
> know about the mx_internal static hook in UIComponent, but I want to catch
> certain events being dispatched from non-visual components and complain
> about it (just to make life easier for developers using my framework).
>
> Cheers,
> -Josh
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
>
> 
>



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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


RE: [flexcoders] XMLList to ArrayCollection

2008-08-21 Thread Gordon Smith
Could you use an XMLListCollection instead of an ArrayCollection?

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Thursday, August 21, 2008 4:52 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] XMLList to ArrayCollection

 

Sure, but you have to do it manually.  Loop over the nodes, then use the
attributes() to loop over the attributes.  If I recall correctly,
attribute[n] will give you the attr value, and attribute[n].name() will
give you the attr name. XML.name() (or localName()) will give you the
name of the node.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sdl1326
Sent: Thursday, August 21, 2008 5:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] XMLList to ArrayCollection

 

I am retrieving the following xml via httpsService with the result
format being 'e4x'. 


Q3
Q4
Q3
Q4
Q3
Q3
Q3
Q3


What's the best way to convert an XMLList to an ArrayCollection?  Is it
possible to do so without knowing the names of the attributes?

Thanks for the assistance.

 



RE: [flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Gordon Smith
You should be able to override the setter for 'target' in a subclass of
Event. There should be nothing special about it; it's just a public
getter/setter.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Josh McDonald
Sent: Thursday, August 21, 2008 5:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Can an event know when it is dispatched?

 

Hey guys,

I want to know if there's a (nice, probably secret) way to for an event
to know when it's dispatched? I could hook into a timer or ENTER_FRAME
and have it check for a valid target, but that's not very nice :)

I haven't overloaded function set target, but I imagine that'll give me
either a compile-time error or a verifier error since Event is
Player-native, and I don't know what namespace to put it in to begin
with. I know about the mx_internal static hook in UIComponent, but I
want to catch certain events being dispatched from non-visual components
and complain about it (just to make life easier for developers using my
framework).

Cheers,
-Josh

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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]  

 



[flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Amy
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> If I understand correctly, the OP has separate calls to get the data 
for
> the four lists.  If so, what is the problem?  Just assign the
> dataProvider as needed.

I probably got a bit carried away after too much time helping people on 
microsoft.public.access.tabledesign.  But I did say he could do that, 
too ;-).  It's just he'll save himself a lot of pain if he gets the 
design right up front.

-Amy



[flexcoders] Can an event know when it is dispatched?

2008-08-21 Thread Josh McDonald
Hey guys,

I want to know if there's a (nice, probably secret) way to for an event to
know when it's dispatched? I could hook into a timer or ENTER_FRAME and have
it check for a valid target, but that's not very nice :)

I haven't overloaded function set target, but I imagine that'll give me
either a compile-time error or a verifier error since Event is
Player-native, and I don't know what namespace to put it in to begin with. I
know about the mx_internal static hook in UIComponent, but I want to catch
certain events being dispatched from non-visual components and complain
about it (just to make life easier for developers using my framework).

Cheers,
-Josh

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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


RE: [flexcoders] XMLList to ArrayCollection

2008-08-21 Thread Tracy Spratt
Sure, but you have to do it manually.  Loop over the nodes, then use the
attributes() to loop over the attributes.  If I recall correctly,
attribute[n] will give you the attr value, and attribute[n].name() will
give you the attr name. XML.name() (or localName()) will give you the
name of the node.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sdl1326
Sent: Thursday, August 21, 2008 5:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] XMLList to ArrayCollection

 

I am retrieving the following xml via httpsService with the result
format being 'e4x'. 


Q3
Q4
Q3
Q4
Q3
Q3
Q3
Q3


What's the best way to convert an XMLList to an ArrayCollection?  Is it
possible to do so without knowing the names of the attributes?

Thanks for the assistance.

 



Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Richard Rodseth
I guess I need a little more info, since TestCase is not an EventDispatcher.
Could you elaborate a little, please?

On Thu, Aug 21, 2008 at 1:40 PM, Richard Rodseth <[EMAIL PROTECTED]> wrote:

> Good idea. Thanks.
>
>
> On Thu, Aug 21, 2008 at 1:38 PM, Johannes Nel <[EMAIL PROTECTED]>wrote:
>
>>   you can hack around it by pointing the the callback function to your
>> unit test class and dispatching an event from there.
>> On Thu, Aug 21, 2008 at 10:34 PM, Richard Rodseth <[EMAIL PROTECTED]>wrote:
>>
>>>   As I mentioned, the service (delegate) method I am calling has an
>>> IResponder callback - it doesn't dispatch events.
>>>
>>> On Thu, Aug 21, 2008 at 1:27 PM, Ralf Bokelberg <
>>> [EMAIL PROTECTED]> wrote:
>>>
   Say you are waiting for an object myDispatcher to dispatch an event
 myEvent.
 Then you call myDispatcher.addEventListener("myEvent", addAsync(
 handleSuccess, 1000 ));
 Inside handleSuccess you can assert as usually. If handleSuccess is
 not called within 1000 ms, the test fails.

 Cheers
 Ralf.

>>>
>>>
>>
>>
>> --
>> j:pn
>> \\no comment
>>  
>>
>
>


[flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Nicolas Noben
I might not understand the problem properly, but what is wrong about 

combobox.dataProvider = anotherone?

at runtime.

Nicolas.

--- In flexcoders@yahoogroups.com, "cox.blair" <[EMAIL PROTECTED]> wrote:
>
> Does anyone have experience with changing a dataprovider at runtime?
> 
> Scenerio: a grocery store Database has four tables, one for Produce,
> Dairy, Meat and Other. Each of the tables is a different
> arrayCollection/HTTPService
> 
> I want to be able to have four comboboxes, each able to point to any
> of the four arrayCollection's, therefore to change the datasource of
> each series in a chart. 
> 
> Why? Because it would allow you to compare values of different data
> sets in a single chart. I did not expect this would be such an issue.
> 
> If anyone can provide any information at all, it would be a huge help.
> 
> Thanks,
>





Re: [flexcoders] Re: Styling renderers in a list?

2008-08-21 Thread Josh McDonald
Thanks for that Amy :) I actually needed the renderers to change their
styleName depending on the data, so I cheated and added in another Canvas
that gets the stylename applied to it, which is working for now. Not really
very happy with it, but it's working for now :)

-Josh

On Fri, Aug 22, 2008 at 9:25 AM, Amy <[EMAIL PROTECTED]> wrote:

> --- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
> >
> > Hey guys,
> >
> > This is probably an FAQ, but I can't seem to google up an answer.
> What's the
> > good way to set style info on renderers inside a list? It's an mxml
> > component using itemRenderer="className" on the mx:List
>
> If it's a TileList, you could use my TileList_withStyle component, or
> you could look at how I did it and copy that with whatever List you
> need.  http://flexdiary.blogspot.com/2008/08/tilelist-with-
> stylefunction.html
>
> HTH;
>
> Amy
>
>
> 
>
> --
> 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
>
>
>
>


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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


Re: [flexcoders] Re: Styling renderers in a list?

2008-08-21 Thread Josh McDonald
Wait, I see that I could use the styleFunction, I might retrofit your list
in when I'm done with this current bugfix :)

Cheers!

-Josh

On Fri, Aug 22, 2008 at 9:55 AM, Josh McDonald <[EMAIL PROTECTED]> wrote:

> Thanks for that Amy :) I actually needed the renderers to change their
> styleName depending on the data, so I cheated and added in another Canvas
> that gets the stylename applied to it, which is working for now. Not really
> very happy with it, but it's working for now :)
>
> -Josh
>
>
> On Fri, Aug 22, 2008 at 9:25 AM, Amy <[EMAIL PROTECTED]> wrote:
>
>> --- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>> >
>> > Hey guys,
>> >
>> > This is probably an FAQ, but I can't seem to google up an answer.
>> What's the
>> > good way to set style info on renderers inside a list? It's an mxml
>> > component using itemRenderer="className" on the mx:List
>>
>> If it's a TileList, you could use my TileList_withStyle component, or
>> you could look at how I did it and copy that with whatever List you
>> need.  http://flexdiary.blogspot.com/2008/08/tilelist-with-
>> stylefunction.html
>>
>> HTH;
>>
>> Amy
>>
>>
>> 
>>
>> --
>> 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
>>
>>
>>
>>
>
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
>



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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


[flexcoders] this.addEventListener() in MXML

2008-08-21 Thread Richard Rodseth
I'm puzzled why this is OK:


http://www.adobe.com/2006/mxml";
initialize="init()"/>

but this is not:

http://www.adobe.com/2006/mxml";
uiEvent="handleUIEvent()"/>


   [Event(name="uiEvent",type="com.xyz.common.UIEvent")]


UIEvent bubbles, and I wish to avoid adding a listener manually to each of
the dynamically-added children. I can add another container level or handle
the event in the controller, but it seemed like I should be able to add a
listener to "this" in MXML.


RE: [flexcoders] Get xml element name

2008-08-21 Thread Tracy Spratt
I seem to recall hearing that using the "IN" operator was preferred.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Guilherme Blanco
Sent: Thursday, August 21, 2008 10:07 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Get xml element name

 

schedules[i].hasOwnProperty('car')

[]s,

On Thu, Aug 21, 2008 at 11:05 AM, markgoldin_2000
<[EMAIL PROTECTED]  > wrote:
> Is there a way to get an xml element name?
> 
> 
> 100
> 
> 
> 1
> 
> 
>
> I want to know if an i element has a name "car".
>
> Thanks
>
> 

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]  
URL: http://blog.bisna.com  
Rio de Janeiro - RJ/Brazil

 



RE: [flexcoders] XML Data - getting unique attributes

2008-08-21 Thread Tracy Spratt
You could do the same using an associative array (Object/Hashtable).
Iterate through the data one time, using bracket notation to create the
properties.  You can't iterate in order over this structure, if that
matters.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kenneth Sutherland
Sent: Thursday, August 21, 2008 11:58 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] XML Data - getting unique attributes

 

You could do something like the following. Use a dictionary to store
you're unique values. So iterate through your data and use the data as
the key for the dictionary

 

Var myDictionary : Dictionary = new Dictionary();

myDictionary[value] = value;  //value would be whatever you are wishing
to store, should you iterate through a dataset and have more than one
value which is the same then it will end up only being stored once.

//then you could pass it all into an ArrayCollection so that you could
bind to that data or similar.

 

public function getUniqueValues (val : Dictionary) : ArrayCollection {

  var unique = new ArrayCollection();

  for(var prop :String in val){

unique.addItem(val[prop]);

  }

  

} 

 

Hope that's what your after.  If you have a very large dataset then you
don't need to do any checking if it already exists in the dictionary, so
I'm presuming it will be reasonably efficient.

 

Kenneth.

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sdl1326
Sent: 21 August 2008 15:06
To: flexcoders@yahoogroups.com
Subject: [flexcoders] XML Data - getting unique attributes

 

Hello All, 

I need to grab all unique attribute values in some xml data. Is there a
quick and dirty way to do this? I could push to an array if the value
doesn't already exist, however I did not know if there was a more
efficient way to get these values.
Example:









Unique values would be: Project A, Project B, Project C

Thanks for any and all replies.



Disclaimer 



This electronic message contains information which may be privileged and
confidential. The information is intended to be for the use of the
individual(s) or entity named above. If you are not the intended
recipient, be aware that any disclosure, copying, distribution or use of
the contents of this information is prohibited. If you have received
this electronic message in error, please notify us by telephone on 0131
476 6000 and delete the material from your computer.
Registered in Scotland number: SC 172507.
Registered office address: Quay House 142 Commercial Street Edinburgh
EH6 6LB.

This email message has been scanned for viruses by Mimecast.



 



RE: [flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Tracy Spratt
If I understand correctly, the OP has separate calls to get the data for
the four lists.  If so, what is the problem?  Just assign the
dataProvider as needed.

 

You are using result handlers, storing the data in instance variables,
and not trying to bind directly to lastResult, correct?

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Amy
Sent: Thursday, August 21, 2008 2:33 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Change dataProvider at runtime?

 

--- In flexcoders@yahoogroups.com 
, "cox.blair" <[EMAIL PROTECTED]> wrote:
>
> Does anyone have experience with changing a dataprovider at runtime?
> 
> Scenerio: a grocery store Database has four tables, one for Produce,
> Dairy, Meat and Other. Each of the tables is a different
> arrayCollection/HTTPService
> 
> I want to be able to have four comboboxes, each able to point to any
> of the four arrayCollection's, therefore to change the datasource of
> each series in a chart. 
> 
> Why? Because it would allow you to compare values of different data
> sets in a single chart. I did not expect this would be such an issue.
> 
> If anyone can provide any information at all, it would be a huge help.

Preferred method:

If you have any control over the database, FIX THE DESIGN. If not, use 
a UNION query to normalize the data, then use a filter function to 
filter on grocery type and refresh the ArrayCollection.

Icky method:
If you have no control over the backend at all, then you can use 
something like myChart.dataProvider = nastyArrayCollection

;-)

HTH;

Amy

 



RE: [flexcoders] DataGridColumn trouble...

2008-08-21 Thread Tracy Spratt
labelFunction gets two arguments.  One is a reference to the *entire*
dataProvider item, the other to the dataGridColumn.  Since you have a
reference to the whole item, you can easily build your return string.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Sefi Ninio
Sent: Thursday, August 21, 2008 4:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DataGridColumn trouble...

 

Hi.

I have a DataGrid, and a few DataGridColumns in it.
One of them has a labelFunction, that should return a value that depends
on the values of two of the other columns.

example:
|  name  |  start  |  end  |  diff  |
|  xxx |   5 |   7 |   2|
|   yyy|   10|  100  |   90  |

etc...

I can't find a way to get a reference to the DataGrid or the other
DataGridColumns inside it from the labelFunction - using it's
DataGridColumn argument...

Any help would be greatly appreciated..

Sefi

 



RE: [flexcoders] Intriguing AMFPHP sample

2008-08-21 Thread Jim Hayes
>How would you convert that ByteArray of the swf file back to a
>MovieClip/SWFLoader/something displayable ??

I guess use Loader.loadBytes and type the resultant contents as a MovieClip?
But that is guessing, I hasten to add.


-Original Message-
From: flexcoders@yahoogroups.com on behalf of Kevin Aebig
Sent: Thu 21/08/2008 21:10
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Intriguing AMFPHP sample
 
If it's going to an Air application, than it can write the bytes
temporarily, load the Movie and delete the temporary file. I did that years
ago with C# and Flash and it worked really well.

 

!k

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Nik Derewianka
Sent: Wednesday, August 20, 2008 9:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Intriguing AMFPHP sample

 

Hi,

Was just looking through some blogs on AMFPHP and came across a php 
snippet that showed:

function getSwf()
{
return new ByteArray(file_get_contents("my.swf"));
}

But no sample of what to do on the Flex side to turn it back into 
something useable.

How would you convert that ByteArray of the swf file back to a 
MovieClip/SWFLoader/something displayable ??

Thanks,
Nik

 



__
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: Styling renderers in a list?

2008-08-21 Thread Amy
--- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
> 
> This is probably an FAQ, but I can't seem to google up an answer. 
What's the
> good way to set style info on renderers inside a list? It's an mxml
> component using itemRenderer="className" on the mx:List

If it's a TileList, you could use my TileList_withStyle component, or 
you could look at how I did it and copy that with whatever List you 
need.  http://flexdiary.blogspot.com/2008/08/tilelist-with-
stylefunction.html

HTH;

Amy



[flexcoders] Dictionary or Array or Linked list?

2008-08-21 Thread flexaustin
I was wondering if anyone has had to do something like this before?

(FYI these are AS3 objects not mxml)

I have a collection of MC's (which contain a title and two images).
These MC's are created dynamically depending on data brough in via
httpservice (xml).  

I was wondering how do I keep track of these items so I can update
them if the data changes? 

Right now I cache the data the first time I get it from the server
then the n+1 times I go to the certain screen it skips the httpservice
call and pulls from my cached data (array).  That all works OK.

But now I want to first populate the MC's with the cache then call the
httpservice and when it comes back update my MC's so their title and
images change, but I also need to add any new MC's if new to the world
data exists or remove old MC's that have no data? Oh, and they all
need to remain in alphabetical order.

Is there a term for this kind of data container?  I have been looking
at Linked List but not sure if something else would be better. 
I looked at Object Pools, but I don't want to store the objects
because of memory issues as I have 500 plus MC's on screen at once so
OP's won't work here.

If you can point me in the right direction I would appreciate it.

THanks, J




[flexcoders] Re: Normalize removing my data??? Is this a bug in Flex?

2008-08-21 Thread flexaustin
Sorry everyone I tried to delete this post but I guess it got through.
The issue was the xml was being passed by reference so all my
references were pointing to the same data source (xml). So if I change
one it changes all.  I had to copy it. 

Lesson here for everyone if you get frustrated go for a run clear your
head and make room for new stuff. 5 minutes into my run it hit me. So
simple yet I was so frustrated I couldn't see it.

Thx for your help.



--- In flexcoders@yahoogroups.com, "Jim Hayes" <[EMAIL PROTECTED]> wrote:
>
> XML has a copy method that might help here : 
> 
> from the docs :
> 
> Example 
> 
> 
> This example shows that the copy() method creates a new instance of
an XML object. When you modify the copy, the original remains unchanged:
> var xml1:XML = ;
> var xml2:XML = xml1.copy();
> xml2.appendChild();
> trace(xml1.bar.length()); // 0
> trace(xml2.bar.length()); // 1
> 
> 
> -Original Message-
> From: flexcoders@yahoogroups.com on behalf of Alex Harui
> Sent: Wed 20/08/2008 21:52
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Normalize removing my data??? Is this a
bug in Flex?
>  
> Isn't it because the XMLList has references to the original nodes and
> not copies?
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of flexaustin
> Sent: Tuesday, August 19, 2008 11:02 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Normalize removing my data??? Is this a bug in
> Flex?
> 
>  
> 
> I have been tracing this bug for two days and finally found it. I
> don't see how this .normalize method is changing data in other areas
> of my code?
> 
> So when makeData is called I pass it xml with child nodes. It is
> stored in _data and then I se several variables and call the the
> buildXMLObj method. When inside the buildXMLObj when the line with
> .normalize is run my variable _data (now only contains parent nodes
> with out the children). The buildXMLObj removes children but it is
> never assigned to _data so how is _data getting changed?
> 
> package 
> {
> public class DataDelegate
> {
> import mx.rpc.AsyncToken;
> import mx.utils.ObjectUtil;
> 
> import com.models.ViewModelLocator;
> 
> private var modelLocator:ViewModelLocator =
> ViewModelLocator.getInstance();
> private var _newSelected:int = 0;
> private var midXML:XMLList;
> private var _data:XMLList;
> 
> public function DataDelegate(){
> 
> }
> 
> private function buildXMLObj(xmllist:XMLList):void
> {
> var copyOfList:XML = ;
> for each (var xl:XML in xmllist)
> {
> if (xl.length())
> {
> xl.replace("*", "");
> }
> copyOfList.appendChild(xl);
> }
> copyOfList = copyOfList.normalize();
> midXML = copyOfList.descendants("*");
> 
> }
> 
> public function makeData(datas:XML):void
> {
> trace("MakeData was called
> ---");
> var _data:XML = datas;
> modelLocator.selected = -1;
> var xml:XML = datas as XML;
> var _newSelected:int;
> 
> var comps:XMLList = xml.group.component;
> buildXMLObj(xml.group);
> var groups:XMLList = midXML;
> 
> if (modelLocator.comps.length() > 0)
> { 
> _newSelected = parseInt([EMAIL PROTECTED]);
> modelLocator.selected = _newSelected;
> }
> /* modelLocator.allDataArr.splice(_newSelected,1); */
> modelLocator.allDataArr[_newSelected] = _data; 
> modelLocator.comps = comps;
> modelLocator.groups = groups;
> }
> }
> }
> 
>  
> 
> 
> 
> __
> 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] Styling renderers in a list?

2008-08-21 Thread Josh McDonald
Hey guys,

This is probably an FAQ, but I can't seem to google up an answer. What's the
good way to set style info on renderers inside a list? It's an mxml
component using itemRenderer="className" on the mx:List

-Josh

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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


Re: [flexcoders] Re: re-throwing keystrokes to browser?

2008-08-21 Thread ibo
I want the browser to react on the CTRL-T (new tab).
But since the focus is on the flash app, it doesnt do that.
So I think I have to catch the keystroke from my flex app and
tell the browser that the user wants a new tab.



- Original Message 
From: sdl1326 <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Thursday, August 21, 2008 6:09:23 PM
Subject: [flexcoders] Re: re-throwing keystrokes to browser?


To clarify my response. I have done some extensive key trapping in Flash/AS3 
where I had to prevent default behaviors in the browser (i.e. F5, F1, etc). In 
some instances these keys would be required by the Flash App. so what I ended 
up doing was setting the focus constantly on the browser (via listeners in 
Flash), trapping the keys, and then sending the event.keyCode back to the Flash 
App. via ExternalInterface. 

Let me know if you would like more details.

HTH
--- In [EMAIL PROTECTED] ups.com, "sdl1326"  wrote:
>
> Where exactly are you trying to trap the keys? Do you need to prevent
> the browser from performing some default function or do you need to
> prevent the Flex App from performing some function.
> --- In [EMAIL PROTECTED] ups.com  ibo poweribo@ wrote:
> >
> > My flex is running on full screen mode on my browser.
> > Problem is, if the focus is on the flex app, it wont respond to
> browser keystrokes
> > like CTRL+T (new tab). I can catch the keycode by listening to keydown
> event
> > but how do I send it to the browser? (prefrably cross-browser
> solution).
> >
>


Re: [flexcoders] Code Hints in Flex 4 Gumbo

2008-08-21 Thread Sherif Abdou
No Charts with this SDK. 
  - Original Message - 
  From: Vivian Richard 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, August 21, 2008 4:52 PM
  Subject: Re: [flexcoders] Code Hints in Flex 4 Gumbo


  Hey Sherif is charting working with flex 4 sdk? I know that
  charting is not part of SDK but I guess charts might
  appear with water marks on them.

  On Thu, Aug 21, 2008 at 1:58 PM, Sherif Abdou <[EMAIL PROTECTED]> wrote:
  > I am using the latest SDK (Gumbo), just wondering if there is a way to
  > enable code hints as of yet, I know it's not even alpha yet so not a problem
  > but just asking to see If i am doing something wrong
  > For example when I do
  >
  >  I do not get any hints as to what properties are there so I have to
  > do everything by memory or checking the source code.
  > 


   

[flexcoders] creating component that has change event

2008-08-21 Thread grimmwerks
Hey all -

I'm creating a searchBox component that's sort of like Safari's search  
(ie a button to delete the current text input) -- I'd like it to  
implement a change event for it in the larger app (ie  
change={fireStuff(event)}

And I do have it dispatching an Event.CHANGE but it doesn't seem to be  
valid.

Can anyone point out any docs on this? I'm even trying to trawl  
through the frameworks to see what I can discover...


[flexcoders] Re: FDS (or LCDS) and refreshFill() from Java

2008-08-21 Thread Geoffrey
I'm having the same issues that Dimitrios had below(changes to
properties of items in managed collections not "showing up").

I was wondering if Jeff Vroom's advice is still the preferred method
for LCDS2.6.


To update those properties, you need to call "dts.updateItem" for each
item where the properties have changed.


--- In flexcoders@yahoogroups.com, "Dimitrios Gianninas"
<[EMAIL PROTECTED]> wrote:
>
> Ah, thank you very much for the enlightment Jeff, that explains things.
>  
> Perhaps in a future release there can be a method called
refreshFillFromDB() (or something like that) that will cause LCDS to
make the same call to retrieve the items from the DB - as the first
call to fill() - and push those changes out to affected clients only -
rather than rely on updateItem for each item. This will probably be
more performant in my case as in some cases only the properties of a
batch of items change.
>  
> Dimitrios Gianninas
> Developer
> Optimal Payments Inc.
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Jeff Vroom
> Sent: Monday, June 18, 2007 9:27 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] FDS (or LCDS) and refreshFill() from Java
> 
> 
> 
> That is the right code to refresh a fill from server side code that
is not part of your assembler methods.  It could be the case that for
some reason the fill parameters are not matching the fill parameters
used by your clients or that when FDMS calls the "fill" method on the
assembler, it sees the same item ids returned that are already on the
client.  Turning on the server debug logging for the pattern
"DataService.*" (in 2.0.1) and "Service.Data.*" (in 2.5) would provide
more diagnostics about what is happening.
> 
> One other problem with refreshFill is that if the properties of the
items have changed but the identities of the items in the filled
collection have not, the refreshFill won't pick it up.  RefreshFill is
just about refreshing the membership of the objects in the filled
collection - i.e. which items are in that list.  It is not about
updating the properties of the items in the filled collection.  To
update those properties, you need to call "dts.updateItem" for each
item where the properties have changed.  
> 
> If bandwidth/performance is not too much of a problem, you can
simply call updateItem for each item id in the list where you just
pass in null for the "previous item" and null for the list of
properties that have changed.  This is similar in performance to just
having the clients re-execute the fill since they will be pushed all
of the items in the collection and will update their local copies of
all of the items with these changes.
> 
> Part of the rationale for this behavior is that we don't want to
necessarily cache a copy of every managed item on the server.  That is
really the only way we can know whether an item has changed (by
comparing the old and new versions) and is somewhat expensive.  That
said, if you do have the cache-items setting turned on, we should be
able to do a better job of this even if it takes a few CPU cycles.  I
think we already have an enhancement filed for this feature but I'll
check and if not file one.
> 
> Jeff
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Dimitrios Gianninas
> Sent: Monday, June 18, 2007 6:04 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] FDS (or LCDS) and refreshFill() from Java
> 
> Hi,
> 
> Basically I have a requirement to refresh a list which all clients
pull in via FDS from the Java side. I thought the code below would
cause all clients to refresh but it doesn't. Any ideas of what is
missing or what is incorrect?
> 
> List x = new ArrayList();
> 
> x.add( new Integer(16) );
> 
> x.add( InboxConstants.INBOX_DISPLAY_ACTIVE );
> 
> DataServiceTransaction dts = DataServiceTransaction.begin( false );
> 
> dts.setSendMessagesToPeers( true ); // notify other nodes in a cluster
> 
> dts.refreshFill( "inboxDS", x );
> 
> dts.commit();
> 
> Dimitrios Gianninas
> 
> Developer
> 
> Optimal Payments Inc.
> 
> AVIS IMPORTANT
> 
> WARNING
> 
> Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation. Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système. La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux. Si vous avez reçu ce courrier électroniq

[flexcoders] Re: re-throwing keystrokes to browser?

2008-08-21 Thread sdl1326
To clarify my response. I have done some extensive key trapping in
Flash/AS3 where I had to prevent default behaviors in the browser (i.e.
F5, F1, etc). In some instances these keys would be required by the
Flash App. so what I ended up doing was setting the focus constantly on
the browser (via listeners in Flash), trapping the keys, and then
sending the event.keyCode back to the Flash App. via ExternalInterface.

Let me know if you would like more details.

HTH
--- In flexcoders@yahoogroups.com  ,
"sdl1326" <[EMAIL PROTECTED]> wrote:
>
> Where exactly are you trying to trap the keys? Do you need to prevent
> the browser from performing some default function or do you need to
> prevent the Flex App from performing some function.
> --- In flexcoders@yahoogroups.com  
 
,
> ibo poweribo@ wrote:
> >
> > My flex is running on full screen mode on my browser.
> > Problem is, if the focus is on the flex app, it wont respond to
> browser keystrokes
> > like CTRL+T (new tab). I can catch the keycode by listening to
keydown
> event
> > but how do I send it to the browser? (prefrably cross-browser
> solution).
> >
>



Re: [flexcoders] SDK 3.1 SOAP deserialization issue

2008-08-21 Thread Josh McDonald
I assume you mean 3.1 where you put 2.1 :)

What exactly is happening in 3.1 that's not happening in 3.0? Without
posting "the real code" where the VOs aren't what you've shown here it's
kinda hard to help, so I've gotta ask more questions :) Also how are you
invoking the service, and what code are you using to map the xsd types to
your classes?

I'm pretty familiar with Flex's SOAP encoder/decoder by now, so I can
probably help, and also if there's a bug in 3.1 I wanna know about it so I
can fix it :)

-Josh

On Fri, Aug 22, 2008 at 1:18 AM, jeff <[EMAIL PROTECTED]>wrote:

> Hello,
>
> I am seeing an issue introduced with SDK 3.1 where the SDK is not properly
> mapping XML schemas to AS classes.  We use the SchemaTypeRegistry magic to
> have our AS classes instantiated based on the types contained in our SOAP
> response.  We are seeing improper object creation, beginning in SDK 3.1, as
> detailed below.
>
> =
>
> AS Class:
>
> public dynamic class UserType   {
>
>public var login:String="";
>public var Locale:LocaleType = new LocaleType();
>public var Flags:ArrayCollection = new ArrayCollection();
>
>public function UserType():void {
>}
> }
>
> Schema fragment:
>
> 
>  
>
>
>  
> 
>
>
> 
>  
> maxOccurs="unbounded">
>  
> 
>
>
> 
>  
>
>
>  
>
>  
>
>  
>
> maxOccurs="1">
>
>
>  
> 
>
> XML:
>
> http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:ns1="http://www.harte-hanks.com/hhl-User/";>
>  
>
>  true
>  
>trainallac
>
>  USA
>  
>  USD
>
>
>
>  OESIMPORTORDERS
>  ONESITE-ENGAGE_EDIT
>  OES-FLEX
>  OES-CREATE-BILLTO
>  REPORTS
>
>  
>
>  
> 
>
> =
>
> What happens with SDK 2.1 is the UserType.Flags gets created as type
> ArrayCollection, which has only one element.  This element is another
> ArrayCollection instance which contains the flags.
>
> If the Flags property is commented out of the class definition, the SDK
> will
> "dynamically" create the Flags ArrayCollection and populate it with the
> expected values.  Also, this issue does not exist with SDK 3.0 .
>
> In our real code, Flags is a subclass of ArrayCollection.  So the fix is
> not
> as simple as just commenting out the formal definition for Flags and
> letting
> the SDK create the property itself, since the SDK will then create an
> instance
> of ArrayCollection instead of our subclass.  In our real code, the bogus
> nested Flags are both of the type of our class, so there's definitely
> something sketchy going on here.  I haven't been able to come up with a
> good
> workaround yet, so we're building against 3.0 SDK for the time being.
>
> Thanks,
> Jeff
>
> 
>
> --
> 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
>
>
>
>


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

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


[flexcoders] Re: re-throwing keystrokes to browser?

2008-08-21 Thread sdl1326
Where exactly are you trying to trap the keys? Do you need to prevent
the browser from performing some default function or do you need to
prevent the Flex App from performing some function.
--- In flexcoders@yahoogroups.com  ,
ibo <[EMAIL PROTECTED]> wrote:
>
> My flex is running on full screen mode on my browser.
> Problem is, if the focus is on the flex app, it wont respond to
browser keystrokes
> like CTRL+T (new tab). I can catch the keycode by listening to keydown
event
> but how do I send it to the browser? (prefrably cross-browser
solution).
>



[flexcoders] XMLList to ArrayCollection

2008-08-21 Thread sdl1326
I am retrieving the following xml via httpsService with the result
format being 'e4x'.

 Q3
 Q4
 Q3
 Q4
 Q3
 Q3
 Q3
 Q3

What's the best way to convert an XMLList to an ArrayCollection?  Is it
possible to do so without knowing the names of the attributes?

Thanks for the assistance.



Re: [flexcoders] Code Hints in Flex 4 Gumbo

2008-08-21 Thread Vivian Richard
   Hey Sherif is charting working with flex 4 sdk? I know that
   charting is not part of SDK but I guess charts might
   appear with water marks on them.




On Thu, Aug 21, 2008 at 1:58 PM, Sherif Abdou <[EMAIL PROTECTED]> wrote:
> I am using the latest SDK (Gumbo), just wondering if there is a way to
> enable code hints as of yet, I know it's not even alpha yet so not a problem
> but just asking to see If i am doing something wrong
> For example when I do
>
>   I do not get any hints as to what properties are there so I have to
> do everything by memory or checking the source code.
> 


[flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Amy
--- In flexcoders@yahoogroups.com, Blair Cox <[EMAIL PROTECTED]> wrote:
>
> Hi Amy,
> 
> Well, I have complete control over the database. This where we 
might have a
> problem, it seemed at the time that creating a table with around 
200 columns
> would be unreasonable. A table was created to handle each of the 
products.
> Each product has as many as 20-30 columns and for the most part, do 
not
> relate to each other. I pondered over normalization for over a 
week. 

Personally, I'd have added three tables to handle the unique 
properties.  So, you'd have a PropertySets, that would just be a 
bunch of "containers" for properties, related to GroceryType in your 
main grocery table.  Then, I'd have a PropertySetProperties, which 
would be all the properties available in each set.  Then I'd have 
ItemProperties, which would be the specific property values at each 
item.  Still four tables, but MUCH easier to add properties and 
allows for a single cohesive approach and set of logic.  True, you 
will have to put logic in place to enforce type based on what gets 
entered in the PropertySetProperties table, but nothing's perfect.

> But now
> look at the issue...
> 
> Hmm, what would be the issue in creating a single arrayCollection 
from all
> sources? How would this differ in any way from loading a single 
enormous
> array directly from the db? Looks like I¹m down to two options, 
recreate the
> db and over half the constructed application to deal with the 
changes in
> code, or figure out a way to combine the tables within the 
application or
> the Union query as you suggested.

If your charts are essentially going to be showing the same data for 
each type, it shouldn't be much of a biggie to use a Union query, 
because they should already have fields that are showing the 
equivalent values.

Or use the icky way I suggested ;-).  I usually don't set 
dataProviders immediately, since that information usually isn't 
available until later (I'm bringing mine in through 
ExternalInterface).

You could look here, and see if the way I did it might work for you:

http://flexdiary.blogspot.com/2008/08/charting-example.html

HTH;


-Amy



[flexcoders] re-throwing keystrokes to browser?

2008-08-21 Thread ibo
My flex is running on full screen mode on my browser.
Problem is, if the focus is on the flex app, it wont respond to browser 
keystrokes
like CTRL+T (new tab). I can catch the keycode by listening to keydown event
but how do I send it to the browser? (prefrably cross-browser solution).

[flexcoders] Template architecture

2008-08-21 Thread Richard Rodseth
I'm prototyping a system where a view is built dynamically from an XML
description (converted to VOs). The description refers to a template
(hard-coded in MXML). The dynamic view observes the description (which is a
part of its model) , and creates a child (the template) and adds it as a
child. However, it also needs to "fill in" the template which involves
accessing some of its children by id (eg. template["slot1"],
template["slot2"] ).

If I construct the template via new Template1(), the children are not yet
created. Their ids show up in the debugger, but the values are null. Should
I add a listener for creationComplete, or is this a case where callLater()
could be put to good effect?


[flexcoders] Code Hints in Flex 4 Gumbo

2008-08-21 Thread Sherif Abdou
I am using the latest SDK (Gumbo), just wondering if there is a way to enable 
code hints as of yet, I know it's not even alpha yet so not a problem but just 
asking to see If i am doing something wrong
For example when I do

  I do not get any hints as to what properties are there so I have to do 
everything by memory or checking the source code. 

[flexcoders] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread Amy
--- In flexcoders@yahoogroups.com, "bryancostanich" 
<[EMAIL PROTECTED]> wrote:
>
> gotcha, thanks again for the info. i feel like so much of this is
> tribal knowledge.
> 
> is there a reference for the tags in the style declaration? e.g.
> format="Color", inherit="yes", etc? i'd love to know what all the
> formats are, what inherit REALLY means, etc.

The best reference I've found for the formats is here 
http://livedocs.adobe.com/flex/3/html/help.html?
content=styles_02.html.  It's not where you'd look for this info when 
_creating_ a style, but who said it should be _easy_ to find 
information LOL.  Can't help you with the rest, but maybe someone else 
can.

HTH;

Amy



Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Johannes Nel
i do think you should wrap your responder in another object, the advantage
of this is that you can place your fault handler and data handler in the
same place, but it does depend on your architecture.

On Thu, Aug 21, 2008 at 10:40 PM, Richard Rodseth <[EMAIL PROTECTED]>wrote:

>   Good idea. Thanks.
>
> On Thu, Aug 21, 2008 at 1:38 PM, Johannes Nel <[EMAIL PROTECTED]>wrote:
>
>>   you can hack around it by pointing the the callback function to your
>> unit test class and dispatching an event from there.
>>
>> On Thu, Aug 21, 2008 at 10:34 PM, Richard Rodseth <[EMAIL PROTECTED]>wrote:
>>
>>>   As I mentioned, the service (delegate) method I am calling has an
>>> IResponder callback - it doesn't dispatch events.
>>>
>>> On Thu, Aug 21, 2008 at 1:27 PM, Ralf Bokelberg <
>>> [EMAIL PROTECTED]> wrote:
>>>
   Say you are waiting for an object myDispatcher to dispatch an event
 myEvent.
 Then you call myDispatcher.addEventListener("myEvent", addAsync(
 handleSuccess, 1000 ));
 Inside handleSuccess you can assert as usually. If handleSuccess is
 not called within 1000 ms, the test fails.

 Cheers
 Ralf.

>>>
>>>
>>
>>
>> --
>> j:pn
>> \\no comment
>>
>
>  
>



-- 
j:pn
\\no comment


Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Richard Rodseth
Good idea. Thanks.

On Thu, Aug 21, 2008 at 1:38 PM, Johannes Nel <[EMAIL PROTECTED]>wrote:

>   you can hack around it by pointing the the callback function to your
> unit test class and dispatching an event from there.
> On Thu, Aug 21, 2008 at 10:34 PM, Richard Rodseth <[EMAIL PROTECTED]>wrote:
>
>>   As I mentioned, the service (delegate) method I am calling has an
>> IResponder callback - it doesn't dispatch events.
>>
>> On Thu, Aug 21, 2008 at 1:27 PM, Ralf Bokelberg <[EMAIL PROTECTED]
>> > wrote:
>>
>>>   Say you are waiting for an object myDispatcher to dispatch an event
>>> myEvent.
>>> Then you call myDispatcher.addEventListener("myEvent", addAsync(
>>> handleSuccess, 1000 ));
>>> Inside handleSuccess you can assert as usually. If handleSuccess is
>>> not called within 1000 ms, the test fails.
>>>
>>> Cheers
>>> Ralf.
>>>
>>
>>
>
>
> --
> j:pn
> \\no comment
>  
>


Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Johannes Nel
you can hack around it by pointing the the callback function to your unit
test class and dispatching an event from there.
On Thu, Aug 21, 2008 at 10:34 PM, Richard Rodseth <[EMAIL PROTECTED]>wrote:

>   As I mentioned, the service (delegate) method I am calling has an
> IResponder callback - it doesn't dispatch events.
>
> On Thu, Aug 21, 2008 at 1:27 PM, Ralf Bokelberg <[EMAIL PROTECTED]>wrote:
>
>>   Say you are waiting for an object myDispatcher to dispatch an event
>> myEvent.
>> Then you call myDispatcher.addEventListener("myEvent", addAsync(
>> handleSuccess, 1000 ));
>> Inside handleSuccess you can assert as usually. If handleSuccess is
>> not called within 1000 ms, the test fails.
>>
>> Cheers
>> Ralf.
>>
>
>  
>



-- 
j:pn
\\no comment


Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Richard Rodseth
As I mentioned, the service (delegate) method I am calling has an IResponder
callback - it doesn't dispatch events.

On Thu, Aug 21, 2008 at 1:27 PM, Ralf Bokelberg <[EMAIL PROTECTED]>wrote:

>   Say you are waiting for an object myDispatcher to dispatch an event
> myEvent.
> Then you call myDispatcher.addEventListener("myEvent", addAsync(
> handleSuccess, 1000 ));
> Inside handleSuccess you can assert as usually. If handleSuccess is
> not called within 1000 ms, the test fails.
>
> Cheers
> Ralf.
>  
>


Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Ralf Bokelberg
Say you are waiting for an object myDispatcher to dispatch an event myEvent.
Then you call myDispatcher.addEventListener("myEvent", addAsync(
handleSuccess, 1000 ));
Inside handleSuccess you can assert as usually. If handleSuccess is
not called within 1000 ms, the test fails.

Cheers
Ralf.


[flexcoders] Context Menus on TextArea/TextField in AIR

2008-08-21 Thread Derrick Grigg
Hey everyone,

I am pulling my hair out trying to get a custom context menu to work
on a TextArea or TextField. In a normal Flex project, it's easy,
create a new ContextMenu and assign it the TextArea, everything works
fine. I take the exact same code, put it in an Air project and
nothing, the normal 'edit,copy,paste,select all' is the only thing I
get inside any TextArea or TextField.

Has anyone run across this issue and found a solution.

Thanks,

Derrick



[flexcoders] DataGridColumn trouble...

2008-08-21 Thread Sefi Ninio
Hi.

I have a DataGrid, and a few DataGridColumns in it.
One of them has a labelFunction, that should return a value that depends on
the values of two of the other columns.

example:
|  name  |  start  |  end  |  diff  |
|  xxx |   5 |   7 |   2|
|   yyy|   10|  100  |   90  |

etc...

I can't find a way to get a reference to the DataGrid or the other
DataGridColumns inside it from the labelFunction - using it's DataGridColumn
argument...

Any help would be greatly appreciated..

Sefi


RE: [flexcoders] Intriguing AMFPHP sample

2008-08-21 Thread Kevin Aebig
If it's going to an Air application, than it can write the bytes
temporarily, load the Movie and delete the temporary file. I did that years
ago with C# and Flash and it worked really well.

 

!k

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Nik Derewianka
Sent: Wednesday, August 20, 2008 9:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Intriguing AMFPHP sample

 

Hi,

Was just looking through some blogs on AMFPHP and came across a php 
snippet that showed:

function getSwf()
{
return new ByteArray(file_get_contents("my.swf"));
}

But no sample of what to do on the Flex side to turn it back into 
something useable.

How would you convert that ByteArray of the swf file back to a 
MovieClip/SWFLoader/something displayable ??

Thanks,
Nik

 



[flexcoders] Re: Error styling datagrids

2008-08-21 Thread Amy
--- In flexcoders@yahoogroups.com, "pixelgeek" <[EMAIL PROTECTED]> wrote:
>
> I snagged some code online to help me in a project where I need to
> style the rows of a datagrid.
> 
> The code creates an array of list items using the listItems 
property.
> 
> Sadly this appears to only be a list of the items that are displayed
> on screen.
> 
> Even sadder is that even though the code will style a row it styles
> every nth row in the datagrid where n is the number of items 
displayed
> on screen.
> 
> So if I have a list of 50 items and I style row 2 it also results in
> rows 12, 22, 32 and 42 being styled.
> 
> Is there any way to replace listItems in this code so that it 
returns
> all of the items and not just the currently displayed items?

It sounds like maybe you're just not resetting things when the data 
property changes.



[flexcoders] Re: Error styling datagrids

2008-08-21 Thread pixelgeek
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:

> No.  DG is virtualized. Not all items have renderers.

Well that explains it. I'll have a look at your blog and hopefully
there will be a sample that makes this a bit easier to do.

It seems that every time I turn around Flex is taking something
utterly basic and making it a lot more difficult than it needs to be.

I'll check through the samples on your blog but it really escapes me
why Adobe can't just make it easier to do simple things in Flex.

Make simple things simple and make impossible things possible.

Currently something as stupefyingly basic as setting the style of a
row is turning out to be a small nightmare.

Sorry for the rant but I've been working around this issue for some
time now and it is frustrating that I need to jump through so many
hoops to do this.



Re: [flexcoders] How to determine object type

2008-08-21 Thread Danny Gold
You did mention needing the classname as a String, but the 'is' keyword is
always a good one ;-)

On Thu, Aug 21, 2008 at 10:39 AM, Alex Harui <[EMAIL PROTECTED]> wrote:

>describeType, getQualifiedClassName
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Dale Cook
> *Sent:* Thursday, August 21, 2008 9:32 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] How to determine object type
>
>
>
> Is there a simple way to use reflection to determine the type of an
> object. I would have thought that that Object would have a method
> called class (or something similar) that would return a string
> representation of the type of the class but that doesn't seem to be
> the case.
>
> Dale
>
>  
>


[flexcoders] Chart items with zero value don't show

2008-08-21 Thread Amy
Is there any way to force a chart to show items where the value is 
exactly 0?

Thanks;

Amy



Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Richard Rodseth
Thanks. I might check those out (experience reports welcome), but I just
tried flex-mojos and it has flexunit integration all set up.

On Thu, Aug 21, 2008 at 12:00 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>There are other testing frameworks out there.  I don't know how well
> they work.  One new one I heard about is dpuint/fluint
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Rodseth
> *Sent:* Thursday, August 21, 2008 11:41 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Re: Flexunit and asynchronous calls
>
>
>
> I did actually find some related blog entries, but they seemed to involve
> modifying FlexUnit sources.
>
> http://jharbs.com/blog/?p=96
>
> Also, I'm not using Cairngorm, but my services (delegates in Cairngorm
> terminology, I guess) use IResponder-based signatures.
>
> - Richard
>
> On Thu, Aug 21, 2008 at 11:18 AM, Tim Hoff <[EMAIL PROTECTED]> wrote:
>
> Hi Richard,
>
> No, not using IResponder. But, you may be able to use the UM
> extensions for a callBack; instead of listening for an event.
>
> -TH
>
> --- In flexcoders@yahoogroups.com , "Richard
> Rodseth" <[EMAIL PROTECTED]>
> wrote:
>
>
> >
> > Does anyone have an example of using FlexUnit's addAsync() call with a
> > service method that takes an IResponder, rather than firing events?
> >
> > Thanks.
> >
>
>
>
>  
>


RE: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Alex Harui
There are other testing frameworks out there.  I don't know how well
they work.  One new one I heard about is dpuint/fluint

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Richard Rodseth
Sent: Thursday, August 21, 2008 11:41 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Flexunit and asynchronous calls

 

I did actually find some related blog entries, but they seemed to
involve modifying FlexUnit sources.

http://jharbs.com/blog/?p=96  

Also, I'm not using Cairngorm, but my services (delegates in Cairngorm
terminology, I guess) use IResponder-based signatures.

- Richard

On Thu, Aug 21, 2008 at 11:18 AM, Tim Hoff <[EMAIL PROTECTED]
 > wrote:

Hi Richard,

No, not using IResponder. But, you may be able to use the UM 
extensions for a callBack; instead of listening for an event.

-TH

--- In flexcoders@yahoogroups.com 
, "Richard Rodseth" <[EMAIL PROTECTED]> 
wrote:


>
> Does anyone have an example of using FlexUnit's addAsync() call with a
> service method that takes an IResponder, rather than firing events?
> 
> Thanks.
>

 

 



RE: [flexcoders] Error styling datagrids

2008-08-21 Thread Alex Harui
No.  DG is virtualized. Not all items have renderers.  See the item
renderers category on my blog for more info and maybe useful examples

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of pixelgeek
Sent: Thursday, August 21, 2008 10:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Error styling datagrids

 

I snagged some code online to help me in a project where I need to
style the rows of a datagrid.

The code creates an array of list items using the listItems property.

Sadly this appears to only be a list of the items that are displayed
on screen.

Even sadder is that even though the code will style a row it styles
every nth row in the datagrid where n is the number of items displayed
on screen.

So if I have a list of 50 items and I style row 2 it also results in
rows 12, 22, 32 and 42 being styled.

Is there any way to replace listItems in this code so that it returns
all of the items and not just the currently displayed items?

TIA

 



Re: [flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Blair Cox
Hi Amy,

Well, I have complete control over the database. This where we might have a
problem, it seemed at the time that creating a table with around 200 columns
would be unreasonable. A table was created to handle each of the products.
Each product has as many as 20-30 columns and for the most part, do not
relate to each other. I pondered over normalization for over a week. But now
look at the issue...

Hmm, what would be the issue in creating a single arrayCollection from all
sources? How would this differ in any way from loading a single enormous
array directly from the db? Looks like I¹m down to two options, recreate the
db and over half the constructed application to deal with the changes in
code, or figure out a way to combine the tables within the application or
the Union query as you suggested.

-- 
Blair 




From: Amy <[EMAIL PROTECTED]>
Reply-To: 
Date: Thu, 21 Aug 2008 18:32:56 -
To: 
Subject: [flexcoders] Re: Change dataProvider at runtime?

 
 

--- In flexcoders@yahoogroups.com  ,
"cox.blair" <[EMAIL PROTECTED]> wrote:
>
> Does anyone have experience with changing a dataprovider at runtime?
> 
> Scenerio: a grocery store Database has four tables, one for Produce,
> Dairy, Meat and Other. Each of the tables is a different
> arrayCollection/HTTPService
> 
> I want to be able to have four comboboxes, each able to point to any
> of the four arrayCollection's, therefore to change the datasource of
> each series in a chart.
> 
> Why? Because it would allow you to compare values of different data
> sets in a single chart. I did not expect this would be such an issue.
> 
> If anyone can provide any information at all, it would be a huge help.

Preferred method:

If you have any control over the database, FIX THE DESIGN.  If not, use
a UNION query to normalize the data, then use a filter function to
filter on grocery type and refresh the ArrayCollection.

Icky method:
If you have no control over the backend at all, then you can use
something like myChart.dataProvider = nastyArrayCollection

;-)

HTH;

Amy

 




Re: [flexcoders] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread Michael Schmalle
- tribal knowledge

Well considering I have been making flex components for 3 years now, I would
say it's just some experience with the framework.

Search back in the archives of the flexcomponents list for this topic and
you will see threads in there of me banging my head on the same issue.

I think formats are for more future implementation, I couldn't really give
you a cold hard answer on that.

As far as inheriting, the inheritance happens when the style proto chains
are created in UIComponent when a component is created or a styleName
changes. The algorithm then separates out what is inheriting and what is
not.

Inheriting styles mean that if an instance has a styleName parent (IE
UIComponet), if the style is not defined on the target component, the style
is then searched by parent and type selectors.

Remember all this happens in initProtoChain(). There is no runtime
searching, that would be a HUGE processor hit.

Look in the UIComponent.inheritingStyles object and
UIComponent.nonInheritingStyles to see what is deemed inheriting.

Anyway, probably confused you, I think I confused myself. ;-)

Mike


On Thu, Aug 21, 2008 at 2:35 PM, bryancostanich
<[EMAIL PROTECTED]>wrote:

>   gotcha, thanks again for the info. i feel like so much of this is
> tribal knowledge.
>
> is there a reference for the tags in the style declaration? e.g.
> format="Color", inherit="yes", etc? i'd love to know what all the
> formats are, what inherit REALLY means, etc.
>


-- 
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] Re: Newbie help, dealing with a design in illustrator

2008-08-21 Thread Richard Rodseth
Also take a look at Degrafa. They have some examples based on exporting
Illustrator paths as SVG.

On Thu, Aug 21, 2008 at 11:06 AM, Tom McNeer <[EMAIL PROTECTED]> wrote:

>   You're raising a very complex question, since skinning can be
> complicated in Flex 3.
>
> I won't try to make any suggestions, because I'm not qualified. But I will
> point out that if your original design is in Illustrator, then it's likely
> that most of the elements *are* vector-based, since Illustrator creates
> vector-, rather than pixel-based, graphics. You can import pixel-based
> elements, such as photos, into Illustrator. But since Illustrator is, at
> heart, a drawing program, it's built to be vector-based.
>
> You might take a look at this article --
> http://www.adobe.com/devnet/flex/articles/flex_photoshop_illustrator.html-- 
> and perhaps other info on the Adobe site. With the CS3 Suite, they've
> begun to work hard to make their core graphics tools work with Flex/Flash
> more easily (even without Thermo).
>
> --
> Thanks,
>
> Tom
>
> Tom McNeer
> MediumCool
> http://www.mediumcool.com
> 1735 Johnson Road NE
> Atlanta, GA 30306
> 404.589.0560
>  
>


Re: [flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Richard Rodseth
I did actually find some related blog entries, but they seemed to involve
modifying FlexUnit sources.

http://jharbs.com/blog/?p=96

Also, I'm not using Cairngorm, but my services (delegates in Cairngorm
terminology, I guess) use IResponder-based signatures.

- Richard

On Thu, Aug 21, 2008 at 11:18 AM, Tim Hoff <[EMAIL PROTECTED]> wrote:

>   Hi Richard,
>
> No, not using IResponder. But, you may be able to use the UM
> extensions for a callBack; instead of listening for an event.
>
> -TH
>
> --- In flexcoders@yahoogroups.com , "Richard
> Rodseth" <[EMAIL PROTECTED]>
> wrote:
>
> >
> > Does anyone have an example of using FlexUnit's addAsync() call with a
> > service method that takes an IResponder, rather than firing events?
> >
> > Thanks.
> >
>
>  
>


[flexcoders] Re: Change dataProvider at runtime?

2008-08-21 Thread Amy
--- In flexcoders@yahoogroups.com, "cox.blair" <[EMAIL PROTECTED]> wrote:
>
> Does anyone have experience with changing a dataprovider at runtime?
> 
> Scenerio: a grocery store Database has four tables, one for Produce,
> Dairy, Meat and Other. Each of the tables is a different
> arrayCollection/HTTPService
> 
> I want to be able to have four comboboxes, each able to point to any
> of the four arrayCollection's, therefore to change the datasource of
> each series in a chart. 
> 
> Why? Because it would allow you to compare values of different data
> sets in a single chart. I did not expect this would be such an issue.
> 
> If anyone can provide any information at all, it would be a huge help.

Preferred method:

If you have any control over the database, FIX THE DESIGN.  If not, use 
a UNION query to normalize the data, then use a filter function to 
filter on grocery type and refresh the ArrayCollection.

Icky method:
If you have no control over the backend at all, then you can use 
something like myChart.dataProvider = nastyArrayCollection

;-)


HTH;

Amy




[flexcoders] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread bryancostanich
gotcha, thanks again for the info. i feel like so much of this is
tribal knowledge.

is there a reference for the tags in the style declaration? e.g.
format="Color", inherit="yes", etc? i'd love to know what all the
formats are, what inherit REALLY means, etc.

--- In flexcoders@yahoogroups.com, "Michael Schmalle"
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Coming from a component developer myself, there is no easier way. :)
> 
> You could create a theme but that is whacked since you would then need a
> compiler arg which is a pain.
> 
> It's really not that bad, you are just doing the work that the
compiler does
> when it encounters an  tag.
> 
> It just creates defaultFactories like you are uisng class or type
selectors.
> 
> Mike
> 
> On Thu, Aug 21, 2008 at 2:26 PM, bryancostanich
> <[EMAIL PROTECTED]>wrote:
> 
> >   woo, good info. wish that was in the sdk docs. :(
> >
> > is there a better way to do this altogether? this seems kind of hacky.
> >
> > --- In flexcoders@yahoogroups.com ,
"Michael
> > Schmalle"
> >  wrote:
> > >
> > > Hi,
> > >
> > > If I'm not mistaken you need;
> > >
> > > - getStyleDeclaration(".styledRoundedRectangle")
> > >
> > > and
> > >
> > > StyleManager.setStyleDeclaration(".styledRoundedRectangle", styles,
> > false);
> > >
> > > So the changes are, the DOT '.' means class selector. No DOT
means type
> > > selecter IE ClassName.
> > >
> > > Also, since this is lazy initialize, you don't need to update right
> > away, so
> > > you can change your true to false in the setStyleDeclaration().
> > >
> > > Mike
> > >
> > >
> > > --
> > > 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'.
> > >
> >
> >  
> >
> 
> 
> 
> -- 
> 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] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread Michael Schmalle
Hi,

Coming from a component developer myself, there is no easier way. :)

You could create a theme but that is whacked since you would then need a
compiler arg which is a pain.

It's really not that bad, you are just doing the work that the compiler does
when it encounters an  tag.

It just creates defaultFactories like you are uisng class or type selectors.

Mike

On Thu, Aug 21, 2008 at 2:26 PM, bryancostanich
<[EMAIL PROTECTED]>wrote:

>   woo, good info. wish that was in the sdk docs. :(
>
> is there a better way to do this altogether? this seems kind of hacky.
>
> --- In flexcoders@yahoogroups.com , "Michael
> Schmalle"
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > If I'm not mistaken you need;
> >
> > - getStyleDeclaration(".styledRoundedRectangle")
> >
> > and
> >
> > StyleManager.setStyleDeclaration(".styledRoundedRectangle", styles,
> false);
> >
> > So the changes are, the DOT '.' means class selector. No DOT means type
> > selecter IE ClassName.
> >
> > Also, since this is lazy initialize, you don't need to update right
> away, so
> > you can change your true to false in the setStyleDeclaration().
> >
> > Mike
> >
> >
> > --
> > 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'.
> >
>
>  
>



-- 
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'.


[flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...

2008-08-21 Thread weezee49
Okay, I finally found a solution that works.  I declare

[Bindable]
private var _rscAndNewXLC: XMLListCollection;

Then my event handler looks like this:

private function handleRscListResult(event:ResultEvent):void{
var resultXML : XML = XML(event.result);
_rscAndNewXLC = getRscAndNew(resultXML.children());
rscBox.rscListCB.dataProvider = _rscAndNewXLC;
rscBox.rscListCB.selectedIndex=0;
}

and my function getRscAndNew:

private function getRscAndNew(rscXL: XMLList):XMLListCollection{
var retval:XMLListCollection = 
new XMLListCollection(rscXL.copy());
retval.addItemAt(NEW_RSC_XML, 0);
return retval;
}

This is populating the ComboBox correctly with "--New Resource" as 
the default selected item, and the single resource returned from the 
HTTPService call as the 2nd item in the box.  

After reading 
http://blogs.adobe.com/aharui/2007/03/arraycollection_arrays_and_ser.
html, I decided that the ArrayCollection data structure is the wrong 
choice here.  

I hope this is helpful to others.

LG



[flexcoders] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread bryancostanich
woo, good info. wish that was in the sdk docs. :(

is there a better way to do this altogether? this seems kind of hacky. 

--- In flexcoders@yahoogroups.com, "Michael Schmalle"
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> If I'm not mistaken you need;
> 
> - getStyleDeclaration(".styledRoundedRectangle")
> 
> and
> 
> StyleManager.setStyleDeclaration(".styledRoundedRectangle", styles,
false);
> 
> So the changes are, the DOT '.' means class selector. No DOT means type
> selecter IE ClassName.
> 
> Also, since this is lazy initialize, you don't need to update right
away, so
> you can change your true to false in the setStyleDeclaration().
> 
> Mike
> 
> 
> -- 
> 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] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread Michael Schmalle
Hi,

If I'm not mistaken you need;

- getStyleDeclaration(".styledRoundedRectangle")

and

StyleManager.setStyleDeclaration(".styledRoundedRectangle", styles, false);

So the changes are, the DOT '.' means class selector. No DOT means type
selecter IE ClassName.

Also, since this is lazy initialize, you don't need to update right away, so
you can change your true to false in the setStyleDeclaration().

Mike


-- 
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'.


[flexcoders] Re: Flexunit and asynchronous calls

2008-08-21 Thread Tim Hoff
Hi Richard,

No, not using IResponder.  But, you may be able to use the UM 
extensions for a callBack; instead of listening for an event.

-TH

--- In flexcoders@yahoogroups.com, "Richard Rodseth" <[EMAIL PROTECTED]> 
wrote:
>
> Does anyone have an example of using FlexUnit's addAsync() call with a
> service method that takes an IResponder, rather than firing events?
> 
> Thanks.
>




[flexcoders] Re: Declaration of style 'cornerRadius' conflicts with previous declaration

2008-08-21 Thread bryancostanich
thanks, that fixed the error. i figured i bolloxed something up. 

another question though, i'm setting the default as you can see, but
in my updateDisplayList() i'm doing:
  this.graphics.beginFill(this._fillColor, this.alpha);
  this.graphics.drawRoundRect(0,0, this.width, this.height,
this.getStyle("cornerRadius"), this.getStyle("cornerRadius"));
  this.graphics.endFill();

but the call to this.getStyle() is just returning 0. have i set my
defaults incorrectly? the SDK examples are pretty confusing.

--- In flexcoders@yahoogroups.com, "Michael Schmalle"
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Since the styleName of a skin gets set to it's parent, there is no
need for
> inherit.
> 
> change
> 
> inherit="yes"
> 
> to
> 
> inherit="no"
> 
> Mike
> 
> On Thu, Aug 21, 2008 at 2:33 AM, bryancostanich
> <[EMAIL PROTECTED]>wrote:
> 
> >   hi all,
> >
> > i have a class: public class RoundedRectangle extends UIComponent
> >
> > and i have the style definition: [Style(name="cornerRadius",
> > type="uint", inherit="yes")], above it.
> >
> > then i've followed the docs to do the default style declaration:
> >
> > private static function classConstruct():Boolean
> > {
> > if
> > (!StyleManager.getStyleDeclaration("styledRoundedRectangle"))
> > {
> > // If there is no CSS definition for StyledRectangle,
> > // then create one and set the default value.
> > var styles:CSSStyleDeclaration = new
> > CSSStyleDeclaration();
> > styles.defaultFactory = function():void
> > {
> > this.color = 0x0;
> > this.width = 40;
> > this.height = 40;
> > this.cornerRadius = 3;
> > this.overColor = 0x00cc00;
> > this.alpha = 1.0;
> > }
> >
> > StyleManager.setStyleDeclaration("styledRoundedRectangle", styles,
true);
> >
> > }
> > return true;
> > }
> >
> > but when i try to build my project, i get the error: Declaration of
> > style 'cornerRadius' conflicts with previous declaration in
> >
> >
C:\[devlocal]\TixSmart\Flex\tixsmartFlexControls\com\tixsmart\flex\controls\RoundedRectangle.as
> >
> > but it gives me an unknown location and no path. i'm only decaring
> > that style once.
> >
> > any ideas? i'm still a little fuzzy on some of the style stuff, so i
> > likely cocked something up, but i'm not really sure what.
> >
> >  
> >
> 
> 
> 
> -- 
> 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] Re: Newbie help, dealing with a design in illustrator

2008-08-21 Thread Tom McNeer
You're raising a very complex question, since skinning can be complicated in
Flex 3.

I won't try to make any suggestions, because I'm not qualified. But I will
point out that if your original design is in Illustrator, then it's likely
that most of the elements *are* vector-based, since Illustrator creates
vector-, rather than pixel-based, graphics. You can import pixel-based
elements, such as photos, into Illustrator. But since Illustrator is, at
heart, a drawing program, it's built to be vector-based.

You might take a look at this article --
http://www.adobe.com/devnet/flex/articles/flex_photoshop_illustrator.html --
and perhaps other info on the Adobe site. With the CS3 Suite, they've begun
to work hard to make their core graphics tools work with Flex/Flash more
easily (even without Thermo).

-- 
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560


[flexcoders] Error styling datagrids

2008-08-21 Thread pixelgeek
I snagged some code online to help me in a project where I need to
style the rows of a datagrid.

The code creates an array of list items using the listItems property.

Sadly this appears to only be a list of the items that are displayed
on screen.

Even sadder is that even though the code will style a row it styles
every nth row in the datagrid where n is the number of items displayed
on screen.

So if I have a list of 50 items and I style row 2 it also results in
rows 12, 22, 32 and 42 being styled.

Is there any way to replace listItems in this code so that it returns
all of the items and not just the currently displayed items?

TIA





[flexcoders] Re: Specifying AxisLabel colors

2008-08-21 Thread kaleb_pederson
So, after much digging through documentation, a co-worker found that 
there's a color property on the AxisRenderer (rather than the stroke 
that's used by the AxisRenderer) that affects the label's color.

BTW, it would be very helpful if the documentation showed a picture 
of a customized graph with callouts or numbers that related to 
sections of the picture so that it would be easy to correlate 
certain customizations with renderers, styles, axis's, etc.

Regards.

--Kaleb

--- In flexcoders@yahoogroups.com, "kaleb_pederson" 
<[EMAIL PROTECTED]> wrote:
>
> What is the best way to specify the color on an AxisLabel?
> 
> I've been working with some charts recently and set the AxisLabel 
> color by setting a labelRenderer on the AxisRenderer.  My 
> LabelRender then returns a mx.controls.Label that has the color 
> set appropriately and the data function overridden so that it can
> display everything correctly.
> 
> Although this works, it causes problems if I'm not very careful 
> about making sure that my graph component is not reused in a 
> different component because the supplied DisplayObject wouldn't be 
a 
> child of the caller (eg. the Label wouln't be a child).
> 
> Is there an easier way?
> 
> Thanks.
> 
> --Kaleb
>




[flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...

2008-08-21 Thread weezee49


The XML returned by 
http://localhost:3000/simulations/4/resources.xml is:

   
- 
- 
  1 
  2008-08-21T17:22:46Z 
  The grocery store server 
  2 
  Rclerk 
  4 
  sec 
  2008-08-21T17:22:46Z 
  
  

This is the same data returned by event.result in the event 
handler.   

LG

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> In the XML, not the MXML.  Your snippet just started with 

> Usually, there's more before that.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of weezee49
> Sent: Thursday, August 21, 2008 5:56 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion 
failed:
> cannot convert ...
> 
>  
> 
> I have 2 namespaces:
> 
> http://www.adobe.com/2006/mxml
>  "
> xmlns:wsm="com.websim.components.*"
> 
> ...
> 
> LG
> 
> --- In flexcoders@yahoogroups.com 
> , "Alex Harui"  wrote:
> >
> > Any namespaces defined in the XML?
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> 
> [mailto:flexcoders@yahoogroups.com 
> ] On
> > Behalf Of weezee49
> > Sent: Wednesday, August 20, 2008 5:16 PM
> > To: flexcoders@yahoogroups.com  
> > Subject: [flexcoders] TypeError: Error #1034: Type Coercion 
failed:
> > cannot convert ...
> > 
> > 
> > 
> > I'm getting the dreaded Type Coercion error on this line:
> > 
> > resourcesAC = event.result.resources.resource;
> > 
> > resourcesAC is declared as follows:
> > 
> > [Bindable]
> > private var resourcesAC : ArrayCollection = new ArrayCollection
();
> > 
> > My result handler for my HTTPService is:
> > 
> > private function handleRscListResult(event:ResultEvent):void{
> > resourcesAC = event.result.resources.resource;
> > var rscObj:Object = new Object();
> > rscObj.name = "--New Resource--";
> > rscObj.resourceID = 0;
> > resourcesAC.addItemAt(rscObj, 0);
> > rscBox.rscListCB.selectedIndex=0;
> > } 
> > 
> > Turns out that event.result.resources.resource is empty, which 
is 
> > why I'm getting the error. However, I can't figure out why this 
is 
> > empty. Here's my event.result:
> > 
> > 
> > 
> > 1
> > 
> > The grocery store server
> > 2
> > Rclerk
> > 4
> > sec
> > 
> > 
> > 
> > 
> > When I check the length of event.result.resources.resource using 
> > trace(event.result.resources.resource.length()), I get 0.
> > 
> > Why is this? Seems to me it should be 1 - there's one  
> > object in there!
> > 
> > The only other guess I have is that somehow "resources" 
> > and "resource" are magic words. I was checking my routes.rb file 
> > today and noticed the following route:
> > 
> > map.resources :resources
> > 
> > which struck me as looking peculiar today.
> > 
> > Has anyone run across this before?
> > 
> > Thanks,
> > LG
> >
>




[flexcoders] Very First Steps in Flex Reference Card

2008-08-21 Thread jilltomichdz
DZone has released an Adobe Flex Refcard which will help readers get
started learning Flex. Firstly, it covers a simple "Hello, World"
application which will help familiarize readers with the Flex Builder
tool and programming model. Secondly, it goes into depth about how to
connect Flex applications to back-end data through RESTful XML and
SOAP. And lastly, "Remoting and Messaging with Java" walks through how
to easily connect to a Java back-end with the open source BlazeDS product.

Features include Hello, World, Web Services, Remoting and Messaging
with Java, Hot Tips and more.

The Refcard can be downloaded for free at: 
http://refcardz.dzone.com/refcardz/very-first-steps-flex

(Note: If you're a new member to DZone, there is a short registration
process to complete in order to download the Flex refcard, and the
additional 17 Refcardz in the library - all for free.)




RE: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...

2008-08-21 Thread Alex Harui
In the XML, not the MXML.  Your snippet just started with 
Usually, there's more before that.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of weezee49
Sent: Thursday, August 21, 2008 5:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed:
cannot convert ...

 

I have 2 namespaces:

http://www.adobe.com/2006/mxml
 "
xmlns:wsm="com.websim.components.*"

...

LG

--- In flexcoders@yahoogroups.com 
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Any namespaces defined in the XML?
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com 

[mailto:flexcoders@yahoogroups.com 
] On
> Behalf Of weezee49
> Sent: Wednesday, August 20, 2008 5:16 PM
> To: flexcoders@yahoogroups.com  
> Subject: [flexcoders] TypeError: Error #1034: Type Coercion failed:
> cannot convert ...
> 
> 
> 
> I'm getting the dreaded Type Coercion error on this line:
> 
> resourcesAC = event.result.resources.resource;
> 
> resourcesAC is declared as follows:
> 
> [Bindable]
> private var resourcesAC : ArrayCollection = new ArrayCollection();
> 
> My result handler for my HTTPService is:
> 
> private function handleRscListResult(event:ResultEvent):void{
> resourcesAC = event.result.resources.resource;
> var rscObj:Object = new Object();
> rscObj.name = "--New Resource--";
> rscObj.resourceID = 0;
> resourcesAC.addItemAt(rscObj, 0);
> rscBox.rscListCB.selectedIndex=0;
> } 
> 
> Turns out that event.result.resources.resource is empty, which is 
> why I'm getting the error. However, I can't figure out why this is 
> empty. Here's my event.result:
> 
> 
> 
> 1
> 
> The grocery store server
> 2
> Rclerk
> 4
> sec
> 
> 
> 
> 
> When I check the length of event.result.resources.resource using 
> trace(event.result.resources.resource.length()), I get 0.
> 
> Why is this? Seems to me it should be 1 - there's one  
> object in there!
> 
> The only other guess I have is that somehow "resources" 
> and "resource" are magic words. I was checking my routes.rb file 
> today and noticed the following route:
> 
> map.resources :resources
> 
> which struck me as looking peculiar today.
> 
> Has anyone run across this before?
> 
> Thanks,
> LG
>

 



RE: [flexcoders] problem on using loaded font in Chinese in LinkBar

2008-08-21 Thread Alex Harui
Buttons use bold by default so you may have to embed a bold font

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of bsyyu
Sent: Wednesday, August 20, 2008 9:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] problem on using loaded font in Chinese in LinkBar

 

I encounter the problem on using swf Chinese font type with chinese
charater in LinkBar with fontFamily. The font doesn't apply and just
show the system font. However, it is OK, for 'English text' English
font swf at same setting. 
I also test using Label or LinkButton, on using Chinese font type with
chinese character, both of them works well.
Is there any idea why this happens and how to solve this.

 



RE: [flexcoders] add to list combobox

2008-08-21 Thread Alex Harui
Set editable=true.  Later, if selectedIndex=-1, it is something not in
the dataProvider and you can add it via dataProvider.addItem().  

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of strykker75
Sent: Thursday, August 21, 2008 6:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] add to list combobox

 

I need to create a combobox that allows the user to type in a item
that is not on the list, then adds it to the data provider. The user
should be able to type into the combo box and, if what they type is
not an item in the data provider, they should be asked if they would
like to add the newly typed entry. If yes, the entry should be added
(in my case, by dispatching an event that would cause a coldfusion
call to happen). Any thoughts or examples out there on how to do this?

 



[flexcoders] Change dataProvider at runtime?

2008-08-21 Thread cox.blair
Does anyone have experience with changing a dataprovider at runtime?

Scenerio: a grocery store Database has four tables, one for Produce,
Dairy, Meat and Other. Each of the tables is a different
arrayCollection/HTTPService

I want to be able to have four comboboxes, each able to point to any
of the four arrayCollection's, therefore to change the datasource of
each series in a chart. 

Why? Because it would allow you to compare values of different data
sets in a single chart. I did not expect this would be such an issue.

If anyone can provide any information at all, it would be a huge help.

Thanks,



  1   2   >