Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-04 Thread Alex Harui
Well, you don’t have any references in the code you posted, but it could be 
somewhere else.  Open the link-report, make sure it contains a script for the 
main app’s .mxml file and then see if the string name of a module is in the 
file.  If it is, that’s trouble.  The reason for the .mxml file check is that 
if you are using Flash Builder and module projects, the module link-report 
overwrites the app’s link-report.   I generally do this by hand.

Another possibility is that some size calculation is now off for some reason 
and a bad value is being passed in to drawRoundRect.  If you can catch the 
scenario in the debugger you may get more info as to what is up.


On 8/4/10 5:10 PM, "Wally Kolcz"  wrote:






Thank you for your advice. I did that, but I have no idea what i am looking at. 
As you can see, I have no references to the modules from the main application 
so I still have no idea why its throwing that error. Where can I find more 
information on how to read it?

On 8/4/2010 5:16 PM, Alex Harui wrote:



Use a link-report to make sure none of the classes in the module are being 
liked into the main app.  Lots of folks have been doing things like:

Var myModule:MyModule = MyModule(moduleInfo.factory.create()

Instead of using an interface.  This actually links MyModule into the main app, 
defeating the purpose of modules, and in Flex 4, will mess up the style lookup.


On 8/4/10 4:24 AM, "Wally Kolcz"  wrote:








Just kidding..kinda.. After googling a lot of combination of  terms, I
was able to finally get some answers regarding problems that seem to
come up while trying to develop a modular application, but, sadly, I am
not 100% sure what the Adobe person was talking about. The error always
centers around the mysterious error: 'ArgumentError: Error #2004: One of
the parameters is invalid. at flash.display::Graphics/drawRoundRect()...'

More often than not it revolves around a  but I just got the
same error on a layout that has no buttons. This time it seems to
revolve this time be a  since when I swapped it out
from a  (which worked fine) it started throwing errors.

My question to the group is how to manage loading Modules from the
application and not throw errors? Why does this happen when it never did
it in 3.4. I read it has to do with Style references with the main
application, but, again, I don't know exactly what that means or how to
fix it.

Since it seems to come up in the other posts I could find, I have an
Application that, based on a log in and the user's 'accountType', loads
a modules for that user's portal type. I use this to load the modules,
which seems to be pretty stock, and it works fine for the loading and
adding of different modules throughout the application.:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR,
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY,
modReadyHandler);
 modLoader.load();
 }

private function modErrorHandler(e:ModuleEvent):void {
 Alert.show("Module did not load correctly", "Module
Loading Error");
 }

private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as
IVisualElement);
 }

Any ideas why I get that error when loading modules? How can I fix it?
Does ANYONE know why that error is thrown?








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


Re:Re: [flexcoders] About baselistdata class issue

2010-08-04 Thread j2me_soul
Thanks Oleg. That's the problem!


At 2010-08-04 22:42:18,"Oleg Sivokon"  wrote:
 

Do you expect value.item to be an XML with a single root node? If so, trace() 
isn't going to print out the contents of that node. Use 
trace(value.item.toXMLString()) instead.


Re: [flexcoders] How to compile single project as both Desktop and WEB

2010-08-04 Thread dorkie dork from dorktown
I think you can set a property that will allow it to incremental build.

Also, how are you deploying the same project to desktop and web? Desktop
requires WindowApplication and web Application.

On Wed, Aug 4, 2010 at 5:00 PM, Oleg Sivokon  wrote:

>
>
> Maybe someone will correct me... but I think that the antTask from the SDK
> doesn't cache do the iterative compilation, so that's why it may be slower.
> This may not be the best technique, but I build with Ant in a way, I set it
> as an alternative builder... so, it's the same as running the Ant script
> from the command line basically. However, I don't think this will have any
> effect on speed...
> Generally, I don't think there is a way to make the compiler think that it
> should cache data from one compilation to reuse it in another compilation,
> if that's not the same project... But, again, I'm not really sure about it.
> Well, if the compilation speed matters, I can only think of some general
> advises, like, putting more code into SWCs, removing all [Embed] and
> @Embed() tags from the code, avoiding MXML in general... Compiling separate
> classes for testing rather than rebuilding the entire project (in fact, I
> build the entire project only few times a day, the rest of the time I'd work
> on a single class, or a small set of classes)...
>  
>


Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-04 Thread Wally Kolcz
Thank you for your advice. I did that, but I have no idea what i am 
looking at. As you can see, I have no references to the modules from the 
main application so I still have no idea why its throwing that error. 
Where can I find more information on how to read it?


On 8/4/2010 5:16 PM, Alex Harui wrote:


Use a link-report to make sure none of the classes in the module are 
being liked into the main app.  Lots of folks have been doing things like:


Var myModule:MyModule = MyModule(moduleInfo.factory.create()

Instead of using an interface.  This actually links MyModule into the 
main app, defeating the purpose of modules, and in Flex 4, will mess 
up the style lookup.



On 8/4/10 4:24 AM, "Wally Kolcz" > wrote:







Just kidding..kinda.. After googling a lot of combination of
 terms, I
was able to finally get some answers regarding problems that seem to
come up while trying to develop a modular application, but, sadly,
I am
not 100% sure what the Adobe person was talking about. The error
always
centers around the mysterious error: 'ArgumentError: Error #2004:
One of
the parameters is invalid. at
flash.display::Graphics/drawRoundRect()...'

More often than not it revolves around a  but I just got
the
same error on a layout that has no buttons. This time it seems to
revolve this time be a  since when I swapped it
out
from a  (which worked fine) it started throwing errors.

My question to the group is how to manage loading Modules from the
application and not throw errors? Why does this happen when it
never did
it in 3.4. I read it has to do with Style references with the main
application, but, again, I don't know exactly what that means or
how to
fix it.

Since it seems to come up in the other posts I could find, I have an
Application that, based on a log in and the user's 'accountType',
loads
a modules for that user's portal type. I use this to load the
modules,
which seems to be pretty stock, and it works fine for the loading and
adding of different modules throughout the application.:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR,
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY,
modReadyHandler);
 modLoader.load();
 }

private function modErrorHandler(e:ModuleEvent):void {
 Alert.show("Module did not load correctly", "Module
Loading Error");
 }

private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as
IVisualElement);
 }

Any ideas why I get that error when loading modules? How can I fix
it?
Does ANYONE know why that error is thrown?






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





Re: [flexcoders] Rounding the corners of a scroller

2010-08-04 Thread Jeff Gomes
Brand-

I started with the default spark ComboBoxSkin and added a mask and 
some other tweaks to get it to look the way I wanted, such as moving 
the border rect to a higher z than the scroller.  It took a bit of 
trial and error, especially to get it to match up cleanly with the 
button, which also has a radius.

You can see the result here:  http://www.finselector.com/

-Jeff

At 06:58 8/3/2010, Brand wrote:
>I've got a skin for my comboboxes, and while it's trivial to do 
>rounded corners for the textentry portion, I can't seem to figure 
>out how to round the corners of the dropdown.
>
>If I remove the scroller altogether, the rounded background and 
>border seem to work fine. However, the scroller portion of the 
>dropdown doesn't seem to allow a radius.
>
>I could put the rounded corner into the itemrenderer for the 
>datagroup, but that would make each item have rounded corners, and 
>if the bottom of the dropdown occurs in the middle of an item, I'll 
>still have squared corners on the overall dropdown.
>
>So, does anybody know if there's a way to round off the corners of 
>the scroller object?
>
>Thanks for your time and attention.
>
>...



[flexcoders] Re: Security with HTML from External Site

2010-08-04 Thread sapejordan
Oleg - I was able to have the text execute inline javascript and I think I 
could devise an extremely clever XSS attack.  Injection would be extremely 
hard.  Anyway, here is my solution:

1) Flex automatically removed all intrinsic elements from the HTML:

 
 
 
 
The value of inputText.htmlText is the following (notice there is no "onclick" 
event as Flex automatically cleans out intrinsic events:
Onclick 
alertalert("Your text in the alert 
function.");
 
2) So all I need to do is remove the "bad" links which is done like so:
public function makeSafeContent(content:String):String {
var safeContentStr:String = content;
 
var myPattern:RegExp = /javascript/gi;
safeContentStr = safeContentStr.replace(myPattern,"javascript");
myPattern = /asfunction/gi;
safeContentStr = safeContentStr.replace(myPattern,"asfunction");
myPattern = /event/gi;
safeContentStr = safeContentStr.replace(myPattern,"event");
myPattern = /vbscript/gi;
safeContentStr = safeContentStr.replace(myPattern,"vbscript");
 
return(safeContentStr);
}
--
Jordan | Yodlee Product Management
Launch your Flex-based financial app in the Yodlee FinApp Store - 
http://www.finappstore.com

--- In flexcoders@yahoogroups.com, Oleg Sivokon  wrote:
>
> Hm... this is a good point... however, I think that you can secure yourself
> by parsing  tags in that text and see if they don't dispatch any events
> that your SWF may be listening to. But, the worst thing that can happen is
> that the anchor in the text will call some handler inside your application
> (that is execute your own code, not the foreign code), which shouldn't be
> really dangerous, but, that's for you to tell :)
>




Re: [flexcoders] How to compile single project as both Desktop and WEB

2010-08-04 Thread Oleg Sivokon
Maybe someone will correct me... but I think that the antTask from the SDK
doesn't cache do the iterative compilation, so that's why it may be slower.
This may not be the best technique, but I build with Ant in a way, I set it
as an alternative builder... so, it's the same as running the Ant script
from the command line basically. However, I don't think this will have any
effect on speed...
Generally, I don't think there is a way to make the compiler think that it
should cache data from one compilation to reuse it in another compilation,
if that's not the same project... But, again, I'm not really sure about it.
Well, if the compilation speed matters, I can only think of some general
advises, like, putting more code into SWCs, removing all [Embed] and
@Embed() tags from the code, avoiding MXML in general... Compiling separate
classes for testing rather than rebuilding the entire project (in fact, I
build the entire project only few times a day, the rest of the time I'd work
on a single class, or a small set of classes)...


Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-04 Thread Alex Harui
Use a link-report to make sure none of the classes in the module are being 
liked into the main app.  Lots of folks have been doing things like:

Var myModule:MyModule = MyModule(moduleInfo.factory.create()

Instead of using an interface.  This actually links MyModule into the main app, 
defeating the purpose of modules, and in Flex 4, will mess up the style lookup.


On 8/4/10 4:24 AM, "Wally Kolcz"  wrote:






Just kidding..kinda.. After googling a lot of combination of  terms, I
was able to finally get some answers regarding problems that seem to
come up while trying to develop a modular application, but, sadly, I am
not 100% sure what the Adobe person was talking about. The error always
centers around the mysterious error: 'ArgumentError: Error #2004: One of
the parameters is invalid. at flash.display::Graphics/drawRoundRect()...'

More often than not it revolves around a  but I just got the
same error on a layout that has no buttons. This time it seems to
revolve this time be a  since when I swapped it out
from a  (which worked fine) it started throwing errors.

My question to the group is how to manage loading Modules from the
application and not throw errors? Why does this happen when it never did
it in 3.4. I read it has to do with Style references with the main
application, but, again, I don't know exactly what that means or how to
fix it.

Since it seems to come up in the other posts I could find, I have an
Application that, based on a log in and the user's 'accountType', loads
a modules for that user's portal type. I use this to load the modules,
which seems to be pretty stock, and it works fine for the loading and
adding of different modules throughout the application.:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR,
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY,
modReadyHandler);
 modLoader.load();
 }

private function modErrorHandler(e:ModuleEvent):void {
 Alert.show("Module did not load correctly", "Module
Loading Error");
 }

private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as
IVisualElement);
 }

Any ideas why I get that error when loading modules? How can I fix it?
Does ANYONE know why that error is thrown?






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


Re: [flexcoders] How to compile single project as both Desktop and WEB

2010-08-04 Thread Greg Hess
Thanks Oleg!

I have added a ANT builder to my FlashBuilder project and am now running my
new ANT build. However, it is much slower, ouch... and only "Clean" is
working the "auto" and "manual" builds do nothing even though I have
configured my targets for auto and manual.

Did you have to do anything special to have the "auto" and "manual" builds
work with ANT?


Cheers,

Greg



On Wed, Aug 4, 2010 at 1:47 PM, Oleg Sivokon  wrote:

>
>
> You can do that with Ant. Just compile the same project twice with
> different settings.
>  
>


Re: [flexcoders] How to compile single project as both Desktop and WEB

2010-08-04 Thread Oleg Sivokon
You can do that with Ant. Just compile the same project twice with different
settings.


[flexcoders] How to compile single project as both Desktop and WEB

2010-08-04 Thread Greg Hess
Hi All,

Finally have the opportunity to build and deploy our WEB app as a desktop
application but am not familiar with how to use Flash Builder to do so.

It does not seem apparent how a single project can support multiple builders
in Flash Builder, do most people leverage a single code base and check it
out into multiple projects, one for Desktop(AIR) and one for Web?

What project structure is recommended?

Any help much appreciated,

Greg


Re: [flexcoders] About baselistdata class issue

2010-08-04 Thread Oleg Sivokon
Do you expect value.item to be an XML with a single root node? If so,
trace() isn't going to print out the contents of that node. Use
trace(value.item.toXMLString()) instead.


[flexcoders] About baselistdata class issue

2010-08-04 Thread j2me_soul
the data is XML. I debug a DataGridListData coverted from listdata has a "item" 
property.

But when trace the "item" is always empty. In the debug perspertive window I 
can see that property.

this is my code:

 

  override public function set listData(value:BaseListData):void{
var dgListData:Object = value as DataGridListData;

   
trace(dgListData.item.); // always empty ~!
   
super.listData = value;
  }

 <>

[flexcoders] Why does Flex 4 hate modules?

2010-08-04 Thread Wally Kolcz
Just kidding..kinda.. After googling a lot of combination of  terms, I 
was able to finally get some answers regarding problems that seem to 
come up while trying to develop a modular application, but, sadly, I am 
not 100% sure what the Adobe person was talking about. The error always 
centers around the mysterious error: 'ArgumentError: Error #2004: One of 
the parameters is invalid. at flash.display::Graphics/drawRoundRect()...'

More often than not it revolves around a  but I just got the 
same error on a layout that has no buttons. This time it seems to 
revolve this time be a  since when I swapped it out 
from a  (which worked fine) it started throwing errors.

My question to the group is how to manage loading Modules from the 
application and not throw errors? Why does this happen when it never did 
it in 3.4. I read it has to do with Style references with the main 
application, but, again, I don't know exactly what that means or how to 
fix it.

Since it seems to come up in the other posts I could find, I have an 
Application that, based on a log in and the user's 'accountType', loads 
a modules for that user's portal type. I use this to load the modules, 
which seems to be pretty stock, and it works fine for the loading and 
adding of different modules throughout the application.:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR, 
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY, 
modReadyHandler);
 modLoader.load();
 }

 private function modErrorHandler(e:ModuleEvent):void {
 Alert.show("Module did not load correctly", "Module 
Loading Error");
 }

 private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as 
IVisualElement);
 }

Any ideas why I get that error when loading modules? How can I fix it? 
Does ANYONE know why that error is thrown?



[flexcoders] Getting a short filename in Air

2010-08-04 Thread Julian Tenney
I want to pass filenames to fcsh. Long filenames with spaces in break
it. How can Flex / Air reliably get a short filename from a long file
path? 

.

Web Bug from
http://geo.yahoo.com/serv?s=97359714/grpId=12286167/grpspId=1705007207/m
sgId=157602/stime=1280747345/nc1=1/nc2=2/nc3=3



This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

[flexcoders] Re: unable to bind to property

2010-08-04 Thread Dave Bonnell
As Alex mentioned, binding expressions require bindable objects.  The plain 
Object elements in your ArrayCollection are not bindable, so you will get 
binding warnings if you attempt to bind to properties (e.g. name) on those 
objects.

To make your Object's bindable, wrap them with ObjectProxy's. 

  bindableObject = new ObjectProxy( sourceObject );


--- In flexcoders@yahoogroups.com, "luvfotography"  wrote:
>
> Hi, I'm getting this message, 
> I know it's not much to go on, but what could be the cause?
> I have an array of objects of type 'myclass' and 
> create an arraycollection for  a datagrid.
> 
> The warning just pops up in the console multiple times.
> 
> warning: unable to bind to property 'name' on class 'Object' (class is not an 
> IEventDispatcher)
> 
> thanks,
>