Re: [flexcoders] Clean way to filter very large ArrayCollection (in pieces) using filterFunction

2010-03-26 Thread Roman Protsiuk
I guess you can easily reset some sort of counter before refreshing
collection and then increment it from inside of filter function without
getting into internals.

Roman

http://kotopakhi.com

On Fri, Mar 26, 2010 at 5:18 AM, Baz li...@thinkloop.com wrote:



 Hello,

 I have a very large arraycollection that users can filter by typing
 characters into a search box. I use ArrayCollection's filterFunction to
 perform the filtering, but as the recordset grows, it (obviously) takes
 longer to filter and makes the interface less responsive.

 Is there a way to access/adjust the internals of filterFunction without
 having to roll my own or implement greenthreading? Similarly, is there a way
 to know how far into the filtering it is, for example to update a Number of
 Matched Records box that gets updated DURING the filtering process rather
 than jst at the end when it is done?

 Cheers,
 Baz
  



Re: [flexcoders] sending email from actionscript / flex REFdn6005077818

2010-03-08 Thread Roman Protsiuk
navigateToURL(mailto:f...@bar.com;);

R

On Mon, Mar 8, 2010 at 4:44 PM, dennis den...@anel.cc wrote:



  Hi, does any body knows how can we send emails from flex projects?

 (in order to implement a “send email” form)



 *dennis*

 ...*we are what we are doing*...  *P **Think! before you print.** *


  



Re: [flexcoders] Mapping Java Generics to an AS3 Vector through BlazeDS remoting?

2010-02-21 Thread Roman Protsiuk
You won't be able to get generic element type information during runtime so
what's the point?
The only likely approach I guess is generic serializer/deserializer. And
still I'm not sure whether vector element type information is
serialized/deserialized with vector or is it just a compile time information
unreachable during runtime.

Roman

On Sun, Feb 21, 2010 at 11:37 AM, Jochem van Dieten joch...@gmail.comwrote:



 ISTM the natural match between Java Generics and ActionScript is the
 Vector since it allows one to declare a type for the collection
 members. And apparently there are some performance gains to be had
 when using a Vector instead of an Array:

 http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3a0f5f19124318fc87b-7fff.html

 Does anybody have any tips on getting a Vector of objects out of a
 BlazeDS remoting call? I know I can convert an ArrayCollection to a
 Vector manually, but that does not seem like a terrible attractive
 option to me.

 Jochem

 --
 Jochem van Dieten
 http://jochem.vandieten.net/
  



Re: [flexcoders] Why most Flex Developer job ads ask now for Knowledge in Java??

2010-02-17 Thread Roman Protsiuk
As I see it Flex is often used to build data intensive and/or highly loaded
applications. Thus Java back end and requirement for Flex developers to
understand it.

Roman Protsiuk
Software Engineer/Engineering Team Lead

http://kotopakhi.com

Kyiv, Ukraine (GMT+2)
mobile: +38 097 321 56 54 email:
roman.prots...@gmail.com%3C/span%3eroman.prots...@gmail.com
 skype: roman.protsiuk
linkedin: http://www.linkedin.com/in/romanpv blogspot:
http://roma-ch.blogspot.com


On Wed, Feb 17, 2010 at 5:10 PM, fred44455 fred44...@yahoo.com wrote:



 Since this year you don't seems to be able to find a Job Offer in Flex
 without the requirement: Knowledge in Java, JEE2 etc.. required( Most job
 ads in Dice.com) Is that mean that now not only I need to learn Flex but
 also Java to be able to find a Flex Developer job??

  



Re: [flexcoders] Re: How to set color?

2010-01-25 Thread Roman Protsiuk
#ff is the CSS color format while 0xff is the hexadecimal number
format in ActionScript and this number can represent color value. The
problem with #ff is that it's not ActionScript.
There shouldn't be any problem if you use 0xff in AS or MXML and #ff
only in CSS.

Roman

On Mon, Jan 25, 2010 at 11:49 PM, markflex2007 markflex2...@yahoo.comwrote:



 I seems the color code have two format,what is the different?

 Thanks

 Mark

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 markflex2007 markflex2...@... wrote:
 
  Flex set color use 0xff or #ff.
 
  I confuse the two format,when I have to use 0xff and when I have to
 use #ff.
 
  Please help
 
  Thanks
 
  Mark
 

  



Re: [flexcoders] Get Notified if a Remoting Result event listener function *doesn't get called?

2009-11-09 Thread Roman Protsiuk
Hi Steve,

In the situation when there's no response from the server you'll eventually
get request timeout fault. It's just the matter of how long is this timeout
configured to be.

Roman Protsiuk
Software Engineer/Engineering Team Lead

http://under.in.ua

Kyiv, Ukraine (GMT+2)
mobile: +38 097 321 56 54 email:
roman.prots...@gmail.com%3C/span%3eroman.prots...@gmail.com
 skype: roman.protsiuk
linkedin: http://www.linkedin.com/in/romanpv blogspot:
http://roma-ch.blogspot.com
I

On Mon, Nov 9, 2009 at 8:48 PM, steveb805 quantumcheese...@gmail.comwrote:



 This sounds vague, but basically it's:

 My Zendamf remoting object has a
 fault=faultListener(event), which has an Alert.show statement.

 However, I noticed that when I'm on my laptop, and my Net connection is
 flakey, this happens:

 I create a new Item that then gets added to my List object successfully,
 and the next step is to add to the database on the Server-end, so I call:
 myRemote.addNewTask(tempTask);

 But there's no feedback , and although I see the new Item in my List this
 only means the Client side succeeds, but the DB save silently fails without
 a Fault event.

 I have a Result event set up, but the resultListener function never gets
 called.
 It's not like I can do this: if (!succeeds) then display fail, like
 you can on a normal php/mysql app.

 And I just want to avoid having to go the reverse logic route to resolve
 this: When the Result event gets called, do an Alert.show(). Don't want to
 have to click OK everytime it's successful. ;/

 Just wondering how anyone else handles this,
 Thanks,
 Steve

  



Re: [flexcoders] Double clicking on a LIST item

2009-10-31 Thread Roman Protsiuk
Quote from the docs:
To receive itemDoubleClick events, you must set the component's
doubleClickEnabled property to true.

Roman



On Sat, Oct 31, 2009 at 10:16 PM, steveb805 quantumcheese...@gmail.comwrote:



 Is there any reason that itemDoubleClick would not produce an event ?

 I'm trying this itemDoubleClick=evtHandler(event), but the function
 doesn't get called. The code for this list is below (but I don't have the
 itemdoubleclick in there now)

 (ProjectList is an *.as file that overrides List just so that I could have
 the custom event for the checkbox)

 mycomp:ProjectList
 labelField=name
 itemClick=OnItemClick(event)
 x=8 y=30
 width=263 height=313
 id=projectList
 itemRenderer=EditableTask
 dataProvider={projectListAC}
 clickTaskCheckBox=clickTaskCheckBoxHandler(event)/

 -Steve

  



Re: [flexcoders] Passing associative array to custom component

2009-10-18 Thread Roman Protsiuk
Try using Dictionary instead.

Roman Protsiuk
Software Engineer/Engineering Team Lead

http://under.in.ua

Kyiv, Ukraine (GMT+2)
mobile: +38 097 321 56 54 email:
roman.prots...@gmail.com%3C/span%3eroman.prots...@gmail.com
 skype: roman.protsiuk
linkedin: http://www.linkedin.com/in/romanpv blogspot:
http://roma-ch.blogspot.com


On Sun, Oct 18, 2009 at 1:43 AM, icepero icep...@yahoo.com wrote:



 I built a custom button component and it has a property that accepts an
 array of values. In the main.mxml file, how can I pass an array when
 defining the property?

 main.mxml has this button code:

 comp:updateButton
 id=update
 cubeName={_cubeName}
 viewName={_viewName}
 serverChartId={_serverChartId}
 titleDims=xxx
 enabled=false/

 for title dims, I tried:
 titleDims=[{Month: comboBox1.text, Year:comboBox2.text, Sales
 Order:comboBox3.text}]

 but I get a 1084: Syntax error: expecting rightparen before colon

 The keys will have spaces in them like 'Sales Order'

 How can I declare the array in mxml?

  



Re: [flexcoders] Re: Space in TextInput

2009-10-10 Thread Roman Protsiuk
Hi,

Take a look at the docs:
http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#restrict
For your case the solution might look like:
mx:TextInput restrict=^  /

Roman Protsiuk
Software Engineer/Engineering Team Lead

http://under.in.ua

Kyiv, Ukraine (GMT+2)
mobile: +38 097 321 56 54 email:
roman.prots...@gmail.com%3C/span%3eroman.prots...@gmail.com
 skype: roman.protsiuk
linkedin: http://www.linkedin.com/in/romanpv blogspot:
http://roma-ch.blogspot.com


On Sat, Oct 10, 2009 at 2:13 PM, Flex Boy ca...@brannsikring.no wrote:





 Hi mister..

 put all the characters taht are allowed in the restrict parameter

 if you use it as in Flex Doc. The following code allows the user to enter
 only uppercase letters (and not numbers or special characters) in the text
 field:
 A-Z , so if you are only restriting the Space you have to put in the whole
 alfabet and the numbers and special characters

 mx:TextInput restrict=aAbBcC0123456789 /


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, yogesh
 patel mailtoyogeshpa...@... wrote:
 
  Hi,
  I have textInput ,i do not want to allow space in this textinput-
 i dont want space,how to do this?
 
 
 
  Thanks  Regards,
  Yogesh Patel
 
 
 
  Connect more, do more and share more with Yahoo! India Mail. Learn more.
 http://in.overview.mail.yahoo.com/
 

  



Re: [flexcoders] Data binding inside Repeater?

2009-08-14 Thread Roman Protsiuk
And what if Object would not be generic Object but rather class
DataProviderContainer { [Bindable]public var dataProvider:ArrayCollection;}
I assume your dynamic property dataProvider on Object is not bindable.

Roman Protsiuk
Software Engineer/Engineering Team Lead

http://under.in.ua

Kyiv, Ukraine (GMT+2)
mobile: +38 097 321 56 54 email:
roman.prots...@gmail.com%3C/span%3eroman.prots...@gmail.com
 skype: roman.protsiuk
linkedin: http://www.linkedin.com/in/romanpv blogspot:
http://roma-ch.blogspot.com


On Fri, Aug 14, 2009 at 12:53 AM, gmbroth gmbr...@hotmail.com wrote:



 Hi,

 I'm having a bit of trouble using the following combination of data binding
 and Repeater and could use some enlightenment:

 mx:ArrayCollection id=fred  some data here... /mx:ArrayCollection 

 mx:ArrayCollection id=measurements 
 mx:Object dataProvider={fred} /
 /mx:ArrayCollection

 mx:Repeater id=measurementRepeater dataProvider=measurements 
 my:Chart dataProvider={measurementRepeater.currentItem.dataProvider} /
 /mx:Repeater

 The intention is to have my chart bind to 'fred' via the Repeater iteration
 over measurements, a kind of double-binding, I suppose. My chart component
 does render the initial data in 'fred' but doesn't respond to subsequent
 changes to 'fred', i.e., I'm not getting dynamic binding. But if I change
 the repeater line above to this:

 my:Chart dataProvider={fred} /

 then everything works as expected. Is there a way to do in MXML what I'm
 trying to do above?

 Thanks, Garry

  



Re: [flexcoders] Access a private method

2007-09-29 Thread Roman Protsiuk
You know methods are private not just because someone want them to be so.
Maybe you can find different approach to your problem solution, without
necessity for calling private methods. If you  somehow access that method
you must consider potentially limitless future support problems.

R.

On 9/29/07, Sheriff [EMAIL PROTECTED] wrote:

   i need to access this private method in the accordion but since its
 private i can't so i was wondering if i would be able to change it to
 protected so i can access it from their but how would i update the flex
 framwork.

 --
 Catch up on fall's hot new 
 showshttp://us.rd.yahoo.com/tv/mail/tagline/falltv/evt=47093/*http://tv.yahoo.com/collections/3658+%0Aon
  Yahoo! TV. Watch previews, get listings, and more!

  



Re: [flexcoders] Using timer with Popups

2007-09-27 Thread Roman Protsiuk
It's really easy. Just check out Timer documentation on livedocs.
E.g. in your pop-up class (or in class which will handle your pop-up):

public class PopUpClass extends TitleWindow {

private var timer : Timer;

public function PopUpClass() {
 timer = new Timer(number of seconds to display pop-up, 1);
 timer.addEventListener(TimerEvent.TIMER, onTimer);
}

public function show() : void {
 PopUpManager.addPopUp(this);
 if (timer.running) {
  timer.stop();
 }
 timer.start();
}

private function onTimer(event : TimerEvent) : void {
 PopUpManager.removePopUp(this);
}

}


On 9/27/07, candysmate [EMAIL PROTECTED] wrote:

   I need to popup a message for the user. It requires no interaction
 from the user, it's just a visual cue.

 I guess that it would ential the use the timer for this in conjunction
 with either an Alert (not sure at the time of writing if Alert's can
 be button-free), or a titleWindow as a popup.

 Unsure how how to implement the timer / box combo to open such a
 message for x seconds I'd be grateful for any pointers please.

 My current efforts have been laughable. I shall not inflict them upon
 your delicate eyes here :)

  



Re: [flexcoders] Re: Validating items in DataGrids

2007-09-19 Thread Roman Protsiuk
I remember I did it like this:

public class FilesDataGridColumnEditor extends TextInput {

public function SomeDataGridEditor() {
_validator.source = this;
_validator.triggerEvent = change;
_validator.required = true;
_validator.property = text;
}

private var _validator : Validator = new SomeValidator();
}

It's not the best practices, but as far as I remember it worked. :)

R.

On 9/18/07, merelypixels [EMAIL PROTECTED] wrote:

   seems to me that no mucking about with itemEditors is necessary...
 extract the data you need from your dataProvider and then validate
 that data directly before sending it on. If you want the little red
 validation things, you should probably validate on a field by field
 basis using the dataGrids itemEditEnd event, validating using
 dg.itemEditorInstance and doing e.preventDefault() if the field is
 invalid.

 Hope that helps!
 -Pixels

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 j_lentzz [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I'm now trying to validating the contents of a datagrid and I was
  wondering if there is an established way to do this. It seems like I
  would need to get an instance of the itemEditor and somehow pass it
  the value on that row. Then I would either call a validator against
  that editor, or call a method contained in the itemEditor to do the
  validation. I can get the itemEditor to do validation when the user
  is entering data, but I need to be able to do validation on all the
  entries in the datagrid when the save button is pressed - to handle
  the cases of missing data in required datagrid fields. I've found
  some examples of how to validate when the user is entering data for
  that field, but not for validating the complete datagrid. Any help or
  ideas would be greatly appreciated.
 
  John
 

  



Re: [flexcoders] Re: Validating items in DataGrids

2007-09-19 Thread Roman Protsiuk
Then all you need is dataProvider. Validate items held in there. And change
some property of the item that indicates whether it's valid or not. Then
item renderer easily can draw something bad basing on that info.

R.

On 9/19/07, j_lentzz [EMAIL PROTECTED] wrote:

   I'm doing something like that right now for the individual cells.
 I've integrated a validator into the cell object. However, I need to
 be able to validate the complete datagrid when the save button is
 pressed. If the user never moves to a cell, I can't use the
 itemEditEnd to validate, I need to move through the data and check.
 Using the itemEditor.newInstance() and calling my validation routine,
 I can detect that a validation fails. Now I'm going to try to use the
 itemRenderer property to indicate the nice red boxes.

 John
 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Roman
 Protsiuk
 [EMAIL PROTECTED] wrote:
 
  I remember I did it like this:
 
  public class FilesDataGridColumnEditor extends TextInput {
 
  public function SomeDataGridEditor() {
  _validator.source = this;
  _validator.triggerEvent = change;
  _validator.required = true;
  _validator.property = text;
  }
 
  private var _validator : Validator = new SomeValidator();
  }
 
  It's not the best practices, but as far as I remember it worked. :)
 
  R.
 
  On 9/18/07, merelypixels [EMAIL PROTECTED] wrote:
  
   seems to me that no mucking about with itemEditors is necessary...
   extract the data you need from your dataProvider and then validate
   that data directly before sending it on. If you want the little red
   validation things, you should probably validate on a field by field
   basis using the dataGrids itemEditEnd event, validating using
   dg.itemEditorInstance and doing e.preventDefault() if the field is
   invalid.
  
   Hope that helps!
   -Pixels
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com,

   j_lentzz jelentz@ wrote:
   
Hi,
   
I'm now trying to validating the contents of a datagrid and I was
wondering if there is an established way to do this. It seems like I
would need to get an instance of the itemEditor and somehow pass it
the value on that row. Then I would either call a validator against
that editor, or call a method contained in the itemEditor to do the
validation. I can get the itemEditor to do validation when the user
is entering data, but I need to be able to do validation on all the
entries in the datagrid when the save button is pressed - to handle
the cases of missing data in required datagrid fields. I've found
some examples of how to validate when the user is entering data for
that field, but not for validating the complete datagrid. Any
 help or
ideas would be greatly appreciated.
   
John
   
  
  
  
 

  



Re: [flexcoders] mouseDownOutside

2007-09-18 Thread Roman Protsiuk
What do you mean popped up? Is it modal pop up? Or what?

R.

On 9/18/07, joaopccoelho [EMAIL PROTECTED] wrote:

   I'm trying to get mouseDownOutside to work but to no avail.
 It does get triggered if there is only a component poped up but as
 soon as I pop up another one, it doesn't get triggered anymore, i.e.,
 if I click on the first component the second should detect a click
 outside of it and vice-versa, but it does not.
 Is this normal behaviour or a bug?
 TIA
 Joao Coelho

  



Re: [flexcoders] Rounded corners

2007-09-14 Thread Roman Protsiuk
It should be custom skinned to do that. Programmatic skin I guess.

R.

On 9/14/07, Roy Tang [EMAIL PROTECTED] wrote:

   Thanks, but I seem to have been misunderstood. I know how to use rounded

 corners, but I want to round corners selectively, like
 focusRoundedCorners property, i.e. have only 3 corners rounded, etc.

 Any ideas? :)

 Maximilian Nyman wrote:
 
  Note: If you use cornerRadius you need to have borderStyle=solid.
  (It could be borderThickness=0, but it has to be existent)
 
  /Max
 
  On 9/14/07, Sheriff [EMAIL PROTECTED] sherif626%40yahoo.com
  mailto:sherif626% sherif626%2540yahoo.com wrote:
  
  
   you can create your own skin and apply it otherwise you can use the
  cornerRadius
  
  
   - Original Message 
   From: Roy Tang [EMAIL PROTECTED] roytang.sub%40gmail.commailto:
 roytang.sub%40gmail.com
   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com mailto:
 flexcoders% flexcoders%2540yahoogroups.com
   Sent: Thursday, September 13, 2007 11:33:23 PM
   Subject: [flexcoders] Rounded corners
  
  
  
  
   Hi,
  
   Is there a way to control which corners are rounded for a button or a
   canvas or whatever? Something like what focusRoundedCorners does,
 except
   for the actual control, not for the focus rectangle.
  
   Thanks,
  
   Roy
  
 
 

  



Re: [flexcoders] File upload in Flex

2007-09-12 Thread Roman Protsiuk
It's possible. See FileReference and FileReferenceList.

R.

On 9/12/07, stephen50232 [EMAIL PROTECTED] wrote:

   Hi,

 I've got a new project, which requires that the user can upload
 resources to a system, which other users can access and download
 through the same system.

 The types of documents which can be uploaded through the system will
 include PDFs, Word docs, Excel docs, but this list may increase (e.g.
 MP3 files etc).

 I have not seen an example of a Flex system which allows users to
 browse there local PC and upload files. Is it possible and if so how?

 Stephen

  



Re: [flexcoders] How do u position a label directly underneath a picture you don't know the size?

2007-08-29 Thread Roman Protsiuk
Why don't you use layout=vertical?

R.

On 8/29/07, steve [EMAIL PROTECTED] wrote:

   I have a panel and I load an image in at runtime, I would like to
 position the label directly underneath the image which may have
 different heights, Can I use the contentHeight of the image to
 position the label? does the panel need to be refreshed? or is
 there another layout tool that does this better?
 I'd like to position textArea 'txComment' directly underneath
 image 'fullImage'
 thanks!
 here's my code:

 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
 xmlns:comp=components.* creationComplete=init()
 height=727
 mx:Script
 ![CDATA[
 import mx.utils.ArrayUtil
 import mx.rpc.events.*;
 import mx.collections.*;
 [Bindable]
 public var members:ArrayCollection;

 private function init():void
 {
 memberDataIn.send();
 }
 private function memberHandler
 (event:ResultEvent):void
 {
 members =
 event.result.members.member;
 }
 [Bindable] public var selectedmember:Object;
 [Bindable] public var
 selectedusername:Object;
 [Bindable] public var selecteduserid:Object;
 [Bindable] public var selectedfname:Object;
 [Bindable] public var selectedlname:Object;
 [Bindable] public var
 selectedlastvisit:Object;
 [Bindable] public var selectedpicture:Object;
 [Bindable] public var selectedtitle:Object;
 [Bindable] public var selectedcomment:Object;
 [Bindable] public var
 selectedlocation:Object;
 [Bindable] public var selectedstate:Object;
 [Bindable] public var selectedage:Object;
 private function displayMemberDetails
 (event:Event):void
 {
 //currentstate ='memberdetails';
 selectedmember = new Object();
 selectedmember =
 event.currentTarget.selectedItem;
 fullImage.load
 ('http://www.yourasianconnection.com/members/' +
 selectedmember.picture);
 selectedusername =
 selectedmember.username;
 selecteduserid =
 selectedmember.userid;
 selectedfname = selectedmember.fname;
 selectedlname = selectedmember.lname;
 selectedlastvisit =
 selectedmember.lastvisit;
 selectedtitle = selectedmember.title;
 selectedcomment =
 selectedmember.comment;
 selectedlocation =
 selectedmember.location;
 selectedstate = selectedmember.state;
 selectedage = selectedmember.age;

 }
 ]]
 /mx:Script
 mx:HTTPService id=memberDataIn url=assets/female180.xml
 result=memberHandler(event) /
 mx:Canvas y=25 right=66 left=-171
 backgroundColor=#80
 mx:TileList x=10 y=10 id=tlUsers
 dataProvider={members}
 rowHeight=140 columnWidth=80
 labelField={data.username}
 change=displayMemberDetails(event)
 percentWidth=50 itemRenderer=components.pnThumb /mx:TileList
 mx:Panel x=561 y=0 width=550 height=600
 layout=absolute id=userdetail
 mx:Text x=10 y=10
 text={selectedusername} id=txUsername fontSize=12
 fontWeight=bold/
 mx:Label x=161 y=12
 text={selectedtitle} fontSize=12/
 mx:Image x=10 y=31 width=400
 height=400 id=fullImage/

 mx:TextArea x=10
 y={fullImage.contentHeight} width=365 height=200
 editable=false wordWrap=true text={selectedcomment}
 id=txComment/
 /mx:Panel
 /mx:Canvas


 /mx:Application

  



Re: [flexcoders] Stupid question - get ready to throw fruit.

2007-08-29 Thread Roman Protsiuk
Your popup can dispatch some event which will bring you the selection or you
can store this info in the array collection values you are working with
or... else.

R.

On 8/29/07, candysmate [EMAIL PROTECTED] wrote:

   I use a titleWindow popup with a datagrid from which the user makes a
 selection from a large database. When closed, does the selection
 datagrid ArrayCollection sit around in memory? If so, what is the best
 practice way of dealing with this please?

 Ok, take aim and 

  



Re: [flexcoders] Dynamically binding a dataprovider in AS

2007-06-10 Thread Roman Protsiuk

mx.binding.utils.BindingUtils.bindProperty(bb, dataProvider, this, vs);

R.

On 6/8/07, zzwi89 [EMAIL PROTECTED] wrote:


  Apologies if this question has been posted; I couldn't find anything
similar in the archives.

Suppose I have the following in MXML:

mx:ButtonBar dataProvider={vs} id=bb/
mx:ViewStack id=vs/

How would I set that binding in AS?

Trying something like this:

mx.binding.utils.BindingUtils.bindProperty(bb, dataProvider, vs, null);

Doesn't work, because I don't know what to set the chain property to.
I don't to bind just a property of the ViewStack, I want to bind the
ViewStack.

Any thoughts?

 



Re: [flexcoders] How to create Repeater in Actionscript only?

2007-06-08 Thread Roman Protsiuk

Why do you need repeater in as? You can do the same functionality without
it. It's mxml where it suits well.

R.

On 6/8/07, arpan srivastava [EMAIL PROTECTED] wrote:


  Hi All,

Is there anyway i can use Repeater in actionscript (only actionscript,
no mxml).? can anyone send me a small code like that created in the help
documents for creating buttons from 1 to 10 in Actionscript only?

--
You snooze, you lose. Get messages ASAP with 
AutoCheckhttp://us.rd.yahoo.com/evt=47959/*http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
in the all-new Yahoo! Mail Beta.

 



Re: [flexcoders] Parameter passing !! I am shocked

2007-06-07 Thread Roman Protsiuk

objParam is not the same reference to created object as obj. Whenever you
set objParam to null it becomes null (try checking it out in your
deleteObject method). But who said the obj should become null? To prepare
obj for garbage collection you should set obj to null.

R.

On 6/7/07, Ravi Kumar Gummadi [EMAIL PROTECTED] wrote:



Hi all

How does flex handle parameter passing, as I understand, it is by Pass
by reference. But I was having some memory leaks and playing around a
few tweaks and the following snippet completely took me by surprise.

// CODE START

script

public var obj:Object;

createObject(){

obj = {test:1234,test2:5678};
}

checkObject(objParam:Object){
trace(objParam);
}

deleteObject(objParam:Object){
objParam = null; // I tried objParam = undefined as well
}

/script

mx:Button id=create click=createObject() /
mx:Button id=check click=checkObject(obj) /
mx:Button id=delete click=deleteObject(obj) /

// END

Now 1. I created the object by click on create
2. Then check for the existence of it (Traces [object object].. This
is fine)
3. Then clicked delete.
4. Then again click on check... (Traces [object] [object]
! But since its passed by reference it should be
NULL)

Somewhere I read that it setting to NULL changes the reference count,
does that mean in each of my function I need to set all the params to
null at the end of it so that refercne count is reduced and raady for
garbage collection!! ( That doesn't quite a sense !!)

Regards
Ravi

 



Re: [flexcoders] dispatchevent question when in a custom component.

2007-06-06 Thread Roman Protsiuk

Why don't you use custom events? I use standard events in my components only
in situations like something is changed - we notify about it using
Event.CHANGE. But in most custom components custom events used (especially
if some event specific information is sent along with it).

R.

On 6/5/07, Romain [EMAIL PROTECTED] wrote:


  Hi,

I am making a custom mxml component, composed of a datagrid and a few
buttons.
I am potentially dispatching the following 2 events:
[Event(name=btnClick, type=flash.events.MouseEvent)]
[Event(name=rowClick, type=mx.events.ListEvent)]

These events are thrown by event handlers on the actual individual
component (either a button or a grid).
for the grid:
private function dispatchRowClickEvent(ev:ListEvent):void{
var e:ListEvent=new ListEvent('rowClick');
e.rowIndex=ev.rowIndex;
dispatchEvent(e);
}
for the button
mx:Button id=btnRefreshRecord
icon=@Embed(source='../assets/icons/table_refresh.png') width=20
height=20 click=dispatchEvent(new Event('gridRefresh'))
toolTip=Refresh table content /

My problem is when I consume these events from the component, I'd like
to be able to write something like:
public function dgDoubleClickHandler(event:ListEvent) : void
{
var currentIssueForm:IssueForm = new IssueForm();
var buf:XML = XML(event.currentTarget.selectedItem);
currentIssueForm.modelIssue = buf;
PopUpManager.addPopUp(currentIssueForm, this, true);
PopUpManager.centerPopUp(currentIssueForm);
}

However at runtime it fails because event.currentTarget.selectedItem
is null.
It is null because the event I am catching is the custom component
event and not the low-level datagrid event

Is there a way to wrap the datagrid event [and keep its content]
whilst still renaming it ?
Or maybe there is just a simpler way to do this ?

Thanks,

Romain.

 



Re: [flexcoders] Is there a way to pass on rollOver to parent object?

2007-06-06 Thread Roman Protsiuk

Is it only rollOver you want to disable? You can set mouseChildren = false
and objects children won't dispatch anything mouse-related.

R.

On 6/6/07, beecee1977 [EMAIL PROTECTED] wrote:


  Hi,

Just wondering, is it possible to have a child object ignore mouse
rollOvers so that the parent object can pick it up. (I want the parent
object's rollOverEffect/rollOutEffect to be activated).

Thanks in advance
Bill

 



Re: [flexcoders] data providers and filter functions

2007-06-05 Thread Roman Protsiuk
The simplest solution as I see it: create another collection.

R.

On 6/5/07, Ariel Jakobovits [EMAIL PROTECTED] wrote:
 I have a global variable called categories. It is an XMLListCollection 
 populated when a user logs in, representing the categories they have created.

 I use the categories collection as a dataprovider in various controls.

 I also have a global variable called selectedItem. An item, among other 
 attributes, has a list of assigned categories.

 What I am approaching is a view with two lists. One list contains the 
 categories that have been assigned to the selected item. Easy: dataprovider = 
 selectedItem.categories.
 The other list needs to contain the categories that have not been assigned to 
 that item yet. The basis for the data is the global categories collection, 
 but since the filterFunction is applied to the dataprovider and not the 
 control itself, the filter function will affect all controls using the 
 categories collection.

 What do I do?




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






Re: [flexcoders] summing a value in an arrayCollection?

2007-06-03 Thread Roman Protsiuk

Just another option:

var total : Number = 0;
for each (var obj : Object in myAC) {
   total += obj.population;
}

R.

On 6/3/07, Jurgen Beck [EMAIL PROTECTED] wrote:


   Hi Todd,

One of the ways would be to traverse your ArrayCollection with a cursor:

var cursor:IViewCursor = myAC.createCursor();
var sumPop:int = 0;
var myObject:Object;
while (!cursor.afterLast) {
myObject = cursor.current;
sumPop += myObject.population;
}

Jurgen

todd_geist wrote:

 Hello,

Very new here. Trying to get some of the basics. I have datagrid
that is populated with the following arrayColleciton

mx:ArrayCollection id=myAC
mx:Array
mx:Object city=Los Angeles state=CA
population=3844829 /
mx:Object city=New York state=NY population=8143197 /
mx:Object city=Chicago state=IL population=2842518 /
mx:Object city=Philadelphia state=PA
population=1463281 /
/mx:Array
/mx:ArrayCollection

How do I go about getting the sum of the population?

Thanks in advance for any advice.

Todd

   



Re: [flexcoders] Visibility of components

2007-05-31 Thread Roman Protsiuk

What about visible-property? To be honest I didn't really understand why one
might need such functionality.
Is it like switching bindings on/off?

R.

On 5/31/07, havardfl [EMAIL PROTECTED] wrote:


  I have an application where several different components in different
containers spread around the application should be bound to external
data. These bindings need to know when the component is actually
on-screen to know when to start fetching data.

What is the easiest way of doing this, that is determine whether a
series of components are on-screen?

 



[flexcoders] HotFix 2 and compc

2007-05-30 Thread Roman Protsiuk
Hi.

Can anyone explain me what does Change compc to use SourceList mean?
Found it on a tech note page regarding hot fix 2
(http://www.adobe.com/go/kb401825) and still have no clue on what is
it.

Thanks,
R.


Re: [flexcoders] MXMLC compile multiple swf

2007-05-30 Thread Roman Protsiuk

Make several calls to mxmlc?

R.

On 5/30/07, Eduardo Dias [EMAIL PROTECTED] wrote:


  Anyone know how to compile multiples MXML to generate multiples SWF
using the ANT Tasks?


Thanks
 



Re: [flexcoders] Positioning Alert Control

2007-05-25 Thread Roman Protsiuk

The reference to the Alert instance you are showing can give you more
control over Alerts position. It (reference) is returned by Alert.show()
method.
E.g.
var alert : Alert = Alert.show(bla-bla-bla);
alert.y /= 2;

R.

On 5/25/07, Marvin Froeder [EMAIL PROTECTED] wrote:


  Simple...

Lets see the show method:
public static function show(text:String = , title:String = ,
flags:uint = 0x4 /* Alert.OK */,
parent:Sprite = null,
closeHandler:Function = null,
iconClass:Class = null,
defaultButtonFlag:uint = 0x4 /* 
Alert.OK*/):Alert
{

Just need to set there a parent!


VELO



On 5/25/07, cbs1918 [EMAIL PROTECTED] wrote:

   How do you control the position of an Alert popup?  By default it
 appears that the location is centered within the dimensions of the flash
 file.  The problem is that the current flash file I am working on is taller
 than the browsers window.  So when I need to show an Alert popup some users
 may not see the popup because they are at the top of the page and the center
 of the page is off screen.  Is there a way to control this, and is there a
 way to center the position of the popup based on the client's current
 viewable area?


 



Re: [flexcoders] Unable to resolve a class for ResourceBundle

2007-05-24 Thread Roman Protsiuk

What are you compiling and how?
If it's component library then probably you didn't include your resource
bundle in compilation
(e.g. compc -include-resource-bundles
ResourceBundleNameWithoutDotPropertiesExtension ...)

R.

On 5/22/07, Praveen Saxena [EMAIL PROTECTED] wrote:



Hi,
I am getting Unable to resolve a class for ResourceBundle
Error while reading from property file.
Is there any solution.
-Regards
Praveen

 



Re: [flexcoders] call function on a pop up

2007-05-24 Thread Roman Protsiuk

If pop1 is member variable of your class everything should work. You create
pop up and store a pointer to it in you variable (pop1). Then using pop1 you
call a method on that pop up. What is the problem?

R.

On 5/23/07, mazarflex [EMAIL PROTECTED] wrote:


  I am trying to call a function to a popup.
i am using the
public function LoadPopUp():voie{
var pop1:pWindow1=pWindow1
(PopUpManager.createPopUp(this,pWindow1,false));
}
to create a popup.
and another function on the parent app to call refresh() on the popup

public function SendRefresh():void{
pop1.Refresh()
}

of course the refresh doesnt work. I am just trying to refresh the
fields on the child page once they are changed on the parent page
instantly without mouseover() etc.

 



Re: [flexcoders] can't remove space around label

2007-05-22 Thread Roman Protsiuk

As far as I remember there are some internal margins in the Label. One of my
suggestions would be to override measure()/updateDisplayList() and to
measure/draw content (UITextField) manually using your rules.
Though it's just a guess. ;)

R.

On 5/22/07, Lincoln Mitchell [EMAIL PROTECTED] wrote:


  I need to get a Label (or Text) as close as possible to an image sitting
below it.
Padding-bottom and height attributes only do part of the job.
It's like there is a margin around the label.

Any ideas?

Linc

 



Re: [flexcoders] compc help

2007-05-05 Thread Roman Protsiuk

If you're setting configuration file like -load-config papervision.xml it
replaces default flex-config.xml, thus you should specify path to the
framework libraries. Something like
compiler
external-library-path
path-elementC:/Program Files/Adobe/Flex Builder 2 Plug-in/Flex SDK
2/frameworks/libs/path-element
/external-library-path
/compiler

But it seems to me that in general the best way is to use your configuration
file appended to default configuration, e.g. compc -load-config+=
papervision.xml. It should solve you problems without additional explicit
properties specification.

R.

On 5/5/07, Alisdair Mills [EMAIL PROTECTED] wrote:


  Hi,

I'm having difficulty getting compc to compile a swc. from the command
line I'm doing compc -load-config papervision.xml which uses the
following xml...

?xml version=1.0?
flex-config xmlns=http://www.adobe.com/2006/flex-config;
outputPapervision.swc/output
compiler
source-path
path-element./path-element
/source-path
/compiler
include-classes
classorg.papervision3d.Papervision3D/class
/include-classes
/flex-config

but when I run it i get the following error...

Papervision/org/papervision3d/Papervision3D.as(1): col: 1 Error: The
definition of base class Object was not found.

Any ideas as to where I'm going wrong? Thanks in advance for any help.

cheers, Al
 



[flexcoders] w not kerned correctly in Safari

2007-05-04 Thread Roman Protsiuk

Hi, everyone.

In Safari 'w' characters (lower-case) always appear to have a space
following them. We are using standard Arial font. What can be done to fix
the situation?
See attached screenshot for an example.

Thanks in advance.

R.
attachment: alphabet.png

Re: [flexcoders] Drag a panel and add reflection to this panel

2007-05-03 Thread Roman Protsiuk

The thing is that when you use Panel (or derived class) instance as a pop up
it is draggable by default. I took me an effort (not much though) to get rid
of that handy behavior.

R.

On 5/3/07, Osvaldo Aufiero [EMAIL PROTECTED] wrote:


  I think the reflection is just an image... I mean a few different images
for the different panel states.
About the drag and drop, I think The work with the mousemove event, and a
DragProxy image while it is being dragged.

But anyway.. it is just an idea... you can find a lot of different ways of
doing that.

BTW, it looks really great!
Congratulations to mobik team!

On 5/2/07, randall_salas [EMAIL PROTECTED] wrote:

 Hi Guys:
   I was looking at this link:
 http://www.mobik.com/mobik/mobik.html

 I wonder if any of you have an idea about how to drag the panel as
 well as how to implement the reflection over this object.

 Thanks a lot




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




 



[flexcoders] Resources and compiling library in command line/ant (compc)

2007-05-03 Thread Roman Protsiuk

Hi.

I'm compiling flex2 library in command line/ant script. The problems I faced
related with including resources into library.
When I use -include-file directive like the following
[excerpt from library-config.xml]
...
   include-file
   namesome_styles.css/name
   pathsrc/resources/css/some_styles.css/path
   /include-file
   include-file
   namesome_icon.png/name
   pathsrc/resources/icons/some_icon.png/path
   /include-file
...

all the resources listed this way are put in the root of resulted swc. Flex
Builder however compiles libraries with preserved resources folder hierarchy
(e.g. library.swcresources/icons or library.swcresources/css). Can I
achieve the same result via compc and how?

Thanks in advance,
R.


Re: [flexcoders] Validating custom component - how to get error to display next to field

2007-04-26 Thread Roman Protsiuk

Is Validator you use required=true?

R.

On 4/26/07, John Menke [EMAIL PROTECTED] wrote:


  How do i get validation errors to appear next to corresponding fields
in a component that i have on an .mxml page?

I have a custom component that contains text fields. I can validate
the component with a custom validator but i cannot get the error to
display next to the field.

Any suggestions?

 



Re: [flexcoders] Validating custom component - how to get error to display next to field

2007-04-26 Thread Roman Protsiuk

Hi, John.
My previous message wasn't any good. Sorry. :)
The error box is one of components rawChilds. I guess what you need to check
is UIComponents validationResultHandler() method.

validationResultHandler()method   public function
validationResultHandler(event:ValidationResultEventhttp://livedocs.adobe.com/flex/2/langref/mx/events/ValidationResultEvent.html
):void http://livedocs.adobe.com/flex/2/langref/specialTypes.html#void

Handles both the valid and invalid events from a validator assigned to this
component.

You typically handle the valid and invalid events dispatched by a validator
by assigning event listeners to the validators. If you want to handle
validation events directly in the component that is being validated, you can
override this method to handle the valid and invalid events. You typically
call super.validationResultHandler(event) in your override.
R.

On 4/26/07, Roman Protsiuk [EMAIL PROTECTED] wrote:


Is Validator you use required=true?

R.

On 4/26/07, John Menke [EMAIL PROTECTED] wrote:

   How do i get validation errors to appear next to corresponding fields
 in a component that i have on an .mxml page?

 I have a custom component that contains text fields. I can validate
 the component with a custom validator but i cannot get the error to
 display next to the field.

 Any suggestions?

  






Re: [flexcoders] Re: submenu can't show completely

2007-04-24 Thread Roman Protsiuk

Never played around with getBounds/getRect methods and the mechanism is
still a little bit vague for me but I though maybe you should choose another
targetCoordinateSpace.
Maybe in your case it should be something like Application.application.

R.

On 4/24/07, kkinaru [EMAIL PROTECTED] wrote:


  thanks Manish, your idea sounds well,

[CODE]
var container_bounds: Rectangle = this.getBounds(this);
var menu_bounds: Rectangle = event.menu.getBounds(this);

if (!container_bounds.containsRect(menu_bounds)){
//MOVE UP SUBMENU
}
[/CODE]

event.menu gives me the submenu, correct, but submenu's position does
not seem to be relative to the container, but to the own submenu
option. (getBounds op gives me a Rectangle in (0,0) upper-left and
(100,100) bottom-right). localToGlobal did not seem to work either.

How can complete this solution? How can take the correct container (or
application)


 You can listen for the menuShow event on the root menu object. The
 event object's menu property actually points to the submenu that's
 being popped up, through which you can check its position and size and
 make sure it's within the screen area (move it).

 On 4/23/07, kkinaru [EMAIL PROTECTED] wrote:
  Hello all.
 
  This time, I have a Button in the bottom of my flex application. This
  button shows a Menu (like the start button in windows). First menu is
  OK, but the last submenu is clipped, because it exceeds the bottom
  edge of my flex app.
 
  Does exist a way for controlling that stuff in my submenus?
 
 
  Thankyou very much in advance.
 
 
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
  Yahoo! Groups Links
 
 
 
 


 



Re: [flexcoders] Open new browser popup

2007-04-23 Thread Roman Protsiuk

Thishttp://skovalyov.blogspot.com/2007/01/how-to-prevent-pop-up-blocking-in.htmlmight
help you.

R.

On 4/23/07, Jaap Cammeraat [EMAIL PROTECTED] wrote:


  Thanks for your answer, but it isn't working in Flex201.
Is there another example of opening a popupwindow?




Op 20-apr-2007, om 14:38 heeft ramp_of_remo het volgende geschreven:

--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Jaap
Cammeraat [EMAIL PROTECTED]
wrote:

 Hi all,
  Can somebody tell me how I can open a sized window in the users
browser?
 At this moment I'm using navigateToURL(u,_blank) to font-family:
Georgia; font-size: 13px; line-height: 15px; new
 window but I want a new window with special sizes.

 Regards,
 Jaap Cammeraat


Hi Jaap,

Wish the following code snippet will be a solution for your question.

?xml version=1.0 encoding=utf-8?
mx:Application 
xmlns:mx=http://www.macromedhttp://www.macromedia.com/2003/mxml
ia.com/2003/mxml
mx:Script![CDATA[

private function openNewBrowser():Void
{
var sURL:String = 'javascript: window.open(,null,' +
taArguments.text + ');void(0);';
getURL(sURL);
}//
]]/mx:Script
mx:TextArea id=taArguments width=200 height=100
text=height=200,width=400,status=yes,toolbar=no,menubar=no,location=
no /
mx:Button label=Open new Browser Window
click=openNewBrowser() /


/mx:Application

Cheers,
Mahesh Reddy.

 



Re: [flexcoders] submenu can't show completely

2007-04-23 Thread Roman Protsiuk

How do you show your menus? Using PopUpButton?
Whatever the mechanism there is a way to specify x, y for the menu.

R.

On 4/23/07, kkinaru [EMAIL PROTECTED] wrote:


  Hello all.

This time, I have a Button in the bottom of my flex application. This
button shows a Menu (like the start button in windows). First menu is
OK, but the last submenu is clipped, because it exceeds the bottom
edge of my flex app.

Does exist a way for controlling that stuff in my submenus?

Thankyou very much in advance.

 



Re: [flexcoders] Can someone explain this?

2007-04-20 Thread Roman Protsiuk

from documentation:
1) BitmapData.copyPixels().

(a) Bitmap as I understood is the target. It has public bitmapData which
copyPixels should be called. And the first parameter here is the source
BitmapData.
(b) I heven't tried that. But you can. ;) This way you can get answer to 2)
by yourself.

R.

On 4/19/07, Ronnie Liew [EMAIL PROTECTED] wrote:


  A BitmapData object can be drawn to the screen by a Bitmap object in
one of two ways: by using the vector renderer as a fill-bitmap shape,
or by using a faster pixel-copying routine. The pixel-copying routine
is substantially faster than the vector renderer, but the Bitmap
object must meet certain conditions to use it:

-No stretching, rotation, or skewing can be applied to the Bitmap object.
-No color transform can be applied to the Bitmap object.
-No blend mode can be applied to the Bitmap object.
-No clipping can be done through mask layers or setMask() methods.
-The image itself cannot be a mask.
-The destination coordinates must be on a whole pixel boundary.

The above is from the help file.

1) the pixel-copying routine is referring to BitmapData.copyPixels() ?
2) What does it mean by the Bitmap object must meet certain
conditions to use it ?

(a) the Bitmap object is referring to the source bitmap for
copyPixels? or the target bitmap to be drawn?
(b) We cannot use copyPixels when the source bitmap has been scaled
etc ? Or after the copyPixel(), the target bitmap can no longer be
scaled etc? or just the speed would be affected?
 



Re: [flexcoders] help with tittlewindows

2007-04-19 Thread Roman Protsiuk

Somehow I can't click the label you specified but I guess the only thing you
need is reference to TitleWindow with your video display. Is it a pop up? If
it is so then PopUpManager.createPopUp() returns you this reference.

R.

On 11 Apr 2007 20:02:21 -0700, Anthony [EMAIL PROTECTED] wrote:


  hi, i made an application a
href=http://prometheus.hostraptor.org/~free4dfw/http://prometheus.hostraptor.org/%7Efree4dfw/
http://prometheus.hostraptor.org/~free4dfw/http://prometheus.hostraptor.org/%7Efree4dfw/
/a
. Go to H and then click the movie The Hills Have Eyes 2. It loads a
titlewindow with a video display but i cant seem to get the video
source to be changed when the button is clicked in the main
application. How do i pass the data between the two?

 



Re: [flexcoders] Image analysis before upload

2007-04-19 Thread Roman Protsiuk

As far as I know you can't do that.

R.

On 11 Apr 2007 12:36:16 -0700, pdflibpilot [EMAIL PROTECTED] wrote:


  Are there client-side ActionScript methods available that would allow
one to determine image resolution in order to prevent a user from
uploading a low-resolution image for hi-resolution application ?

 



Re: [flexcoders] TextArea number of lines.

2007-04-18 Thread Roman Protsiuk

If it's OK to validate it can be reg ex validation for specific number of \r
characters. If not, try something else, like manually controlling quantity
of \r characters in text, not allowing to enter another one.

R.

On 18 Apr 2007 05:42:44 -0700, uday kiran [EMAIL PROTECTED] wrote:


  How can I restrict the number of lines in Textarea.
Is there any built in fumction?

Thank you,
Uday Kiran.

__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 



Re: [flexcoders] PopUpButton :: creationComplete is giving ERROR

2007-03-30 Thread Roman Protsiuk

Dunno if it'll do in your situation, maybe you have some specific
calculations there, but I do all (well, most) property handling in
commitProperties method.

Recommended reading: Creating Advanced Visual Components in
ActionScript.http://livedocs.adobe.com/flex/2/docs/1721.html#210754

R.

On 29 Mar 2007 23:52:38 -0700, sanjaypmg [EMAIL PROTECTED] wrote:


  Hi All,

I am using creation complete in my one of the screens where I am
attaching a Dynamic menu to PopUpButton. I am using creationComplete
event of PopUpButton to initialise that menu once the creation is
completed of the popUpButton... but its shows the following error on
run time:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at ComboPOS/initVal()
at ComboPOS/__cboAuthorsStatusFilter_creationComplete()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchE
ventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

If I use initialize event, it doesnt init my dynamic menu Can
anyone tell me the solution for the same?

Appriciate quick response...

Thanks in Advance..
Sanjay sharma

 



Re: [flexcoders] onChange()

2007-03-30 Thread Roman Protsiuk

creationComplete is dispatched by any component derived from UIComponent.
TextInput is.

R.

On 30 Mar 2007 02:48:31 -0700, Jeremy Watson [EMAIL PROTECTED]
wrote:


  Hi Roman,

Um. I didn't know you can put creationComplete on a textBox. I'll give it
a try. I'm like a fish out of water
with all this flex mumbo jumbo.

J.

- Original Message 
From: Roman Protsiuk [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, 29 March, 2007 9:46:52 PM
Subject: Re: [flexcoders] onChange()

 And, as I understood, making mx:TextInput change=CostCalc()
creationComplete=CostCalc() / won't do a trick. Am I right?

R.

On 29 Mar 2007 03:55:44 -0700, Jeremy Watson [EMAIL PROTECTED] com.au[EMAIL 
PROTECTED]
wrote:

   Sorry Guys,

 I thought I was clear. Okay I'll try to explain it a bit better. I'm
 slightly sick from WebDU. Let me try again.
 In HTML you can call a function when the page loads. OnLoad() if I
 remember correctly.  What i want to do is call a function in Flex and have
 it automatically call  and calculate all the fields within this function
 i.e . CostCalc().  At the moment when I change a mx:TextInput I have
 an change attribute which calls the costCalc() i.e. mx:TextInput
 change=CostCalc() It goes out and recalculates all the fields again. SO
 here lies my issue. How do I call that function and make it like someone has
 changed a value in the TextInput box?

 Does that make more sense?

 Worse case scenario is I'll just populate the fields with the correct
 data rather then trying to calculate it. I just wanted to know if it can be
 done like in Javascript/HTML.

 Thanks in advanced!

 Jeremy
 - Original Message 
 From: Roman Protsiuk roman.protsiuk@ gmail.com
 To: flexcoders@yahoogroups.com
 Sent: Wednesday, 28 March, 2007 8:21:23 PM
 Subject: Re: [flexcoders] onChange()

  What your method does with those basic calculation? Returns them, sets
 them to some Label as text, what? It's very hard to get what is going on and
 thus what might be wrong.

 R.

 On 27 Mar 2007 18:59:56 -0700, Jeremy Watson [EMAIL PROTECTED] com.au
 [EMAIL PROTECTED] wrote:
 
I'm calling on onCreationCompletel (event)
 
   creationComplete=onCreationComplete( event); 
 
  //Alert.show( RequestType) ;
if (RequestType == 1)
{
 EndValue();
 CostCalc()
 }
 else
 {
  LandedCosts( );
  CostCalc()
 }
}
 
 
  Here is one of the text boxes in which I call the CostCalc()
 
  mx:TextInput id=CattleAvWtKg editable=true enabled=true
  change=CostCalc()  text={remoteService. qryDrawdown. lastResult[
  0].CattleAvgWeig htKg} /
  That's pretty much it.
  The function CostCalc() is just doing basic math calculation. i.e. a +
  b
 
  does that help at all.
 
  Jeremy
 
 
  - Original Message 
  From: Bjorn Schultheiss [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] ups.com
  Sent: Wednesday, 28 March, 2007 10:59:57 AM
  Subject: Re: [flexcoders] onChange()
 
   Send through more of your code.
  Are you calling this logic on the creationComplete event?
 
 
  On 28/03/2007, at 10:43 AM, Jeremy Watson wrote:
 
 
  AnyoneAm I calling the function correctly in flex
  actionscript?
 
  J.
 
  - Original Message 
  From: Jeremy Watson [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] ups.com
  Sent: Tuesday, 27 March, 2007 7:48:38 AM
  Subject: [flexcoders] onChange()
 
 
  Howdy again.
 
  The flex application that I'm building is really quite simple which is
  good cause I'm learning flex. However that said.. in html we have onLoad()
  which we put on a page. I have built a function called CostCalc() everytime
  someone changes a field it will recalculate each field. I got that working
  perfectly.
 
  However, when I first load the page up with values every value in the
  form is 0.00 until I make a change to a field. I know that in flex we
  have creationComplete= onCreationCompl ete(event) ;  but when I put in the
  function call CostCalc() it doesn't seem to work. Below is the code.
  Disregard the RequestType stuff. I'm switching states based on the URL.
 
  //Alert.show( RequestType) ;
if (RequestType == 1)
{
 EndValue();
 CostCalc()
 }
 else
 {
  LandedCosts( );
  CostCalc()
 }
}
 
 
 
  Send instant messages to your online friends http://au.messenger
  .yahoo.com
 
 
  Send instant messages to your online friends http://au.messenger
  .yahoo.com
 
 
 
 
  Send instant messages to your online friends http://au.messenger.yahoo.com
 
 
 


 Send instant messages to your online friends http://au.messenger.yahoo.com





Send instant messages

Re: [flexcoders] Dispatching Event Question?

2007-03-30 Thread Roman Protsiuk

When you are adding an event listener the only thing that tells who is to
dispatch the event is who's addEventListener() is called. I mean if you are
calling addEventListener(...) this means that you are listening to 'this'
that will dispatch the event. If a.addEventListener(...) then 'a' will
dispatch it.

What you need is smth like:
instanceOfA.addEventListener(myEvent, myBListenerFunc);
inside of the B instance.

R.

On 30 Mar 2007 08:25:28 -0700, paulwelling [EMAIL PROTECTED]
wrote:


  Hello,

Question on disipatching events that I hope someone can clear up...

I have two custom components, A and B created at the Application level.

I want to send a custom event from A to B.

Inside of B creationComplete, I have addEventListener(myEvent,
myBListenerFunc);

Inside of A, on a button click, I dispatchEvent(new Event(myEvent))

Obviously I would like the function on B, myBListenerFunc() to be
called, but is not.

I'm sure I can do this without having to tell B that A is the
dispatcher (in B, A.addEventListner(myEvent,myBListnerFunc);)

Thanks,
Paul

 



Re: [flexcoders] onChange()

2007-03-29 Thread Roman Protsiuk

And, as I understood, making mx:TextInput change=CostCalc()
creationComplete=CostCalc() / won't do a trick. Am I right?

R.

On 29 Mar 2007 03:55:44 -0700, Jeremy Watson [EMAIL PROTECTED]
wrote:


  Sorry Guys,

I thought I was clear. Okay I'll try to explain it a bit better. I'm
slightly sick from WebDU. Let me try again.
In HTML you can call a function when the page loads. OnLoad() if I
remember correctly.  What i want to do is call a function in Flex and have
it automatically call  and calculate all the fields within this function
i.e. CostCalc().  At the moment when I change a mx:TextInput I have an
change attribute which calls the costCalc() i.e. mx:TextInput
change=CostCalc() It goes out and recalculates all the fields again. SO
here lies my issue. How do I call that function and make it like someone has
changed a value in the TextInput box?

Does that make more sense?

Worse case scenario is I'll just populate the fields with the correct data
rather then trying to calculate it. I just wanted to know if it can be done
like in Javascript/HTML.

Thanks in advanced!

Jeremy
- Original Message 
From: Roman Protsiuk [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, 28 March, 2007 8:21:23 PM
Subject: Re: [flexcoders] onChange()

 What your method does with those basic calculation? Returns them, sets
them to some Label as text, what? It's very hard to get what is going on and
thus what might be wrong.

R.

On 27 Mar 2007 18:59:56 -0700, Jeremy Watson [EMAIL PROTECTED] com.au[EMAIL 
PROTECTED]
wrote:

   I'm calling on onCreationCompletel (event)

  creationComplete=onCreationComplete( event); 

 //Alert.show( RequestType) ;
   if (RequestType == 1)
   {
EndValue();
CostCalc()
}
else
{
 LandedCosts( );
 CostCalc()
}
   }


 Here is one of the text boxes in which I call the CostCalc()

 mx:TextInput id=CattleAvWtKg editable=true enabled=true
 change=CostCalc()  text={remoteService. qryDrawdown. lastResult[
 0].CattleAvgWeig htKg} /
 That's pretty much it.
 The function CostCalc() is just doing basic math calculation. i.e. a + b


 does that help at all.

 Jeremy


 - Original Message 
 From: Bjorn Schultheiss [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] ups.com
 Sent: Wednesday, 28 March, 2007 10:59:57 AM
 Subject: Re: [flexcoders] onChange()

  Send through more of your code.
 Are you calling this logic on the creationComplete event?


 On 28/03/2007, at 10:43 AM, Jeremy Watson wrote:


 AnyoneAm I calling the function correctly in flex actionscript?

 J.

 - Original Message 
 From: Jeremy Watson [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] ups.com
 Sent: Tuesday, 27 March, 2007 7:48:38 AM
 Subject: [flexcoders] onChange()


 Howdy again.

 The flex application that I'm building is really quite simple which is
 good cause I'm learning flex. However that said.. in html we have onLoad()
 which we put on a page. I have built a function called CostCalc() everytime
 someone changes a field it will recalculate each field. I got that working
 perfectly.

 However, when I first load the page up with values every value in the
 form is 0.00 until I make a change to a field. I know that in flex we
 have creationComplete= onCreationCompl ete(event) ;  but when I put in the
 function call CostCalc() it doesn't seem to work. Below is the code.
 Disregard the RequestType stuff. I'm switching states based on the URL.

 //Alert.show( RequestType) ;
   if (RequestType == 1)
   {
EndValue();
CostCalc()
}
else
{
 LandedCosts( );
 CostCalc()
}
   }



 Send instant messages to your online friends http://au.messenger
 .yahoo.com


 Send instant messages to your online friends http://au.messenger
 .yahoo.com




 Send instant messages to your online friends http://au.messenger.yahoo.com





Send instant messages to your online friends http://au.messenger.yahoo.com


 



Re: [flexcoders] debug compile and trace statements

2007-03-29 Thread Roman Protsiuk

Traces are not stripped from swf even if debug='false'. All you need to
check that is to have debug flash player installed. Output is stored (on my
Windows machine, the latest version of flash player) in: C:\Documents and
Settings\username\Application Data\Macromedia\Flash
Player\Logs\flashlog.txt.

R.

On 29 Mar 2007 06:08:41 -0700, Steve Gilchrist [EMAIL PROTECTED] wrote:


  Hi,

I like to pepper my code with a heap of trace statements so I can see
execution flow.

When I go to deploy to production I compile with debug=false. Are the
trace statements stripped out / ignored or do they still execute?

Also is there any way to get trace to output the function it is running in
automagically. I'm wondering if there is a short cut for the below:

public function myMethod():void
{
trace(this+.myMethod+some variables);
}

'this' gives the object name but I have to hand code the myMethod().

Thanks
S
 



Re: [flexcoders] Personalized Popup

2007-03-28 Thread Roman Protsiuk

Far from good, very straightforward, but hopefully working. :)

ImagePopUp:
?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
   mx:Image id=image /
/mx:Canvas

Event handler for your TileList:
mx:TileList ... itemClick=onItemClick(event)
...
mx:Script
![CDATA[
...
private function onItemClick(event : ListEvent) : void {
var popUp : ImagePopUp = ImagePopUp(PopUpManager.createPopUp(this,
ImagePopUp));
popUp.image.source = event.itemRenderer.data.imageUrl;
}
...
]]
/mx:Script

R.

On 27 Mar 2007 14:43:21 -0700, leoaraguas [EMAIL PROTECTED] wrote:


  Hi, i need to make a popup that show me an image that represent the
item selected (one of my tilelist that is showed using render) can
anyone help me please? Its just like an image explorer.

Thanks

 



Re: [flexcoders] onChange()

2007-03-28 Thread Roman Protsiuk

What your method does with those basic calculation? Returns them, sets them
to some Label as text, what? It's very hard to get what is going on and thus
what might be wrong.

R.

On 27 Mar 2007 18:59:56 -0700, Jeremy Watson [EMAIL PROTECTED]
wrote:


  I'm calling on onCreationCompletel(event)

 creationComplete=onCreationComplete(event); 

//Alert.show(RequestType);
  if (RequestType == 1)
  {
   EndValue();
   CostCalc()
   }
   else
   {
LandedCosts();
CostCalc()
   }
  }


Here is one of the text boxes in which I call the CostCalc()

mx:TextInput id=CattleAvWtKg editable=true enabled=true
change=CostCalc()  
text={remoteService.qryDrawdown.lastResult[0].CattleAvgWeightKg}
/
That's pretty much it.
The function CostCalc() is just doing basic math calculation. i.e. a + b

does that help at all.

Jeremy


- Original Message 
From: Bjorn Schultheiss [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, 28 March, 2007 10:59:57 AM
Subject: Re: [flexcoders] onChange()

 Send through more of your code.
Are you calling this logic on the creationComplete event?


On 28/03/2007, at 10:43 AM, Jeremy Watson wrote:


AnyoneAm I calling the function correctly in flex actionscript?

J.

- Original Message 
From: Jeremy Watson [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Tuesday, 27 March, 2007 7:48:38 AM
Subject: [flexcoders] onChange()


Howdy again.

The flex application that I'm building is really quite simple which is
good cause I'm learning flex. However that said.. in html we have onLoad()
which we put on a page. I have built a function called CostCalc() everytime
someone changes a field it will recalculate each field. I got that working
perfectly.

However, when I first load the page up with values every value in the form
is 0.00 until I make a change to a field. I know that in flex we have
creationComplete= onCreationCompl ete(event) ;  but when I put in the
function call CostCalc() it doesn't seem to work. Below is the code.
Disregard the RequestType stuff. I'm switching states based on the URL.

//Alert.show( RequestType) ;
  if (RequestType == 1)
  {
   EndValue();
   CostCalc()
   }
   else
   {
LandedCosts( );
CostCalc()
   }
  }



Send instant messages to your online friends http://au.messenger.yahoo.com


Send instant messages to your online friends http://au.messenger.yahoo.com




Send instant messages to your online friends http://au.messenger.yahoo.com


 



Re: [flexcoders] Sharing An ArrayCollection

2007-03-28 Thread Roman Protsiuk

You can make them static, though it's not very good practice. There should
be better solution considering context.

R.

On 28 Mar 2007 05:01:20 -0700, Ajay K [EMAIL PROTECTED] wrote:


  i want to share ArrayCollection  object Across  various mxml s
can anyone guide regard this




Regards
Ajay K

--
The fish are biting.
 Get more 
visitorshttp://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php?o=US2140cmp=Yahooctv=Q107Taglines=Ys2=EMb=50on
 your site using Yahoo!
Search Marketing.

 



Re: [flexcoders] Accessing Item Renderer in a List.

2007-03-28 Thread Roman Protsiuk

All the interaction with item renderer is expected to be done via data set
to it. And the feedback may be  for example bubbling event (though, I use
this technique very seldom).
When list-based control is created it creates as many item renderer
instances as needed and only substitutes data afterwards.

R.

On 28 Mar 2007 06:06:00 -0700, ivansebastiansurya 
[EMAIL PROTECTED] wrote:


  Hi everyone,

I need bit of a help in displaying items from a List.

I have an item renderer which is associated to the List.

The items in the list contains lots of data, one of which is an
indication of how many percent a task has been completed.

My custom item renderer has a ProgressBar in it.

Every 5 minutes, the data source for my list is updated, hence the
progress bar should be updated.

How can I detect the change in data source from the item renderer's
class, so that I can change the progress bar status?

I have always thought that new item renderer object is created
everytime the list is updated (everytime the data source is updated,
I cleared the array collection which is the source of the list and re
add the new items).

At the moment, my progress bar only looks right when the application
first run. However, seems like the progress bar is updated randomly
afterwards.

Thanks.

Ivan.

 



Re: [flexcoders] Model TitleWindow - Container becomes hazy

2007-03-27 Thread Roman Protsiuk

TitleWindow has got following styles derived from Panel: modalTransparensy
and modalTransparencyBlur. If you set both to 0.0 there won't be any changes
to background when modal pop-up is drawn.

R.

On 27 Mar 2007 01:22:17 -0700, Flexing... [EMAIL PROTECTED] wrote:


  When we show a model titlewindow, the application/container
becomes hazy/blurred.
How to make it look normal ?
I tried using disbledOverlayAlpha of the container but this didn't
help.

TIA
 



Re: [flexcoders] Controlling item spacing in a vbox

2007-03-26 Thread Roman Protsiuk

verticalGap?

R.

On 26 Mar 2007 05:32:19 -0700, Rick Root [EMAIL PROTECTED] wrote:


  I have a group of checkboxes that I'd like to put in a vbox.  However, I
need the spacing between the items in the box to be dramatically less than
the standarding spacing because we have some real estate issues.

I currently use absolute positioning on the checkboxes, and have them such
that there is only about 1 px of space between each one.

When I put them inside a vbox, they are automatically spaced in a way that
I could only describe as double spacing... ie, there's room for another
checkbox between each.

I've tried setting the paddingTop and paddingBottom on the checkboxes and
the vbox itself to no avail.

Any suggestions?

Rick

--
CFMBB - Coldfusion Message Boards, Version 1.21 Now Available!
http://www.cfmbb.org

 



Re: [flexcoders] How to pass some values along with invalidateDisplayList

2007-03-22 Thread Roman Protsiuk

You can store mouse coordinates in some private fields before calling
invalidateDisplayList() and then use them in updateDisplayList(...).

R.

On 3/22/07, Janis Radins [EMAIL PROTECTED] wrote:


  Hello ppl!

I have run into some problems in here.
I'm making menu which is supposed to react on Mouse position. Actually I'm
trying to recreate macintosh menu dock.
When menu is in active state i subscribe to MouseEvent.MOUSE_MOVE and
whenever it's called I fire invalidateDisplayList which leads to
updateDisplayList on next time graphics are rendered.
Guess that sounds pretty logical and stright forward.

Now, the problem is that I have problem with synchronizing whole thing,
because between time when invalidateDisplayList is issued and
updateDisplayList mouse position has already changed.
Hence my fist idea was to somehow pass current mouse position along with
invalidateDisplayList call, though I dont see any possible way to solve it
atm.

Any ideas will be preciated.

Jānis
 



Re: [flexcoders] Flex dates

2007-03-20 Thread Roman Protsiuk

Formatter will do that only for displaying your date. And how it comes out
of database depends on database interface. In general you receive some
standardized date/time. If you want to get specifically formatted date out
of the database you should ask database to do it. Though I can't imagine why
one may need that kind of formatting.

R.

On 20 Mar 2007 01:47:16 -0700, flexjeremy [EMAIL PROTECTED] wrote:


  Hi guys,

I am new to flex and have been having a huge learning curve. So be
gentle. I'm kinda new to REAL OO. But I know CF very well. So with
that said I'm stuck on dates.

I am trying to format a date coming out of a database so it will
look pretty. i.e. dd/mm/

I have an mx:datefield id=DateIn
text=remoteService.qryDrawdown.lastResult[0].DateIn
formatString=DD/MM//mx:datefield

Now I know that the formatString paramater does that for when you
choose it but how do you format it coming out of the database.
Currently its Tue Feb 28 00:00:00 GMT etc etc.

I found the mx:dateFormater tag but haven't been able to get it
working correctly.

Any Advise would be great!!

Jeremy

 



Re: [flexcoders] TextArea.text confusion

2007-03-16 Thread Roman Protsiuk

Exactly. Thanks for the tip, Alex.

R.

On 3/16/07, Alex Harui [EMAIL PROTECTED] wrote:


   Sounds like he wants the light grey add comments  in the TA and then
have it clear on focus in.



For sure, textChanged will be false by the time you get back from
super.commitProperties so I think I'd check the text before calling
super.commitProperties and change it to the default if needed.


 --

*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Tracy Spratt
*Sent:* Thursday, March 15, 2007 5:33 PM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] TextArea.text confusion



What is the problem behavior?  I need a bit more detail before I run or
analyze the code.

Tracy


 --

*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Roman Protsiuk
*Sent:* Thursday, March 15, 2007 7:04 AM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] TextArea.text confusion



Hi, all.

I'm extending TextArea to make it show default text if it's empty. It will
be cleared (if needed) on focusIn.
The problem I've faced is that when I set text property in
commitProperties method that text isn't shown in the TextArea itself. :\

Following is my class:

package {

import flash.display.DisplayObject;
import flash.events.FocusEvent;

import mx.controls.TextArea;

public class ExtendedTextArea extends TextArea {

public function get defaultText() : String {
return _defaultText;
}

public function set defaultText(value : String) : void {
_defaultText = value;
_defaultTextChanged = true;
invalidateProperties();
}

public function get defaultTextFunctional() : Boolean {
return _defaultTextFunctional;
}

public function set defaultTextFunctional(value : Boolean) : void
{
_defaultTextFunctional = value;
}

override public function get text() : String {
if (_showingDefaultText) {
return ;
} else {
return super.text;
}
}

override public function set text(value : String) : void {
super.text = value;
_textChanged = true;
invalidateProperties();
}

override protected function commitProperties() : void {
super.commitProperties ();

if ((_textChanged || _defaultTextChanged)  text == ) {
setText(_defaultText, true);
}

_textChanged = false;
_defaultTextChanged = false;
}

override protected function focusInHandler(event : FocusEvent) :
void {
super.focusInHandler(event);
if (contains(DisplayObject( event.target)) 
_showingDefaultText  !_defaultTextFunctional) {
setText();
}
}

override protected function focusOutHandler(event : FocusEvent) :
void {
super.focusOutHandler(event);
if (contains(DisplayObject(event.target)) 
!_defaultTextFunctional  text == ) {
setText(_defaultText, true);
}
}

private function setText(value : String, isDefaultText : Boolean =
false) : void {
text = value;
_showingDefaultText = isDefaultText;
}

private var _defaultText : String = ;

private var _defaultTextChanged : Boolean;

private var _textChanged : Boolean;

private var _showingDefaultText : Boolean;

private var _defaultTextFunctional : Boolean;

}

}

The class is far from complete.
Here's sample application:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
ExtendedTextArea
width=220
height=80
defaultText=Album description goes here...
/
mx:Button label=button /
/mx:Application

Can anyone explain me this behavior and/or where is my mistake?

Thanks,
R.

 



Re: [flexcoders] TextArea.text confusion

2007-03-16 Thread Roman Protsiuk

The working version of this component (ExtendedTextArea) can be found here
http://roma-ch.blogspot.com/2007/03/one-down-more-to-go.html.

Thanks everyone,
R.


Re: [flexcoders] validation

2007-03-15 Thread Roman Protsiuk

Validator class has property triggerEvent. It can be focusOut for example.
Or if you want something more complicated then you can manually call
yourValidator.validate().

R.

On 15 Mar 2007 04:34:23 -0700, Kenneth Sutherland [EMAIL PROTECTED]
wrote:


   I know I've seen this done somewhere but just cant seem to find it on
livedocs or in the history of flexcoders!

Anyway I want to validate a textbox / combobox, but I only want the
validation to validate after the user has tabbed out of the box or pressed
enter.  At the moment it validates after each keypress.

So if the user has a box and has to type Europe then I don't want the
validator to say error while they type E then Eu and so on…..



Cheers



*Kenneth Sutherland*

* *

**

*Visit our Web site at www.inps.co.uk*

* *

*The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it by
anyone else is not authorised. Any views or opinions presented are solely
those of the author and do not necessarily represent those of In Practice
Systems Limited or any of its affiliates. If you are not the intended
recipient please contact [EMAIL PROTECTED]



 




[flexcoders] TextArea.text confusion

2007-03-15 Thread Roman Protsiuk

Hi, all.

I'm extending TextArea to make it show default text if it's empty. It will
be cleared (if needed) on focusIn.
The problem I've faced is that when I set text property in commitProperties
method that text isn't shown in the TextArea itself. :\

Following is my class:

package {

   import flash.display.DisplayObject;
   import flash.events.FocusEvent;

   import mx.controls.TextArea;

   public class ExtendedTextArea extends TextArea {

   public function get defaultText() : String {
   return _defaultText;
   }

   public function set defaultText(value : String) : void {
   _defaultText = value;
   _defaultTextChanged = true;
   invalidateProperties();
   }

   public function get defaultTextFunctional() : Boolean {
   return _defaultTextFunctional;
   }

   public function set defaultTextFunctional(value : Boolean) : void {
   _defaultTextFunctional = value;
   }

   override public function get text() : String {
   if (_showingDefaultText) {
   return ;
   } else {
   return super.text;
   }
   }

   override public function set text(value : String) : void {
   super.text = value;
   _textChanged = true;
   invalidateProperties();
   }

   override protected function commitProperties() : void {
   super.commitProperties();

   if ((_textChanged || _defaultTextChanged)  text == ) {
   setText(_defaultText, true);
   }

   _textChanged = false;
   _defaultTextChanged = false;
   }

   override protected function focusInHandler(event : FocusEvent) :
void {
   super.focusInHandler(event);
   if (contains(DisplayObject(event.target))  _showingDefaultText
 !_defaultTextFunctional) {
   setText();
   }
   }

   override protected function focusOutHandler(event : FocusEvent) :
void {
   super.focusOutHandler(event);
   if (contains(DisplayObject(event.target)) 
!_defaultTextFunctional  text == ) {
   setText(_defaultText, true);
   }
   }

   private function setText(value : String, isDefaultText : Boolean =
false) : void {
   text = value;
   _showingDefaultText = isDefaultText;
   }

   private var _defaultText : String = ;

   private var _defaultTextChanged : Boolean;

   private var _textChanged : Boolean;

   private var _showingDefaultText : Boolean;

   private var _defaultTextFunctional : Boolean;

   }

}

The class is far from complete.
Here's sample application:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical
   ExtendedTextArea
   width=220
   height=80
   defaultText=Album description goes here...
   /
   mx:Button label=button /
/mx:Application

Can anyone explain me this behavior and/or where is my mistake?

Thanks,
R.


Re: [flexcoders] Problem with datagrid inline radio button itemRenderer

2007-03-14 Thread Roman Protsiuk

What does updateCorrectAnswer? It would be helpful if you give us some
working example to test what's going on.
Do you really need data.correct=!data.correct;?
Maybe you could just call outerDocument.updateCorrectAnswer(!data.correct,
data.id);

Probably that's not the reason of this behavior, but it's hard to guess for
me.

R.

On 3/13/07, Xia Zhao [EMAIL PROTECTED] wrote:


   Hello,

I use radio button as data grid itemRenderer. The short code is at the
end. What I want to do is adding answers for one question and set the
correct answer. I attched the screen shot. I use the check box and text
input on the top line to add an answer. Once I click Add this answer button,
the answer will appear in the bottom datagrid. And if it is the correct
answer, the radio button in front should be selected. There are some
problems here:

1) If I set the entered answer as the correct answer, after I click Add
this answer button, the radio button in front of this answer is not
selected immediately. When I add the next answer and click Add this answer
button, the selection for the previous radio button appears.

2) Connect with the first problem I think, if I set the last answer as the
correct answer, the radio button will keep appear then disppear when I
refresh the answer list. Refresh I mean read data from collection.

I tried to debug and traced the value of the correct answer. I boolean
value is correct but the radio button is not rendered correctly with the
value.

Does anyone have any idea about this?

BTW, I am using Flex 2.0.1 and Caringorm2.1.

Xia



mx:DataGridColumn
dataField=correct width=32 

mx:itemRenderer

mx:Component

mx:RadioButton selected={data.correct } click=
data.correct=!data.correct;outerDocument.updateCorrectAnswer(data.correct,
data.id )/

/mx:Component

/mx:itemRenderer

/mx:DataGridColumn


 





Re: [flexcoders] Reposition label inside button component

2007-03-07 Thread Roman Protsiuk

Haven't tried anything like this myself but afaik my colleagues play around
with UITextField inside of a Button to get rid of some unpleasant
behavior.
Better late than never? ;)

R.

On 1/24/07, evert_dennis [EMAIL PROTECTED] wrote:


  I'm trying to create an Actionscript class that extends Button.
Everything works great except for when a different font is embedded
the label moves up a few pixels. How can I reposition the label
inside the button so that it is centered again?

 



Re: [flexcoders] Mouse events in non-drawn areas?

2007-03-07 Thread Roman Protsiuk

You can pass along this events to your component from the application
itself.
E.g.
// in application:
private function onMouseClick(event : MouseEvent) : void {
   yourComponent.onMouseClick(event);
}

R.

On 1/2/07, Reid Priedhorsky [EMAIL PROTECTED] wrote:


  Hi folks,

I have a component which is a subclass of UIComponent. I would like it
to receive mouse events (MouseDown, MouseUp, and MouseMove,
specifically) even in areas where there are no children and I have not
drawn using this.graphics.

Is this possible? Do any of you have ideas on how to do it or where to
find more info?

(I could work around it by drawing the background manually, but that
seems awkward. I was hoping for some kind of switch or setting. This is
Flex 2.)

Thanks for any help,

Reid
 



Re: [flexcoders] URL Link in Flex Application

2007-02-26 Thread Roman Protsiuk

Try navigateToURL method.

R.

On 2/24/07, Lisa Lee [EMAIL PROTECTED] wrote:


  Can you tell me how to be able to have a user click on a link (button,
whatever) from within a Flex application and have it take the user to a
non-Flex, regular web page within their browser? It's probably a
simple answer but I'm still getting up to speed with Flex. Thanks!

 



Re: [flexcoders] does double click also fire a mouse down event?

2007-02-22 Thread Roman Protsiuk

:)
http://livedocs.adobe.com/flex/2/langref/flash/display/InteractiveObject.html#event:doubleClick

doubleClickeventEvent object type:
flash.events.MouseEventhttp://livedocs.adobe.com/flex/2/langref/flash/events/MouseEvent.html
MouseEvent.type property =
flash.events.MouseEvent.DOUBLE_CLICKhttp://livedocs.adobe.com/flex/2/langref/flash/events/MouseEvent.html#DOUBLE_CLICK

Dispatched when a user presses and releases the main button of a pointing
device twice in rapid succession over the same InteractiveObject when that
object's doubleClickEnabled flag is set to true. For a doubleClick event to
occur, it must immediately follow the following series of events: mouseDown,
mouseUp, click, mouseDown, mouseUp. All of these events must share the same
target as the doubleClick event. The second click, represented by the second
mouseDown and mouseUp events, must occur within a specific period of time
after the click event. The allowable length of this period varies by
operating system and can often be configured by the user. If the target is a
selectable text field, the word under the pointer is selected as the default
behavior. If the target InteractiveObject does not have its
doubleClickEnabled flag set to true it receives two click events.
R.


On 2/22/07, Paul Hastings [EMAIL PROTECTED] wrote:


  i seem to be seeing mouse down events getting fire before (or during
or sometime) a mouse double click. is that expected? if so, how can i
tell the two apart?

thanks.
 



Re: [flexcoders] does double click also fire a mouse down event?

2007-02-22 Thread Roman Protsiuk

Hm. What exactly do you need? Not to handle mouseDown?

R.

On 2/22/07, Paul Hastings [EMAIL PROTECTED] wrote:


  thanks for the reply.

On 2/22/07, Roman Protsiuk [EMAIL PROTECTED]roman.protsiuk%40gmail.com
wrote:
immediately follow the following series of events: mouseDown,
mouseUp, click,
mouseDown, mouseUp. All of these events must share the same target
as the doubleClick
event. The second click, represented by the second mouseDown and
mouseUp events,
must occur within a specific period of time after the click event. The

i'm not really seeing two mouse downs, only one followed by the
doubleClick event. in any case, the mouse down handler's firing then
the double click handler. this hadn't mattered before but i had to
make some flow changes that exposed this. any workarounds?

thanks.
 



Re: [flexcoders] Disable RollOverColor within TileList

2007-02-21 Thread Roman Protsiuk

useRollOver=false

R.

On 2/4/07, pioplacz [EMAIL PROTECTED] wrote:


  I have a question is it possible to disable the rollover color when u
move the mouse over
some item within TileList. What i mean is that color box that shows
behind the item. Or is it
possible to customise it?

 



Re: [flexcoders] Binding to a dataprovider in ActionScript

2007-02-21 Thread Roman Protsiuk

Tried BindingUtils class?

R.

On 2/21/07, hartws1 [EMAIL PROTECTED] wrote:


  I'm aware that the syntax in mxml is:

dataprovider = { myArray }

What is (or is there) an equivalent way to perform the same function
in actionscript?

Thanks in advance for any insight.

 



Re: [flexcoders] Disable RollOverColor within TileList

2007-02-21 Thread Roman Protsiuk

BTW, if it's not so very interesting to read documentation maybe it will
be fun enough to play around with Flex 2 Style Explorer. For example I found
this style (useRollOver) of ListBase derived controls using Style Explorer.

R.

PS Documentation rocks! Definitely. At least sometimes. ;)

On 2/21/07, Roman Protsiuk [EMAIL PROTECTED] wrote:


useRollOver=false

R.

On 2/4/07, pioplacz [EMAIL PROTECTED] wrote:

   I have a question is it possible to disable the rollover color when u
 move the mouse over
 some item within TileList. What i mean is that color box that shows
 behind the item. Or is it
 possible to customise it?

  






Re: [flexcoders] Re:width=100% as maximum, not minimum?

2007-02-21 Thread Roman Protsiuk

Try
mx:GridItem width=100%
mx:Label id=route_from width=100% minWidth=0 /
/mx:GridItem

R.

On 2/21/07, Robi Ray [EMAIL PROTECTED] wrote:


  Reid,
As far as my knowledge goes, you can achieve truncation only if you
specify fixed width values in pixels when using labels. Percentage values
always get overridden when the text is too long. Another suggestion after
looking at your code : - Avoid using the 'GridRow'  'GridItem' tags from
performance perspective. These tags are analogous to the 'Table' tags in
HTML  degrade rendering performance. You can achieve the same using
'Canvas' as the primary container or maybe a 'HBox' or 'VBox'.

Cheers !

 



Re: [flexcoders] Quick Question

2007-02-20 Thread Roman Protsiuk

As far as I remember someone once told me... :)

When you write:
mx:Button x=23 y=242 label=Button click={myFunction()} /
or
mx:Button x=23 y=242 label=Button click={foo = bar;} /
the event handler (function) is generated dynamically.
So writing
mx:Button x=23 y=242 label=Button click={myFunction()} /
means that some method will be generated by compiler and it will call
myFunction().
If you don't use braces myFunction used for handling event and no additional
function is generated.

Am I right?

R.

On 2/20/07, Paul Andrews [EMAIL PROTECTED] wrote:


   - Original Message -

*From:* Kumar [EMAIL PROTECTED]
*To:* flexcoders@yahoogroups.com
*Sent:* Tuesday, February 20, 2007 7:35 AM
*Subject:* [flexcoders] Quick Question

 Hi All,





Just a quick one guys just had a little confusion in two statements below



First:

  mx:Button x=23 y=242 label=Button click=myFunction() /



This is just calling myFynction() in response to the button click.



Second:

  mx:Button x=23 y=242 label=Button click={myFunction()} /



Here, you have the same as above, but you are (for some reason) trying to
wrap the function call in a binding which is having no effect in this
context, so the effect is the same.



Perhaps some research on Flex binding will help.



Paul



Both Buttons give the same result…

Just a bit confused…









 



Re: [flexcoders] Object property

2007-02-20 Thread Roman Protsiuk

obj[property_name]

R.

On 2/20/07, Mikhail Shevchuk [EMAIL PROTECTED] wrote:


  Hello, group.

I got an object with several properties. I can access these properties
just by using obj.property_name.
How can I access the given property if it is passed to the function as a
string? How to implement the following function?

function getObjectPropertyValue(obj:Object, property:String)
{
  return ?
}

This function should return obj.property_name, if property =
property_name.

Thanks.
--
A vivid and creative mind characterizes you.
 



Re: [flexcoders] mouseOver an element within a TileList problem

2007-02-10 Thread Roman Protsiuk

I don't really see problem in this. You just have to add event handler to
handle itemRollOver event of your TileList. That's all. Handler may look
like:

protected function onItemRollOver(event : ListEvent) : void {
   someLabelUnderTheList.text = event.itemRenderer.data.name;
}

Or something like this. Here event.itemRenderer is list element you rolled
over and event.itemRenderer.data is this elements data (from data provider).

R.

On 2/9/07, bensmith5774 [EMAIL PROTECTED] wrote:


  Hello, I hope someone can help me with my problem - I think I may be
missing something
rather obvious.

I have a TileList populated with data (ArrayCollection). Underneath the
TileList I have a blank
area. When the user mouseOver's a row in the TileList I want some of that
data (for example
name, category) to appear in the blank area. This sounds rather straight
forward but I having
a bit of a hard time getting it to work.

Is there a way to explicitly reference the currently mouseOver'd object
so it can be displayed
outside the TileList. item renderers and repeaters don't seem to help much
as I'm trying to
display the content OUTSIDE of the TileList. I've also tried using
IViewCursor
(cursor.current.name) but it only ever displays the first element of the
ArrayCollection.

Any ideas much appreciated.
Iain.

 



[flexcoders] Opening GIF in Safari (offtopic?)

2007-02-09 Thread Roman Protsiuk
Hi, everyone.

Dunno maybe it's offtopic. However, the question is:
if I try opening GIF image in a Safari browser via ExternalInterface,
e.g. ExternalInterface.call(window.open, /content/some.gif,
_blank);
I get it saved instead of showed. Browser just saves image and that's all.

I'm not keen on Safari and stuff. Maybe someone knows what it's all about.

Thanks,
R.


Re: [flexcoders] Opening GIF in Safari (offtopic?)

2007-02-09 Thread Roman Protsiuk

Thanks, I'll check that out.

R.

On 2/9/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


  Its probably the mime type (or content type) of the server that serves
up
the gif...


 Hi, everyone.

 Dunno maybe it's offtopic. However, the question is:
 if I try opening GIF image in a Safari browser via ExternalInterface,
 e.g. ExternalInterface.call(window.open, /content/some.gif,
 _blank);
 I get it saved instead of showed. Browser just saves image and that's
all.

 I'm not keen on Safari and stuff. Maybe someone knows what it's all
about.

 Thanks,
 R.

 



Re: [flexcoders] enabled={Boolean(myDataProvider.length)}

2007-02-07 Thread Roman Protsiuk

Well, technically Boolean(-1) == true. Though, it's probably not your case
but...

R.

On 2/6/07, Ralf Bokelberg [EMAIL PROTECTED] wrote:


  I would prefer the following:

*enabled={ myDataProvider.length  0}
*
It's shorter and communicates the intention better imho
Cheers,
Ralf.

On 2/6/07, rd_grimes [EMAIL PROTECTED] wrote:

   Just curious if this type of syntax is wise or advisable? I just
 completed my first major Flex project and I use this in several
 places. But, now I'm wondering if anyone knows of a reason why this
 might cause problems or introduce some undesired side-effect.

 Thanks,

 Ron




--
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35
 



Re: [flexcoders] Re: TitleWindow missing all focus events??

2007-02-03 Thread Roman Protsiuk

As the matter of fact I just forgot to say that for focusInHandler to work
your component has to implement IFocusManagerComponent. In this way you
don't have to add these methods as event listeners manually.

And as to relatedObject part of understanding came from documentation and
another one came from reading sdk sources.

R.

On 2/2/07, zhongtie [EMAIL PROTECTED] wrote:


  Thanks, Roman. Actually you answered my another question: I have been
trying to figure out why I cannot focus in the edit control inside the
titlewindow :) Where did you learn those good tips about relatedObject ?!!

I am still a little puzzled by how focusIn works. I realized I have to
do these two lines before the focusIn/OutHandler gets invoked:

this.addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
this.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);

Does it mean by default, TitleWindow doesn't get FOCUS events
dispatched to?

Thanks again for your great help!

Tim

--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Roman
Protsiuk
[EMAIL PROTECTED] wrote:

 Overloading focusOutHandler/focusInHandler helps. You'll be able to
handle
 FocusEvents there.
 Like in


 protected override function focusOutHandler(event : FocusEvent) : void {
 if (event.relatedObject == null || !contains(event.relatedObject)) {
 // event came from outside not from one of the children
 }
 super.focusOutHandler(event);
 }

 R.

 On 2/2/07, zhongtie [EMAIL PROTECTED] wrote:
 
  I pop up TitleWindows using PopupManager, and I change the titlebar
  colors based on if the titleWindow is active (topmost) or not. The
  problem is, I am NOT able to capture the focus event for TitleWindow
  (other controls, like TextArea, has no problems), nor does
  onFocusIn/onFocusOut overwrite work.
 
  Any idea?
 
 
 


 



Re: [flexcoders] pop ups again

2007-02-02 Thread Roman Protsiuk

:) Thanks, Doug. I've just made the same thing you did. ;)

R.

On 2/1/07, Doug McCune [EMAIL PROTECTED] wrote:


   By the way, here's my modification to your example that works.
Basically I extended TitleWindow to dispatch a custom event whenever the
visiblity is changed, regardless of the flag that normally controls whether
to dispatch the event.

See it here: http://dougmccune.com/flex/popup_test/

right click to view source

-Doug


Doug McCune wrote:

 So the reason for this is because PopUpManager listens for the SHOW and
HIDE events (see PopUpManagerImpl.as line 471). If your popped up
component dispatches SHOW or HIDE then the PopUpManager takes this to mean
that it should show or hide the popup.

So when your popped up window dispatches SHOW, PopUpManager calls
showModalWindow(), which then also sets the window's visible property. If
this setting of the visible property in turn triggered the SHOW event, then
we'd get caught in an endless loop of PopUpManager calling showModalWindow()
over and over again.

So this isn't a solution, but hopefully it helps to understand what's
going on.

Doug


Roman Protsiuk wrote:

 I guess the reason is in following line of PopUpManagerImpl.as:

line 574: IUIComponent(o.owner).setVisible(true, true);

Second parameter says do not dispatch show event... I wonder why is
it this way...

Maybe someone who understands this behavior will read these lines someday.

R.

On 2/1/07, Roman Protsiuk [EMAIL PROTECTED]roman.protsiuk%40gmail.com
wrote:
 Hi, everyone.

 I've modified my previous example (if anyone saw it). Now I'm using
 following approach to handle pop ups:

 The pop up itself PopUpWindow.mxml:

 ?xml version=1.0 encoding=utf-8?
 mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=vertical
 horizontalAlign=center
 width=400
 height=300
 implements=mx.managers.IFocusManagerComponent
 title=TESTING
 defaultButton={mainButton}
 creationComplete=onCreationComplete()
 show=onShow()

 mx:Box height=100% minHeight=0 width=100%
 mx:Text id=traceText text=show captured (not creationComplete): /
 /mx:Box

 mx:Canvas width=100%
 mx:Label id=total text=total: none left=10 /
 mx:Button id=mainButton
 horizontalCenter=0
 bottom=10
 label=close me
 click=onMainButtonClick() /
 /mx:Canvas

 mx:Script
 ![CDATA[
 import mx.core.Application;
 import mx.managers.PopUpManager;
 import mx.managers.PopUpManagerChildList;

 private static var _popUp : PopUpWindow;

 private static var _totalCounter : Number = 0;

 private static var _showCounter : Number = 0;

 public var modal : Boolean;

 public static function showPopUp(parent : DisplayObject = null,
 modal : Boolean = true) : PopUpWindow {
 var popUpParent : DisplayObject = (parent != null ? parent :
 DisplayObject(Application.application));

 if (_popUp == null) {
 _popUp = PopUpWindow(PopUpManager.createPopUp(popUpParent,
 PopUpWindow, modal, PopUpManagerChildList.APPLICATION));
 } else {
 if (!_popUp.isPopUp) {
 _popUp.modal = modal;
 _popUp.traceText.htmlText += (++_totalCounter).toString() + ) 
 +  modality:  + modal.toString() + . ;

 PopUpManager.addPopUp(_popUp, popUpParent, modal,
 PopUpManagerChildList.APPLICATION);
 }
 }

 PopUpManager.centerPopUp(_popUp);

 return _popUp;
 }

 protected function hidePopUp() : void {
 if (isPopUp) {
 PopUpManager.removePopUp(this);
 }
 }

 protected function onCreationComplete() : void {
 mainButton.setFocus();
 }

 protected function onShow() : void {
 mainButton.setFocus();

 traceText.htmlText += (++_showCounter).toString() +  time +
 (_showCounter == 1 ?  : s);
 total.text = total:  + _showCounter.toString();
 }

 protected override function focusOutHandler(event : FocusEvent) : void {
 if (event.relatedObject == null || !contains(event.relatedObject)) {
 hidePopUp();
 }
 super.focusOutHandler(event);
 }

 private function onMainButtonClick() : void {
 hidePopUp();
 dispatchEvent(new Event(Event.CLOSE));
 }

 ]]
 /mx:Script

 /mx:TitleWindow


 Application popUpSample.mxml:

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

 mx:CheckBox id=modal label=modal? horizontalCenter=0
 verticalCenter=-30 /

 mx:Button id=clickButton
 horizontalCenter=0
 verticalCenter=0
 label=click me
 click=onButtonClick() /

 mx:Script
 ![CDATA[
 private function onButtonClick() : void {
 PopUpWindow.showPopUp(null, modal.selected);
 }
 ]]
 /mx:Script

 /mx:Application


 The problem here consist in show event which should be dispatched when
 component visibility is changed to true as I understand.
 The bad thing is this pop up dispatches show event ONLY while it is
 NOT MODAL. If I say 'let's make it modal', show event isn't
 dispatched. Confusing. At least as for me.

 Can anybody explain this behavior? Or say it's not right?

 Thanks,
 R.




 



Re: [flexcoders] TitleWindow missing all focus events??

2007-02-02 Thread Roman Protsiuk

Overloading focusOutHandler/focusInHandler helps. You'll be able to handle
FocusEvents there.
Like in


protected override function focusOutHandler(event : FocusEvent) : void {
   if (event.relatedObject == null || !contains(event.relatedObject)) {
   // event came from outside not from one of the children
   }
   super.focusOutHandler(event);
}

R.

On 2/2/07, zhongtie [EMAIL PROTECTED] wrote:


  I pop up TitleWindows using PopupManager, and I change the titlebar
colors based on if the titleWindow is active (topmost) or not. The
problem is, I am NOT able to capture the focus event for TitleWindow
(other controls, like TextArea, has no problems), nor does
onFocusIn/onFocusOut overwrite work.

Any idea?

 



Re: [flexcoders] DATAGRID clic on cell

2007-02-01 Thread Roman Protsiuk

editable=false on DataGrid or on DataGridColumn if it's the single column
you don't want to edit.

R.

On 2/1/07, wifi19 [EMAIL PROTECTED] wrote:


  hie

how can i do to get cell clic on a datagrid without edit this cell

thank!

 



[flexcoders] SOLVED: IFocusManagerComponent and removePopUp

2007-02-01 Thread Roman Protsiuk
Thanks for the huge amount of advises. ;)

As it appeared the hole thing was in method hidePopUp of PopUpWindow.
We do removePopUp there and after it focus of course changes and this
pop-up fires focusOut. in focusOutHandler we call the very same
hidePopUp. But, it isn't popped up now. So the only thing missing in
hidePopUp is test for isPopUp. The final code for hidePopUp is
following:

public function hidePopUp() : void {
if (isPopUp) {
PopUpManager.removePopUp(this);
}
}

That's all.

R.

On 1/18/07, Roman Protsiuk [EMAIL PROTECTED] wrote:
 Yeah, and this bug appeared just recently. Is it related with Flash
 Player 9.0.28 changes or with FlexBuilder 2.0.1 hard to tell.
 Everything worked as it is without crashes before.

 R.

 On 1/18/07, Roman Protsiuk [EMAIL PROTECTED] wrote:
  Hi, everyone.
 
  As I understand in order to properly handle focusOut event for my
  component it should implement IFocusManagerComponent. The component I
  develop is a pop-up window. Then strange and very unpleasant bug
  appear. After I set focus to one of my components child and after I
  click a button on it to close it browser crashes (firefox, ie).
  I don't know what to say more. Here's example. Simply clicking close
  me crashes browser. Totally confused.
 
  PopUpWindow.mxml:
 
  ?xml version=1.0 encoding=utf-8?
  mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=absolute
  width=400
  height=300
  implements=mx.managers.IFocusManagerComponent
  defaultButton={mainButton}
 
  mx:Button id=mainButton
  horizontalCenter=0
  verticalCenter=0
  label=close me
  click=onMainButtonClick() /
 
  mx:Button label=fake /
 
  mx:Script
  ![CDATA[
  import mx.core.UIComponent;
  import mx.managers.PopUpManager;
 
  public function showPopUp(parent : UIComponent) : 
  void {
  PopUpManager.addPopUp(this, parent);
  PopUpManager.centerPopUp(this);
  setFocus();
  }
 
  public function hidePopUp() : void {
  PopUpManager.removePopUp(this);
  }
 
  public override function setFocus() : void {
  super.setFocus();
  mainButton.setFocus();
  }
 
  protected override function focusOutHandler(event : 
  FocusEvent) : void {
  if (event.relatedObject == null || 
  !contains(event.relatedObject)) {
  hidePopUp();
  }
  super.focusOutHandler(event);
  }
 
  private function onMainButtonClick() : void {
  hidePopUp();
  dispatchEvent(new Event(Event.CLOSE));
  }
  ]]
  /mx:Script
 
  /mx:TitleWindow
 
 
  popUpSample.mxml:
 
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=absolute
  creationComplete=onCreationComplete()
 
  mx:Button id=clickButton
  horizontalCenter=0
  verticalCenter=0
  label=click me
  click=onButtonClick() /
 
  mx:Button label=fake /
 
  mx:Script
  ![CDATA[
  public override function setFocus() : void {
  super.setFocus();
  clickButton.setFocus();
  }
 
  private function onCreationComplete() : void {
  _popUp = new PopUpWindow();
  _popUp.addEventListener(Event.CLOSE, 
  onPopUpClose);
  }
 
  private function onButtonClick() : void {
  _popUp.showPopUp(this);
  }
 
  private function onPopUpClose(event : Event) : void 
  {
  //clickButton.setFocus();
  }
 
  private var _popUp : PopUpWindow;
  ]]
  /mx:Script
 
  /mx:Application
 
  The only thought i have: it's because focus is lost (it stays in
  pop-up) when pop-up is removed and the lost focus is unacceptable for
  flash player. So I added clickButton.setFocus() on close. But if i do
  it before removePopUp then PopUpWindws focusOutHandler removes it. Why
  do i need to call it manually anyway

[flexcoders] pop ups again

2007-02-01 Thread Roman Protsiuk
Hi, everyone.

I've modified my previous example (if anyone saw it). Now I'm using
following approach to handle pop ups:

The pop up itself PopUpWindow.mxml:

?xml version=1.0 encoding=utf-8?
mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
horizontalAlign=center
width=400
height=300
implements=mx.managers.IFocusManagerComponent
title=TESTING
defaultButton={mainButton}
creationComplete=onCreationComplete()
show=onShow()

mx:Box height=100% minHeight=0 width=100%
mx:Text id=traceText text=show captured (not 
creationComplete): /
/mx:Box

mx:Canvas width=100%
mx:Label id=total text=total: none left=10 /
mx:Button id=mainButton
horizontalCenter=0
bottom=10
label=close me
click=onMainButtonClick() /
/mx:Canvas

mx:Script
![CDATA[
import mx.core.Application;
import mx.managers.PopUpManager;
import mx.managers.PopUpManagerChildList;

private static var _popUp : PopUpWindow;

private static var _totalCounter : Number = 0;

private static var _showCounter : Number = 0;

public var modal : Boolean;

public static function showPopUp(parent : DisplayObject 
= null,
modal : Boolean = true) : PopUpWindow {
var popUpParent : DisplayObject = (parent != 
null ? parent :
DisplayObject(Application.application));

if (_popUp == null) {
_popUp = 
PopUpWindow(PopUpManager.createPopUp(popUpParent,
PopUpWindow, modal, PopUpManagerChildList.APPLICATION));
} else {
if (!_popUp.isPopUp) {
_popUp.modal = modal;
_popUp.traceText.htmlText += 
(++_totalCounter).toString() + ) 
+  modality:  + modal.toString() + . ;

PopUpManager.addPopUp(_popUp, 
popUpParent, modal,
PopUpManagerChildList.APPLICATION);
}
}

PopUpManager.centerPopUp(_popUp);

return _popUp;
}

protected function hidePopUp() : void {
if (isPopUp) {
PopUpManager.removePopUp(this);
}
}

protected function onCreationComplete() : void {
mainButton.setFocus();
}

protected function onShow() : void {
mainButton.setFocus();

traceText.htmlText += 
(++_showCounter).toString() +  time +
(_showCounter == 1 ?  : s);
total.text = total:  + 
_showCounter.toString();
}

protected override function focusOutHandler(event : 
FocusEvent) : void {
if (event.relatedObject == null || 
!contains(event.relatedObject)) {
hidePopUp();
}
super.focusOutHandler(event);
}

private function onMainButtonClick() : void {
hidePopUp();
dispatchEvent(new Event(Event.CLOSE));
}

]]
/mx:Script

/mx:TitleWindow


Application popUpSample.mxml:

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

mx:CheckBox id=modal label=modal? horizontalCenter=0
verticalCenter=-30 /

mx:Button id=clickButton
horizontalCenter=0
verticalCenter=0
label=click me
click=onButtonClick() /

mx:Script
![CDATA[

Re: [flexcoders] pop ups again

2007-02-01 Thread Roman Protsiuk
I guess the reason is in following line of PopUpManagerImpl.as:

line 574: IUIComponent(o.owner).setVisible(true, true);

Second parameter says do not dispatch show event... I wonder why is
it this way...

Maybe someone who understands this behavior will read these lines someday.

R.

On 2/1/07, Roman Protsiuk [EMAIL PROTECTED] wrote:
 Hi, everyone.

 I've modified my previous example (if anyone saw it). Now I'm using
 following approach to handle pop ups:

 The pop up itself PopUpWindow.mxml:

 ?xml version=1.0 encoding=utf-8?
 mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=vertical
 horizontalAlign=center
 width=400
 height=300
 implements=mx.managers.IFocusManagerComponent
 title=TESTING
 defaultButton={mainButton}
 creationComplete=onCreationComplete()
 show=onShow()

 mx:Box height=100% minHeight=0 width=100%
 mx:Text id=traceText text=show captured (not 
 creationComplete): /
 /mx:Box

 mx:Canvas width=100%
 mx:Label id=total text=total: none left=10 /
 mx:Button id=mainButton
 horizontalCenter=0
 bottom=10
 label=close me
 click=onMainButtonClick() /
 /mx:Canvas

 mx:Script
 ![CDATA[
 import mx.core.Application;
 import mx.managers.PopUpManager;
 import mx.managers.PopUpManagerChildList;

 private static var _popUp : PopUpWindow;

 private static var _totalCounter : Number = 0;

 private static var _showCounter : Number = 0;

 public var modal : Boolean;

 public static function showPopUp(parent : 
 DisplayObject = null,
 modal : Boolean = true) : PopUpWindow {
 var popUpParent : DisplayObject = (parent != 
 null ? parent :
 
 DisplayObject(Application.application));

 if (_popUp == null) {
 _popUp = 
 PopUpWindow(PopUpManager.createPopUp(popUpParent,
 PopUpWindow, modal, PopUpManagerChildList.APPLICATION));
 } else {
 if (!_popUp.isPopUp) {
 _popUp.modal = modal;
 _popUp.traceText.htmlText += 
 (++_totalCounter).toString() + ) 
 +  modality:  + modal.toString() + . ;

 PopUpManager.addPopUp(_popUp, 
 popUpParent, modal,
 PopUpManagerChildList.APPLICATION);
 }
 }

 PopUpManager.centerPopUp(_popUp);

 return _popUp;
 }

 protected function hidePopUp() : void {
 if (isPopUp) {
 PopUpManager.removePopUp(this);
 }
 }

 protected function onCreationComplete() : void {
 mainButton.setFocus();
 }

 protected function onShow() : void {
 mainButton.setFocus();

 traceText.htmlText += 
 (++_showCounter).toString() +  time +
 (_showCounter == 1 ?  : s);
 total.text = total:  + 
 _showCounter.toString();
 }

 protected override function focusOutHandler(event : 
 FocusEvent) : void {
 if (event.relatedObject == null || 
 !contains(event.relatedObject)) {
 hidePopUp();
 }
 super.focusOutHandler(event);
 }

 private function onMainButtonClick() : void {
 hidePopUp();
 dispatchEvent(new Event(Event.CLOSE));
 }

 ]]
 /mx:Script

 /mx:TitleWindow


 Application popUpSample.mxml:

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

 mx:CheckBox id=modal label=modal? horizontalCenter=0
 verticalCenter=-30 /

 mx:Button id=clickButton
 horizontalCenter=0
 verticalCenter=0
 label=click me
 click=onButtonClick() /

 mx:Script
 ![CDATA[
 private function onButtonClick

Re: [flexcoders] Why must default arguments be primitives?

2007-01-20 Thread Roman Protsiuk

I guess the keyword here is not a compile-time constant. You can use
'null' but not 'new Array()' because it is calculated in run-time. Please,
correct me if I'm wrong.

R.

On 1/19/07, ben.clinkinbeard [EMAIL PROTECTED] wrote:


  I just noticed that you cannot set default values for arguments of
complex types like arrays and objects. The error given is 1047:
Parameter initializer unknown or is not a compile-time constant, but
that doesn't seem to hold water when the code looks like this:

public function
GetBatchContainersEvent(a_arr_containersToRetrieve:Array =
[IndustryTrends, OptionalSections])

Its obviously not hard to work around this, I just thought I would ask
because it doesn't make sense to me.

Thanks,
Ben

 



Re: [flexcoders] PopUpManager.removePopUp() not actually removing pop ups

2007-01-20 Thread Roman Protsiuk

Hi.

PopUpManager.removePopUp(someWindow) really doesn't destroy someWindow.
If you create someWindow in some function it should be destroyed by garbage
collector.
Otherwise... well sometimes I simply use one object for every pop-up of
special type, e.g.

private static var _popUp : IFlexDisplayObject = new FailurePopUp(Error
msg);

and then in some function:
PopUpManager.addPopUp(_popUp, model.mainAppCanvas, true);
PopUpManager.centerPopUp(_popUp);

and removing it like this:
PopUpManager.removePopUp(_popUp);

R.

On 1/19/07, ben.clinkinbeard [EMAIL PROTECTED] wrote:


  I am seeing behavior where pop ups seem to just be getting hidden by
removePopUp(), resulting in a growing stack of them each time a new
one is added. I create the pop up like this:

var p:IFlexDisplayObject = new FailurePopUp(Error msg);
PopUpManager.addPopUp(p, model.mainAppCanvas, true);
PopUpManager.centerPopUp(p);

and removing it like this:

PopUpManager.removePopUp(this);

No idea what is going on. Any help is greatly appreciated.

Thanks,
Ben

 



Re: [flexcoders] Is this a bug about FocusEvents and popupmanager?

2007-01-19 Thread Roman Protsiuk

There is several messages with subject Firefox - TextInput Bug. Though it
not looks like exactly your problem however i guess the reason of such
behavior is the same.
There seem to be quite a lot of funny focus tricks in firefox+flash
player. Pity.

R.

On 1/19/07, eren bali [EMAIL PROTECTED] wrote:


  Thanks for your reply, I am using firefox.
I searched for posts before sendind a new post but could not find a
relevant post.


On 1/18/07, Roman Protsiuk [EMAIL PROTECTED] wrote:

   It is more likely Firefox bug. Are you using this browser? Because the
 described behavior is reproducible in Firefox but not in IE. Try to search
 older posts in list seems to me that I saw this problem being discussed
 here.

 R.


 On 1/17/07, eren bali  [EMAIL PROTECTED] wrote:
 
Hi to all,
 
  I have a couple of textinputs that all have focusIn and focusOut
  listeners.
  One of these tese inputs open a file reference (FileReference.browse)
  When you press cancel in file explorer dialog, it closes silently. But
  when i click another textinput, two focusIn events are disparchet together,
  one for the old textinput one for the recently clicked textinput.
 
  Below is a code to demonstrate the issue.
  Just click 1st textinput, than 3rd one. Close the dialog with cancel
  button, than click the first textinput.
  log variable was expected to be:
  Laga Luga
  Browse
  Laga Luga
 
  However it is:
  Laga Luga
  Browse
  Browse
  Laga Luga
 
  --
  Eren BALİ
 
  =
 
  ?xml version= 1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml 
  layout=vertical
  mx:Script
  ![CDATA[
  import mx.controls.Alert;
  import mx.controls.Text;
  [Bindable]
  private var log:String=;
  private var fr:FileReference=new FileReference;
  private function focusIn(event:FocusEvent):void{
  log+=\n+event.currentTarget.text;
  if(event.currentTarget==tiGozat){
  fr.browse();
  }
  }
  ]]
  /mx:Script
  mx:TextInput text=Laga Luga focusIn=focusIn(event) /
  mx:TextInput text=Laga Luga2 focusIn=focusIn(event) /
  mx:TextInput id=tiGozat text=Browse focusIn=focusIn(event)
  /
  mx:Text width=300 text={log} /
  /mx:Application
 




--
Eren BALİ
Invento Studios

 



Re: [flexcoders] Re: Code behind- do you use it?

2007-01-18 Thread Roman Protsiuk
Hi, everybody.

Interesting thing that just recently we had discussion at our team
about code-behind and why should we use it or use not. The point we
are at the moment is: we've used code-behind more like legacy related
thing from Flex 1.5 (FlexBuilder) and now we've got a lot of classes
which simply copy several properties. Definitely it's not very
object-oriented. And now the idea is NOT to use code-behind where
possible. The discussion continues so it's very interesting to hear
different opinion. As far as I understand while developing components
trying make them atomic and not overweight Script block looks not so
bad.

R.

On 1/17/07, Tom Chiverton [EMAIL PROTECTED] wrote:
 On Wednesday 17 January 2007 09:49, Danko Kozar wrote:
  Why doesn't Flex Builder allow to name the .mxml and .as page using the
  same name? Does this happen only with files in subdirectories (?).

 Because it builds down the MXML to an AS class. Guess how it picks the name
 for that class :-)
 There is a 'keep classes' compiler option if you are curious.

 --
 Tom Chiverton
 Helping to continually pursue exceptional e-services

 

 This email is sent for and on behalf of Halliwells LLP.

 Halliwells LLP is a limited liability partnership registered in England and 
 Wales under registered number OC307980 whose registered office address is at 
 St James's Court Brown Street Manchester M2 2JF.  A list of members is 
 available for inspection at the registered office. Any reference to a partner 
 in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by 
 the Law Society.

 CONFIDENTIALITY

 This email is intended only for the use of the addressee named above and may 
 be confidential or legally privileged.  If you are not the addressee you must 
 not read it and must not use any information contained in nor copy it nor 
 inform any person other than Halliwells LLP or the addressee of its existence 
 or contents.  If you have received this email in error please delete it and 
 notify Halliwells LLP IT Department on 0870 365 8008.

 For more information about Halliwells LLP visit www.halliwells.com.



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






Re: [flexcoders] It shouldn't be this hard.

2007-01-18 Thread Roman Protsiuk

The first thought is:

mx:Canvas width=100% height=100%
   mx:Image source={yourSource} horizontalCenter=0 verticalCenter=0
/
/mx:Canvas

To scale, dunno, but maybe something like:

mx:Canvas id=imageContainer width=100% height=100%
   mx:Image id=image
   source={yourSource}
   width={imageContainer.width  image.width ? imageContainer.width :
image.width}
   height={imageContainer.height  image.height ?
imageContainer.height : image.height}
   scaleContent=true
   horizontalCenter=0
   verticalCenter=0 /
/mx:Canvas

This one probably won't work, it's very dirty, however might give you a
clue... ;)

And the easiest way to scale, but still, not so nice from the point of ui
(it scales both way) is just:

mx:Image source={yourSource} scaleContent=true width=100%
height=100% /

Have fun,
R.


On 1/18/07, Russell Sprague [EMAIL PROTECTED] wrote:


  I hate the flex documentation...

All I want to do is dynamically center an image on my stage.

I have a VDividedBox with an image in the top, and text in the bottom.
I loading in images by setting the source of an image tag(probably not
the best way to do it, but again I hate the Flex docs...).
So when the image loads I am trying to set it to center in the upper
pane of the vdividedbox, but all my attemps have failed.

It would be nice to also resize the image as the divideBar is dragged,
but only to the original size of the image, then it just centers.

Thanks
Russ

 



Re: [flexcoders] Is this a bug about FocusEvents and popupmanager?

2007-01-18 Thread Roman Protsiuk

It is more likely Firefox bug. Are you using this browser? Because the
described behavior is reproducible in Firefox but not in IE. Try to search
older posts in list seems to me that I saw this problem being discussed
here.

R.

On 1/17/07, eren bali [EMAIL PROTECTED] wrote:


  Hi to all,

I have a couple of textinputs that all have focusIn and focusOut
listeners.
One of these tese inputs open a file reference (FileReference.browse)
When you press cancel in file explorer dialog, it closes silently. But
when i click another textinput, two focusIn events are disparchet together,
one for the old textinput one for the recently clicked textinput.

Below is a code to demonstrate the issue.
Just click 1st textinput, than 3rd one. Close the dialog with cancel
button, than click the first textinput.
log variable was expected to be:
Laga Luga
Browse
Laga Luga

However it is:
Laga Luga
Browse
Browse
Laga Luga

--
Eren BALİ

=

?xml version= 1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
mx:Script
![CDATA[
import mx.controls.Alert;
import mx.controls.Text;
[Bindable]
private var log:String=;
private var fr:FileReference=new FileReference;
private function focusIn(event:FocusEvent):void{
log+=\n+event.currentTarget.text;
if(event.currentTarget==tiGozat){
fr.browse();
}
}
]]
/mx:Script
mx:TextInput text=Laga Luga focusIn=focusIn(event) /
mx:TextInput text=Laga Luga2 focusIn=focusIn(event) /
mx:TextInput id=tiGozat text=Browse focusIn=focusIn(event) /
mx:Text width=300 text={log} /
/mx:Application
 



[flexcoders] IFocusManagerComponent and removePopUp

2007-01-18 Thread Roman Protsiuk
Hi, everyone.

As I understand in order to properly handle focusOut event for my
component it should implement IFocusManagerComponent. The component I
develop is a pop-up window. Then strange and very unpleasant bug
appear. After I set focus to one of my components child and after I
click a button on it to close it browser crashes (firefox, ie).
I don't know what to say more. Here's example. Simply clicking close
me crashes browser. Totally confused.

PopUpWindow.mxml:

?xml version=1.0 encoding=utf-8?
mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
width=400
height=300
implements=mx.managers.IFocusManagerComponent
defaultButton={mainButton}

mx:Button id=mainButton
horizontalCenter=0
verticalCenter=0
label=close me
click=onMainButtonClick() /

mx:Button label=fake /

mx:Script
![CDATA[
import mx.core.UIComponent;
import mx.managers.PopUpManager;

public function showPopUp(parent : UIComponent) : void {
PopUpManager.addPopUp(this, parent);
PopUpManager.centerPopUp(this);
setFocus();
}

public function hidePopUp() : void {
PopUpManager.removePopUp(this);
}

public override function setFocus() : void {
super.setFocus();
mainButton.setFocus();
}

protected override function focusOutHandler(event : 
FocusEvent) : void {
if (event.relatedObject == null || 
!contains(event.relatedObject)) {
hidePopUp();
}
super.focusOutHandler(event);
}

private function onMainButtonClick() : void {
hidePopUp();
dispatchEvent(new Event(Event.CLOSE));
}
]]
/mx:Script

/mx:TitleWindow


popUpSample.mxml:

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

mx:Button id=clickButton
horizontalCenter=0
verticalCenter=0
label=click me
click=onButtonClick() /

mx:Button label=fake /

mx:Script
![CDATA[
public override function setFocus() : void {
super.setFocus();
clickButton.setFocus();
}

private function onCreationComplete() : void {
_popUp = new PopUpWindow();
_popUp.addEventListener(Event.CLOSE, 
onPopUpClose);
}

private function onButtonClick() : void {
_popUp.showPopUp(this);
}

private function onPopUpClose(event : Event) : void {
//clickButton.setFocus();
}

private var _popUp : PopUpWindow;
]]
/mx:Script

/mx:Application

The only thought i have: it's because focus is lost (it stays in
pop-up) when pop-up is removed and the lost focus is unacceptable for
flash player. So I added clickButton.setFocus() on close. But if i do
it before removePopUp then PopUpWindws focusOutHandler removes it. Why
do i need to call it manually anyway? :/ And if i do it after calling
removePopUp then situation remains the same, browser crashes, not
surprisingly.

Any help highly appreciated.
R.


Re: [flexcoders] IFocusManagerComponent and removePopUp

2007-01-18 Thread Roman Protsiuk
Yeah, and this bug appeared just recently. Is it related with Flash
Player 9.0.28 changes or with FlexBuilder 2.0.1 hard to tell.
Everything worked as it is without crashes before.

R.

On 1/18/07, Roman Protsiuk [EMAIL PROTECTED] wrote:
 Hi, everyone.

 As I understand in order to properly handle focusOut event for my
 component it should implement IFocusManagerComponent. The component I
 develop is a pop-up window. Then strange and very unpleasant bug
 appear. After I set focus to one of my components child and after I
 click a button on it to close it browser crashes (firefox, ie).
 I don't know what to say more. Here's example. Simply clicking close
 me crashes browser. Totally confused.

 PopUpWindow.mxml:

 ?xml version=1.0 encoding=utf-8?
 mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
 width=400
 height=300
 implements=mx.managers.IFocusManagerComponent
 defaultButton={mainButton}

 mx:Button id=mainButton
 horizontalCenter=0
 verticalCenter=0
 label=close me
 click=onMainButtonClick() /

 mx:Button label=fake /

 mx:Script
 ![CDATA[
 import mx.core.UIComponent;
 import mx.managers.PopUpManager;

 public function showPopUp(parent : UIComponent) : 
 void {
 PopUpManager.addPopUp(this, parent);
 PopUpManager.centerPopUp(this);
 setFocus();
 }

 public function hidePopUp() : void {
 PopUpManager.removePopUp(this);
 }

 public override function setFocus() : void {
 super.setFocus();
 mainButton.setFocus();
 }

 protected override function focusOutHandler(event : 
 FocusEvent) : void {
 if (event.relatedObject == null || 
 !contains(event.relatedObject)) {
 hidePopUp();
 }
 super.focusOutHandler(event);
 }

 private function onMainButtonClick() : void {
 hidePopUp();
 dispatchEvent(new Event(Event.CLOSE));
 }
 ]]
 /mx:Script

 /mx:TitleWindow


 popUpSample.mxml:

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

 mx:Button id=clickButton
 horizontalCenter=0
 verticalCenter=0
 label=click me
 click=onButtonClick() /

 mx:Button label=fake /

 mx:Script
 ![CDATA[
 public override function setFocus() : void {
 super.setFocus();
 clickButton.setFocus();
 }

 private function onCreationComplete() : void {
 _popUp = new PopUpWindow();
 _popUp.addEventListener(Event.CLOSE, 
 onPopUpClose);
 }

 private function onButtonClick() : void {
 _popUp.showPopUp(this);
 }

 private function onPopUpClose(event : Event) : void {
 //clickButton.setFocus();
 }

 private var _popUp : PopUpWindow;
 ]]
 /mx:Script

 /mx:Application

 The only thought i have: it's because focus is lost (it stays in
 pop-up) when pop-up is removed and the lost focus is unacceptable for
 flash player. So I added clickButton.setFocus() on close. But if i do
 it before removePopUp then PopUpWindws focusOutHandler removes it. Why
 do i need to call it manually anyway? :/ And if i do it after calling
 removePopUp then situation remains the same, browser crashes, not
 surprisingly.

 Any help highly appreciated.
 R.



Re: [flexcoders] Filter An ArrayCollection By Multiple ArrayCollections (selectedItems)

2007-01-17 Thread Roman Protsiuk

Hard to understand what exactly do you need. However if I understood
correctly maybe this
http://tech.groups.yahoo.com/group/flexcoders/message/60145 thread will help
you.

R.

On 1/13/07, m_ollman  [EMAIL PROTECTED] wrote:



I'm trying to think of the best way to approach this.

I have 3 main arrayCollections - store, store_category and 6 X
categories (categories filtered into groupings).

A user would select several items from the cats AC's that would
filter store_cats AC (the mappings). Then the stores with matches
are filtered from the stores AC.

I have a filter function in place but can only figure out out to
feed it one value - not an array of selected values from several
DataGrids.

public function addMapping():void
{
ac.addItem({dg1:selectedItem.text});
}


Any thoughts throbbing Flex Brain?

Great example by Bruce Phillips

http://www.brucephillips.name/blog/index.cfm/2006/11/23/Sort-An-
ArrayCollection-By-Multiple-Fields-and-Filter-An-ArrayCollection-By-
Multiple-Fields-In-Flex

 



Re: [flexcoders] Capturing an event everytime an item becomes visibile in a viewstate

2007-01-12 Thread Roman Protsiuk

Do you have some effect played in transition? It dispatches effectEnd.

R.

On 1/11/07, Sam Shrefler [EMAIL PROTECTED] wrote:


  Enterstate is actually called before the creationComplete on the child.
I have the state display to a transition.  I'd actually like to call the
function after the transition finishes.  Any thoughts on how to do that?

On 1/11/07, Roman Protsiuk [EMAIL PROTECTED] wrote:

   enterState?

 R.

 On 1/11/07, Sam Shrefler  [EMAIL PROTECTED] wrote:
 
I have a canvas that is part of a view state.  I'd like to know how
  to call a method on that canvas everytime that canvas is made visible
  because the view state it's contained in is made visible.  Also, I'd only
  like this to happen after the creationComplete event-init method has
  completed.  I'd like this to totally be taken care of Any thoughts on how
  this could be done?  Thanks!
 
  Sam
 
 

 



Re: [flexcoders] New to Flex - dynamic text in mx:Label?

2007-01-11 Thread Roman Protsiuk

Hi, Alex.

Tried your example. It works. %)

However, maybe what you need is something like this:

   [Bindable]
   protected function get someText() : String {
   return _someText;
   }

   protected function set someText(value : String) : void {
   _someText = statusToImage(value);
   }

   private var _someText : String;

and:

   mx:Label text={someText} /

This seems pretty flexible to me.

R.

On 1/11/07, Alex [EMAIL PROTECTED] wrote:


  Hi there,

Given this function:

mx:Script
![CDATA[

private function statusToImage(data:String):String {
return test;
}

]]
/mx:Script

How precisely can I set it as text-generator for a label? I've tried:

mx:Label text={statusToImage('abc')} /

And Flex Builder writes: 1180: Call to a possibly undefined method
statusToImage..

Seems it's right above in the same mxml file though!

Thanks in advance.
Alex

 



Re: [flexcoders] Uploading flex applictions to the web

2007-01-11 Thread Roman Protsiuk

Hi.

Debug flash player gives me (8 times, different filenames):

SecurityError: Error #2148: SWF file
http://www.ctrlzsc.com/other/bin/theCartoonExpress.swf cannot access local
resource file:///C|/Documents and Settings/Xyii/My Documents/Andre
Adams/graphix/dog_home_hero.jpg. Only local-with-filesystem and trusted
local SWF files may access local resources.
   at flash.display::Loader/flash.display:Loader::_load()
   at flash.display::Loader/load()
   at mx.controls::SWFLoader/::loadContent()
   at mx.controls::SWFLoader/load()
   at mx.controls::SWFLoader/::initializeHandler()
   at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction
()
   at flash.events::EventDispatcher/dispatchEvent()
   at mx.core::UIComponent/set processedDescriptors()
   at mx.core::UIComponent/mx.core:UIComponent::initializationComplete()
   at mx.core::UIComponent/initialize()
   at
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded
()
   at
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()
   at mx.core::Container/addChildAt()
   at mx.core::Container/addChild()
   at mx.core::Container/createComponentFromDescriptor()
   at mx.core::Container/createComponentsFromDescriptors()
   at mx.core::Container/mx.core:Container::createChildren()
   at mx.core::UIComponent/initialize()
   at mx.core::Container/initialize()
   at mx.core::Application/initialize()
   at theCartoonExpress/initialize()
   at
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded
()
   at mx.managers::SystemManager/::initializeTopLevelWindow()
   at mx.managers::SystemManager/::frameEndHandler()

Take care,
R.


On 1/11/07, Simeon Bateman [EMAIL PROTECTED] wrote:


  Well if you hit the swf directly the document loads just fine.

http://www.ctrlzsc.com/other/bin/theCartoonExpress.swf

So I guess my question would be have you done anything to modify the html
that is generated by flex builder?  Or have you renamed any of the files and
such?

simeon


On 1/11/07, retrogamer4ever [EMAIL PROTECTED] wrote:

   Okay when I test my flex appliction on my computer it works fine,
 displays and everything but when I uploaded my bin folder to my
 hosting service for some reason it doesn't display when I test the
 page http://www.ctrlzsc.com/other/bin/theCartoonExpress.html all that
 shows up is a blank default Flex swf file. What is the problem, why
 won't it display?


 



Re: [flexcoders] Capturing an event everytime an item becomes visibile in a viewstate

2007-01-11 Thread Roman Protsiuk

enterState?

R.

On 1/11/07, Sam Shrefler [EMAIL PROTECTED] wrote:


  I have a canvas that is part of a view state.  I'd like to know how to
call a method on that canvas everytime that canvas is made visible because
the view state it's contained in is made visible.  Also, I'd only like this
to happen after the creationComplete event-init method has completed.  I'd
like this to totally be taken care of Any thoughts on how this could be
done?  Thanks!

Sam

 



Re: [flexcoders] Multiple dynamic filterFunction help

2007-01-04 Thread Roman Protsiuk

And if you really need several steps of filtration you can always design
your own filters/wrappers with filters for Array or ArrayCollection.

R.

On 1/4/07, michrx7 [EMAIL PROTECTED] wrote:


  I have an arraycollection(myArray) and I need to filter it dynamically
based on multiple criteria from user selections. How do you set
multiple filterFunctions on the array collection?

I tried calling one filter function, then refreshing and calling
another and refreshing, but it only remembers the 2nd filter function.

 



  1   2   >