[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-04 Thread Florian
I created a ticket at adobe's jira:

https://bugs.adobe.com/jira/browse/SDK-26621

Best regards

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 I may not be understanding your issue.  I'm pretty sure our 
 SkinnableContainers delegate their assigned layouts to the contentGroup 
 because the contentGroup's measurements affect the size given to it by its 
 parent and the eventual call to updateDisplayList.  If you subclass 
 updateDisplayList in the SkinnableComponent I don't see how the assigned 
 layout will know that its measurement is not right.
 
 One way to encapsulate the measurement and layout logic together is to create 
 a custom layout.  I suppose you could also just override measure() in the 
 component as well.
 
 
 On 5/31/10 12:34 AM, Florian florian.saliho...@... wrote:
 
 
 
 
 
 
 Hi Alex, usually i would agree right on spot but the fact that i am using a 
 basic layout in for group and the layouting is done correctly, i don't really 
 see the need for another class. There is just one update of the measuring 
 missing, which i don't understand.
 
 When a Group is using a BasicLayout contentWidth and contentHeight should be 
 equal with width and height, if clipping is not enabled and no values for 
 width or height are set explicitly. Or am i mistaken in this point?
 
 Best regards and thanks for taking the time.
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
 Alex Harui aharui@ wrote:
 
  I would create a new Layout class and properly measure and layout in its 
  measure() and updateDisplayList() methods and use that as the 
  contentGroup's layout, otherwise the Group's default layout class is going 
  to be arguing with your code.
 
 
  On 5/30/10 3:36 AM, Florian florian.salihovic@ wrote:
 
 
 
 
 
 
  Hi,
 
  i was and i am still running into problems with sizing and placing 
  components in skins programmatically for spark ActionScript and 
  MXML/ActionScript components.
 
  I want to initialize the components in MXML and size and position the 
  children in the component's (a component's skin) updateDisplayList, 
  although this might be a bit of an uncommon approach.
 
  I was implementing the positioning via UIComponent.move, which i realized 
  was the wrong approach. After just setting the x and y properties, i did 
  some research and stumbled across the ILayoutElement and its methods like 
  setLayoutBoundsPosition and corresponding methods to modify the skin's 
  display list. But somehow the group, which contains the children, does not 
  propagate its new size up to its parent. I use the updateComplete event to 
  invalidate the group's size and force the layout to be calculated properly 
  a last time. The view looks as expected. But i don't think that 
  invalidating a component a last time after an updateComplete event was 
  dispatched is wrong.
 
  Now, what is the right approach for the following task: implementing a 
  skinnable component and a corresponding skin. The skin creates the skin 
  parts in MXML in a Group (id=contentGroup) but the layout is calculated 
  within the skin's updateDisplayList method.
 
  I only found one useful article on the web, which is not really a lot of 
  information at all 
  (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
 
  Best regards.
 
 
 
 
 
 
  --
  Alex Harui
  Flex SDK Team
  Adobe System, Inc.
  http://blogs.adobe.com/aharui
 
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





Re: [flexcoders] Modify Flex ComboBox DataProvider

2010-06-04 Thread Angelo Anolin
hi Alex,

Prior to SDK 4, is there a build after 3.5?

Thanks for this info. I can't seem to get the way out of this and it dawned on 
me now that it must have been a bug.

Thank you.

angelo




From: Alex Harui aha...@adobe.com
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Sent: Fri, 4 June, 2010 0:03:37
Subject: Re: [flexcoders] Modify Flex ComboBox DataProvider

  
There’s a bug like that in Flex 3.5.  Older and newer versions don’t have that 
problem.


On 6/3/10 1:56 PM, Angelo Anolin angelo_anolin@ yahoo.com wrote:



 
 
   

I am finding some issues when I am trying to change a combobox's data provider.

I have a checkbox that would trigger whether a combobox would use an 
xmlListCollection of all Locations (xmllcAll) or an XMLListCollection of just 
a subset of locations (xmllcSubset) .

In the change event of my checkbox, I have defined:

private function checkBox1_change( e:Event) :void
{
  if (e.currentTarget. selected == true)
  {
comboBox1.dataProvi der = xmllcAll;
  }
  else
  {
comboBox1.dataProvi der = xmllcSubset;
  }
}

By default, the comboBox's default dataProvider is the xmllcSubset.  When I 
tick the checkbox, I expect that the data for the combobox should now map to 
the data for the xmllcAll variable.  The comboBox does not get the proper 
values.  Is there anything that I need to do to refresh the comboBox and make 
the values that appear on the list those that were in the the proper 
xmllistcollection?

Thanks.

Angelo

 
 
   



-- 
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs. adobe.com/ aharui
 
 


  

[flexcoders] Re: spark Panel titleBar equivalent

2010-06-04 Thread bhaq1972
Thanks Alex

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Use a Custom skin for the Panel
 
 
 On 6/3/10 8:13 AM, bhaq1972 mbha...@... wrote:
 
 
 
 
 
 
 In flex 3
 I used do add buttons to MyPanel (extends mx.containers.Panel) titleBar.
 
 var button:Button = new Button();
 this.titleBar.addChild(button);
 
 whats the equivalent to this in Spark?
 
 one way i'm thinking of is using a basic layout, and positioning the buttons 
 where I want.
 
 Just wanted to get an idea what approach others would take.
 
 thanks
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





Re: [flexcoders] Event before preinitialize

2010-06-04 Thread Anatole Tartakovsky
This is an old article of what you are trying to do :
http://flexblog.faratasystems.com/2006/09/20/flex-developers-and-the-need-to-understand-flash
There should be also article by Ted Patrick on the topic dated around the
same time.
Thank you
Anatole



On Fri, Jun 4, 2010 at 12:16 AM, Andriy Panas a.pa...@gmail.com wrote:

 Hi Judah,
 AFAIK, you have 2 approaches to execute the code before
 preinitialize event is fired.

 1) Mark you class with metadata [Mixin] and put the code in need into
 method

 public static function init(systemManager:ISystemManager):

 See HowTo create your developer ToolBox with Mixins blog article

 http://www.rialvalue.com/blog/2010/05/21/howto-create-your-developer-toolbox-with-mixins/

 2) Via custom preloader class you can execute the code before
 SystemManager.intialize() method executes,

 See How I (sort of) modified Flex’s SystemManager.initialize() method

 http://www.visible-form.com/blog/how-i-sort-of-modified-flexs-systemmanagerinitialize-method/

 --
 Best regards,
 Andriy Panas



 On 4 June 2010 06:57, dorkie dork from dorktown
 dorkiedorkfromdorkt...@gmail.com wrote:
 
 
 
  That's what I'd like to do. So I added an event listener to the
 application preinitialized event like so:
 
  s:Application preinitialize=myHandler() /
 
  the problem is, in my application it takes a while to get to that event.
 so that's why I'm trying to find another event that happens sooner than
 that. it would be great to have systemManager, fontManager, resourceManager
 and styleManager creationComplete events so I can see what's taking so long
 in addition to redirecting if I need to.
 
  JP
 
  On Thu, Jun 3, 2010 at 10:02 PM, Kerry Thompson al...@cyberiantiger.biz
 wrote:
 
 
 
  it's taking a couple of seconds to reach the preinitialize event.
  according to this slideshow
 http://www.slideshare.net/michael.labriola/dense-and-hot-360-flex slide
 24, 25 etc
  there are a couple things going on that i don't need early on. so i'd
 like to check the contents of a shared object or session variable early on
 and redirect to a much lighter login page if i need to.
 
 
  It doesn't take long to check the contents of a shared object. Why not
 just do that before you intialize the object, and let it know whether to do
 the lighter load?
 
  Cordially,
 
  Kerry Thompson
 
 


 

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






[flexcoders] how to make flex app compiled using sdk 3.5 to be compatible with flex sdk 3.0?

2010-06-04 Thread sathish_mca_raja
how to make flex app compiled using  sdk 3.5 to be compatible with flex sdk 
3.0? Urgent!! Please reply.



[flexcoders] Using Flex with server that does authentication

2010-06-04 Thread Trent Brown
Hi all,

I'm building a Flex client for a fully-authenticated server with a REST-like
API. All communication with the server will be over SSL/TLS. All requests
must be authenticated. What I've discovered, by Googling and by trying my
own code, is that Flex makes things very, very difficult for such a client.
The problems all center around the fact that my Basic Auth headers get
removed.

The only way I've found to get my headers over to the server is by:

   - Switching from using HTTPService to URLLoader (the former seems to
   strip all headers, no matter what)
   - Changing all my GET's to POST's (because headers are always stripped
   from GET requests)
   - Adding a dummy body to my POST's so that they don't get turned back
   into GET's (why, for God's sake?) and have their headers stripped.

I also need to upload files --with authentication. Headers are stripped from
FileReference.upload() calls also. I'm aware of this bug:
https://bugs.adobe.com/jira/browse/FP-1044 It appears that a fix is in the
works, which is encouraging, but it completely baffles me that this issue
has been ignored for so very long.

I also need to display images in my client that are served by my server
--with authentication. I have have mx:Image elements with source
properties bound to URL's that point to my server. I know of no way to turn
these implicit GET requests into POSTs and to then somehow insert my
authentication header into them.

At this point I'm really feeling beaten down by how difficult this all
is. Does nobody else write clients for authenticated servers? This seems so
basic. I've been a fan of Flex for years, but this is causing me to question
whether it's ready for real-world RIA's.

I'm now considering something desperate like trying to write a Tomcat filter
that looks for credentials in a URL parameter and manufactures an
Authentication header. I don't know Tomcat well, so I'm not sure whether
filters can run before authentication is done. If that works, though, I can
go back to using my GET requests and solve my problems with upload and image
rendering. The fact that we use SSL/TLS would save us here, since the URL
parameters containing the credentials would be encrypted along with
everything else.

Somebody please tell me that I'm missing something obvious.

Thanks much


[flexcoders] Setting preferences on the browser in the release folder

2010-06-04 Thread Quintjer
Hello All,
  I am trying to set up my browser in the bin-debug folder to scroll 
properly when I set a specific width and height to my swf file but Flex will 
overwrite it every time with defaults setting.  I am then forced to export the 
swf file to Dreamweaver so that I can configure my HTML page.
Does anyone know how to stop Flex from overwriting the HTML every time I run 
the app within Flexbuilder?

Thanks in advance!



[flexcoders] ListCollectionMap

2010-06-04 Thread ilya_persky
Hi guys!

I wanna share a thing I coded recently: it is a ListCollectionMap class, that 
adds map functionality to ListCollectionView sort and filter. A lot of 
times I felt I was missing something like this, especially when using Mate 
framework where everything is controlled by flows of binding events.

ListCollectionMap can do one-to-one and one-to-many mappings and can be used in 
data binding chains along with ListCollectionView.

The quick example is:

public var dataIntegers:ArrayCollection = new ArrayCollection([1, 2, 3]); 

public var mapIntegers:ListCollectionMap = new 
ListCollectionMap(incrementMapping, dataIntegers); 

public function incrementMapping(i:int):int
{
return i + 1
}

Detailed explanation and examples are in my blog:

http://oitar.biz/blog/2010/06/04/meet-listcollectionmap/

Cheers, 
Ilya.




[flexcoders] dispatchEvent import

2010-06-04 Thread Marco Catunda
Hi,

I'm learning swiz framework and stumble upon this code 
http://www.pastebin.org/307313
at http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html 

My question is how could flex compiler understand the 'dispatchEvent' method in
line 41 and 65? I haven't seen any explicit import of it.

Cheers

--
Marco Catunda





[flexcoders] Opinions Wanted : Best Performing AS3 Zip Library

2010-06-04 Thread Battershall, Jeff
Hello,

I'm using the nochump zip library in an AIR project and it's working reasonably 
well but I wanted to see if anyone has a strong opinion as to what is the best 
performing AS3 Zip library out there.

Jeff Battershall
Application Architect
Dow Jones Indexes
jeff.battersh...@dowjones.com
(609) 520-5637 (p)

(484) 477-9900 (c)



[flexcoders] Re: Setting preferences on the browser in the release folder

2010-06-04 Thread Andrew
I don't know how to override the settings, but I'll tell you what I do to 
handle this. After I have compiled the release build for the first time, I do a 
save-as on the html file that was created. I save the copy as index.html, since 
that is what I typically use (it simplifies the url, as you probably know: if I 
put an index.html file in a folder 'bla' at the sight 'boo.com', its url is 
simply 'boo.com/bla' [unless someone has changed the server settings]).

Then I adjust the index.html file, giving it the title I want and resizing the 
flash movie if I need to, adding metadata and so on, and save it. That's the 
file I post to wherever I am putting the project, along with the other 
generated files in the bin/release folder.

When you do another 'export release build', FlashBuilder ignores index.html, so 
you don't have a problem with it being overwritten. 

I hope that helps.

Andrew

--- In flexcoders@yahoogroups.com, Quintjer quintj...@... wrote:

 Hello All,
   I am trying to set up my browser in the bin-debug folder to scroll 
 properly when I set a specific width and height to my swf file but Flex will 
 overwrite it every time with defaults setting.  I am then forced to export 
 the swf file to Dreamweaver so that I can configure my HTML page.
 Does anyone know how to stop Flex from overwriting the HTML every time I run 
 the app within Flexbuilder?
 
 Thanks in advance!





[flexcoders] Re: Setting preferences on the browser in the release folder

2010-06-04 Thread valdhor
That is what the html-template directory is for. Modify the index.template.html 
file to how you want it. Flex Builder will use this file to build the 
index.html file.

--- In flexcoders@yahoogroups.com, Quintjer quintj...@... wrote:

 Hello All,
   I am trying to set up my browser in the bin-debug folder to scroll 
 properly when I set a specific width and height to my swf file but Flex will 
 overwrite it every time with defaults setting.  I am then forced to export 
 the swf file to Dreamweaver so that I can configure my HTML page.
 Does anyone know how to stop Flex from overwriting the HTML every time I run 
 the app within Flexbuilder?
 
 Thanks in advance!





[flexcoders] Re: dispatchEvent import

2010-06-04 Thread turbo_vb
Hi Marco,
That does look like a problem.  The dispatchEvent() method is available
for any UIComponent subclass or any class that extends EventDispatcher. 
So, if you're going to use [Bindable] properties in the presentation
model, you would want to have the PM extend EventDispatcher:

import flash.events.EventDispatcher;




public class UserPresentationModel extends EventDispatcher

{

private var _currentState : String;





[Bindable( currentStateChanged )]

public function get currentState() : String

{

return _currentState;

}




public function set currentState( state : String ) : void

{

_currentState = state;

dispatchEvent( new Event( currentStateChanged ) );

}


}

This will allow you to bind the property to a view.
For events that you want to [Mediate], you would use the injected
dispatcher:

[Dispatcher]

public var dispatcher:IEventDispatcher;




dispatcher.dispatchEvent( new Event( myEvent ) );




-TH

--- In flexcoders@yahoogroups.com, Marco Catunda marco.catu...@...
wrote:

 Hi,

 I'm learning swiz framework and stumble upon this code
http://www.pastebin.org/307313
 at
http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.ht\
ml

 My question is how could flex compiler understand the 'dispatchEvent'
method in
 line 41 and 65? I haven't seen any explicit import of it.

 Cheers

 --
 Marco Catunda




[flexcoders] Re: dispatchEvent import

2010-06-04 Thread valdhor
The component itself has a dispatchEvent method. The this keyword is implicit 
in the call. It could have been written as this.dispatchEvent.

--- In flexcoders@yahoogroups.com, Marco Catunda marco.catu...@... wrote:

 Hi,
 
 I'm learning swiz framework and stumble upon this code 
 http://www.pastebin.org/307313
 at http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html 
 
 My question is how could flex compiler understand the 'dispatchEvent' method 
 in
 line 41 and 65? I haven't seen any explicit import of it.
 
 Cheers
 
 --
 Marco Catunda





Re: [flexcoders] ListCollectionMap

2010-06-04 Thread Oleg Sivokon
Cool, really, thanks for sharing.
Although I didn't like the idea of extending Proxy... I think the bug where
the dataProvider is accessed in a dataProvider[i] way should've been fixed
now... There are also couple of wrong assumption that ListCollection makes
when treating data as Arrays, thus not using interfaces. But that's
definitely an edge case.


Re: [flexcoders] Opinions Wanted : Best Performing AS3 Zip Library

2010-06-04 Thread Oleg Sivokon
I think that it says on the nochump site that it is not the fastest. In
fact, using BiteArray.compress() with deflate would be the fastest, but
that's only if you can use FP10.


RE: [flexcoders] Opinions Wanted : Best Performing AS3 Zip Library

2010-06-04 Thread Battershall, Jeff
Thanks Oleg,

Using FP 10 is no problem, but I'm using CF on the server side - not sure how 
CF would decompress.

Jeff


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Oleg Sivokon
Sent: Friday, June 04, 2010 3:17 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Opinions Wanted : Best Performing AS3 Zip Library




I think that it says on the nochump site that it is not the fastest. In fact, 
using BiteArray.compress() with deflate would be the fastest, but that's only 
if you can use FP10.






[flexcoders] Re: dispatchEvent import

2010-06-04 Thread turbo_vb
Hey Steve,

The component that Marco is referring to is not a UIComponent, so it doesn't 
have a dispatchEvent() method.  He'll have to change thel class to extend 
EventDispatcher.

-TH

--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 The component itself has a dispatchEvent method. The this keyword is implicit 
 in the call. It could have been written as this.dispatchEvent.
 
 --- In flexcoders@yahoogroups.com, Marco Catunda marco.catunda@ wrote:
 
  Hi,
  
  I'm learning swiz framework and stumble upon this code 
  http://www.pastebin.org/307313
  at 
  http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html 
  
  My question is how could flex compiler understand the 'dispatchEvent' 
  method in
  line 41 and 65? I haven't seen any explicit import of it.
  
  Cheers
  
  --
  Marco Catunda
 





Re: [flexcoders] Re: dispatchEvent import

2010-06-04 Thread Oleg Sivokon
If it ever worked that may be because of the patched compiler /
preprocessor, and so all dispatchEvent calls were translated to what is
marked as [Dispatcher]. Maybe it does the same as [Bindable] on class, or
maybe like HaXe using directive. Otherwise - just a confusing piece of
code... Well, you know, so far the only reasonable place to put metadata in
AS3 was __go_to_definitionHelp, and that you don't have to write... :S


[flexcoders] Re: dispatchEvent import

2010-06-04 Thread turbo_vb
The example does compile and the binding works; even when you remove the 
injected dispatcher.  Kind of stumped on why this works in a class that doesn't 
extend EventDispatcher.

-TH

--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 If it ever worked that may be because of the patched compiler /
 preprocessor, and so all dispatchEvent calls were translated to what is
 marked as [Dispatcher]. Maybe it does the same as [Bindable] on class, or
 maybe like HaXe using directive. Otherwise - just a confusing piece of
 code... Well, you know, so far the only reasonable place to put metadata in
 AS3 was __go_to_definitionHelp, and that you don't have to write... :S





Re: [flexcoders] Re: dispatchEvent import

2010-06-04 Thread Marco Catunda

Yes, this component is neither UIComponent nor extend EventDispatcher and I 
don't have to change it 
to extend EventDispatcher because every things works well. For me it's so 
strange!! I don't know why.


On 04/06/2010, at 18:24, turbo_vb wrote:

 Hey Steve,
 
 The component that Marco is referring to is not a UIComponent, so it doesn't 
 have a dispatchEvent() method. He'll have to change thel class to extend 
 EventDispatcher.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:
 
  The component itself has a dispatchEvent method. The this keyword is 
  implicit in the call. It could have been written as this.dispatchEvent.
  
  --- In flexcoders@yahoogroups.com, Marco Catunda marco.catunda@ wrote:
  
   Hi,
   
   I'm learning swiz framework and stumble upon this code 
   http://www.pastebin.org/307313
   at 
   http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html

   
   My question is how could flex compiler understand the 'dispatchEvent' 
   method in
   line 41 and 65? I haven't seen any explicit import of it.
   
   Cheers
   
   --
   Marco Catunda
  
 
 
 

--
Marco Catunda





[flexcoders] excluding symbols from sub swf

2010-06-04 Thread mattgarland2000
In my main swf, I have a (CS4) library item with the class of Dog. It's just a 
movie clip with a picture of a dog inside it. 

In the sub swf, there is a also a dog on the stage.

It's necessary that the item in the sub swf be in the library or components 
panel, because my designer likes dogs. He likes to place them on the stage, 
rotate them, and play with them all day. 

It's a big Dog. And there are many sub swfs. Is there a way to exclude Dog from 
the sub swfs?

Runtime Shared Libraries is not an option--too flaky. And runtime loading of 
assets is not an option either, unless it can be made compatible with WYSIWYG. 

I tried this: 

1. Creating a dog.swc component, using it, and then putting it in the external 
library path of the sub swf. 
2. Putting the dog swc in the folder with main.fla.
These did not work. The big Dog remained either way.

I looked into this:
Using -load-externs and -link-report compiler options for an actionscript 
project. But there is not link report for .flas, and no compiler options 
either, and jsfl does not seem to provide workarounds.

Is it even possible (without using Runtime Shared Libraries) to exclude symbols 
from compiled flas? 

Thanks!

Matt









Re: [flexcoders] Re: dispatchEvent import

2010-06-04 Thread Oleg Sivokon
OK... dispatchEvent is an undocumented global function...
test case:

var ns:Namespace = new Namespace();
trace(ns::dispatchEvent);

Another hack in AS3... well... I have couple of strong words about this, but
these should be only spoken in private... crap :(


[flexcoders] Several swf for an application

2010-06-04 Thread Christophe
Hello, 

How to decompose an application into several swf files with a common list of 
variables ? 

Thank you,
Christophe,