Re: [flexcoders] Where To Declare CSS Style Name in AS Component

2010-08-29 Thread Angelo Anolin
Do you have any sample codes for this? I'm still having a hard time trying to 
figure this out in my code.

For example, I have two files, one is named default.css and my component is 
named myButton.as

Where do I declare which?

Thanks.





From: Alex Harui 
To: "flexcoders@yahoogroups.com" 
Sent: Sun, 29 August, 2010 22:10:22
Subject: Re: [flexcoders] Where To Declare CSS Style Name in AS Component

  
I believe the fully qualified name is now used to find the type-selector. 
 Namespaces allow you to specify the fully-qualified name with less typing.

So, if your component is in package foo, then declare the namespace foo and use 
it to qualify the type-selector.


On 8/29/10 11:33 AM, "Angelo Anolin"  wrote:



> 
> 
>   
>
>Wesley,
>
>I did not quite understand what you meant here (my less than expertise in CSS 
>and designing in general is a hindrance in tackling this quite simple problem, 
>perhaps).
>
>Previously in Flex3, when you declare a CSS style named after a component, 
>that 
>component would get the styles you have declared automatically.  Say you have 
>a 
>component myButton, then creating a default css file and naming a style 
>myButton, that style is carried by the component all throughout the 
>application.
>
>But in Flex4, they made some changes to that. It gives you a warning (or 
>error?) 
>that you have to qualify the CSS declaration.
>
>Now, what I did was to rename the CSS style to .myButton{}. Notice the dot 
>before the CSS name.
>
>I want this style to be used by myButton component (ActionScript) but I am 
>lost 
>where to declare or to even make the component know that it needs to use that 
>style. How do I actually that style for the component whereas previously, 
>there 
>wasn't much of a problem.
>
>I think I may also need to understand the logic why Flex decided to go on this 
>path.  Certainly, if you got a lot of components and the styling is declared 
>in 
>a centralized CSS file, and then you moved to Flex4, you got to have an AWFUL 
>lot of changes you need to make to your codes.
>
>Thanks a lot. 
>
>

From:Wes! ley Acheson 
>To: flexcoders@yahoogroups.com
>Sent: Fri, 27 August, 2010 14:03:14
>Subject: Re: [flexcoders] Where To Declare CSS Style Name in AS Component
>
>  
>   
>
>I think the issue is that you need to namespace all of the styles. So 
>depending 
>on which component your myButton was based off a spark component or a Halo 
>component.
>
>See the following link for more details.
>
>http://cookbooks.adobe.com/post_How_to_use_the_new_CSS_syntax_in_Flex_4-15726.html
>
>
>Another good way to do this is to use the style manager built into flash 
>builder, you can apply a style to an instance of a button directly, click the 
>convert to css button and see what the markup for the css looks like.
>
>Hope this has been some help,
>
>Wes
>
>On Fri, Aug 27, 2010 at 10:42 PM, Angelo Anolin  
wrote:
>
>
>> 
>> 
>>   
>>
>>Anybody?
>>
>>Having so much hard time trying to move flex3 to flex4.
>>
>>Basically this is a styling issue which is far beyond my expertise.
>>
>>If you have a component created named myButton.as, and you created a CSS file 
>>with a style named myButton, that CSS declaration would span all instances 
>>where 
>>you used the myButton component.  But since Flex4 does not like that naming 
>>convention of CSS, I have had to rename my CSS declaration to .myButton{}.
>>
>>Now, how do I declare the same in my AS component to utilize that style?
>>
>>Thanks a lot for any inputs on this.
>>
>>

From:Angelo Anolin 
>>To: flexcoders@yahoogroups.com
>>Sent: Fri, 27 August, 2010 10:51:02
>>Subject: [flexcoders] Where To Declare CSS Style Name in AS Component
>>
>>  
>>   
>>
>>Dear FlexCoders,
>>
>>In Flex 3, you can simply name your CSS style to the name of the component 
>>you 
>>created.  For example, you created an AS component named MyNewButton, hence, 
>>in 
>>your CSS file, you can declare a style with name MyNewButton and the 
>>component 
>>automatically picks up that style.
>>
>>But when you use Flex 4, you get an error saying: CSS type selectors are not 
>>supported in components: MyNewButton.
>>
>>Modifying the CSS file, let us say the style name MyNewButton has been now 
>>declare as .MyNewButton{}.  How do I reference the new style name to be used 
>>by 
>>the component? How do I declare it in the AS file?
>>
>>Thanks for your inputs.
>>
>>Angelo
>>
>>
>>  
>> 
>>
>>  
>>   
>> 
>>
 
 

 
 
   



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


  

Re: [flexcoders] Pb with SwfLoader

2010-08-29 Thread Alex Harui
Flex will zoom the SWFLoader content if it isn’t another Flex app. I guess it 
could be possible that the content has other code that zooms other stuff.


On 8/29/10 3:04 AM, "Christophe"  wrote:






Hello,

When I use SwfLoader to load an external swf with resizing it, there is a zoom 
on all my application ?

Thank you,
Christophe,






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


Re: [flexcoders] Where To Declare CSS Style Name in AS Component

2010-08-29 Thread Alex Harui
I believe the fully qualified name is now used to find the type-selector.  
Namespaces allow you to specify the fully-qualified name with less typing.

So, if your component is in package foo, then declare the namespace foo and use 
it to qualify the type-selector.


On 8/29/10 11:33 AM, "Angelo Anolin"  wrote:






Wesley,

I did not quite understand what you meant here (my less than expertise in CSS 
and designing in general is a hindrance in tackling this quite simple problem, 
perhaps).

Previously in Flex3, when you declare a CSS style named after a component, that 
component would get the styles you have declared automatically.  Say you have a 
component myButton, then creating a default css file and naming a style 
myButton, that style is carried by the component all throughout the application.

But in Flex4, they made some changes to that. It gives you a warning (or 
error?) that you have to qualify the CSS declaration.

Now, what I did was to rename the CSS style to .myButton{}. Notice the dot 
before the CSS name.

I want this style to be used by myButton component (ActionScript) but I am lost 
where to declare or to even make the component know that it needs to use that 
style. How do I actually that style for the component whereas previously, there 
wasn't much of a problem.

I think I may also need to understand the logic why Flex decided to go on this 
path.  Certainly, if you got a lot of components and the styling is declared in 
a centralized CSS file, and then you moved to Flex4, you got to have an AWFUL 
lot of changes you need to make to your codes.

Thanks a lot.


From: Wes! ley Acheson 
To: flexcoders@yahoogroups.com
Sent: Fri, 27 August, 2010 14:03:14
Subject: Re: [flexcoders] Where To Declare CSS Style Name in AS Component




I think the issue is that you need to namespace all of the styles. So depending 
on which component your myButton was based off a spark component or a Halo 
component.

See the following link for more details.

http://cookbooks.adobe.com/post_How_to_use_the_new_CSS_syntax_in_Flex_4-15726.html

Another good way to do this is to use the style manager built into flash 
builder, you can apply a style to an instance of a button directly, click the 
convert to css button and see what the markup for the css looks like.

Hope this has been some help,

Wes

On Fri, Aug 27, 2010 at 10:42 PM, Angelo Anolin  wrote:





Anybody?

Having so much hard time trying to move flex3 to flex4.

Basically this is a styling issue which is far beyond my expertise.

If you have a component created named myButton.as, and you created a CSS file 
with a style named myButton, that CSS declaration would span all instances 
where you used the myButton component.  But since Flex4 does not like that 
naming convention of CSS, I have had to rename my CSS declaration to 
.myButton{}.

Now, how do I declare the same in my AS component to utilize that style?

Thanks a lot for any inputs on this.


From: Angelo Anolin 
To: flexcoders@yahoogroups.com
Sent: Fri, 27 August, 2010 10:51:02
Subject: [flexcoders] Where To Declare CSS Style Name in AS Component




Dear FlexCoders,

In Flex 3, you can simply name your CSS style to the name of the component you 
created.  For example, you created an AS component named MyNewButton, hence, in 
your CSS file, you can declare a style with name MyNewButton and the component 
automatically picks up that style.

But when you use Flex 4, you get an error saying: CSS type selectors are not 
supported in components: MyNewButton.

Modifying the CSS file, let us say the style name MyNewButton has been now 
declare as .MyNewButton{}.  How do I reference the new style name to be used by 
the component? How do I declare it in the AS file?

Thanks for your inputs.

Angelo


















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


Re: [flexcoders] Calculating width of a child BEFORE it's added...

2010-08-29 Thread Alex Harui
For mx:Label, you can try using measureText() on the parent unless the label 
will have different styles that will affect measurement.  Then you’ll have to 
add it and call validateNow() and call getExplicitOrMeasuredWidth().

But why not use mx:Text?  Why do you have to get the width exactly?  If you 
stretch an mx:Text to the width of the Vbox it sounds like it would suit your 
needs.


On 8/29/10 2:06 PM, "Laurence"  wrote:






Using ActionScript, I want to add a Label to a VBox.  I know what text I want 
to put into the label (said text is read from an XML file), but of course, the 
program cannot know what the width of the label should be until after the text 
is read from that XML file.  I want the label to be as wide as it needs to be, 
but not wider than the vBox I'm adding it to -- if that label will need to be 
wider than the given amount to display all the text, then I want to add a 
TextArea (with word-wrap turned on) so I can display all the text in that given 
width.

My question is, how do I calculate the width of a label I'll need, when given a 
string of text?  I do know the font-family and font-size the label will have.  
Is there an easy way to go from a string of text to the width that a label will 
need to be to display that text?

Thanks,
Laurence MacNeill
Mableton, Georgia, USA






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


[flexcoders] basic authentification on air

2010-08-29 Thread cholid cholid
i try to get some property of an object with xmlrpc
and it's work
then i adopt the code to air application
when it run, then show a login window that is not happen in flex application
it says
"The Server admin (on port 0) requires a username and password"
"this server uses 'basic' authentification"
username:
password:

are there has a different from air and flex code on handle authentification 
methode?
thanks


this the code;

creationComplete="init()"  layout="absolute">
.
import com.ak33m.rpc.xmlrpc.XMLRPCConnection;
import mx.rpc.Fault;
import com.ak33m.rpc.xmlrpc.XMLRPCObject;
import mx.utils.Base64Encoder;
import mx.utils.ArrayUtil;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.AsyncToken;
import  mx.controls.Alert;
import mx.collections.ItemResponder;

[Bindable] public var returnedData:ArrayCollection;
[Bindable] public var 
serviceEndpoint:String="http://admin:ad...@localhost:8080";;
public var service:XMLRPCObject;

public function init():void
{
service = new  XMLRPCObject();
service.endpoint = serviceEndpoint;
service.destination = "/zport/dmd";
service.addEventListener(FaultEvent.FAULT, onFault);
service.addEventListener(ResultEvent.RESULT, onResult);
}
public function onResult(event:ResultEvent):void
{
Alert.show(String(event.result));
}
 public function onFault(event:FaultEvent):void
{
Alert.show(event.fault.faultString, event.fault.faultCode);
}
public function getId():void
{
service.call("getProductName");
}
...

..



  

[flexcoders] Calculating width of a child BEFORE it's added...

2010-08-29 Thread Laurence
Using ActionScript, I want to add a Label to a VBox.  I know what text I want 
to put into the label (said text is read from an XML file), but of course, the 
program cannot know what the width of the label should be until after the text 
is read from that XML file.  I want the label to be as wide as it needs to be, 
but not wider than the vBox I'm adding it to -- if that label will need to be 
wider than the given amount to display all the text, then I want to add a 
TextArea (with word-wrap turned on) so I can display all the text in that given 
width.

My question is, how do I calculate the width of a label I'll need, when given a 
string of text?  I do know the font-family and font-size the label will have.  
Is there an easy way to go from a string of text to the width that a label will 
need to be to display that text?

Thanks,
Laurence MacNeill
Mableton, Georgia, USA




Re: [flexcoders] Where To Declare CSS Style Name in AS Component

2010-08-29 Thread Angelo Anolin
Wesley,

I did not quite understand what you meant here (my less than expertise in CSS 
and designing in general is a hindrance in tackling this quite simple problem, 
perhaps).

Previously in Flex3, when you declare a CSS style named after a component, that 
component would get the styles you have declared automatically.  Say you have a 
component myButton, then creating a default css file and naming a style 
myButton, that style is carried by the component all throughout the application.

But in Flex4, they made some changes to that. It gives you a warning (or 
error?) 
that you have to qualify the CSS declaration.

Now, what I did was to rename the CSS style to .myButton{}. Notice the dot 
before the CSS name.

I want this style to be used by myButton component (ActionScript) but I am lost 
where to declare or to even make the component know that it needs to use that 
style. How do I actually that style for the component whereas previously, there 
wasn't much of a problem.

I think I may also need to understand the logic why Flex decided to go on this 
path.  Certainly, if you got a lot of components and the styling is declared in 
a centralized CSS file, and then you moved to Flex4, you got to have an AWFUL 
lot of changes you need to make to your codes.

Thanks a lot. 




From: Wesley Acheson 
To: flexcoders@yahoogroups.com
Sent: Fri, 27 August, 2010 14:03:14
Subject: Re: [flexcoders] Where To Declare CSS Style Name in AS Component

  
I think the issue is that you need to namespace all of the styles. So depending 
on which component your myButton was based off a spark component or a Halo 
component.

See the following link for more details.

http://cookbooks.adobe.com/post_How_to_use_the_new_CSS_syntax_in_Flex_4-15726.html


Another good way to do this is to use the style manager built into flash 
builder, you can apply a style to an instance of a button directly, click the 
convert to css button and see what the markup for the css looks like.

Hope this has been some help,

Wes


On Fri, Aug 27, 2010 at 10:42 PM, Angelo Anolin  wrote:

  
>Anybody?
>
>
>Having so much hard time trying to move flex3 to flex4.
>
>
>Basically this is a styling issue which is far beyond my expertise.
>
>
>If you have a component created named myButton.as, and you created a CSS file 
>with a style named myButton, that CSS declaration would span all instances 
>where 
>you used the myButton component.  But since Flex4 does not like that naming 
>convention of CSS, I have had to rename my CSS declaration to .myButton{}.
>
>
>Now, how do I declare the same in my AS component to utilize that style?
>
>
>Thanks a lot for any inputs on this.
>
>
>

From: Angelo Anolin 
>To: flexcoders@yahoogroups.com
>Sent: Fri, 27 August, 2010 10:51:02
>Subject: [flexcoders] Where To Declare CSS Style Name in AS Component
>
>
>  
>Dear FlexCoders,
>
>
>In Flex 3, you can simply name your CSS style to the name of the component you 
>created.  For example, you created an AS component named MyNewButton, hence, 
>in 
>your CSS file, you can declare a style with name MyNewButton and the component 
>automatically picks up that style.
>
>
>But when you use Flex 4, you get an error saying: CSS type selectors are not 
>supported in components: MyNewButton.
>
>
>Modifying the CSS file, let us say the style name MyNewButton has been now 
>declare as .MyNewButton{}.  How do I reference the new style name to be used 
>by 
>the component? How do I declare it in the AS file?
>
>
>Thanks for your  inputs.
>
>
>Angelo
>
>
>
>

 


  

[flexcoders] Re: Nested ItemRenderers Problem

2010-08-29 Thread Stephen
If I make the DataGrid editable I can select from the drop down and it updates 
the Data Grid which I can show by scrolling the Drop Down List off the panel 
and back on and it is still changed at the same time the Drop Down List scroll 
bars just close the drop down list when you click on them.

If I make the Data Grid Un-editable the scroll bars begin to work but the 
editorDataField does not pass the update into the Data Grid and so it won't 
remember the changes.

editable="true" Scrolling fails, Update works
editable="false" Scrolling works, Update fails

- Help!!




[flexcoders] Nested ItemRenderers Problem

2010-08-29 Thread Stephen
I have placed a Label renderer inside of a Drop Down List inside of a Data Grid 
and I am having trouble makeing the Drop Down List scroll properly. I have 
included a link to the application which has the attached source code available 
if you need to look.

When I click to drag the list closes for some reason.

http://sbrown.myip.org/files/NestedRenders/NestedRenderers.html

- Stephen



Re: [flexcoders] Overriding Item Background In ItemRenderer Problem.

2010-08-29 Thread claudiu ursica
Working alternating 2 color renderer. Should give you a headstart:
oddColor and evenColor are defined in css file. You can justg hardcode them in 
here. In took out data code and labels, left the skeleton ...



xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%"
height="40"
autoDrawBackground="true"
useHandCursor="true"
buttonMode="true"
click="onItemClick(event)">

















--drop your data here



C



From: Stephen 
To: flexcoders@yahoogroups.com
Sent: Sun, August 29, 2010 3:34:23 PM
Subject: [flexcoders] Overriding Item Background In ItemRenderer Problem.

   
I can change the Label color but cant change the background color, its anying. 
Can anybody suggest a solution.


xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/mx" 
autoDrawBackground="true">






















 


  

[flexcoders] Overriding Item Background In ItemRenderer Problem.

2010-08-29 Thread Stephen
I can change the Label color but cant change the background color, its anying. 
Can anybody suggest a solution.

http://ns.adobe.com/mxml/2009"; 
xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/mx" 
autoDrawBackground="true">























[flexcoders] Pb with SwfLoader

2010-08-29 Thread Christophe
Hello,

When I use SwfLoader to load an external swf with resizing it, there is a zoom 
on all my application ? 

Thank you, 
Christophe, 




Re: [flexcoders] Re: 3D Carousel in Flex 4?

2010-08-29 Thread claudiu ursica
HTH
http://blog.onebyonedesign.com/actionscript/3d-carousel-as3-style-bop-secrets-turns-10/


Claudiu





From: hdave_123 
To: flexcoders@yahoogroups.com
Sent: Sat, August 28, 2010 11:32:49 PM
Subject: [flexcoders] Re: 3D Carousel in Flex 4?

   
Thanks -- got their coverflow working, but am stuck trying to create a carousel 
layout!

--- In flexcoders@yahoogroups.com, claudiu ursica  wrote:
>
> You'll get that by implementing a custom coverflow layout class. 
> 
> 
http://www.rialvalue.com/blog/2010/04/14/carroflow-another-3d-layout-for-flex4/
> 
> http://www.flexstuff.co.uk/2009/12/23/flex-4-coverflow-layout/
> 
> This should get you started...
> 
> Cheers,
> Claudiu
> 
> 
> 
> 
> 
> From: hdave_123 
> To: flexcoders@yahoogroups.com
> Sent: Tue, August 24, 2010 7:18:38 AM
> Subject: [flexcoders] 3D Carousel in Flex 4?
> 
> 
> I am desperate to get a 3D Carousel in my Flex 4 web app.  I found this 
>example:
> 
>http://dougmccune.com/blog/2007/11/19/flex-coverflow-performance-improvement-flex-carousel-component-and-vertical-coverflow/
>/
> 
> 
> It has been last updated in 2008.  Does anyone where know of where I can get 
> a 

> component I can use in a Flex 4 project?  Has it been updated?
>