[flexcoders] addChild & creationCompleteEffect

2007-10-15 Thread johantrax
Hi all,

I create a TitleWindow with the PopupManager. The titlewindow should
dynamically contain a canvas.
So how did I do that. I gave the titlewindow a property called
'contentForm' which contains a canvas. Then in the
creationComplete-event of the titlewindow, addChild(contentForm) is
called for adding the canvas to the titlewindow.
So far, so good...

Next I wanted to create some popup/popout effect on the titlewindow.
So I set creationCompleteEffect to 'popup', a mx:Parallel of
zoom/move/fade. I also set the removedEffect to 'popout', a mx:Sequence.

What's the problem? The 'popup'-effect should move the titlewindow
from the top to the center of the application. I figured this move-tag
would give me what needed:

However, this isn't working as expected.
The only logical explanation I can come up with is the following:
creationComplete and creationCompleteEffect both get executed when the
creationcomplete-Event is fired. Since the childComponent is only
added during the handling of that event, the effect playing is not yet
aware of the change in size.

This lead me into the FlexDocs, where I learned that adding children
should be part of the initialisationEvent.
So I assigned my init()method to the initialize-listener instead of
creationComplete.
However, this is giving me the following errors:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at mx.containers::Panel/::showTitleBar()
at mx.containers::Panel/mx.containers:Panel::layoutChrome()
at mx.core::Container/mx.core:Container::updateDisplayList()
...
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at components::PopupFormWindow/::init()
at components::PopupFormWindow/___TitleWindow1_initialize()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
...

My init-method is as follows:
private function init():void {
//create inner form
contentForm.currentState = this.currentState;
(contentForm as customerPopupForm).ac = this.ac;
this.addChild(contentForm);
}

Any help, push in the right direction is really appreciated. I will
provide the full errormsgs/more code if needed, but I consider this to
be a long post already ;)
--Johan




[flexcoders] change click of button with state

2007-10-15 Thread johantrax
Hi again,

Seems I'm not having my day today.
The problem I'm now facing is: I have a button in a state called
'insert'. I have a state 'update' which is based on the insert-state.
The button should have a different clickhandler in the updatestate.

However using:

The debugger gives:
ReferenceError: Error #1069: Property click not found on
mx.controls.Button and there is no default value.

Anyone with a bright light about this issue?
Thanks,
--Johan





[flexcoders] Re: change click of button with state

2007-10-15 Thread johantrax
nvm, just discovered 

--Johan

--- In flexcoders@yahoogroups.com, "johantrax" <[EMAIL PROTECTED]>
wrote:
>
> Hi again,
> 
> Seems I'm not having my day today.
> The problem I'm now facing is: I have a button in a state called
> 'insert'. I have a state 'update' which is based on the insert-state.
> The button should have a different clickhandler in the updatestate.
> 
> However using:
>  name="click"
>   value="update()"
>   />
> The debugger gives:
> ReferenceError: Error #1069: Property click not found on
> mx.controls.Button and there is no default value.
> 
> Anyone with a bright light about this issue?
> Thanks,
> --Johan
>




[flexcoders] Re: addChild & creationCompleteEffect

2007-10-18 Thread johantrax
Nobody with any tips? :(

--Johan

--- In flexcoders@yahoogroups.com, "johantrax" <[EMAIL PROTECTED]>
wrote:
>
> Hi all,
> 
> I create a TitleWindow with the PopupManager. The titlewindow should
> dynamically contain a canvas.
> So how did I do that. I gave the titlewindow a property called
> 'contentForm' which contains a canvas. Then in the
> creationComplete-event of the titlewindow, addChild(contentForm) is
> called for adding the canvas to the titlewindow.
> So far, so good...
> 
> Next I wanted to create some popup/popout effect on the titlewindow.
> So I set creationCompleteEffect to 'popup', a mx:Parallel of
> zoom/move/fade. I also set the removedEffect to 'popout', a mx:Sequence.
> 
> What's the problem? The 'popup'-effect should move the titlewindow
> from the top to the center of the application. I figured this move-tag
> would give me what needed:
>  yFrom="{-this.height}" yTo="{(Application.application.height -
> this.height) / 2}"
>   xFrom="{Application.application.width / 2}"
> xTo="{(Application.application.width - this.width) / 2}"
>   />
> However, this isn't working as expected.
> The only logical explanation I can come up with is the following:
> creationComplete and creationCompleteEffect both get executed when the
> creationcomplete-Event is fired. Since the childComponent is only
> added during the handling of that event, the effect playing is not yet
> aware of the change in size.
> 
> This lead me into the FlexDocs, where I learned that adding children
> should be part of the initialisationEvent.
> So I assigned my init()method to the initialize-listener instead of
> creationComplete.
> However, this is giving me the following errors:
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>   at mx.containers::Panel/::showTitleBar()
>   at mx.containers::Panel/mx.containers:Panel::layoutChrome()
>   at mx.core::Container/mx.core:Container::updateDisplayList()
> ...
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>   at components::PopupFormWindow/::init()
>   at components::PopupFormWindow/___TitleWindow1_initialize()
>   at
>
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
> ...
> 
> My init-method is as follows:
> private function init():void {
>   //create inner form
>   contentForm.currentState = this.currentState;
>   (contentForm as customerPopupForm).ac = this.ac;
>   this.addChild(contentForm);
> }
> 
> Any help, push in the right direction is really appreciated. I will
> provide the full errormsgs/more code if needed, but I consider this to
> be a long post already ;)
> --Johan
>




[flexcoders] Re: addChild & creationCompleteEffect

2007-10-18 Thread johantrax
Thanks for the input, however with little success.
Adding the effect to showEffect gives nothing. If I recall correctly
showeffect is triggered by clicking the object when it's inside a
viewstack.

However listening to the childAdd brought me to the following idea.
At the end of me creationCompleteHandler I have put the following:
callLater(function():void{popup.play([this])});

This gives me the same error as listening to the addChildEvent, being
the following:

TypeError: Error #1006: dispatchEvent is not a function.
at mx.effects::EffectInstance/play()
at mx.effects.effectClasses::MoveInstance/play()
at mx.effects::EffectInstance/startEffect()
at mx.effects.effectClasses::ParallelInstance/play()
at mx.effects::EffectInstance/startEffect()
at mx.effects::Effect/play()
at MethodInfo-3081()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

--Johan

--- In flexcoders@yahoogroups.com, "Joan Lafferty" <[EMAIL PROTECTED]> wrote:
>
> One more suggestion to try. You can listen for the childAdd event on the
> TitleWindow. Then, in the event handler, play the effect on the Canvas.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Joan Lafferty
> Sent: Thursday, October 18, 2007 10:06 AM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Re: addChild & creationCompleteEffect
> 
>  
> 
> Maybe try your effect on the showEffect rather than the
> creationCompleteEffect? I haven't tried this to see if it works... just
> a suggestion.
> 
>  
> 
> Joan



[flexcoders] TabNavigator and includeInlayout

2007-10-19 Thread johantrax
I'm having some trouble understanding the 'why' of the restriction on
the includeInLayout-property

As Stated in the livedocs, includeInLayout only applies to:
* Box, or any of its subclasses: HBox, VBox, DividedBox,
HDividedBox, VdividedBox, Grid, GridItem, GridRow, ControlBar, and
ApplicationControlBar,
* Form
* Tile and its subclass, Legend
* ToolBar
But then again, includeInLayout is a property of UIComponent.

Why aren't we allowed to hide a Canvas, ... ?

Or even better, when using a Box inside a TabNavigator (most likely
within any viewStack) this setting just gets ignored.

I do realise I could use addChild and RemoveChild for my tab inside
the navigator. However, consider the following:
A TabNavigator, a buttonbar with a button for each tab. A click on a
button changes includeInLayout and visible properties for the
corresponding tab.
What I expect is, that on clicking a button, the corresponding tab is
'removed' from the navigator. When making the tab visible again, it
shows up at the same position as before.

So why don't use removeChildAt() ?
Say I have 4 tabs, and I removed tab2. Next I want to remove the tab
originally at index3, but now at index2. Removing the third tab, ends
in removing the tab that was originally 4th...

And why don't use addChildAt() ?
State I somehow managed to remove the tabs 2-4 of a navigator of 5
tabs. Now I want to show(re-add) the original 4th tab. This tab should
be set 'in place' again. However when using addChildAt(3), you'll get
an indexOutOfBoundsException, since only tab 1 and 5 are present. What
leaves you a tabnavigator with numChildren of 2...

Any thought on solving this one?
--Johan



[flexcoders] Re: TabNavigator and includeInlayout

2007-10-22 Thread johantrax
Apologies for the late reply, I have been busy with some other project.
I'll check out the superTabNavigator as suggested, will post
subsequent data on failure.

--Johan


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> includeInLayout is a flag on UIComponent and therefore Canvas and just
> about everything as to whether its parent container should include it in
> its layout algorithm, which is why only HBox, VBox, etc will actuall
> examine the flag on its children.
> 
>  
> 
> Navigators do not examine this flag, and use visibility to hide the
> unselected child, so there's no easy way to hide things from the
> navigators we ship.  SuperTabNavigator does, I believe, so check it out.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Daniel Freiman
> Sent: Friday, October 19, 2007 8:00 AM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] TabNavigator and includeInlayout
> 
>  
> 
> Where does it say this in the docs?  Does it mean that these the
> includeInLayout property is only heeded for children of those types of
> containers?  Because that would make more sense.
> 
> - Dan Freiman





[flexcoders] Re: addChild & creationCompleteEffect

2007-10-22 Thread johantrax
Desperate bump. Still getting nowhere, and to popup a window of
600*400 on a 800*600 screen, without being able to center it is not
really appealing...

Thank,
Johan

--- In flexcoders@yahoogroups.com, "johantrax" <[EMAIL PROTECTED]>
wrote:
>
> Hi all,
> 
> I create a TitleWindow with the PopupManager. The titlewindow should
> dynamically contain a canvas.
> So how did I do that. I gave the titlewindow a property called
> 'contentForm' which contains a canvas. Then in the
> creationComplete-event of the titlewindow, addChild(contentForm) is
> called for adding the canvas to the titlewindow.
> So far, so good...
> 
> Next I wanted to create some popup/popout effect on the titlewindow.
> So I set creationCompleteEffect to 'popup', a mx:Parallel of
> zoom/move/fade. I also set the removedEffect to 'popout', a mx:Sequence.
> 
> What's the problem? The 'popup'-effect should move the titlewindow
> from the top to the center of the application. I figured this move-tag
> would give me what needed:
>  yFrom="{-this.height}" yTo="{(Application.application.height -
> this.height) / 2}"
>   xFrom="{Application.application.width / 2}"
> xTo="{(Application.application.width - this.width) / 2}"
>   />
> However, this isn't working as expected.
> The only logical explanation I can come up with is the following:
> creationComplete and creationCompleteEffect both get executed when the
> creationcomplete-Event is fired. Since the childComponent is only
> added during the handling of that event, the effect playing is not yet
> aware of the change in size.
> 
> This lead me into the FlexDocs, where I learned that adding children
> should be part of the initialisationEvent.
> So I assigned my init()method to the initialize-listener instead of
> creationComplete.
> However, this is giving me the following errors:
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>   at mx.containers::Panel/::showTitleBar()
>   at mx.containers::Panel/mx.containers:Panel::layoutChrome()
>   at mx.core::Container/mx.core:Container::updateDisplayList()
> ...
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>   at components::PopupFormWindow/::init()
>   at components::PopupFormWindow/___TitleWindow1_initialize()
>   at
>
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
> ...
> 
> My init-method is as follows:
> private function init():void {
>   //create inner form
>   contentForm.currentState = this.currentState;
>   (contentForm as customerPopupForm).ac = this.ac;
>   this.addChild(contentForm);
> }
> 
> Any help, push in the right direction is really appreciated. I will
> provide the full errormsgs/more code if needed, but I consider this to
> be a long post already ;)
> --Johan
>




[flexcoders] Re: addChild & creationCompleteEffect

2007-10-25 Thread johantrax
What I have done is setting a breakpoint on the line of the
move-effect-tag in which both width and height are 0.

So Now I have added some 'debugging-alerts'
 (1) one in the creationcomplete-event of the popupwindowcomponent,
before the inner form is added
 (2) one in the creationcomplete-event of the injected form, before
its fields/innercomponents are added
 (3) second-one in the creationcomplete-event of the injected form
after it's children are added with addChild()
 (4) second-one in the creationcomplete-event of the popupwindow after
the inner form has been added with the addChild()-method.

These do not appear in this order!
The order of appearance is
 (1) popupwindow.width = 52 | height = 48
 (4) popupwindow.width = 52 | height = 48
 (2) injectedForm.width = 20 | height = 20
 (3) injectedForm.width = 20 | height = 20

Not quite what I expected..
--Johan

--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]>
wrote:
> 
> Have you stopped it in the debugger to check the values before/after
the move 
> effect ?
> 
> -- 
> Tom Chiverton. Are you a great Flex programmer, who knows Cairngorm,
and has 
> done some ColdFusion work ? Would you like to work for a top 30 law
firm in 
> Manchester, UK ? Are not an agency ? If yes, send email !
> 
> 
> 
> This email is sent for and on behalf of Halliwells LLP.
> 
> Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at St James's Court Brown Street Manchester M2 2JF.
 A list of members is available for inspection at the registered
office.  Any reference to a partner in relation to Halliwells LLP
means a member of Halliwells LLP.  Regulated by The Solicitors
Regulation Authority.
> 
> CONFIDENTIALITY
> 
> This email is intended only for the use of the addressee named above
and may be confidential or legally privileged.  If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells
LLP or the addressee of its existence or contents.  If you have
received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 8008.
> 
> For more information about Halliwells LLP visit www.halliwells.com.
>




[flexcoders] switching states and binding

2007-10-31 Thread johantrax
Hi All,

I'm currently creating my own imagecomponent, which has 4 states:
  * image : display the image
  * text  : display the uri
  * edit  : display uri in an inputfield
  * both  : display image+uri

The idea is that when a non-edit-state is double-clicked, the
editstate gets activated and my user can provide a new uri for the image.

What I've done so far (stripped code, only states text and edit)

//*start of code*//

http://www.adobe.com/2006/mxml";
currentState="text"
creationComplete="init()"
doubleClickEnabled="true"
>




















//*end of code*//

However this gives me unexpected behaviour.
If you double-click on the text, the edit-field shows up with the
correct content. Then you alter this field and focus out of it, so the
text-view appears instead.
However the text-view is not changed.  (In the meantime I do realize
that the curly braces only bind in one direction, but besides that)
The really wierd thing is that, when going back into the edit-state,
the inputfield DOES contain my altered value...

Can anyone clarify this behaviour out for me, because I don't see
where the altered value can be saved, except for the variable imgURL.
But if that is the case, then why isn't the text-view updated?

Kind regards,
--Johan

PS: does anyone know a free host to upload a swf, it could make
examples in here lots easier :)



[flexcoders] Re: parseFloat vs Number

2007-10-31 Thread johantrax
Well, sometimes to discover you ought to try ;)

I built you a little sample-application showing the results of
parseFloat and Number() (and 'as Number', which gives, lets say
'predictable', results when used on a String)


http://www.adobe.com/2006/mxml";
creationComplete="showNumbers()"
>







--Johan


--- In flexcoders@yahoogroups.com, "reflexactions" <[EMAIL PROTECTED]>
wrote:
>
> Thanks anyway for the reply, though I wasnt really asking what the 
> difference is between Number and parseFloat I was asking more 
> specifically about the difference between Number and parseFloats 
> string parsing capabilities.




[flexcoders] Re: parseFloat vs Number

2007-10-31 Thread johantrax
I agree that in most (if not all) cases, small tests indeed will skip
some situations (as did mine, i forgot the empty string)

But for most functions you can find solid documentation within the
language reference.
f.e. (under Global functions):

Number()function public function Number(expression:Object
<http://livedocs.adobe.com/flex/2/langref/Object.html> ):Number
<http://livedocs.adobe.com/flex/2/langref/Number.html>
Converts a given value to a Number value. The following table shows the
result of various input types:

Input Type/Value   Example   Return Value
undefined   Number(undefined)   NaN null  
Number(null)   0 true   Number(true)   1
false   Number(false)   0 NaN   Number(NaN)
NaN Empty string   Number("")   0
String that converts to Number   Number("5")   The number (e.g.
5) String that does not convert to Number  
Number("5a")   NaN   Parameters
expression:Object <http://livedocs.adobe.com/flex/2/langref/Object.html>
— A value to be converted to a number.   Returns
Number <http://livedocs.adobe.com/flex/2/langref/Number.html>  —
The converted number value.
and a bit further:

parseFloat()function public function parseFloat(str:String
<http://livedocs.adobe.com/flex/2/langref/String.html> ):Number
<http://livedocs.adobe.com/flex/2/langref/Number.html>
Converts a string to a floating-point number. The function reads, or
parses, and returns the numbers in a string until it reaches a character
that is not a part of the initial number. If the string does not begin
with a number that can be parsed, parseFloat() returns NaN. White space
preceding valid integers is ignored, as are trailing nonnumeric
characters.
Parameters
str:String <http://livedocs.adobe.com/flex/2/langref/String.html>  —
The string to read and convert to a floating-point number.   Returns
Number <http://livedocs.adobe.com/flex/2/langref/Number.html>  —
A number or NaN (not a number).

So the differnce is that (as was posted here before) parseFloat tries
'harder' to return a Number than Number() does.

--Johan

--- In flexcoders@yahoogroups.com, "reflexactions" <[EMAIL PROTECTED]>
wrote:
>
> Yeah I did exactly that already, even before asking the question.
> I was just asking the question of a larger group to see if there was
> something I might have missed before committing to overriding a
> function in an Adobe class that was just doing Number(string) :)
>
> It easy to write a test and then find out later there is some
> situation you overlooked that then invalidates your original small
> test.
>
>
> --- In flexcoders@yahoogroups.com, "johantrax" johan.temmerman@
> wrote:
> >
> > Well, sometimes to discover you ought to try ;)
> >
> > I built you a little sample-application showing the results of
> > parseFloat and Number() (and 'as Number', which gives, lets say
> > 'predictable', results when used on a String)
> >
> > 
> > http://www.adobe.com/2006/mxml";
> >  creationComplete="showNumbers()"
> > >
> >  
> >   
> >  
> >
> >  
> > 
> >
> > --Johan
> >
> >
> > --- In flexcoders@yahoogroups.com, "reflexactions" 
> > wrote:
> > >
> > > Thanks anyway for the reply, though I wasnt really asking what
> the
> > > difference is between Number and parseFloat I was asking more
> > > specifically about the difference between Number and parseFloats
> > > string parsing capabilities.
> >
>



[flexcoders] Re: switching states and binding

2007-10-31 Thread johantrax
No difference using data.

I solved it by explicitly setting the property in the
revertState()-function:
this.imgURL = this.editImage.text;

I assume the edit-view could hold it's altered value because, when
altering it's value, only the text/data-value for the textfield is
changed, and due to the curly braces not pushed back to the variable
imgURL.
So when going back into the edit-view, it's value is displayed rather
than the value of imgURL, since imgURL never got changed, it doesn't
push it's changes...
(hmmm... rereading this, seems like a messy explanation, but can't
find better words for now)

--Johan

--- In flexcoders@yahoogroups.com, "Edward Yakop" <[EMAIL PROTECTED]>
wrote:
>
> > Can anyone clarify this behaviour out for me, because I don't see
> > where the altered value can be saved, except for the variable imgURL.
> > But if that is the case, then why isn't the text-view updated?
> 
> Have you try to use [data="{imgURL}"] instead of [text={imgURL}]?
> 
> Regards,
> Edward Yakop
>




[flexcoders] Hold execution untill result from database

2007-10-31 Thread johantrax
Hi all (again... I'm having a productive day ;) )

I'm trying to lift the creation of components to a new level (at
least, for me)
What I have: (if it is possible...)
1.
I have an .AS-class which describes a person. To keep it simple, the
person only has a name(String) and a photo(String - the URI).
2.
A/ I have a databasetable with the following structure
ObjectClass | propertyName | renderType
B/ Another database table as follows
renderType | bindPropertyName
3.
I have an AS-class(UICF) in my own lib, having following method
public static getUIComponent(object:Object, objectClass:Class,
propertyName:String, propertyType:Class):UIComponent
4.
I have a canvas

What should happen:
In the creationComplete of the canvas(4) a new Person is created:
var p:Person = new Person("Foo", "images/bar.jpg");
Now the canvas(4) calls the getUIComponent(3) for rendering the image:
var c:UIComponent = UICF.getUIComponent(p, Person, "photo",
String);
The method(3) returns the correct component, being an imagecomponent
and the canvas(4) just adds it to it's children:
this.addChild(c);

The problem is inside getUIComponent(3). This method should do a call
to my database to find out which type of component it should create
and which property to set. For this example, the db would look like this:
First Table
ObjectClass | propertyName | renderType
   Personphoto Image
Second Table
renderType | bindPropertyName
  Image  source

However, if I recall correctly, all database requests made by Flex are
Asynchronous. One option I see, is to have a boolean which gets sets
by a resulthandler, and create a lock-up-loop in getUIComponent.
However there might just be another (better?) way, to wait for my
response and then create and return the correct component.

Thanks in advance,
--Johan



[flexcoders] Re: Hold execution untill result from database

2007-11-01 Thread johantrax
Nope, I was aiming for pure Flex actually.
Currently I'm still at Flex2, if needed a change to Flex3-beta can be
made.

--Johan

--- In flexcoders@yahoogroups.com, "Mike Krotscheck" <[EMAIL PROTECTED]>
wrote:
>
> I assume you're talking AIR rather than true Flex, right? Synchronous
> database queries were added in beta 2.
> 
>  
> 
> Michael Krotscheck
> 
> Senior Developer
> 
>  
> RESOURCE INTERACTIVE
> 
> <http://www.resource.com/> www.resource.com <http://www.resource.com> 
> 
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
> 
> 
> 
> This email and any of its attachments may contain Resource Interactive
> proprietary information, which is privileged, confidential and may be
> subject to copyright or other intellectual property rights belonging to
> Resource Interactive. This email is intended solely for the use of the
> individual or entity to which it is addressed. If you are not the
> intended recipient of this email, you are hereby notified that any
> dissemination, distribution, copying or action taken in relation to the
> contents of and attachments to this email is strictly prohibited and may
> be unlawful. If you have received this email in error, please notify the
> sender immediately and permanently delete the original and any copy of
> this email and any printout.
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of johantrax
> Sent: Wednesday, October 31, 2007 12:25 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Hold execution untill result from database
> 
>  
> 
> Hi all (again... I'm having a productive day ;) )
> 
> I'm trying to lift the creation of components to a new level (at
> least, for me)
> What I have: (if it is possible...)
> 1.
> I have an .AS-class which describes a person. To keep it simple, the
> person only has a name(String) and a photo(String - the URI).
> 2.
> A/ I have a databasetable with the following structure
> ObjectClass | propertyName | renderType
> B/ Another database table as follows
> renderType | bindPropertyName
> 3.
> I have an AS-class(UICF) in my own lib, having following method
> public static getUIComponent(object:Object, objectClass:Class,
> propertyName:String, propertyType:Class):UIComponent
> 4.
> I have a canvas
> 
> What should happen:
> In the creationComplete of the canvas(4) a new Person is created:
> var p:Person = new Person("Foo", "images/bar.jpg");
> Now the canvas(4) calls the getUIComponent(3) for rendering the image:
> var c:UIComponent = UICF.getUIComponent(p, Person, "photo",
> String);
> The method(3) returns the correct component, being an imagecomponent
> and the canvas(4) just adds it to it's children:
> this.addChild(c);
> 
> The problem is inside getUIComponent(3). This method should do a call
> to my database to find out which type of component it should create
> and which property to set. For this example, the db would look like
> this:
> First Table
> ObjectClass | propertyName | renderType
> Person photo Image
> Second Table
> renderType | bindPropertyName
> Image source
> 
> However, if I recall correctly, all database requests made by Flex are
> Asynchronous. One option I see, is to have a boolean which gets sets
> by a resulthandler, and create a lock-up-loop in getUIComponent.
> However there might just be another (better?) way, to wait for my
> response and then create and return the correct component.
> 
> Thanks in advance,
> --Johan
>




[flexcoders] Re: Hold execution untill result from database

2007-11-01 Thread johantrax
I doubt this to work correctly.
This most propably will work if I only have to make 1 request to a db,
however if the canvas makes 3 calls to the getUIComponent-method (for
instantiating 3 children), how will I know which call will take the
longest ?

--Johan

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Perhaps set creationPolicy="none", then trigger a call to
> createChildren() from the resultHandler.
> 
> Tracy
> 




[flexcoders] Re: Hold execution untill result from database

2007-11-01 Thread johantrax
I think this is rather what I was doing,

The canvas raises the creationComplete-event and contains info about
what children should be instantiated.
Then this canvas requests that instance by calling getUIComponent().
This static method is part of a class called UIComponentFactory, a
part of my lib.
It is UIComponentFactory that connects to a Java-service (I'm thinking
RPC would be fit here) and the Java-class that connects with the db,
and sends the result back to UICF.getUIComponent(). At that moment,
the method instantiates the component and returns it to it's caller
(in this case the canvas).

However, if I have a slow db, my user will see a canvas with some
hardcoded parts on, that then gradually updates itself to it's final
form (as the resulthandlers are getting invoked). Instead of not
seeing anything, and then a complete canvas...

--Johan

--- In flexcoders@yahoogroups.com, "Paul Andrews" <[EMAIL PROTECTED]> wrote:
>
> I'm not sure having a visual component doing database calls is a good 
> architecture, though I haven't really gone through your code.
> 
> In an MVC architecture the UI should raise an event. The model should 
> recognise the event, initiate the DB transfer, on transfer complete
you can 
> raise another event to alert the GUI to update itself or just bind
to the 
> model.
> 
> I suspect that in your case, the canvas should not be responding to
creation 
> complete by trying to initiate the creation of the person for
display. On 
> creation complete, you should ask the model to fetch a person. The
model 
> should then initiate the DB transfer and handle the asynchronous
completion 
> event. On completion, it can either update part of the model with
the person 
> data (and use binding from the GUI to update the display), or raise
an event 
> to alert the GUI to update itself and create the visual for the person.
> 
> Paul




[flexcoders] Re: Progress Bar Item Renderer

2007-11-12 Thread johantrax
The source-property is bindable, though as stated in the docs:
"Refers to the control that the ProgressBar is measuring the progress
of. Use this property only in event and polled mode. A typical usage
is to set this property to a Loader control."

Since you set your mode to manual, the source-property will be ignored
 and as a consequence, the binding won't be executed.

When using 'manual' you could try using the setter method, again from
the docs:
"public function setProgress(value:Number, total:Number):void
Sets the state of the bar to reflect the amount of progress made
when using manual mode. The value argument is assigned to the value
property and the maximum argument is assigned to the maximum property.
The minimum property is not altered."

When needed for binding, take a look at BindingUtils.bindSetter

--jeetee

--- In flexcoders@yahoogroups.com, "triggersoftware" <[EMAIL PROTECTED]>
wrote:
>
> I'm trying to create a progress bar item renderer, but I can't get the
> value of progress bar to bind:
> 
>  
>   
>   
>  
> 
>text="{data.percentageComplete}"/>
>width="100%"
> mode="manual" source="{data.percentageComplete}"/>
> 
>   
>   
>   
>   
> 
> You don't appear to be able to bind the value using source.  What am I
> doing wrong?
>




[flexcoders] Re: Progress Bar Item Renderer

2007-11-12 Thread johantrax
Seems to me that Flex doesn't like scripts anywhere but in the root of
a document. I do not have any experience with item-renderers, nor do I
have with loaders, but this is my guess:

If you create the ItemRenderer as a custom mxml-component, then you
should be able to set a script-block in this file.

Again this is just my wild thinking, but I hope that with it, you, or
others in here, might get to a working example.

Good luck,
--jeetee

--- In flexcoders@yahoogroups.com, "triggersoftware" <[EMAIL PROTECTED]>
wrote:
>
> > When using 'manual' you could try using the setter method, again
> from the docs...
> 
> I've tried doing this but Flex doesn't like having script blocks in
> the item renderer.
> 
> > When needed for binding, take a look at BindingUtils.bindSetter
> 
> I don't know what to do with this as I can't get into a 

[flexcoders] Date(String) vs 'String as Date' | DateField

2007-11-12 Thread johantrax
Hi all,

Currently I'm working with a custom DateField, being a canvas with 2
states: "text" and "insert", and a public bindable property value:Date

the component:

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

 
 .vet { font-weight: bold; }
 

 
 
 


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 




Now in my app (simplified for this example)  I have 2 instances of this
component, one in inputState (id = in) and one in textState (id = view).
Next to them is a button which click-function is as follows:
public function setFilterText():void
{
 if (in.value as String == "")
 in.value = "(none)";
 view.value = in.value;
 //empty input
 in.value = null;
 }
}

Somehow this doesn't work, at all. Neither the value is passed on, nor
the inputDateField is set blank again.
Any thoughts?

--jeetee



[flexcoders] Re: Date(String) vs 'String as Date' | DateField

2007-11-12 Thread johantrax
--- In flexcoders@yahoogroups.com, "johantrax" <[EMAIL PROTECTED]>
wrote:
>
> Hi all,
> 
> Currently I'm working with a custom DateField, being a canvas with 2
> states: "text" and "insert", and a public bindable property value:Date
> 
> the component:
> 
> http://www.adobe.com/2006/mxml";
>  currentState="text"
>  creationComplete="init()"
> >
> 
>  
>  .vet { font-weight: bold; }
>  
> 
>  
>  
>  
> 
> 
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>   editable="true" formatString="DD/MM/" firstDayOfWeek="1" />
>  
>  
>  
>  
> 
> 
> 
> 
> Now in my app (simplified for this example)  I have 2 instances of this
> component, one in inputState (id = in) and one in textState (id = view).
> Next to them is a button which click-function is as follows:
> public function setFilterText():void
> {
>  if (in.value as String == "")
>  in.value = "(none)";
>  view.value = in.value;
>  //empty input
>  in.value = null;
>  }
> }
> 
> Somehow this doesn't work, at all. Neither the value is passed on, nor
> the inputDateField is set blank again.
> Any thoughts?
> 
> --jeetee
>
posted too soon:
Above gives following warning:
Date(x) behaves the same as new Date().toString(). To cast a value to
type Date use "x as Date" instead of Date(x).

However I do get the dateString of todays date upon loading (after
spamming errors about the failed conversion)

But when changing the bindsetter to us (arg as Date), as suggested by
the warning, both errors and result are gone :(

--Johan



[flexcoders] Re: RightClick Event

2007-11-12 Thread johantrax
Well, if I recall correctly, the right-click-event doesn't exist in
Flash. 

However you can alter the contextMenu.customItems (Array) of a
component at any time, being even when it's not visible. And you can
even use data-binding on it's items.

Good luck,
--jeetee

--- In flexcoders@yahoogroups.com, "toofah_gm" <[EMAIL PROTECTED]> wrote:
>
> Did anyone see this post?  Is there really no trigger to use?
> 
> 
> --- In flexcoders@yahoogroups.com, "toofah_gm"  wrote:
> >
> > Is there an event that I can use to know that the ContextMenu is about
> > to pop up when the user Right Clicks?  I would like to run some code
> > to enable/disable some of my custom context menu items.
> > 
> > Thanks!
> > 
> > Gary
> >
>




[flexcoders] Re: Code for preventing browser caching of SWF

2007-11-13 Thread johantrax
I used to be rather good in js, and I think i found your solution.
In AC_OETags.js, the function AC_GetArgs, change the following (line 200):

  case "src":
  case "movie": 
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
to this
  case "src":
  case "movie": 
args[i+1] = AC_AddExtension(args[i+1], ext) + '?build=' + (new
Date()).getTime();
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;


The new Date() creates a date-object of the current moment and
getTime() return the milliseconds for that date since 1/1/1970 (GMT)

Hope it works,
--jeetee

--- In flexcoders@yahoogroups.com, Darren Houle <[EMAIL PROTECTED]> wrote:
>
> 
> I'm trying to stop the client's browser from caching my flex app swf
so that each time they call the html wrapper they get the latest swf.
>  
> I've found some suggestions out there for accomplishing this, and I
think adding the "myapp.swf?build=12341234" (some timestamp) solution
looks cleanest, but I was wondering...
>  
> Has anyone modified their index.template.html wrapper so that each
time you compile your app it auto-generates and appends that random
(or time based) number like this?  Anyone know if there's an example
out there I can look at?  It would be nice if this was automatic and I
didn't have to implant a new number in the wrapper each time by hand.
>  
> Thanks
> Darren
>




[flexcoders] Re: PopUpManager.removePopUp Not Removing Modal Overlay

2007-11-15 Thread johantrax
Sounds like there could be an error|nullreference|illegal thing
somewhere in the closeHandler of your TitleWindow..

It's a bit like using Alert.show(nullobject.property), which will lay
over the modal part, but won't show the Alert.

--jeetee

--- In flexcoders@yahoogroups.com, "bryanpoopbartow" <[EMAIL PROTECTED]>
wrote:
>
> I'm using Flex 3 Beta 2. compiling against 2.0.1 Hotfix 3.  Created
a custom component 
> extending TitleWindow.  Using PopUpManager to show it.  It works as
expected.  However, 
> when calling PopUpManager.removePopUp the component itself is
removed, while the modal 
> overlay stays intact.  I can not interact with the application in
any way.  I can't get the modal 
> overlay to go away.  Has anyone experienced this or have any ideas
why it might be 
> happening?  I should say that I've used this component in other apps
with no problems 
> whatsoever.
>




[flexcoders] Re: how do I freeze the users actions while data is loading

2007-11-15 Thread johantrax
How about creating a little popup that shows 'Loading..' ?
Then let it close by the resulthandler.

--jeetee

--- In flexcoders@yahoogroups.com, "Mark" <[EMAIL PROTECTED]> wrote:
>
> I have a web service that's getting data to fill comboBoxes  then
the "real" data.  This takes a 
> few seconds.  I'm using the showBusyCursor on the service, but the
user can actually still 
> click buttons.  Is there a way to blur the screen out during this
time like when using a pop-
> up window?
> 
> Thanks,
> Mark
>




[flexcoders] Re: Context menu in flex

2007-11-17 Thread johantrax
A little examplecode:
<>
//creates a new entry in the contextMenu
// which is handled by the (self-written) function doMyCommand(Event)
var myCMI:ContextMenuItem;
myCMI = new ContextMenuItem("myMenuCommand");
myCMI.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doMyCommand);
this.treeComponentID.contextMenu.customItems.push(myCMI);
<>

Check the livedocs for ContextMenu(Item) to disable most of the
built-in items. Also, keep in mind that your menuItem can't be named
the same as one of the Items used by the Flashplayer (like: copy,
delete, ...)

--jeetee

--- In flexcoders@yahoogroups.com, "yourName" <[EMAIL PROTECTED]> wrote:
>
> Hi iam new to this group and working with flex about one month.
> I want to add custom contex menu in tree component any one can help
me or can send a code sample can i display  popup menu when some one
right clicks on my tree menu.
> Thanks in advance
>




[flexcoders] Re: Viewstack problems

2007-11-19 Thread johantrax
First lets explain the problem:
A viewstack normally doesn't create all it's children, but only the
visible ones. This has been done in an ateempt to minimize the
startuptime of your application.

Possible solution:
1. Ask yourself if you really need to write data on something that is
not visible. It's not like someone is going to notice it...
Try if you could use the initialize/show-events of the child itself to
do this.
2. If you can't delegate the writing, and you do have to write to an
invisible component. Do as Josh suggested and set the creationPlicy of
the viewstack and its children to "all". This should let the viewstack
create it's children, even if they're not visible.

--jeetee

--- In flexcoders@yahoogroups.com, "Rafael Faria"
<[EMAIL PROTECTED]> wrote:
>
> Hello all,
> 
> I'm having a big trouble with a viewstack.
> 
> I have this code
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
> and an init actionscript which i'm just trying to trace the elements
> to see what happens and ends up getting null for some elements that i
> need to work with.
> 
> private function init():void {
> trace(step1); // return the object
> trace(step1_1); // return the object
> trace(step1_2); // return the object
> trace(step2); // return the object
> trace(step2_1); // return NULL
> trace(step2_2);  // return NULL
> trace(step3) // return the object
> trace(step3_1); // return NULL
> trace(step3_2); // return NULL
> }
> 
> The problem is that i really need to work with the canvas on the
> initialization. I can write dynamically on the canvas (step2 and
> step3) but weirdly i can't get the objects inside them.
> 
> Any guru to help me out with that?! 
> 
> Raf
>




[flexcoders] adding children: best practices

2007-11-26 Thread johantrax
Hi all,

I have some components that dynamically generate their children.
However I'm wondering what would be the best practice for this, or
which method you prefer and why.

Currently I'm down to 2 methods:
1. creating/adding the childcomponents in an initialize handler,
bindings get executed in a creationCompleteHandler except when they
influence the layout (like the width/height of a datagrid)

2. overriding the createChildren-method, again most binding go into
the creationCompleteHandler()

Appreciate every opinion,
--jeetee



[flexcoders] string to date, no support for european dates ?

2007-11-27 Thread johantrax
Hi,

I'm writing a custom DateValidator (subclassing it in AS) which adds 2
properties to the existing one: minDate:Date and maxDate:Date

What I'd like to do is compare the dates to see if the inputted date
is within the correct range. However, I can't tell which inputFormat
f.e. a DateField will have, since it is configurable through it's
formatString-property.
I have some problems with parsing this value (of the DateField) back
to a date, since Date.parse() doesn't support the format "DD/MM/"

I'd like to know if there is a parse-method in which we can provide
the format of the string as a parameter, sth like
Date.parse(value:String, format:String = null)
would be wonderful

This validator is to be used in form where a user can input a start-
and enddate, and to check if startdate=

[flexcoders] Re: string to date, no support for european dates ?

2007-11-27 Thread johantrax
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]>
wrote:
>
> 
> Why are you manipulating the String of a DateField, and not the Date ?
> 

Hi Tom,

This is because the call to super.doValidation(value) needs a string
as parameter, using the date gives the following validationError:
"Please enter a year between 0 and "
And this is for a date picked with the DateChooser of the control...

I also noticed that the DateField.data-property doesn't seem to be
altered at all whether typing or selecting a new date.

--Johan



[flexcoders] Re: getElement from scope

2007-11-28 Thread johantrax
> Like if i create a  to work with it on the
> actionscript just use foo.text = 'bla' for example.
>
The reason you can access foo in your AS here is because when you
define an mxml-tag, it basically becomes a public, bindable property
of that class. So if you want the same in AS it's sth like:
  [Bindable]
  public var foo:TextInput;

> So, looking at this code and suppose that you CAN NOT change not one
> line of this code, how do i work with "foo" in the myTimer function?
If we CAN NOT change the code, there's no way to work with 'foo' in
myTimer function (however as you pointed out yourself, you can test on
the last part of childName of the last canvas to see if it matches the
name of 'foo').
This is because you've declared foo inside the init-funtion, therefore
it doesn't 'exists' out of the scope of that function.

> The thing is i'm creating a lot of forms dynamically
Great :) So do I, and I stumbled on a likewise problem. Not being able
to reference the created objects.
Even if you think to outsmart Flex and do like JJain said
(object.id='myId'), the object won't be accessible by the use of that
ID. The reason is that Flex/Flash generates the id of a generated
object itself.
There is a clean workaround for this problem using a Dictionary with
the id's as keys and the objects as values. You can find an
explanation about this method here:
http://www.jumpingbean.co.za/blogs/mark/flex_reference_components_dynamic_runtime_creation

--Johan




[flexcoders] Re: string to date, no support for european dates ?

2007-11-28 Thread johantrax
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]>
wrote:
>
> DateField.*date* not DateField.*data*
> 
Tom, would be nice to use *date*, only.. this isn't a property of the
DateField...
There is however the property selectedDate, but as stated in the docs:
"Date as selected in the DateChooser control."

So that doesn't apply for a manually entered date.
To be sure the problems are not part of my components, I created this
little testcase:




Which bumps up the 'This field is required'-error, even after
selecting a date with the DateChooser and focussing out.

I have the feeling, we're still far from home...

--Johan




[flexcoders] Re: string to date, no support for european dates ?

2007-11-28 Thread johantrax
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]>
wrote:
>
> If you *must* allow users to type in the box, you want to parse the
String 
> into a real Date (once the control loses focus) then assign that
Date back to 
> the control, before calling your validation - assuming the string
parses.
> You could use the DateUtil class from
http://falkensweb.com/other.html for 
> instance.
> 

Thanks for the link, that one was exactly what I was looking for.
Think this should be filed as a bug/feature request ?

--Johan



[flexcoders] Re: getElement from scope

2007-11-29 Thread johantrax
Hi Raf,

item.modelns::name.text(); is a way of accessing the variable
name.text() in another namespace (item.modelns). This is far more
complicated than it needs to be.

An example:
___
components/Example.mxml
---

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

  

  


_
main.mxml
-

http://www.adobe.com/2006/mxml";
  xmlns:cc="components.*" creationComplete="cComplete()">

  

  
  
  


---
So once you create/add a child in your own component, you add it to
the dictionary as follows:
generatedChildren["childID"] = child;
Then, in any other part you can just use generatedChildren["childID"]
to retrieve the object assigned to it.

Hope this helps,
--Johan

P.S. Note that the example is invented while writing this post, so
untested and maybe with typo's and such, however I believe this should
work ;)

--- In flexcoders@yahoogroups.com, "Rafael Faria"
<[EMAIL PROTECTED]> wrote:
>
> The other thing is that i create all the elements on a formitem
> and a form before add to the stage 

> > I will try to work with the dictionary as well but i was
> > hopping you could explain me what does
> >item.modelns::name.text(); 
> > mentioned on the article means.
> > 
> > thanks
> > raf
> > 



[flexcoders] Re: string to date, no support for european dates ?

2007-11-29 Thread johantrax
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]>
wrote:
>
> As soon as Flex 3 is open sourced, I'll be submitting the code for
inclusion 
> myself, as a replacement for the current Date.parse() :-)
>

Just be sure to alter the endOfDay-function to this one:
/**
* Return the date with (non-UTC) time set to 23:59:59.999
*/
public static function endOfDay(h:Date):Date
{
h.seconds = 59;
h.hours = 23;
h.minutes = 59;
h.milliseconds = 999;
return h;
}

instead of 23:23:23.59

--Johan



[flexcoders] Re: Flex Calendar...

2007-11-29 Thread johantrax
I don't see much of an 'attached image', but the things you mention
can be achieved by extending/subclassing the standard datechooser.
However I don't have the impression that what you want to achieve is
something that will go easily, considering being new as a Flex-developper.

If you're into calendarstuff, I'd say, check out the component Ely
Greenfield started:
http://demo.quietlyscheming.com/calendar/app.html
and the newer version by Jove Shi:
http://www.flex-flex.net/flex/Calendar/Calendar.html

Also, the Sheduling Framework on labs has some interesting stuff,
although maybe not as much related to what you wish to achieve.

--Johan

--- In flexcoders@yahoogroups.com, "vivek" <[EMAIL PROTECTED]> wrote:
>
> Hi Guys,
> I am new in developing flex applications. I was just wondering whether
> is it possible to customize the datechooser component. Basically i
> would like the datechooser to be exactly same as the image i have
> attached i.e. no toggle forward and backward button instead of it when
> we click on month all the months get displayed where the dates are
> shown and when the year is clicked, years would be displayed (where
> the dates are displayed) with a back and forward to toggle between
years.
> 
> Thanks in Advance.
>




[flexcoders] Re: Can VBoxes in an Accordion be of variable height?

2007-12-04 Thread johantrax
Setting resizeToContent="true" on the accordiontag might get you there.
I do believe this means you have to set the width for each direct
child of the accorion explicitly, otherwise the accordion will
shrink/grow horizontally too.

--Johan

--- In flexcoders@yahoogroups.com, justSteve <[EMAIL PROTECTED]> wrote:
> 
> Ideally, each accordion body would size itself to the height of the
> text for the given record. Possible?
> 
> thx
>



[flexcoders] Re: Probleme Upload File de flex vers PHP

2007-12-05 Thread johantrax
--- In flexcoders@yahoogroups.com, "exuperok" <[EMAIL PROTECTED]> wrote:
>
>  Hello How should understand this trace when uploading file to php
> application:
> 
> what does eventPase = 2 means? same thing for bubbles=false?

bubbles = false means the event doesn't 'bubble'
eventPhase = 2 means the event is in the target-phase
Both properties can be found in the language reference of Event
http://livedocs.adobe.com/flex/2/langref/flash/events/Event.html

To actually get a grasp of what they mean, check this chapter of the
livedocs:
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0462.html

--Johan



[flexcoders] Re: Binding to a ViewStack Child Container Property

2007-12-06 Thread johantrax
--- In flexcoders@yahoogroups.com, "tedgies" <[EMAIL PROTECTED]> wrote:
>
> Jeez, what happened?  I've never been cutoff when posting to a 
> newsgroup before!
>
Just seems like a misunderstanding both ways. Your first post only
stated you were trying, not that it didn't work...
And the 'And?' from Tom was his short way of asking for more info ;)

Now, back to the problem
> I'm trying to bind a label's text to a viewStack's selected VBox 
> toolTip.  I have specified each toolTip within VBox components 
> themselves.
> 
In the docs is stated that toolTip is a bindable String, so I'm
thinking on the not-yet-initialized track.

Since you're working with a viewStack, are you sure you're accessing
data that exists? I am tempted to think so, since you're using the
selectedChild-property, but can you confirm this through the debugger?
(Maybe there's some stuff going on that needs callLater()...)

--Johan



[flexcoders] RegExpValidator

2007-12-06 Thread johantrax
Hi all,

I'd like to validate some textfields to match on alphabetic input and
whitespace only, which brought me to the RegExpValidator. (Rather long
post, please bear with me)

First of all: I'm no big hero in regular expressions. I mostly can read
one when I see one, but that's about it.
So I figured I could use the sample of the language reference to test
out my own expression (link:
http://livedocs.adobe.com/flex/2/langref/mx/validators/RegExpValidator.h\
tml#includeExamplesSummary)
The expression I came up with:
/[a-zA-Z\s]/
But as i soon discovered this only covers 1 char, not a whole input. I
moved onto /[a-zA-Z\s]*/
However... putting that expression into the sample (input = 'abcd
EFGH9023') made it lock up ("Warning: a script has been...)
Similary /[a-zA-Z\s]?/ also leads to a lockup

/[a-zA-Z\s]+/ on the other hand doesn't lock the app up, and works..
partially...
With the given input this doesn't return INVALID, but gives a valid
match upon 'abcd EFGH'.

Since I couldn't find a property/method to let RegExpValidator match
only on the complete input, I resorted to my own sample, which is as
follows:


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


 









The idea is to catch the result of the validation, check if the match
was on the complete inputstring, and if not, replace the
validationResultEvent with one that does return invalid and thus matches
my needs.

However, this doesn't seem to be working at all.
When the input is empty, I'm getting a nullreference (probably from
event.target.text, understandable, fixable).
I have 3 more scenarios:

1. inserting a correct value: 'valid' is alerted, so this seems to be
working fine
2. inserting a completly wrong value ('123'): 'partially valid' is
alerted, which should be (imo) "impossible" given the normal behaviour
and matching of this regexpvalidator. This behaviour is not expected, as
the same input in the sample of the developers guide does return
invalid...
3. inserting a mixed value: 'partially valid' is alerted, as it
should. But the newly created event holding an error doesn't seem to be
dispatched/applied to the inputfield

I'm totally open for any suggestion,
--Johan



[flexcoders] Re: RegExpValidator

2007-12-06 Thread johantrax
Kill me, shoot me, whatever ;)

Just found out the correct expression to use..

^[a-zA-Z\s]*$

will match alphanumeric (no special chars) and whitspace only

--Johan



[flexcoders] Re: RegExpValidator

2007-12-06 Thread johantrax
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]>
wrote:
>
> On Thursday 06 Dec 2007, johantrax wrote:
> > ^[a-zA-Z\s]*$
> > will match alphanumeric (no special chars) and whitspace only
> 
> No, just alpha ?
> ^[a-zA-Z0-9\s]*$
> would be alphanumeric and whitespace.
> 
Got it, copied it wrong :)



[flexcoders] Flex Builder 3 public beta 3 on Labs

2007-12-13 Thread johantrax
http://labs.adobe.com/technologies/flex/flexbuilder3/

Be sure to uninstall beta2 before installing beta3! (and also, read
the release notes ;) )

--Johan



[flexcoders] Debug::warning: multiple describeType entries for ...

2007-12-17 Thread johantrax
Hi all,

I'm creating a custom component in mxml, and discovered a warning
while I was debugging (due to sth else). What followed was a
stripped-down testcase to reproduce the warning, which seems to be
successfull. But I can't get my head around how to get rid of this
warning:

warning: multiple describeType entries for 'selectedItem' on type
'mx.controls::ComboBox': (full message follows)

The warning shows up as soon as i use a bindSetter expression on
'selectedItem' of the combobox. Also, the both results of describeType
given seem to be identical...

Thanks in advance,
Johan

---
mxml
---

http://www.adobe.com/2006/mxml";
xmlns:cc="components.*"
creationComplete="cComplete();">











---
Debug - console
---
warning: multiple describeType entries for 'selectedItem' on type
'mx.controls::ComboBox':

  

  
  

  
  

  
  

  
  

  


  

  
  

  
  

  
  

  
  

  





[flexcoders] Re: Force DataGrid item to update style

2007-12-17 Thread johantrax
--- In flexcoders@yahoogroups.com, "m.frigge" <[EMAIL PROTECTED]> wrote:
>
> Hey there,
> 
> i found some nice examples for an itemRenderer here
>
 tml>  .
> I tried to use one of them for an app i am developing.
> In my case i need the colum's style to change when i select it, but you
> can only see the changes, after selecting another item. How can i force
> the item to update its style immediately?
> 
> Here    is an
> example with ViewSource enabled.
> 
> Cheers, Max
>

Call invalidateDisplayList of the component?
docs:
http://livedocs.adobe.com/flex/2/langref/mx/core/UIComponent.html#invalidateDisplayList()

--Johan



[flexcoders] Re: Flex <> JavaFX <> Sliverlight <> Flash

2007-12-18 Thread johantrax
It depends, languages and technologies are tools: use the right one
for the right job.

So starting at the beginning: Do you want to develop a web-app or a
desktop application? Given your own suggestions I assume you are
familiar with creating a Java-backend.

First I'll start by ruling out Flash: Yes, you 'can' make an
application with Flash, but it doesn't seems easy to me. I believe
Flash is more about animation/look-n-feel. What you easily CAN do, is
create assets in Flash, and use them for Flex-components.

I can't help you with Silverlight, it's a big black box to me. Which
at it's release seemed wanting to conquer the Flash(?Flex)-world, but
just lacks the years of experience for it.

Next Up is 'Standard Webpages'. It's hard to know what you define as
'standard webpages', but if that includes to be not entirely static
pages, serverside controlled (maybe even some AJAX thrown in), and
you're familiar with that, then why not? However, it's just another
WebInterface, sure you can do amazing stuff with this, but try getting
it working on each browser(version)...

The Java-GUI-side: you mention JavaFX or Swing-based(fat) clients.
First of all, if you're going for a webapp: drop it. Only 4 letters
apply there: s-l-o-w. (Before the Java-community shoots me: yes, the
speed of Java Web Start has increased astonishing, but please, compare
it to flexApps...)
However if you're going for a desktop-Application, then yeah, go for
JavaFX. Being a Swing/Awt-wrapper, it allows you to fit in plain
Swing-code when you need it.
Do note that at this point JavaFX is only fully released as an
interpreted language. The compiled version is stable at milestone1,
but not yet good enough for a productionenvironment according to me.

Then there is Flex. When it's a webapp you want, and it has to look
and feel like you want, use it. It's not hard at all to grasp the
concept of how to develop a FlexApplication. The structure of the
language allows you to create anything you need.
Besides, with the recent release of BlazeDS, easy communication with
Java-backends just got free of charge.
And I must say, the community here is great ;)
Flex might require some new logical approach when you're used to
writing Java, since it's completely event-based, but untill now I have
found it worth the effort.


Also note that above is written out of personal experience (which is
not to be esteemed to high). Once again, use the tool which fits the
job best, and if you're tight on time use one you know or is easy to
learn (*subtile hint into Flex, after all this is the FlexCoders list*)

--Johan



[flexcoders] Re: Flex <> JavaFX <> Sliverlight <> Flash

2007-12-19 Thread johantrax
> What is the difference between an RIA desktop application (e.g. in
Flex) and
> a standard desktop application (e.g. Swing based) ?
A RIA is an application with as primary goal (well, second to primary:
working should always be the first goal) the user-experience.
RIA-development is all about making the interface comfortable, make
your user enjoy the use of it.

As for our company, it often starts out as a project with a 'standard'
UI. Which goes up to the UI-testers, and they provide, together with
one of our designers, a list of GUI-requirements.
Once in a while this requires adding some new services to the
back-end, but mostly it doesn't.
There is NO difference in the functionality of an app, RIA or not. It
'just' is about making the user leaving the application with a nice
feeling.

> It has no reason to be a web-app so we will rather go for a desktop
> application. (Or make it a web-app and lock the browser to benefit
from all the web technologies (e.g. RSS feeds, thin client) Does that
makes sense ?)

If you are thinking about this, AIR might be worth looking at. I have
no personal experience with this, but it should be an
extension/wrapper for FlexApplications, adding support for
communicating with the OS. Do keep in mind that AIR is not yet
supported on anything but Windows/Mac.

--Johan


--- In flexcoders@yahoogroups.com, debussy007 <[EMAIL PROTECTED]> wrote:
>
> 
> Thank you johan.
> 
> The back ends are based on Java webservices.
> It has no reason to be a web-app so we will rather go for a desktop
> application. (Or make it a web-app and lock the browser to benefit
from all
> the web technologies (e.g. RSS feeds, thin client) Does that makes
sense ?)
> But there is something I don't get:
> 
> What is the difference between an RIA desktop application (e.g. in
Flex) and
> a standard desktop application (e.g. Swing based) ?
> 
> Thank you.
>



[flexcoders] Re: const?

2007-12-20 Thread johantrax
I think you still pretty much get the concept of const.
It means the value of yyy cannot be changed after initialisation.

To actually see it used in methods like this.. I assume the example
you gave is a bit 'stripped down' :p
If I get it correctly, everything is ActionScript is passed by
reference, so to expand your example a bit:

function xxx() {
 const yyy:Number = 99;
 abc(yyy);
}
function abc(zzz:Number) {
 zzz *= 10;
}

Not big of an example, not even sure if it's correct. But when this is
done I assume an error will be thrown, saying that the assignment to
zzz in function abc is illegal for the argument yyy, being const.

However this is an assumption, based on how I used const in other
programming languages. I have no experience with it in AS

--Johan

--- In flexcoders@yahoogroups.com, "reflexactions" <[EMAIL PROTECTED]>
wrote:
>
> I thought I understood the meaning and use of const until
> 
> I saw Adobe use it inside methods...
> 
> function xxx(){
>  const yyy:Number=99
> }
> 
> What is the effect of that and what is the benefit?
> 
> tks
>




[flexcoders] Re: const?

2007-12-20 Thread johantrax
Then it's out of my league, perhaps someone from Adobe could help us
out? (subtile hint ;)


--- In flexcoders@yahoogroups.com, "reflexactions" <[EMAIL PROTECTED]>
wrote:
>
> Actually I wouldnt mind betting that code of yours would run without 
> any error at all, native types are passed by value not reference.
> 




[flexcoders] Re: const?

2007-12-20 Thread johantrax
> unless you have a split personality.

Well... it might be you just provided the answer there. When working
on a project having the size of Flex, you work in a team.
Most probably a short function is indeed written by one person. But
what guarantees that nobody else will one day pass by and alter your
functions? In the case of shared work, defining that variable as a
const is a much quicker way of telling others that it's a
marker/whatever, than having to put comment out there, saying:
//next is a variable
//I pray to you and the lord to not change it
// because it just holds some value I need to remember
var pleaseDoNotChangeMe:Number = 3.1415...;
// End of Prayer ;)

--Johan




[flexcoders] Re: FlexBuilder 3 Beta 2 charting and license

2007-12-20 Thread johantrax
As previously stated in this discussion:
It is expected behaviour, since beta3 is already configured for use
with FB3 licenses, not the ones from FB2.

Matt stated in another thread here that if you really are in a
position where you absolutely need the watermark to be removed during
this beta-period, you can mail him with a request off-list.

Link to post:
http://tech.groups.yahoo.com/group/flexcoders/message/96530

--Johan

--- In flexcoders@yahoogroups.com, "polestar11" <[EMAIL PROTECTED]> wrote:
>
> Hi there
> 
> We purchased FlexBuilder 2 with Charting & used the serial number for
> FlexBuilder 3. This removed the watermark.
> 
> Now we are running a later build version of FlexBuilder 3 and the
> watermark has re-appeared. Is there anything we can do to get rid of
this?
> 
> Cheers
> Tracy B
>