RE: [flexcoders] Localization in Actionscript file

2012-11-06 Thread Gordon Smith
 Not able to achieve this.

Why not? One simple solution is just to have a resource in your .properties 
file that looks like this:

ComboList=Item 1,Item 2,Item 3

Use getString() and split() to turn it into the array [ “Item 1”, “Item 2”, 
“Item 3” ] that you can use as the dataProvider of the ComboBox.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of sony antony
Sent: Tuesday, November 06, 2012 2:26 AM
To: flex coders
Subject: [flexcoders] Localization in Actionscript file


Hello friends,

I have a scenario like I need to implement localization in actionscript files.

Accessing strings from respective .properties files(resource files) for 
different locales. We are using resourcebundle class for that.

And we have ComboBox in that page. We need to change the display list of that 
combox according to the languages being changed.

Not able to achieve this.

Please reply if anyone can help in this scenario.

Regards,
Sony



[flexcoders] RE: Syntax - Package

2012-07-23 Thread Gordon Smith
No. The braces are required.

Gordon Smith, Adobe compile team

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Davidson, Jerry
Sent: Friday, July 20, 2012 6:30 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Syntax - Package


We've all seen this:
Package x.y.z
{
Public ...
{
...
}
}

Is this equally valid?
Package x.y.z;
Public ...
{
...
}

Thanks.




RE: [flexcoders] setStyle, preinitialize and initialize

2012-04-12 Thread Gordon Smith
Doing it in the 'initialize' event seems like the right way to do it. The 
'initialize' event still occurs before the LayoutManager has sized and 
positioned the children. But if you wait until creationComplete() the 
LayoutManager has already laid out the children and calling setStyle()will 
force another layout.

Gordon Smith, Adobe

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of flexwdw
Sent: Wednesday, April 11, 2012 3:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] setStyle, preinitialize and initialize



So, I've run into this before but I don't recall it being the headscratcher it 
has become today

I'm using Flex 3.5 in an app. I have an MXML class with a bunch of UI in it. I 
have been asked to add a switch that causes the positions of some of the 
different child components to change. The components use constraint-based 
layouts, so this is going to amount to modifying their left, right, top, and 
bottom styles. This only needs to happen once per object creation.

In the docs:
http://livedocs.adobe.com/flex/3/html/help.html?content=styles_08.html

Some applications must call the setStyle() method during the application or 
object instantiation. If this is the case, call the setStyle() method early in 
the instantiation phase. Early in the instantiation phase means setting styles 
from the component or application's preinitialize event, instead of the 
creationComplete or other event. By setting the styles as early as possible 
during initialization, you avoid unnecessary style notification and lookup. For 
more information about the component startup life cycle, see Improving Startup 
Performance.

Putting these style sets in preinitialize is impossible because the children 
have not been setup and are null. At this point, I am making the calls in the 
handler for the initialize event. Is there an acceptable way to do this without 
having to create two versions of the class subclass the children?



RE: [flexcoders] Exiting from a Flex app

2012-01-26 Thread Gordon Smith
I think you can call flash.net.navigateToURL() to change the browser page. When 
you change the page, the instance of the Flash Player playing the old page will 
get terminated.

- Gordon Smith, Adobe

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Dan M
Sent: Thursday, January 26, 2012 7:45 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Exiting from a Flex app



I realize this is beginner stuff, so I apologize for having to ask this,
but how do I terminate a Flex app? The application will be running in a
browser.

This is a Flash encoding application, that grabs the user's camera,
connects it to a net connection, and sends the stream to a Wowza server.
The guts of the application are working fine, but I'm putting in error
handling now. If the app starts up and either can't find a camera or is
not given permission to access the camera I pop up an Alert box warning
of the issue, and I'd like to then bail out of the application (perhaps
direct the browser to return to the previous page?). I've been able to
find instructions on how to terminate an Air application, but not an app
running inside a browser.



RE: [flexcoders] Re: date problem?

2012-01-13 Thread Gordon Smith
ECMAScript did it this way and ActionScript was trying to follow ECMAScript.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of John Fletcher
Sent: Friday, January 13, 2012 6:23 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: date problem?


Or maybe the person that wrote the Java Date class is from Venus and the 
person that wrote the Actionscript one just copied him. You might get quite 
some support on the Java assertion...

John
2012/1/13 Rick Winscot rick.wins...@zyche.commailto:rick.wins...@zyche.com

I'm suspicious... I think that the person that wrote the Date class is from 
Venus.

Cheers,

Rick Winscot

From: John Fletcher fletch...@gmail.commailto:fletch...@gmail.com
Reply-To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Date: Fri, 13 Jan 2012 10:03:28 +0100
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: date problem?


Months start at 0 and go up to 11.

Don't ask me why.

John
2012/1/12 luvfotography 
ygro...@all-digital-links.commailto:ygro...@all-digital-links.com


http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html#methodSummary

says:

If you pass two or more arguments, the Date object is assigned a time value 
based on the argument values passed, which represent the date's year, month, 
date, hour, minute, second, and milliseconds.


--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
luvfotography ygroups@...mailto:ygroups@... wrote:

 Why does:
 trace((new Date(2012,01,15)).toString());
 and
 trace((new Date('2012','01','15')).toString());

 return:

 Wed Feb 15 00:00:00 GMT-0800 2012

 February??



--
John

You're old enough to make your own decisions about the environment without me 
telling you what you should and shouldn't print. But if you do print, I hope 
this signature doesn't cause the message to go onto an additional page. Because 
that would be kind of stupid, wouldn't it?




RE: [flexcoders] You are the product

2011-12-16 Thread Gordon Smith
 I don't think there is a JIT inside (maybe I am wrong), so each instruction 
 is decoded and emulated on the native CPU.

The ActionScript 3 Virtual Machine in Flash Player does use a JIT.

Gordon Smith, Adobe

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Mihai Vrinceanu
Sent: Friday, December 16, 2011 11:20 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] You are the product


Flash Player is a virtual machine. Last time I opened a *.swf file in a hex 
editor, it was a compressed file (I think zlib). After you decompress the file, 
you have to parse the structures inside (code, data, images, sounds). After 
that you have to load them inside the virtual machine and emulate the code. I 
don't think there is a JIT inside (maybe I am wrong), so each instruction is 
decoded and emulated on the native CPU. Excluding flash byte code, there is 
also a native decoder for images, videos and audio. Flash player also has 
support for UDP, TCP and other things inside (which need cpu and ram to work).

If you open a page with 2 flash ads and a YouTube video embedded in it, you are 
in serious trouble. Each device has a different CPU, different memory 
bandwidth, different speed when writing on the internal memory.

My point of view: Flash Player is an excellent product. Adobe should make it 
open source, invest money in future versions and sell support services (RedHat 
tactics).


--- On Fri, 12/16/11, Bill Brutzman bill.brutz...@scottynow.com wrote:

From: Bill Brutzman bill.brutz...@scottynow.com
Subject: RE: [flexcoders] You are the product
To: flexcoders@yahoogroups.com
Date: Friday, December 16, 2011, 8:16 PM


My sense is that Adobe has realized that it close to impossible to port Flash 
to the staggering proliferation of tablets, smart phones, and other devices.



Does anybody expect Flash to run on a Kindle or a Nook?



In my little world of fantasy… I wish I knew how Flash worked… Perhaps a 
standards-based Flash lite could be cranked into HTML-6.



--Bill



From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Kevin MacDonald
Sent: Friday, December 16, 2011 12:50 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] You are the product





Good points. Thanks for responding. I'm not sure why you conflate me knocking 
Adobe for a lack of willingness to learn. I code on a daily basis in half a 
dozen languages for a small company struggling to reach profitability. Our 
client application is one piece of that. The 'learning' in this case is that 
some companies can be trusted more than others. Adobe puts forth a consistent 
marketing message to software developers: Trust us! Follow us!, and they 
consistently fail to live up to that in order to sell us the next round of 
developer tools. Microsoft, while clearly capable of various brands of 
skulduggery, has consistently maintained a level of loyalty to their 
developers, and it has succeeded famously for them. Have you every noticed that 
15 year old programs still run on Windows 7? I don't expect that from Adobe. 
But the heavy sell job on AIR followed by stepping at arms length from it irks 
me.

Kevin

2011/12/16 Csomák Gábor csom...@gmail.com/mc/compose?to=csom...@gmail.com



technology simply changes. i met a guy who was the lead engineer of commodore 
64. do you think when he was on the top of his career, he stopped learning? 
this segment changes a lot. it is a lifelong learning. get used to it.



html5 is not ready. even w3c says it'll be in 2014 (as i remember). and i 
think, it won't kill air. neither flash. of course it will depend on a lot of 
things, but the two technologies are good in different segments. you cannot do 
a prezi.comhttp://prezi.com in html5, and you cannot do an entire webpage in 
flash. (login remembers will not work, etc...)

the key is to know both, and know when to use what.

On Wed, Dec 14, 2011 at 7:02 PM, Kevin MacDonald 
kevinmacdon...@gmail.com/mc/compose?to=kevinmacdon...@gmail.com wrote:



Hello developers,



I have come to some unfortunate conclusions about how Adobe operates. I would 
be interested to get your opinions on the matter.



Some years ago I helped build out a desktop application using Macromedia 
Director. It ran on both Mac and Windows, and was heavily backed by web 
services. In principle it was much like an Adobe AIR app might be today. After 
a few years Adobe bought Macromedia Director, with promises to the developer 
community that they would continue to support it. They came out with a few 
maintenance releases that were extremely buggy, enough so that we tried to roll 
back to the previous version. However, Adobe made sure there were some gotchas 
that made it painful to either stay on the current version or roll back. 
Shortly thereafter they killed Director altogether.



An Adobe evangelist came to our office and sold us hard on moving to Adobe AIR, 
which we did. We completely re-wrote our

RE: [flexcoders] help with a repeater

2011-10-07 Thread Gordon Smith
This poorly-worded message is trying to explain that you cannot access the 
'currentItem' of a Repeater, as your code vimeo.currentItem.title in 
openWindowVimeo() is doing, after the Repeater has already created all the 
repeated components. As each repeated component is created, 'currentItem' is 
the item in the dataProvider that is creating that particular component. So 
what would the 'currentItem' of the Repeater be after all the components have 
been created? It doesn't make sense, and therefore is an error.

Once a repeated component has been created, you can use its getRepeaterItem() 
method to get the item in the dataProvider that created it.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Gustavo Duenas
Sent: Friday, October 07, 2011 5:28 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] help with a repeater



thanks for your help
here is the error log

Error: Repeater is not executing.
at mx.core::Repeater/get 
currentItem()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\Repeater.as:305]
at iglesiaFls/openWindowVimeo()[/Users/gustavoduenas/Documents/Flex 
Builder 3/iglesiaFls/src/iglesiaFls.mxml:17]
at 
iglesiaFls/__vimeoButton_click()[/Users/gustavoduenas/Documents/Flex Builder 
3/iglesiaFls/src/iglesiaFls.mxml:51]

On Oct 7, 2011, at 12:47 AM, Tandon, Rishi wrote:




You missed the most important thing in message, the error log.
Send over that.


From: Gustavo Duenas 
gdue...@leftandrightsolutions.commailto:gdue...@leftandrightsolutions.com
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Sent: Friday, October 7, 2011 9:47 AM
Subject: [flexcoders] help with a repeater

I have a repeater which! reads a xmllist from vimeo, it works and do the repeat 
but when I tried to pass info from the repeater to the title window, something 
happens and I have an as3
errror. this is  my code.

mx:Script
![CDATA[
import mx.managers.PopUpManager;
import mx.containers.*;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import flsWindow;

private function 
openWindowVimeo(event:MouseEvent):void{
var myVimeoWindow:TitleWindow= 
TitleWindow(PopUpManager.createPopUp(this, flsWindow, true));
!
myVimeoWindow.title=vimeoService.lastResult.video.title;///this is the one 
using the xmlList,
it works but only the last title and with tags there is a way that my different 
video titles will be in the opened windows?
also when I try using the repeater like:
myVimeoWindow.title=vimeo.currentItem.title
is always giving me and error.

}

///here is my repeater, it works, but I cannot open the window as I want.
mx:HTTPService id=vimeoService 
url=http://vimeo.com/api/v2/iglesiafls/videos.xml; resultFormat=e4x 
fault=onFault(event)/
mx:XMLListCollection id=myVimeoList 
source={vimeoService.lastResult.video}/
mx:VBox width=340 height=33! 4 x=699 y=422
mx:Repeater id=vimeo dataProvider={myVimeoList}
mx:Image source={vimeo.currentItem.thumbnail_medium} 
width=200 height=150/
mx:Text text={vimeo.currentItem.title} 
color=#F5FBFC fontSize=14 width=300/
mx:Text text={vimeo.currentItem.description} 
color=#F5FAFB width=300/
mx:LinkButton label=ver video 
click=openWindowVimeo(event) id=vimeoButton enabled=true/

/mx:Repeater
   /mx:VBox

Could someone help me out

gus






RE: [flexcoders] help with a repeater

2011-10-07 Thread Gordon Smith
BTW, you should consider moving to Spark components and using a Spark DataGroup 
rather than a Repeater. A DataGroup is more efficient when you have many data 
items that need to be rendered because it only creates item renderers for the 
data items that are visible. Repeater always creates all of them.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Gustavo Duenas
Sent: Friday, October 07, 2011 9:51 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] help with a repeater



Thank you my friend, you are really good. I guess I should have read more the 
book. It totally works.

Gustavo

On Oct 7, 2011, at 12:21 PM, Gordon Smith wrote:




This poorly-worded message is trying to explain that you cannot access the 
'currentItem' of a Repeater, as your code vimeo.currentItem.title in 
openWindowVimeo() is doing, after the Repeater has already created all the 
repeated components. As each repeated component is created, 'currentItem' is 
the item in the dataProvider that is creating that particular component. So 
what would the 'currentItem' of the Repeater be after all the components have 
been created? It doesn't make sense, and therefore is an error.

Once a repeated component has been created, you can use its getRepeaterItem() 
method to get the item in the dataProvider that created it.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Gustavo Duenas
Sent: Friday, October 07, 2011 5:28 AM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] help with a repeater



thanks for your help
here is the error log

Error: Repeater is not executing.
at mx.core::Repeater/get 
currentItem()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\Repeater.as:305]
at iglesiaFls/openWindowVimeo()[/Users/gustavoduenas/Documents/Flex 
Builder 3/iglesiaFls/src/iglesiaFls.mxml:17]
at 
iglesiaFls/__vimeoButton_click()[/Users/gustavoduenas/Documents/Flex Builder 
3/iglesiaFls/src/iglesiaFls.mxml:51]

On Oct 7, 2011, at 12:47 AM, Tandon, Rishi wrote:





You missed the most important thing in message, the error log.
Send over that.


From: Gustavo Duenas 
gdue...@leftandrightsolutions.commailto:gdue...@leftandrightsolutions.com
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Sent: Friday, October 7, 2011 9:47 AM
Subject: [flexcoders] help with a repeater

I have a repeater which! reads a xmllist from vimeo, it works and do the repeat 
but when I tried to pass info from the repeater to the title window, something 
happens and I have an as3
errror. this is  my code.

mx:Script
![CDATA[
import mx.managers.PopUpManager;
import mx.containers.*;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import flsWindow;

private function 
openWindowVimeo(event:MouseEvent):void{
var myVimeoWindow:TitleWindow= 
TitleWindow(PopUpManager.createPopUp(this, flsWindow, true));
!
myVimeoWindow.title=vimeoService.lastResult.video.title;///this is the one 
using the xmlList,
it works but only the last title and with tags there is a way that my different 
video titles will be in the opened windows?
also when I try using the repeater like:
myVimeoWindow.title=vimeo.currentItem.title
is always giving me and error.

}

///here is my repeater, it works, but I cannot open the window as I want.
mx:HTTPService id=vimeoService 
url=http://vimeo.com/api/v2/iglesiafls/videos.xml; resultFormat=e4x 
fault=onFault(event)/
mx:XMLListCollection id=myVimeoList 
source={vimeoService.lastResult.video}/
mx:VBox width=340 height=33! 4 x=699 y=422
mx:Repeater id=vimeo dataProvider={myVimeoList}
mx:Image source={vimeo.currentItem.thumbnail_medium} 
width=200 height=150/
mx:Text text={vimeo.currentItem.title} 
color=#F5FBFC fontSize=14 width=300/
mx:Text text={vimeo.currentItem.description} 
color=#F5FAFB width=300/
mx:LinkButton label=ver video 
click=openWindowVimeo(event) id=vimeoButton enabled=true/

/mx:Repeater
   /mx:VBox

Could someone help me out

gus








RE: [flexcoders] Space character in additional compiler arguments

2010-08-26 Thread Gordon Smith
I would expect single/double quotes to work. If they don't, I think you should 
file a bug.

One more thing to try in the meantime is putting a backslash in front of the 
space.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of tom_sobut
Sent: Thursday, August 26, 2010 6:36 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Space character in additional compiler arguments



This should be simple...

I need to include a file path which includes a space character in the 
Additional complier arguments of my project properties. Problem is, the space 
is reserved to separate compiler arguments, so the compiler thinks my file path 
ends at the space. I've tried lots of approaches...escape codes for space, 
backslash, single and double quotes around the path. None work. Does anyone 
know what the secret code is?

Thanks



RE: [flexcoders] Re: FB4: Looping thru itemrenderers

2010-08-25 Thread Gordon Smith
You should have a background color stored in -- or associated with, in some way 
-- each data item. Then you should access the next and previous data item, 
change the background color, and let the renderer re-render the data item.

You cannot generally access the next and previous item renderer, because they 
may not exist yet. Item renderers get created on demand as items scroll into 
view.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of sdl1326
Sent: Wednesday, August 25, 2010 9:48 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: FB4: Looping thru itemrenderers



Thanks for the assistance. I posted what I was trying to accomplish in the 
reply above. Ultimately, I need to be able to access the next or previous 
itemrenderer from the one that is currently selected.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gregor 
Kiddie gregor.kid...@... wrote:

 If you need to access an itemrenderer, there's almost always a better
 way of doing what you are trying to do...



 So, why are you wanting to access the itemrenderer instance?



 Gk.




RE: [flexcoders] Re: Aspects of functional programming in ActionScript

2010-08-20 Thread Gordon Smith
I think using const for local variables that don't change is a good idea. I 
wish we had done it throughout the framework. In the future, it might allow the 
ActionScript compiler to do better optimization.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Florian
Sent: Friday, August 20, 2010 1:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Aspects of functional programming in ActionScript



Well, the question was more intended to case like:

function elementAddhandler(event:ElementExistenceEvent):void
{
const renderer:IVisualElement = event.renderer;
}

or

function iterateOverList(list:IList):void
{
if (!list) return;

const length:int = list.length;

for (var i:int; i  length; i++) { trace(list.getItemAt(i)); }
}

I'm looking for reasons not to use constants in this context.

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

 Despite this whole FP issue coming back into fashion in the last years,
 there's really no use for that in ECMAScript-like languages. Every piece of
 code you can write using nested functions can be rewritten in a way that no
 nested functions will be used and the program will work better.
 I'm not sure where would you need immutable objects, except date and string.
 I'm not sure what kind of impact you were afraid of re' constants, but, sure
 the constant which is not static is initialized as many times as it's scope
 is initialized:

 function foo():void {
 const bar:int = 100;
 }

 bar initialized as many times as often you call foo().

 class Foo {
 private const bar:int = 100;
 }

 bar is initialized as many times as often you create new Foo.

 If you need an example of intensive use of closures in AS3, look into
 binding mechanism in Flex. It uses them a lot, and this is why it is bad.
 Another example - Googlemaps, which is just another example of a lame code.
 It is confusing to think that big corporation with many years of programming
 experience would produce crappy code. I cannot tell why did this happen
 exactly... but you know, lots of girls wear high heels, even though it's one
 hell uncomfortable :)




RE: [flexcoders] Re: how to access action script variable data type in mxml

2010-06-16 Thread Gordon Smith
I think you're right that you can't find out at runtime that 'bar' was typed as 
IBitmapDrawable. But using IBitmapDrawable as a type annotation does ensure 
that it gets compiled in unless you deliberately exclude it.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Oleg Sivokon
Sent: Wednesday, June 16, 2010 4:38 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: how to access action script variable data type in 
mxml


Nope, sorry Amy, it's not possible to get the type of a local variable, you can 
only get the type of a value it references. Example:

function foo():void {

var bar:IBitmapDrawable = new BitmapData();

}

you can only know what the type of the value is ( BitmapData ) the type of the 
bar variable (IBitmapDrawable) may not even exist in the compiled code - 
there's no need for it to exist anyway.



RE: [flexcoders] Unicode Characters

2010-06-08 Thread Gordon Smith
But you don't HAVE to use embedded fonts. You could just specify some standard 
Japanese device font.

What problem are you having with Japanese text?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Andriy Panas
Sent: Tuesday, June 08, 2010 1:51 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Unicode Characters



  Use embedded fonts with unicodeRange set only to Japanese characters to 
reduce the overall file size.

  The comprehensive list of Japanese characters is listed in 
flash-unicode-table.xml file included into Flex SDK

--
Best regards,
Andriy Panas


On 8 June 2010 11:44, Christophe 
christophe_jacque...@yahoo.frmailto:christophe_jacque...@yahoo.fr wrote:


Hello,

How to display unicode characters (for Japanese language , ...) in a flex 
application ?

Thank you,
Christophe




RE: [flexcoders] Event before preinitialize

2010-06-03 Thread Gordon Smith
I don't think so. How early do you need it? Why isn't preinitialize early 
enough?

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of dorkie dork from dorktown
Sent: Thursday, June 03, 2010 12:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Event before preinitialize



Is there an event before application preinitialize that I can listen
for in the application?

JP



RE: [flexcoders] init, creationcomplete and other events

2010-05-19 Thread Gordon Smith
From the ASDoc for these events:

preinitialize: Dispatched at the beginning of the component initialization 
sequence. The component is in a very raw state when this event is dispatched. 
Many components, such as the Button control, create internal child components 
to implement functionality; for example, the Button control creates an internal 
UITextField component to represent its label text. When Flex dispatches the 
preinitialize event, the children, including the internal children, of a 
component have not yet been created.

initialize: Dispatched when the component has finished its construction and 
has all initialization properties set. After the initialization phase, 
properties are processed, the component is measured, laid out, and drawn, after 
which the creationComplete event is dispatched.

creationComplete: Dispatched when the component has finished its construction, 
property processing, measuring, layout, and drawing. At this point, depending 
on its visible property, the component is not visible even though it has been 
drawn.

applicationComplete: Dispatched after the Application has been initialized, 
processed by the LayoutManager, and attached to the display list.
If you think we need better explanations, please file a documentation bug. (The 
second sentence about creationComplete is confusing, but the rest doesn't seem 
too bad.)
- Gordon






From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Angelo Anolin
Sent: Wednesday, May 19, 2010 6:41 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] init, creationcomplete and other events



Thanks Alex and Gordon.

Is there some sort of documentation for this?

Thanks.


From: Alex Harui aha...@adobe.com
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Sent: Tue, 18 May, 2010 18:20:36
Subject: Re: [flexcoders] init, creationcomplete and other events



Preinitialize, initialize, creationComplete, applicationComplete .

Objects do not have a stage until applicationComplete .


On 5/18/10 3:22 PM, Angelo Anolin angelo_anolin@ yahoo.com wrote:





Hi FlexCoders,

Does anyone have a link on which event fires up first?  For example, in an 
application container, which event fires up and any other pointers which I have 
to be aware of.

Thanks.

Angelo






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




RE: [flexcoders] textInput - Flex 4 vs. Flex 3

2010-05-19 Thread Gordon Smith
It should work. Exactly what problem are you having?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of tex_learning_flex
Sent: Wednesday, May 19, 2010 7:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] textInput - Flex 4 vs. Flex 3



In Flex 3 you could set an initial value for a textInput field like so:

mx:TextInput id=textinput1
text={data.name}
editable=true
/

I haven't been able to do this in Flex 4 -- does anyone know a way to achieve 
the same result?

thanks in advance,

Tex



RE: [flexcoders] Limit to number of states in a Flex application?

2010-05-18 Thread Gordon Smith
 Is there a limit to the number of states in a Flex application?

Not that I'm aware of.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Joel
Sent: Saturday, May 15, 2010 8:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Limit to number of states in a Flex application?



Is there a limit to the number of states in a Flex application?

Joel



RE: [flexcoders] init, creationcomplete and other events

2010-05-18 Thread Gordon Smith
preinitialize - before child components are created
initialize - after children are created, but before component undergoes layout
creationComplete - after layout

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Angelo Anolin
Sent: Tuesday, May 18, 2010 3:22 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] init, creationcomplete and other events


Hi FlexCoders,

Does anyone have a link on which event fires up first?  For example, in an 
application container, which event fires up and any other pointers which I have 
to be aware of.

Thanks.

Angelo




RE: [flexcoders] Re: Flex Events

2010-05-14 Thread Gordon Smith
You can assume that anything not documented as being asynchronous is 
synchronous.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of itaid1
Sent: Friday, May 14, 2010 9:35 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Flex Events




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

 dispatchEvent is a regular method and it id executed synchronously. If you
 call it twice, then the same group of listeners will be called twice in the
 same call stack. If you want to manage the order in which handlers are
 called you can specify priority when adding them, however, if you must add
 many handlers (many would be hundreds) I would rethink using priority as the
 handlers are sorted when added and the more handlers there are with the
 certain priority specified, the slower the adding will be.

Thanks! Did you figure it's synchronous aspect through testing or is this 
documented somewhere?



RE: [flexcoders] Best way to remove line breaks from Label text?

2010-05-12 Thread Gordon Smith
I would just use a RegExp to replace \r and \n with nothing or with a space.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Baz
Sent: Wednesday, May 12, 2010 11:39 AM
To: Google/Yahoo Groups
Subject: [flexcoders] Best way to remove line breaks from Label text?



I have an s:Label whose text comes from a DB. What's the best way to remove, 
or not show, any line breaks that may be in that text? I could use another text 
element if that's easier/cleaner.

Thanks.



RE: [flexcoders] Updating Static vars

2010-05-11 Thread Gordon Smith
 Is is possible to update all the variables that are affected by a change to 
 the affiliate?

If you make them static getters rather than static vars,  they can return 
something different every time you access them.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Joshua
Sent: Monday, May 10, 2010 2:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Updating Static vars



Hello I've got a situation as follows

1. I have a class called MessageStrings.as that I use for storing static consts 
and variables used throughout my project.

2. Recently, we started an affiliate program where I need to make modifications 
to the MessageStrings to change company names, email addresses, etc depending 
on which affiliate is loading the page (from url string)

3. Instead of copying a bunch of static vars like
public static var CONTACT_US:String = Hello, contact us by phone at: +PHONE;
public static var CONTACT_US_AFFILIATE:String = Hello, contact us by phone at: 
+PHONE_AFFILIATE;

and switching all the references I have to MessageStrings for affiliate info I 
would like to do

public static var CONTACT_US:String = Hello, contact us by phone at: 
+getPhone();

and have a new variable (static var) called THE_AFFILIATE that gets set by a 
static function and getPhone returns a static var depending on what 
THE_AFFILIATE is set to.

where getPhone is something like this

public static function getPhone():String {
var retPhone:String = ;
switch (THE_AFFILIATE) {
case MY_BUSINESS:
retPhone = SUPPORT_PHONE;
break;
case AFFILIATE:
retPhone = SUPPORT_PHONE_AFFILIATE;
break;
}
return retPhone;
}

So, this almost works, problem is that the class (MessageStrings) sets all the 
variables intially and then when I set the Affiliate info later, the static 
vars are not updated, and therefore do not reflect the text I want to see.

Is is possible to update all the variables that are affected by a change to the 
affiliate? Kinda like calling the constructor again, but that won't work cause 
it resets my affiliate variable?



RE: [flexcoders] Implement question

2010-04-28 Thread Gordon Smith
If class C implements interface I, and object o is an instance of C, then the 
expressions o is C and o is I are true. This means that o can be passed to 
any code that expects either a C or an I; it satisfies both types at once! 
Generally you use the interface I to express the public contract of what the 
object can do, and the class C to implement the details.

Implementing multiple interfaces makes this even cooler. You might have a 
library of code that deals with carbon emissions and works with 
ICarbonEmitters, and a library that works with IVehicles and does 
transportation scheduling algorithms. If you had a Car class that implemented 
both ICarbonEmitter and IVehicle, then either library could work with an 
instance of Car.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dan Pride
Sent: Wednesday, April 28, 2010 1:12 PM
To: Flex Coders
Subject: [flexcoders] Implement question



What is the practical difference between implementing an interface (Like say 
IResponder) and passing in a variable typed as IResponder in the construction 
method?
Thanks
Dan Pride



RE: [flexcoders] Re: Can someone rewrite this...

2010-04-19 Thread Gordon Smith
 that solution (the age switch) is what i proposed before, in the first reply

Oops, sorry! I need to pay more attention to the whole thread before I answer.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Joe Cabezas
Sent: Friday, April 16, 2010 11:08 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Can someone rewrite this...



Gordon:

that solution (the age switch) is what i proposed before, in the fisrt reply, :D

PD: Adobe Flex SDK Team?, wow!, nice work adobe! :D

2010/4/16 Gordon Smith gosm...@adobe.commailto:gosm...@adobe.com

If age were an int rather than a Number (which it probably should be) then you 
could use a switch:

switch (age)
{
case 0:
case 1:
case 2:
return 1;
case 3:
case 4:
case 5:
return 2;
case 6:
case 7:
case 8:
return 3;
case 9:
case 10:
case 11:
case 12:
return 4;
case 13:
case 14:
case 15:
return 5;
case 16:
case 17:
case 18:
return 6;
default:
return 0;
}

You could also use an array specifying the last age in each group - [ 2, 5, 8, 
12, 15, 18 ] - and iterate over it until you find the first one where the age 
is = the array entry. This would involve less code, but it would probably 
execute slightly slower.

Finally, if the age groups were more sensible so that each one contained 3 
ages, then you could just do something like int(age/3) + 1.

Gordon Smith
Adobe Flex SDK Team


From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of Wally Kolcz
Sent: Friday, April 09, 2010 9:00 PM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Can someone rewrite this...



Thanks for the catch on the GT. Haven't tried to run it yet. Just wrote is and 
hoped there would be a switch/case that is easier than having to case out each 
age..

On 4/9/2010 11:43 PM, Joe wrote:


it curious but a person who are 2000 years old, with your implementation it's 
group 1

run this code:

package
{
import flash.display.Sprite;

public class test extends Sprite
{
public function test()
{
trace(this.getAgeGroup(2000));
}

private function getAgeGroup(age:Number):int {
if (age = 0  age 3){ //Birth to 2
return 1;
}else if (age =3  age 6){ //3 to 5
return 2;
}else if (age =6  age 9){ //6 to 8
return 3;
}else if (age =9  age 13){ //9 to 12
return 4;
}else if (age =13  age 16){ //13 to 15
return 5;
}else if (age =16  age 19){ //16 to 18
return 6;
}else { //Older or Adults
return 0;
}

}
}
}

maybe you want to do this:

private function getAgeGroup(birthday:Date):int {

var age:int = getAge(birthday);

if (age=0age3) {//Birth to 2
return 1;
} else if (age =3  age 6) {//3 to 5
return 2;
} else if (age =6  age 9) {//6 to 8
return 3;
} else if (age =9  age 13) {//9 to 12
return 4;
} else if (age =13  age 16) {//13 to 15
return 5;
} else if (age =16  age 19) {//16 to 18
return 6;
} else {//Older or Adults
return 0;
}

}

see i changed yours  with  ???

HOWEVER, a switch implementation is like this:

private function getAgeGroup(birthday:Date):int {

var age:int=getAge(birthday);

switch (age) {
case 0 :
case 1 :
case 2 :
return 1;
break;
case 3 :
case 4 :
case 5 :
return 2;
break;
case 6 :
case 7 :
case 8 :
return 3;
break;
case 9 :
case 10 :
case 11 :
case 12 :
return 4;
break;
case 13 :
case 14 :
case 15 :
return 5;
break;
case 16 :
case 17 :
case 18 :
return 6;
break;
default :
return 0;
break;
}

}

Point for testing! :D

greetings from Chile!, Latin America
_





RE: [flexcoders] Question on TextInput

2010-04-19 Thread Gordon Smith
Or use an mx:NumberValidator and specify the minValue and maxValue.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Tom Chiverton
Sent: Monday, April 19, 2010 3:34 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Question on TextInput



On Monday 19 Apr 2010, Christophe wrote:
 How to limit the value of a textInput to be a Number between 0 and 12 ?

Use a NumericStepper instead.

--
Helping to collaboratively transition corporate unique dynamic slick IPOs as
part of the IT team of the year 2010, '09 and '08



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 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of 
members is available for inspection at the registered office together with a 
list of those non members who are referred to as partners. We use the word 
?partner? to refer to a member of the LLP, or an employee or consultant with 
equivalent standing and qualifications. Regulated by the Solicitors Regulation 
Authority.

CONFIDENTIALITY

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

For more information about Halliwells LLP visit 
www.Halliwells.comhttp://www.Halliwells.com.



RE: [flexcoders] Re: Can someone rewrite this...

2010-04-16 Thread Gordon Smith
If age were an int rather than a Number (which it probably should be) then you 
could use a switch:

switch (age)
{
case 0:
case 1:
case 2:
return 1;
case 3:
case 4:
case 5:
return 2;
case 6:
case 7:
case 8:
return 3;
case 9:
case 10:
case 11:
case 12:
return 4;
case 13:
case 14:
case 15:
return 5;
case 16:
case 17:
case 18:
return 6;
default:
return 0;
}

You could also use an array specifying the last age in each group - [ 2, 5, 8, 
12, 15, 18 ] - and iterate over it until you find the first one where the age 
is = the array entry. This would involve less code, but it would probably 
execute slightly slower.

Finally, if the age groups were more sensible so that each one contained 3 
ages, then you could just do something like int(age/3) + 1.

Gordon Smith
Adobe Flex SDK Team


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Wally Kolcz
Sent: Friday, April 09, 2010 9:00 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Can someone rewrite this...



Thanks for the catch on the GT. Haven't tried to run it yet. Just wrote is and 
hoped there would be a switch/case that is easier than having to case out each 
age..

On 4/9/2010 11:43 PM, Joe wrote:


it curious but a person who are 2000 years old, with your implementation it's 
group 1

run this code:

package
{
import flash.display.Sprite;

public class test extends Sprite
{
public function test()
{
trace(this.getAgeGroup(2000));
}

private function getAgeGroup(age:Number):int {
if (age = 0  age 3){ //Birth to 2
return 1;
}else if (age =3  age 6){ //3 to 5
return 2;
}else if (age =6  age 9){ //6 to 8
return 3;
}else if (age =9  age 13){ //9 to 12
return 4;
}else if (age =13  age 16){ //13 to 15
return 5;
}else if (age =16  age 19){ //16 to 18
return 6;
}else { //Older or Adults
return 0;
}

}
}
}

maybe you want to do this:

private function getAgeGroup(birthday:Date):int {

var age:int = getAge(birthday);

if (age=0age3) {//Birth to 2
return 1;
} else if (age =3  age 6) {//3 to 5
return 2;
} else if (age =6  age 9) {//6 to 8
return 3;
} else if (age =9  age 13) {//9 to 12
return 4;
} else if (age =13  age 16) {//13 to 15
return 5;
} else if (age =16  age 19) {//16 to 18
return 6;
} else {//Older or Adults
return 0;
}

}

see i changed yours  with  ???

HOWEVER, a switch implementation is like this:

private function getAgeGroup(birthday:Date):int {

var age:int=getAge(birthday);

switch (age) {
case 0 :
case 1 :
case 2 :
return 1;
break;
case 3 :
case 4 :
case 5 :
return 2;
break;
case 6 :
case 7 :
case 8 :
return 3;
break;
case 9 :
case 10 :
case 11 :
case 12 :
return 4;
break;
case 13 :
case 14 :
case 15 :
return 5;
break;
case 16 :
case 17 :
case 18 :
return 6;
break;
default :
return 0;
break;
}

}

Point for testing! :D

greetings from Chile!, Latin America
_



RE: [flexcoders] Handler functions convention

2010-04-05 Thread Gordon Smith
  if you subscribe to the event using ActionScript,
 not the mxml handler sugar, then you'll always get the event.

An MXML event attribute like click=trace(event.target) just autogenerates an 
event handler that looks like

function clickHandler(event:MouseEvent):void
{
trace(event.target);
}

The attribute value is code that becomes the body of the handler.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mike Chang
Sent: Saturday, April 03, 2010 10:47 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Handler functions convention



Thanks Gabriel.
Mike
2010/4/3 gabriel montagné gabr...@rojored.commailto:gabr...@rojored.com

On 03/04/2010, Mike Chang mik...@gmail.commailto:mikecc%40gmail.com wrote:

 I noticed in many examples on the web handler functions mostly have a
 parameter event, even though the event isn't used (such as even.target). I'm
 wondering if there's a reason for this convention.
I'd say it's up to you, but if you subscribe to the event using ActionScript,
not the mxml handler sugar, then you'll always get the event.


 I have to pass a null in case it isn't triggered by the event, which seems
 pretty cumbersome.
Perhaps you could use defaults in the handler, something like

login_clickHandler(event:MouseEvent = null)

Gabriel

--
gabriel montagné láscaris comneno
http://rojored.com
+44 (0) 7500 709 209




RE: [flexcoders] what is the method in mx script for declaration....as fx:declarations

2010-04-05 Thread Gordon Smith
Can you please restate your question? I'm not sure what you're asking.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of gogineni
Sent: Saturday, April 03, 2010 10:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] what is the method in mx script for declarationas 
fx:declarations



what is the method we use in mxml to declare a $(dollar) symbol
as i konw in fx script we writ the code as

fx:Declarations
mx:CurrencyFormatter id=usdFormatter precision=2 currencySymbol=$ 
decimalSeparatorFrom=.
decimalSeparatorTo=. useNegativeSign=true
useThousandsSeparator=true alignSymbol=left/
/fx:Declarations



RE: [flexcoders] Can't get properties to compile?

2010-04-05 Thread Gordon Smith
This step is necessary if you are writing attributes like

label={resourceManager.getString('MyApp', 'someResource')

But I don't think it is necessary if you use the @Resource() compiler directive:

label=@Resource(bundle='MyApp', key='someResource')

However, unlike the databinding expression, the @Resource directive doesn't 
re-evaluate when the localeChain changes.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Rick Genter
Sent: Sunday, April 04, 2010 5:45 PM
To: flexcoders@yahoogroups.com
Cc: Rick Genter
Subject: Re: [flexcoders] Can't get properties to compile?



On Apr 4, 2010, at 8:37 PM, gabriel montagné wrote:

 Hi Rick,

 On 4 April 2010 21:24, Rick Genter 
 rick.gen...@gmail.commailto:rick.genter%40gmail.com wrote:
 What am I missing?

 Have you declared the bundle metadata anywhere in your app? Something like...

 mx:Metadata
 [ResourceBundle(MyApp)]
 /mx:Metadata

 ... in your main app?

 hth,
 gabriel

 --
 gabriel montagné láscaris comneno
 http://rojored.com
 +44 (0) 7500 709 209

Hi Gabriel,

Thank you; that was it. I must have looked at 3 or 4 different tutorials and 
none of them mentioned that obviously critical step. The next time I'm in the 
UK, I owe you a pint ;-).
--
Rick Genter
rick.gen...@gmail.commailto:rick.genter%40gmail.com



RE: [flexcoders] Re: Is it a ValueObject, or is it a String.

2010-03-30 Thread Gordon Smith
The 'is' operator should definitely work.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Laurence
Sent: Saturday, March 27, 2010 2:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Is it a ValueObject, or is it a String.



I could've sworn I tried that, and it didn't work...

I did find something that worked, even though it's a bit of a hack...

if (String(returnedItem) == [object Object]) {
//I know it's a VO and not a String
}

So that works... I'll give your suggestion a try and see if that works -- 
although I think I tried it already.

Thanks for the suggestion,
L.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
robert.vancuren...@... robert.vancuren...@... wrote:

 Use the is operatornbsp;

 If (returnedItem is String)




 -- Sent from my Palm Pre
 On Mar 27, 2010 4:23 PM, Laurence lmacne...@... wrote:


 nbsp;










 I have a function (not written by me) that's returning either a String or a 
 ValueObject, depending on whether or not it finds a match in an 
 ArrayCollection of ValueObjects. If it finds a match, it returns the 
 ValueObject that matches the search string. If it doesn't find a match, it 
 returns the search-string itself.



 So, here's my question -- how do I know if what's being returned is a String 
 or a ValueObject?



 I need something like the following:

 if returnedItem isString {

 //do stuff needed for when match isn't found

 } else {

 //do stuff needed for when match is found

 }



 But I can't figure out how to word that 'if' statement -- how do you ask it 
 if it is a String or a ValueObject, without knowing in advance what it's 
 going to be?



 Thanks,

 Laurence MacNeill

 Mableton, Georgia, USA




RE: [flexcoders] How can i localize and internationalize a flex application

2010-03-24 Thread Gordon Smith
If these folders exist, then I'm not sure what's causing the unable to open 
errors. Rob, have you heard of this problem before?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Thomas Silvester
Sent: Wednesday, March 24, 2010 12:50 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] How can i localize and internationalize a flex 
application


Hi Smith,
copylocale en_US fr_CA and de_CH infact created these folders and copied the 
en_US swc files to these folders, but when I try to compile the resource bundle 
file for fr_CA and de_CH to create the respective .swf files Ii am getting the 
below error.
thanks,
Ann.

--- On Sat, 3/20/10, Gordon Smith gosm...@adobe.com wrote:

From: Gordon Smith gosm...@adobe.com
Subject: RE: [flexcoders] How can i localize and internationalize a flex 
application
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Date: Saturday, March 20, 2010, 2:19 AM

You probably just need to create fr_CA and de_CH subdirectories inside of 
frameworks/locale so that the resource SWCs for these locales can be created 
there.

Gordon Smith
Adobe Flex SDK Team

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of Thomas Silvester
Sent: Friday, March 19, 2010 6:22 AM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] How can i localize and internationalize a flex application


Hi All,
I did all the steps for this like copyloale, create resource file and cnage the 
compiler optionin Flex builder. The localization works in Flex builder 
environment, but when I try to compile the resourcebundles from command line, I 
get for fr_CA and de_CH, he following Error: unable to open 'locale/fr_CA' and 
Error: unable to open 'locale/de_CH' . Any quick help on this is well 
appreciated. When I try to compile for en_US it creates the .swf file.

Thanks in advance,
Ann.







RE: [flexcoders] From your own experience how long does it take to learn AS3?

2010-03-24 Thread Gordon Smith
If you've never programmed before, I wouldn't expect you to be able to do much 
on your own after only 4 weeks. First, you need to make sure you understand 
basics like what is a variable, what is a function, what is a getter/setter, 
how to use various operators, how to write conditional and looping statements, 
what is a class, what is an instance, etc. There are a lot of fundamental 
programming concepts to understand before even getting to Flash Player and Flex 
Framework concepts like Events, Styles, and DataGrids.

For example, let's start with something simple Do you understand how to write a 
function that adds up the first n integers, where n is an integer that you pass 
as an argument (and how to call it)? Just that involves functions, arguments, 
return values, local variables, and a for-loop. Do you understand how to use 
the debugger to watch it execute line by line, set breakpoints, inspect the 
loop counter and the sum, etc.?

You're likely to succeed if you take baby steps and have patience. And ask 
questions when you get stuck!

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Clark Stevenson
Sent: Wednesday, March 24, 2010 1:39 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] From your own experience how long does it take to 
learn AS3?



I started AS3 in a flex environment in 2007. I only currently code in AS3 as 
its all i require for games and the type of stuff i do.

I found the journey difficult but all i knew was AS1 (and i didnt even 
understand it back then).

Its not to much the syntax i struggle with but the structure and 
architecture... how does changes in portion A of my code change portion B 
elsewhere I still struggle with these issues but you start to find easier 
ways of doing things.

Think of a project and break it into small pieces then build each piece. Dont 
try to start something massive on the first attemp because i did this and was 
always frustrated.

Good luck though mate!

If you enjoy what your doing (frustration aside) it will all work out.

I will say one thing, if i ever had to start out again, id do C++!

Cheers,

Clark
On 24 March 2010 19:51, ellistein52 
ellistei...@yahoo.commailto:ellistei...@yahoo.com wrote:


I have no background in programming , I am close to 54.I am following some AS3 
Lynda.com Essential Training. I seem to understand the material but when I try 
to make a simple program on my own I am lost , I have to refer back to the 
lesson to be able to write a simple line of code on my own.Also I started 
learning the material 4 weeks ago so maybe it is too early for me to write my 
own code? I would appreciate your comments regarding this issue.




RE: [flexcoders] WHO IS RESPONSIBLE???

2010-03-22 Thread Gordon Smith
My understanding is that none of Adobe's Creative Suite applications support 
being installed on a case-sensitive Mac file system. The Flex team was 
unfortunately unable to get this restriction relaxed when Flash Builder joined 
the Creative Suite.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Florian
Sent: Monday, March 22, 2010 5:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] WHO IS RESPONSIBLE???



I am scared...

I was glad to see that there is now Flash Builder 4 available @ adobe.com... I 
am glad i didn't buy it right away. I can't install it on a case sensitive 
formatted HDD?



RE: [flexcoders] How can i localize and internationalize a flex application

2010-03-19 Thread Gordon Smith
You probably just need to create fr_CA and de_CH subdirectories inside of 
frameworks/locale so that the resource SWCs for these locales can be created 
there.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Thomas Silvester
Sent: Friday, March 19, 2010 6:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How can i localize and internationalize a flex application


Hi All,
I did all the steps for this like copyloale, create resource file and cnage the 
compiler optionin Flex builder. The localization works in Flex builder 
environment, but when I try to compile the resourcebundles from command line, I 
get for fr_CA and de_CH, he following Error: unable to open 'locale/fr_CA' and 
Error: unable to open 'locale/de_CH' . Any quick help on this is well 
appreciated. When I try to compile for en_US it creates the .swf file.

Thanks in advance,
Ann.






RE: [flexcoders] DateField month's name

2010-03-19 Thread Gordon Smith
The month names are pulled from localized resources according to the 
ResourceManager's localeChain. If you set resourceManager.localeChain = [ 
fr_FR ] then the month names should be in French.

Are you using the ResourceManager to localize your interface for various 
locales?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Christophe
Sent: Friday, March 19, 2010 10:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DateField month's name



Hello,

In a date field, how to setup the name of the month (Ex: 18 March 2010).

And how to have the month in the language of the interface ?

Thank you,
Christophe,



RE: [flexcoders] Is there an internal build number?

2010-03-16 Thread Gordon Smith
Most Flex framework classes have an mx_internal version string similar to this:

mx_internal static const VERSION:String = 4.0.0.13827;

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Nick Middleweek
Sent: Tuesday, March 16, 2010 6:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is there an internal build number?



Hi,

Is there some kind of internal build number that I can show on screen so I know 
when testing/ debugging that i'm looking at the latest compiled version?

I guess I could maintain my own date/ time stamp but was wondering if there's 
any mx_internals variables or something?


Thanks,
Nick



RE: [flexcoders] Default parameters in function

2010-03-11 Thread Gordon Smith
Yes, this should work. I can't reproduce your problem. Can you post a tiny but 
complete app that demonstrates the problem?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mike Chang
Sent: Wednesday, March 10, 2010 2:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Default parameters in function



Hi, I have a function

function myfunc (a:int, b:int, c:int = 0) {
}

I want to be able to call myfunc(a, b) and have c using a default
value 0, is this possible?
I tried it but it says function expects 3 arguments.

Mike



RE: [flexcoders] String to object reference?

2010-03-09 Thread Gordon Smith
You can access the properties of any object by name, using square-bracket 
notation. For example, o.p can be written o[p]. In this case, the relevant 
object is 'this', so you want

this[california]
this[california + _over]

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mike Chang
Sent: Tuesday, March 09, 2010 11:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] String to object reference?



Hi,
I was wondering if it's possible to change a string to an object name.
For example, I pass a string california, and there's an object named
california. I would like to reference the california object.

For example, this is my code right now:
case california:
up = california;
over = california_over;
break;

I would like to have
up = californiaString  to object;
over = californiaString + _over  to object.

Thanks,
Mike



RE: [flexcoders] Detecting Events in Flex

2010-02-19 Thread Gordon Smith
addEventListener() requires you to specify what kind of event you're listening 
for. However, any event dispatched by a UIComponent can be intercepted because 
UIComponent overrides dispatchEvent() to pass the event to an dispatchEventHook 
function that you can set. The static var for this hook function is mx_internal 
and therefore undocumented and subject to change or removal without warning.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Nick Middleweek
Sent: Friday, February 19, 2010 10:26 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Detecting Events in Flex



Hello,

Is it possible to put a generic listener on an Object so that a function is 
fired and I can trace(event.type) from that function to see exactly what events 
are being fired and in what order so I can then read about the events to see 
which is appropriate for my needs?


Cheers and have a good weekend!

Nick



RE: [flexcoders] Is there a way to enumerate all of the available styles in CSSStyleDeclaration?

2010-02-05 Thread Gordon Smith
[Bindable] metdata gets retained, and so should appear in describeType()'s 
output, but [Style], [Event], and [Effect] do not. You could, however, 
recompile the framework to keep them. Look at the keep-as3-metadata tags in 
the Ant build.xml file for frameworks/projects/framework, for example.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dmitry
Sent: Friday, February 05, 2010 11:01 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is there a way to enumerate all of the available styles 
in CSSStyleDeclaration?



the way to get Style,Event, Effect and Bindable metadata from UIComponent when 
calling describeType

However, the above does not work since subclasses of CSSStyleDeclaration, 
DataGridColumn for instance, in Flex do not have [Style] metadata defined. Yet, 
FlexBuilder somehow knows about all of the available styles for DataGridColumn. 
Is there a programmatic way to retrieve these?

Thanks in advance

--- Dmitry



RE: [flexcoders] Localization problems mainly on Macs - Cannot switch to second input Language

2010-02-01 Thread Gordon Smith
Fotis, I contacted the relevant Player engineer and he replied First I've 
heard of it.  Can we get a bug filed with repro steps fit for people who don't 
know how to do Greek input? So could you please file an SDK bug in Jira and 
then I'll get a Player bug filed?

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of fotis.chatzinikos
Sent: Friday, January 29, 2010 5:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Localization problems mainly on Macs - Cannot switch to 
second input Language



Any ideas why on mac browsers we can not control-shift (or whatever is the 
appropriate keys combo to switch to another language) to Greek for example 
(some minor windows browsers as well)? The language indicator some times 
switches to Greek but still all text inputs are broken. Either empty spaces or 
broken characters instead of Greek.

PS: Follows history from previously (slightly hijacked thread)

Thanks Gordon, I will open a new Thread

On Fri, Jan 29, 2010 at 2:09 AM, Gordon Smith 
gosm...@adobe.commailto:gosmith%40adobe.com wrote:

I'm not aware of this particular problem, but I'll ask a Player engineer who 
might know what's going on.

Gordon Smith

Adobe Flex SDK Team

Sorry for being slightly off topic, but I also have a localization problem and 
Gordon seems the right person to ask..

Any ideas why on mac browsers we can not control-shift (or whatever is the 
appropriate keys combo to switch to another language) to Greek for example 
(some minor windows browsers as well)? The language indicator some times 
switches to Greek but still all text inputs are broken. Either empty spaces or 
broken characters instead of Greek.

TIA,
Fotis



RE: [flexcoders] Re: Pointers

2010-02-01 Thread Gordon Smith
 I did not see a functional similarity to a pointer in actionscript or did I 
 just miss it?

All object references in ActionScript are similar to pointers in that they are 
not the object itself, but references to it. For example, when you declare

var textInput1:TextInput = new TextInput();
var textInput2:TextInput = textInput2;

you haven't created two TextInput instances; you have made two variables refer 
to (point to) the same TextInput instance.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dan Pride
Sent: Saturday, January 30, 2010 7:11 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Pointers


Interesting but not quite the design issue I have in mind.

See  http://www.danielpride.com/Vehicles3/Vehicles3.html

(Its still a little crude, basically playing with the tech.
Clicking on a row fills in a series of text boxes.
if you edit a box, I want to shift the  state just like it does now
when you click the new button at the top, except now it will go to an edit 
state.

The idea is you can examine a large data record by selecting it from a row of 
important fields, then edit if you like or just look.

Its easy enough to compare the values field by field
but in my old language I would have written a very small
function with two pointers (new and old)
and then just called the same function in each
focus out, passing in the two pointers to the current
field of the focus event.
This has got to be childs play I would think
but newbie status prevents it from popping out of my head I guess.

Dan Pride

--- On Fri, 1/29/10, jamesfin james.alan.finni...@gmail.com wrote:

From: jamesfin james.alan.finni...@gmail.com
Subject: [flexcoders] Re: Pointers
To: flexcoders@yahoogroups.com
Date: Friday, January 29, 2010, 11:51 PM



Here's what I've done in the past...

// add this in your init code...
myDataGrid.addEvent Listener( ListEvent. ITEM_EDIT_ END, editEnd);

private function editEnd(evt: DataGridEvent) :void{

// get a reference to the datagrid
var grid:DataGrid = evt.target as DataGrid;

// get a reference to the name of the property in the
// underlying object corresponding to the cell that's being edited
var field:String = evt.dataField;

// get a reference to the row number (the index in the
// dataprovider of the row that's being edited)
var row:Number = Number(evt.rowIndex );

// get a reference to the column number of
// the cell that's being edited
var col:int = evt.columnIndex;


if (grid != null){

var oldValue:String = String(grid. dataProvider. getItemAt( row)[field] );

var newValue:String = String(grid. itemEditorInstan ce[grid.columns[ 
col].editorDataF ield]);

var rowData:XML = XML(grid.dataProvid er.getItemAt( row)[0]);

// check if the value has changed
if (newValue == oldValue){
// nothing has changed...
return;
}

// something has changed...
// do something...
// you could prevent the change if you want
// or do some validation
// or just return and the data move on to the dp.
}

}

--- In flexcod...@yahoogro 
ups.com/mc/compose?to=flexcoders%40yahoogroups.com, Dan Pride danielpride@ 
... wrote:

 Looking for suggestions on how to approach an issue.

 I want to write a function to compare the current value of a text field with 
 the value of the field in the selected row of the dataGrid. I want to use the 
 function as a focus-out handler on every text input.

 Obviously I don't want to rewrite this for each and every field but I did not 
 see a functional similarity to a pointer in actionscript or did I just miss 
 it?

 This is for the awesome Flashbuilder 4,... I have a text input for every 
 field in the value object and want to compare each to the selectedItem for 
 the dataGrid and kick some stuff if it does not match.
 Thanks
 Dan Pride







RE: [flexcoders] Sort function does not work with turkish characters

2010-02-01 Thread Gordon Smith
Player 10.1 will add a new flash.globalization.Collator class for performing 
locale-dependent collation using operating system routines. So, on OS's that 
support Turkish collation, Player 10.1 will support Turkish collation. With 
earlier Players, you have to provide your own locale-dependent collation 
routines, as Gregor said.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Gregor Kiddie
Sent: Monday, February 01, 2010 7:19 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Sort function does not work with turkish characters


IIRC, the default Sort uses the ASCII values of the characters, so the Turkish 
characters appear later in the alphabet than I and S.

You may need to use a custom compare function which includes functionality for 
the Turkish alphabet.

Gk.


Hi everybody,

I'm also a newbie actionscript developer,  and i'm in trouble with sort 
function. I want to sort the array collection , it is successful with english 
characters, but when there is a turkish word beginning with  'İ', 'Ş',  it does 
not sort, putting these words at the end of the sorting. So i'm not able to do 
the right sorting. Any idea?

var sortField:SortField=new SortField(value);
sortField.numeric=false;
sortField.descending=false;
var sort:Sort=new Sort();
sort.fields=[sortField];
xmlListColl.sort=sort;
return xmlListColl.refresh();

Thanks all guys,,




RE: [flexcoders] Flex Builder 3 - A little to be desired

2010-02-01 Thread Gordon Smith
Have you tried the beta of FlashBuilder 4? (FlexBuilder was renamed to 
FlashBuilder.)

http://labs.adobe.com/technologies/flashbuilder4/

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Lee Jenkins
Sent: Monday, February 01, 2010 11:10 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex Builder 3 - A little to be desired



Hi all,

Just getting started with Flex and FlexBuilder and I am unimpressed with the FB
IDE (though flex and actionscript are nice to me) and was hoping someone could
help me out with a couple of annoyances.

1. After working in the editor, I ALWAYS have to highlight the project node in
the Flex Navigator before Run, Debug, etc buttons work or say CTRL-F11 to run my
project will work.

2. My projects (different ones I've noticed this with) required that I perform a
Clean from the Project  Clean menu before changes will take effect many
times. I've wasted literally hours trying to figure why my code is not working
correctly, until a light bulb goes off and I try the Clean option at which the
compiler finally links in the changes.

After working with the likes of Delphi and Visual Studio, I'm very disappointed
in the product if I have to in fact take these annoying steps consistently just
to get my projects to compile and build correctly :-)

Thanks for suggestions.

--
Warm Regards,

Lee



RE: [flexcoders] localization

2010-01-28 Thread Gordon Smith
Flex's mx.formatters.CurrencyFormatter has various properties that you can set, 
such as currencySymbol.

By default, the currencySymbol comes from a locale-dependent resource in the 
ResourceManager (the currencySymbol resource in the SharedResources 
bundle). Which locale is used depends on the localeChain.

The framework has resources for the following locales:

English
French
Spanish
Portuguese
Italian
German
Dutch
Danish
Norwegian
Swedish
Finnish
Russian
Japanese
Korean
Simplified Chinese
Traditional Chinese

When you use the ResourceManager's getString() method, you can pass a locale 
identifier like fr_FR to specify that you want the French currency symbol, 
rather than the one specified by the localeChain.

Alternately, if you will be running on the new Player 10.1, you can use the new 
flash.globalization.CurrencyFormatter class, which uses operating-system 
routines to do currency formatting for any locale that the OS supports.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of ZIONIST
Sent: Wednesday, January 27, 2010 9:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] localization



hi guys i would like to set different currency symbols for countries, so that 
if a product is particular to a certain country, that countries currency symbol 
is used instead of the dollar sign. how do i achieve this with localization?



RE: [flexcoders] localization

2010-01-28 Thread Gordon Smith
I'm not aware of this particular problem, but I'll ask a Player engineer who 
might know what's going on.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Fotis Chatzinikos
Sent: Thursday, January 28, 2010 3:49 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] localization



Sorry for being slightly off topic, but I also have a localization problem and 
Gordon seems the right person to ask..

Any ideas why on mac browsers we can not control-shift (or whatever is the 
appropriate keys combo to switch to another language) to Greek for example 
(some minor windows browsers as well)? The language indicator some times 
switches to Greek but still all text inputs are broken. Either empty spaces or 
broken characters instead of Greek.

TIA,
Fotis
On Fri, Jan 29, 2010 at 1:23 AM, Gordon Smith 
gosm...@adobe.commailto:gosm...@adobe.com wrote:

Flex's mx.formatters.CurrencyFormatter has various properties that you can set, 
such as currencySymbol.

By default, the currencySymbol comes from a locale-dependent resource in the 
ResourceManager (the currencySymbol resource in the SharedResources 
bundle). Which locale is used depends on the localeChain.

The framework has resources for the following locales:

English
French
Spanish
Portuguese
Italian
German
Dutch
Danish
Norwegian
Swedish
Finnish
Russian
Japanese
Korean
Simplified Chinese
Traditional Chinese

When you use the ResourceManager's getString() method, you can pass a locale 
identifier like fr_FR to specify that you want the French currency symbol, 
rather than the one specified by the localeChain.

Alternately, if you will be running on the new Player 10.1, you can use the new 
flash.globalization.CurrencyFormatter class, which uses operating-system 
routines to do currency formatting for any locale that the OS supports.

- Gordon

From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of ZIONIST
Sent: Wednesday, January 27, 2010 9:43 PM

To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: [flexcoders] localization



hi guys i would like to set different currency symbols for countries, so that 
if a product is particular to a certain country, that countries currency symbol 
is used instead of the dollar sign. how do i achieve this with localization?




RE: [flexcoders] Re: Quick Question?

2010-01-21 Thread Gordon Smith
There is no way for these properties to be correct until the image has been 
loaded. So to get the correct values, you probably need to wait for a 
'complete' event from the Image.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of criptopus
Sent: Thursday, January 21, 2010 9:50 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Quick Question?



Strange its working now, no idea what that was, but thanks for the confirmation.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Tibor 
Ballai ballai.t...@... wrote:

 Hi Stephen,

 You'll find those values in the Image component's contentHeight and
 contentWidth properties.

 Tibor.

 www.tiborballai.com

 criptopus wrote:
 
  I have loaded an image into a mx:Image/ component, how do I get the
  dimentions of the source image in the file it comes from.
 
  when I try contentWidth  contentHeight I just get the current
  displayed width and hight, not the image files width and height?
 
  - Stephen
 
 




RE: [flexcoders] flash player 10 problem for Flex textinput in Chinese

2010-01-14 Thread Gordon Smith
What control are you using? mx:TextInput? s:TextInput?

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of bsyyu
Sent: Tuesday, January 12, 2010 9:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] flash player 10 problem for Flex textinput in Chinese



I make a application to capture the user textinput in Chinese.
I test this in windows xp using xp default text input editor.
In flash player 9, the input editor is located close to the textinput field and 
move according to the text.
however for flash player 10, the text editor is located at upper left corner of 
the application and does not move according to the text.

any idea ?



RE: [flexcoders] flex 4 text styling

2010-01-14 Thread Gordon Smith
Flash Player 10 introduced a new text system known as FTE (the 
flash.text.engine classes). It also continues to have the old TextField class. 
So there are basically two text systems, with their own ways of doing text 
formatting.

They have some formats in common, but each also has formats of its own. The 
fontSharpness and fontAntiAliasType formats are not part of FTE and therefore 
not supported by Spark components, which use FTE. Their closest relatives in 
FTE are renderingMode and cffHinting.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Ariel J
Sent: Thursday, January 14, 2010 1:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] flex 4 text styling



In the language reference, I see styles such as fontSharpness and 
fontAntiAliasType for Label, but I am not seeing them as styles for the spark 
Label or RichText. Are they no longer being used?



RE: [flexcoders] Flex4: getChildById or getElementById

2010-01-14 Thread Gordon Smith
You can write code like

if (mycomponent in this)
{
this[mycomponent].doSomething()
}

to avoid an FTE with mycomponent does not exist.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Ondina F
Sent: Thursday, January 14, 2010 3:02 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex4: getChildById or getElementById


Hi,
Oftentimes I need to check if a component( for example a  TextInput) exists 
before populating it with data.
The getChildByName()is the only method I know of, that can do this.
I wish there was a getChildById() as well, so I wouldn’t have to set the name 
for all my components( could be hundreds )in addition to their id.
[
If the component( myComponent ) doesn’t exist:
this[“myComponent”] throws the RE ReferenceError: Error #1069
and
this.contains(myComponent) doesn’t compile of course
1120: Access of undefined property myComponentId.
]
I know, Christmas time is over, no more gifts for us from Adobe:)
Should I put it on my next flex-xmas list?
Or do you guys know about other ways of checking the existence of components? 
Any input would be much appreciated.
Cheers,
Ondina
P.S. My message didn’t show up on the mailing list after trying to create a new 
topic on the Yahoo Groups. I must have done something wrong. Sorry for any 
inconvenience I might have caused.




RE: [flexcoders] Question about 'copyLocale'

2010-01-12 Thread Gordon Smith
I don't beleve there is any requirement for dstLocale to be related to 
srcLocale.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of tungchau81
Sent: Monday, January 11, 2010 5:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Question about 'copyLocale'



Usage: copylocale srcLocale dstLocale

copyLocale is a command to generate framework resource for each locale.

I wonder whether srcLocale should be a default locale for dstLocale. In other 
words, should srcLocale be a locale that is as close as possible to dstLocale.

For example, would the following two commands generate the same results?
1 -  copylocale en_US de
2 -  copylocale de_DE de

de_DE is closer to de and it can be a default locale for de - instead of en_US. 
Would 'copylocale en_US de' cause any error?

The following document does not not mention anything about that:
http://livedocs.adobe.com/flex/3/html/help.html?content=l10n_3.html

Any advice is greatly apprecidated,
Tung Chau



RE: [flexcoders] how to use stage in mxml

2010-01-06 Thread Gordon Smith
I suspect that an Application dispatches a resize event when it is first 
created and sized, but before it is onstage, so 'stage' is null when it is 
first called.

You could just make resizeHandler() return if stage is null. Or you could delay 
listening for resize events until the application dispatches an 
applicationComplete event.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of markflex2007
Sent: Wednesday, January 06, 2010 7:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to use stage in mxml



I try to get current stage size with the code,but I get error
TypeError: Error #1009: Cannot access a property or method of a null object 
reference..
It seems I get error for stage.height.

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
creationPolicy=all resize=resizeHandler(event)
mx:Script
![CDATA[
import mx.events.ResizeEvent;


private function resizeHandler(event:ResizeEvent):void{


trace(height: + stage.height);
trace(height: + stage.width);

}
]]
/mx:Script

...
...

/mx:Application

Please help me.Thanks

Mark



RE: [flexcoders] Testing for XML equality

2010-01-06 Thread Gordon Smith
This is likely to be rather slow, but if you really need to do a recursive 
comparison of XML objects, it's probably reasonable. I don't know of any 
built-in operator or method that does deep equality.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Davis Ford
Sent: Wednesday, January 06, 2010 5:22 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Testing for XML equality



I found a solution:

import mx.utils.ObjectUtil;

Assert.assertTrue(ObjectUtil.compare(xml1, xml2) == 0);

That does the trick.

Regards,
Davis
On Wed, Jan 6, 2010 at 8:20 PM, Paul Andrews 
p...@ipauland.commailto:p...@ipauland.com wrote:
Davis Ford wrote:


 Hi Paul,

 I don't believe this is correct for ActionScript3.  Strict equality is
 the === operator which compares object instances.  == should test
 for equality.
I tried (in Flash)..

var objA:Object = {a:1};
var objB:Object = {a:1};
trace(objA==objB);  // false
var xmlA:XML = /x;
var xmlB:XML = /x;
trace(xmlA==xmlB);  // true
trace(xmlA===xmlB);  // false

and indeed you are right. I didn't know that XML was treated differently
from vanilla object in comparisons.

Thanks.

Paul

 If you change the test to this...

 [Test]
 public function testXmlEquality():void {
  var xml1:XML =
  a
  b/b
  c/c
  /a;
  var xml2:XML =
  a
  b/b
  c/c
  /a;
  xml1.normalize();
  xml2.normalize();
  Assert.assertTrue(xml1 == xml2);
 }

 it passes.  XML/e4x is supposed to support this out of the box, and it
 does -- to a degree.  Although, semantically and syntactically, xml1
 and xml2 from the 1st test are equivalent, e4x is not thinking so, and
 I think that is broken.  Searching for a workaround has popped up very
 little, which is why I was hoping someone on the list might have a
 good answer for why this is, and how I can test XML equivalence
 without caring about element ordering.

 Regards,
 Davis

 On Wed, Jan 6, 2010 at 7:03 PM, Paul Andrews 
 p...@ipauland.commailto:p...@ipauland.com
 mailto:p...@ipauland.commailto:p...@ipauland.com wrote:


 Davis Ford wrote:
 
 
  Why does this test fail? Is there any way to test for equality that
  ignores the ordering of elements -- which shouldn't technically
 matter?
 
  [Test]
  public function testXmlEquality():void {
  var xml1:XML =
  a
  b/b
  c/c
  /a;
  var xml2:XML =
  a
  c/c
  b/b
  /a;
  Assert.assertTrue(xml1 == xml2);
  }
 xml1 and xml2 are references to objects. Because they are different
 objects they are not equal - the references are different.
 
 
 
 
 




 --
 Zeno Consulting, Inc.
 home: http://www.zenoconsulting.biz
 blog: http://zenoconsulting.wikidot.com
 p: 248.894.4922
 f: 313.884.2977







--
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

   Individual Email | Traditional





--
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977



RE: [flexcoders] Testing my understanding of Flex

2010-01-06 Thread Gordon Smith
Metadata is used to do a variety of things. Generally it affects how the 
ActionScript or MXML compilers work. For example, [Embed] metadata tells the 
ActionScript compiler to embed an asset such as a JPG. [ResourceBundle] 
metadata tells the ActionScript compiler to link a ResourceBundle subclass with 
localized strings. [Event] and [Style] metadata tell the MXML compiler what to 
do when it encounters attributes like click=... or fontSize=

In general, metadata affects the SWF-or-SWC-compilation process. But I wouldn't 
describe it as being there for Flex Builder only because you can compile 
without using Flex Builder, such as with the mxmlc Ant task or the mxmlc 
command line tool.

You're correct that if you don't use MXML then [Event] and [Style] metadata is 
irrelevant. But other metadata like [Embed], [ResourceBundle], and 
[AccessibilityImplementation] is.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of ztpi1
Sent: Wednesday, January 06, 2010 7:12 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Testing my understanding of Flex



So, I have been studying the flex source and I see a lot of metadata statements 
in the component class definitions.

Am I correct in saying that the metadata is there for Flex Builder only? From 
what I have read, the metadata is there so that the events, effects, etc, can 
be accessed from mxml as tag attributes.

It seems to me, that the events, effects, styles, etc become available in pure 
AS3 by simply importing the proper classes and using the appropriate methods.

Is this the correct interpretation of the code, or am I missing something?



RE: [flexcoders] Question about flex source

2010-01-04 Thread Gordon Smith
Aaron is correct. The AS/MXML compiler ignores comments, and the @ in 
@eventType has nothing to do with an XML attribute (although this is what it 
would indicate if it were in AS code rather than in a comment). However, the 
ASDoc generator pays attention to all comments that start with /**, and does 
special processing on attributes like @eventType, @param, and @result inside 
these comments. We adopted this convention from how JavaDoc works.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Aaron Hardy
Sent: Monday, January 04, 2010 7:31 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Question about flex source



See here under asdoc tags: 
http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html

The @eventType tells the ASDoc generator that what it's seeing on that line is 
something special and needs to be dealt with in a special way.  It shouldn't 
affect your application's code execution in any way.  I'm not from Adobe though 
so my response is nothing official...it's just what I've gathered from 
experience.

Aaron
On Sun, Jan 3, 2010 at 7:55 PM, ztpi1 zt...@yahoo.commailto:zt...@yahoo.com 
wrote:


I notice that the flex source files have commented out sections like this one:

**
* Dispatched after the Application has been initialized,
* processed by the LayoutManager, and attached to the display list.
*
* @eventType mx.events.FlexEvent.APPLICATION_COMPLETE
*/

Is the @ symbol significant here? Does the compiler see the line with the @ 
symbol or is it merely for reader information?

It is my understanding that the @ symbol denotes an XML attribute, is that the 
correct interpretation?




RE: [flexcoders] mx.controls.Text

2009-12-22 Thread Gordon Smith
 is there anyway to find the number of textRows in a TEXT.

It sounds like you want the numLines of the TextField inside the Text control.

 I can't seem to get my text to measure properly

You may be having timing issues. For example, if you ask for the width and 
height immediately after setting the text, they won't be correct because the 
LayoutManager hasn't run a validation pass (i.e., commitProperties(), 
measure(), and updateDisplayList() haven't executed). But if you wait for an 
updateComplete event, they will be correct.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of djhatrick
Sent: Tuesday, December 22, 2009 3:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] mx.controls.Text



is there anyway to find the number of textRows in a TEXT.

I can't seem to get my text to measure properly, it's anywhere between
5 and 80 pixels off. It's a subject of much frustration, unfortunately, the the 
Text component has a lot of protected properties.

Any suggestions on a free component as a replacement, etc.

Thanks,
Patrick



RE: [Spam] [flexcoders] Re: getters before setters

2009-12-17 Thread Gordon Smith
As far as I know, the setter never auomatically calls the getter. It certainly 
shouldn't, since the getter could have some undesirable side-effect that you 
wouldn't want happening in the setter.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Nick Middleweek
Sent: Thursday, December 17, 2009 3:26 AM
To: flexcoders@yahoogroups.com
Subject: Re: [Spam] [flexcoders] Re: getters before setters



Thanks for your replies guys... I'll go with getters first then :)

Also, i'm sure I've read somewhere that internally when you access a setter, 
it's self-checks the getter and only executes the setter if the return of the 
getter is different from the getter...

Have I made this up?

I normally put these checks in myself anyway but I'm sure I've read it... I 
can't find the site though...


Nick


2009/12/16 Ariel J arielj...@yahoo.commailto:arielj...@yahoo.com

 As long as you define the [Bindable] metadata tag right before a
 getter, the
 order of the setters/getters doesn't really matter.
I remember Alex Harui saying Bindable can indeed go before the setter, too.

See this page:

http://livedocs.adobe.com/flex/3/html/databinding_8.html#194574

Note #3:

Before a public, protected, or private property defined by a getter or setter 
method




RE: [flexcoders] getters before setters

2009-12-16 Thread Gordon Smith
I'm pretty sure that this ordering is just a convention.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Nick Middleweek
Sent: Wednesday, December 16, 2009 8:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] getters before setters



Hi,

I've been told to put my getters before my setters when defining Interfaces and 
creating the Class functions...

... then Bind my getters.


Is this a known practice? Any what's the benefit? Is it something to do with 
how Flex calls the getters when setting via the setters?



Thanks,
Nick



RE: [flexcoders] using system fonts in Flex

2009-12-09 Thread Gordon Smith
 Given a use-case involving Flash running in IE7 on a Windows OS, is it safe 
 to assume that
 device fonts in the context of this thread refers to any font installed on 
 the Windows client machine?

That's right.

Gordon Smith
Adobe Flex SDK Team


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Glenn Jones
Sent: Tuesday, December 08, 2009 5:09 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] using system fonts in Flex



Thanks for all of the helpful responses.

I don't need to rotate the text or do anything exotic with it - just render 
basic labels.
I'm actually trying to avoid embedding fonts in the SWF as I don't have a 
license to redistribute my preferred font.

If I can specify a list of fonts that includes one or more fonts which are 
already installed on Windows,
then that will work fine for my case.

Given a use-case involving Flash running in IE7 on a Windows OS, is it safe to 
assume that device fonts in the context of this thread refers to any font 
installed on the Windows client machine?

Thanks,
Glenn
On Tue, Dec 8, 2009 at 6:18 PM, Gordon Smith 
gosm...@adobe.commailto:gosm...@adobe.com wrote:

 Out of curiosity, why *can't* Flash do things like rotate text unless the 
 corresponding font is embedded?
 Couldn't it just embed the necessary glyphs from the local font on an 
 as-needed basis?

For one thing, you don't generally know at compile time (i.e., when the SWF is 
being created) what text you're going to render at runtime (i.e., when the SWF 
is being executed). The data to display often comes from outside, or gets 
calculated in some way. And even if all the text was set explicitly in MXML or 
AS, the compiler doesn't understand what those assignment statements are 
actually doing, as opposed to c = a + b.

For another thing, I think with device fonts the Player doesn't just grab 
glyphs and render them... I think it uses the OS to render them. So if the OS 
doesn't have rotation APIs, it can't rotate them.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of Guy Morton
Sent: Tuesday, December 08, 2009 3:55 PM

To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] using system fonts in Flex



Yes, the original post didn't state why he thought embedding was required, so 
you may be right and the requirement may have been to do something you can only 
do with an embedded font. In which case, neither of us has provided a useful 
answer, other that yes you need to embed the font in a swf file... :-)

Out of curiosity, why *can't* Flash do things like rotate text unless the 
corresponding font is embedded? Couldn't it just embed the necessary glyphs 
from the local font on an as-needed basis?

Guy




On 09/12/2009, at 10:16 AM, Alex Harui wrote:


It will if he wants to use device fonts.  I just assumed he wanted to use 
embedded fonts for various rendering effects.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcod...@yahoog! roups.comhttp://roups.com] On Behalf Of Guy Morton

Sent: Tuesday, December 08, 2009 2:55 PM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] using system fonts in Flex


Are you sure it won't pick up locally available fonts? I'm fairly sure it will. 
If you use CSS to define the font to use you can specify a list of fonts to 
degrade to, so if ! your preferred font is unavailable the next one on the list 
wi! ll be us ed.

Have you tried that?

Guy


On 09/12/2009, at 7:12 AM, Glenn Jones wrote:



AFAIK, any fonts used in Flex ha! ve to be compiled into the SWF.

Is there some way to use system fonts that are already installed on a customer 
machine?

Specifically, I'd like to build an app that uses Microsoft's new Segoi UI font 
(included
with Vista and Office 2007) without compiling a TTF into my SWF.

Thanks,
Glenn







RE: [flexcoders] Question about getting the type of item / component with drag and drop

2009-12-09 Thread Gordon Smith
1. if (dragEvent.currentTarget is Panel)

2. currentTarget is generically typed as Object, which doesn't have an 
addChild() method. But if you have already checked that the dropTarget is a 
Panel, it's safe to do a cast:

Panel(dragEvent.currentTarget).addChild(...);

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of timgerr
Sent: Wednesday, December 09, 2009 12:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Question about getting the type of item / component with 
drag and drop



Hello all,
I have been tasked with creating a menu that gets build with drag and drop 
components. I have followed this tutorial 
(http://www.flexafterdark.com/tutorials/Flex-Drag-and-Drop) and have learned a 
lot.

I have a few questions to get to the next stage so I will ask a few questions.

1. When I drop (or drag over) an item like a panel, how can I tell what that 
UIComponent is, how can I tell that is a panel?

2. How can I get that panel as an object so I can do something like 
panelid.addChild(new dropped item)?

Thanks for the read,
timgerr

Here is the code that I have from the tutorial.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
name=Drag and Drop tutorial creationComplete=Init()

mx:Script
![CDATA[
import mx.core.DragSource;
import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.controls.Alert;

public function Init():void
{
// a mouseDown event will start the drag
this.redBox.addEventListener(MouseEvent.MOUSE_DOWN, BeginDrag);
// accepting a drag/drop operation...
this.blueBox.addEventListener( DragEvent.DRAG_ENTER,AcceptDrop);
// handling the drop...
this.blueBox.addEventListener( DragEvent.DRAG_DROP, handleDrop );
}

private function BeginDrag(mouseEvent:MouseEvent):void
{
// the drag initiator is the object being dragged (target of the mouse event)
var dragInitiator:IUIComponent = mouseEvent.currentTarget as IUIComponent;

// the drag source contains data about what's being dragged
var dragSource:DragSource = new DragSource();

// ask the DragManger to begin the drag
DragManager.doDrag( dragInitiator, dragSource, mouseEvent, null );
}

public function AcceptDrop(dragEvent:DragEvent):void
{
var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent;
// accept the drop
DragManager.acceptDragDrop( dropTarget );
// show feedback
DragManager.showFeedback( DragManager.COPY );

}

public function handleDrop( dragEvent:DragEvent ):void
{
var dragInitiator:IUIComponent = dragEvent.dragInitiator;
var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent;

Alert.show( You dropped the Red Box on the Blue Box! );
var obj:Object = dragEvent.target;
}

]]
/mx:Script
mx:HBox horizontalGap=100
mx:Canvas id=redBox width=100 height=100 backgroundColor=Red /
mx:Canvas id=blueBox width=100 height=100 backgroundColor=Blue /
/mx:HBox

/mx:Application



RE: [flexcoders] using system fonts in Flex

2009-12-08 Thread Gordon Smith
 Out of curiosity, why *can't* Flash do things like rotate text unless the 
 corresponding font is embedded?
 Couldn't it just embed the necessary glyphs from the local font on an 
 as-needed basis?

For one thing, you don't generally know at compile time (i.e., when the SWF is 
being created) what text you're going to render at runtime (i.e., when the SWF 
is being executed). The data to display often comes from outside, or gets 
calculated in some way. And even if all the text was set explicitly in MXML or 
AS, the compiler doesn't understand what those assignment statements are 
actually doing, as opposed to c = a + b.

For another thing, I think with device fonts the Player doesn't just grab 
glyphs and render them... I think it uses the OS to render them. So if the OS 
doesn't have rotation APIs, it can't rotate them.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Guy Morton
Sent: Tuesday, December 08, 2009 3:55 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] using system fonts in Flex



Yes, the original post didn't state why he thought embedding was required, so 
you may be right and the requirement may have been to do something you can only 
do with an embedded font. In which case, neither of us has provided a useful 
answer, other that yes you need to embed the font in a swf file... :-)

Out of curiosity, why *can't* Flash do things like rotate text unless the 
corresponding font is embedded? Couldn't it just embed the necessary glyphs 
from the local font on an as-needed basis?

Guy




On 09/12/2009, at 10:16 AM, Alex Harui wrote:



It will if he wants to use device fonts.  I just assumed he wanted to use 
embedded fonts for various rendering effects.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoog! roups.com] On 
Behalf Of Guy Morton
Sent: Tuesday, December 08, 2009 2:55 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] using system fonts in Flex


Are you sure it won't pick up locally available fonts? I'm fairly sure it will. 
If you use CSS to define the font to use you can specify a list of fonts to 
degrade to, so if ! your preferred font is unavailable the next one on the list 
wi! ll be us ed.

Have you tried that?

Guy


On 09/12/2009, at 7:12 AM, Glenn Jones wrote:




AFAIK, any fonts used in Flex ha! ve to be compiled into the SWF.

Is there some way to use system fonts that are already installed on a customer 
machine?

Specifically, I'd like to build an app that uses Microsoft's new Segoi UI font 
(included
with Vista and Office 2007) without compiling a TTF into my SWF.

Thanks,
Glenn






RE: [flexcoders] am a newbie , can somebody explains to me this simple For loop statement?

2009-12-04 Thread Gordon Smith
Are you asking for an explanation of the for-loop? The comment above it 
explains what it does. The general form is

for (a; b; c)
{
d;
...
}

and it is basically equivalent to the following while-loop:

a;
while (b)
{
d;
...
c;
}

The 'a' part is typically an assignment statement to initialize a loop 
variable like an integer i that starts out at 0 and increments to 1, 2, 3, etc.

The 'b' part is typically a conditional expression evaluating to true or false, 
telling the loop whether to keep going or not. (Have I reached the end of the 
collection yet?)

The 'c' part is typically an expression like i++ to increment the loop variable 
for the next pass.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Ballai Tibi
Sent: Friday, December 04, 2009 10:48 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] am a newbie , can somebody explains to me this simple For 
loop statement?



public function removeItem(item:StoreItem):void {

var i:uint;  //declares a local variable i of type uint (unsigned int)

/*initialize i with the value 0;
  until i is smaller than the collection's length, execute the code inside 
the for loop and increment i by one at the end of each step (i++)
*/
for (i=0; i  _collection.length; i++){

//check if the item in the _collection array at position i is equal to 
the item that was passed as an argument
if (_collection [i]==item){

//remove 1 item from the _collection array starting at position i
_collection.splice(i, 1);

//since the item we were looking for was found, there's no need to 
continue searching
break;
 }

}

}



Tibor.



RE: [flexcoders] Inline functions and Anonymous

2009-12-03 Thread Gordon Smith
I've heard that anonymous functions are significantly slower because the 
runtime has to create an activation frame for them. We use very few anonymous 
functions in the Flex framework.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of cuttenv
Sent: Thursday, December 03, 2009 6:04 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Inline functions and Anonymous



Hi everyone, I have a quick question. Is there any performance gain when using 
an inline or anonymous function in flex??

For example let's say you have:

private foo function():void{
var btn:Button = new Button();
var str:String = Hello Guys;
btn.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void{ 
Alert.show(str); } );
}

So I realize the advantage to using inline functions is that you can use local 
variables that are defined in the scope for example the str variable. But what 
happens when you have the extreme case like this:

private var run:String = one;
private function main():void{
function boo()void{
Alert.show(boo hoo);
}
foo(boo);
}
private function foo function(bar:Function):void{
var str:String = Hello;
function fnc1a():void{
function fnc1a():void{
Alert.show(str+ function 1 A!);
bar();
}
function fnc1b():void{
bar();
Alert.show(str+ function 1 B!);
}
runFuncs(fnc1a, fnc1b);
}
function fnc2():void{
Alert.show(WOW This can be confusing!);
}
if(run == one){
fnc1();
}
else if(run == two){
fnc2();
}
else{
bar();
}
}

private runFuncs(a:Function, b:Function):void{
a();
b();
}

nice eh? _ So what are the disadvantages?? My main concern here is memory 
leaks and performance. I was looking at the profiler and I think the garbage 
collector may not be cleaning up all the unused functions.

Please help :D



RE: [flexcoders] Re: Change the caret in TextArea

2009-11-30 Thread Gordon Smith
If you are talking about the old MX TextInput and TextArea, they are based on 
the TextField class in the Flash Player. It is blinking the insertion point and 
you can't change what it looks like.

If you are talking about the new Spark TextInput and TextArea in Flex 4, they 
are based on the Text Layout Framework, which is an ActionScript library 
providing high-level services like layout and editing on top of the Flash Text 
Engine in Player 10. The code for TLF is opensource. You could figure out where 
it draws the caret and change that code. If you're lucky, it will be something 
you can override. If you're unlikely, you might need to monkey-patch TLF.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of valdhor
Sent: Tuesday, November 24, 2009 5:47 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Change the caret in TextArea



I do not believe you can inside Flex. If someone else knows differently, please 
chime in.

You should be able to create a custom component with a timer and keyboard event 
listeners to simulate what you want.

This blog post might be a good starting point:

http://joshblog.net/2008/01/17/source-code-for-custom-textfields-with-cool-effects/

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
rituraj_tiwari rituraj.tiw...@... wrote:


 Valdhor,
 Thanks for taking the time to respond.

 I am not looking to change the mouse pointer cursor. I need to change the
 blinking caret that appears in text input and text area when they are
 editable.

 -Raj


 valdhor-3 wrote:
 
  These links should help...
 
  http://www.switchonthecode.com/tutorials/flex-custom-cursor-tutorial
  http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/
  http://www.adobe.com/livedocs/flex/3/langref/mx/managers/CursorManager.html#setCursor%28%29
 
  --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
  Shabir Gilkar shabirgilkar@ wrote:
 
  Nice question friend, even i do wanna to know the answer
 
  On 11/23/09, rituraj_tiwari rituraj.tiwari@ wrote:
  
   Folks,
   I need to implement and editable text area where the cursor (caret) is
   different from the default vertical flashing caret. Is the caret a
   skinnable property of TextArea?
  
   In case the flashing vertical line is deeply entrenched, I would like
  to be
   able to overlay my own floating caret on top of it to obscure it. Is
  there
   an easy way to get the X-Y coordinates of the caret so that I can
  move() my
   custom cursor graphic to that location?
  
   Thanks for your help.
   -Raj
   --
   View this message in context:
  
  http://old.nabble.com/Change-the-caret-in-TextArea-tp26474743p26474743.html
   Sent from the FlexCoders mailing list archive at Nabble.com.
  
  
 
 
  --
  With Regards
 
  Shabir Ahmad Gilkar
 
  Srinagar Kashmir JK
 
  Voice: +91 9419942501
  email: shabirgilkar@
  Skype: shabirgilkar
 
 
 
 
 

 --
 View this message in context: 
 http://old.nabble.com/Change-the-caret-in-TextArea-tp26474743p26484608.html
 Sent from the FlexCoders mailing list archive at Nabble.com.




RE: [flexcoders] Re: When does 0.2 and 0.1 not equal 0.3?

2009-11-30 Thread Gordon Smith
Unfortuantely, floating-point arithmetic in most CPUs and computer languages 
today is based on binary fractions (1/2, 1/4, 1/8, 1/16, ...) not decimal 
fractions (1/10, 1/100, 1/1000, 1/1000,...). There is no ActionScript Number 
(or C++ double) that is EXACTLY equal to 0.1, 0.2, or 0.3 because doing so 
would require an infinite number of binary fractional bits. (Some fractions 
such as 0.5 can be exactly represented because they only need a few binary 
fractional bits.) So you're pretty much always dealing with floating-point 
approximations to the real numbers that you think you're manipulating.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Chris
Sent: Wednesday, November 25, 2009 5:17 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: When does 0.2 and 0.1 not equal 0.3?



This is a pretty well known limitation of floating point numbers.

A workaround:
http://joshblog.net/2007/01/30/flash-floating-point-number-errors/


Another option around this is to use the toPrecision() function of Number/Int 
to convert a number to a String and then compare the Strings.

var num1:Number = 0.1;
var num2:Number = 0.2;
var num3:Number = num1 + num2;
trace(num3:+num3);
trace(is 0.3?+(num3 == 0.3));
trace(num3.toPrecision()+num3.toPrecision(3));
trace(is precise 0.3?+(num3.toPrecision(3) == (0.3).toPrecision(3)));


More info:

http://www.google.com/search?q=floating+point+math+errors
On Wed, Nov 25, 2009 at 5:11 PM, tntomek 
tnto...@yahoo.commailto:tnto...@yahoo.com wrote:


So to reliably add 0.1 and 0.2 I need to convert them to ints? This must be a 
joke, its not adding anything complicated.

So is there a Flex wrapper for this? math.add(0.1, 0.2) ?

How can we be sure that 2 numbers we just added equal the true sum?


--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
kidl33t kidl...@... wrote:

 I have encountered an odd bug. In the process of creating a little numeric 
 stepper component (a text box with an up/down stepper beside it) I have found 
 an odd rounding error. Starting from 0.0 and adding 0.1 increments, I get the 
 follow console output.

 currentNumber: 0 increment: 0.1
 result: 0.1

 currentNumber: 0.1 increment: 0.1
 result: 0.2

 currentNumber: 0.2 increment: 0.1
 result: 0.30004

 As you can see, .2 + .1 is yielding 0.30004. This behaviour 
 happens at at many numbers actually.

 You can verify this yourself by simply doing a: trace( (0.1 + 0.2) );

 The other flex developer at our company can also see this error, so I don't 
 think it's isolated to my box or particular build. Does anyone know anything 
 about this?





RE: [flexcoders] Special characters (eg. Cyrillic) TextArea

2009-11-30 Thread Gordon Smith
BTW, are you are talking about the old MX TextArea or the or new Spark TextArea?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Andriy Panas
Sent: Monday, November 30, 2009 10:49 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Special characters (eg. Cyrillic)  TextArea



Hi polestar11,

Simple code sample will definitely help to understand your issue.

--
Best regards,
Andriy Panas


2009/11/30 polestar11 polesta...@yahoo.commailto:polesta...@yahoo.com


Hi there

I have a problem where I am not able to paste special characters (eg. cyrillic 
 arabic) into a flex TextArea component. This occasionally happens in a debug 
version of my app and always happens in a release build.

I created a test application in the same project to try isolate the issue. I 
intermittently am not able to paste special characters into a textarea. I also 
created a different project entirely and never experience the issue.

My guess is that the compiler is misbehaving  getting stuck.

Any help MUCH appreciated

Cheers
Tracy




RE: [flexcoders] Re: Is there any way to update Resource bundle dynamically?

2009-11-30 Thread Gordon Smith
The resources in a ResourceBundle CAN be modified at runtime. A 
ResourceBundle's 'content' property is just an Object where you can store 
name/value pairs for resources such as

myBundle.content[foo] = bar;

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of tungchau81
Sent: Monday, November 30, 2009 2:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Is there any way to update Resource bundle 
dynamically?



About my question#2, since ResourceManger API does not provide a way to update 
resource bundle, is there anyway I can modify .properties files on the fly and 
then recompile the Resource Module .swf for the log-in user after he/she 
modifies the UI configuration?

Any advice is appreciated,
Tung Chau

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
tungchau81 tungcha...@... wrote:

 Hi,
 In a new project, I am required to create customizable UI using Flex. The 
 application should allow each log-in user or customer to configure their own 
 labels, messages and icons. I have two questions:

 1) I plan to load different ResourceModule for each log-in user. For example, 
 user1 will have user1Resource.swf loaded everytime he logs in into the 
 applicatio. user2 will have user2Resource.swf. Is this a good approach? Is 
 there any better way?

 2) At run time, when a login user configures (through a UI) his/her own label 
 for a FormItem and hits save, I need to update the UI immediately with the 
 new label he/she entered. What would be a good solution for this? I looked at 
 ResourceManger API, but could not find any way to update Resource bundle 
 dynamically. Is there any way to update Resource bundle dynamically or is 
 there a different way to do the task?

 Thanks in advance,
 Tung Chau




RE: [flexcoders] UnicodeFFFE not working in web

2009-11-13 Thread Gordon Smith
Please file a bug against Flash Player.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of tom.pijsel
Sent: Friday, November 13, 2009 6:45 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] UnicodeFFFE not working in web



Hello,

I have a strange problem running the following code:

var byteArray:ByteArray = new ByteArray();
byteArray.writeMultiByte(1234, unicodeFFFE);
Alert.show( + byteArray.length);

If I run the following code in Air the length of the bytearray is 8. This is 
correct. If I run the same code in web the length of the bytearray is 4. I have 
tried different browsers but all have the same problem.



RE: [flexcoders] How to test if an object contains a certain property?

2009-11-12 Thread Gordon Smith
if (item in objADGLD)

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of thomas parquier
Sent: Thursday, November 12, 2009 5:10 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How to test if an object contains a certain property?



objADGLD.hasOwnProperty('item') ?

thomas parquier
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.frmailto:thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.netmailto:sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056

2009/11/12 Nick Middleweek n...@middleweek.co.ukmailto:n...@middleweek.co.uk


Hello,

Does anyone know if it's possible to check if an object has a given property?

objADGLD is of type AdvancedDataGridListData which always contains a property 
called .item

Looking at the debugger, objADGLD.item's Declared Type can either be an Object 
or XML in different situations.

When it is an Object I want test if objADGLD.item.GroupLabel exists.

In JavaScript, I could've done this...

if ((objADGLD.item)  (objADGLD.item.GroupLabel))
{ // do something... }

... but it doesn't seem to be working for me in Flex.



Are there any good object inspection routines to help with this?


Thanks,
Nick




RE: [flexcoders] how can I parse this Srting in Flex

2009-10-30 Thread Gordon Smith
I would use String's split() method to split your string on the | character 
into the Array [ Label1, url1, label2Explorer, url2, Label3, url3 
]. Then you can use a for-loop to walk through this 6-element array and create 
a new 3-element array by combinding elements 0/1, 2/3, and 4/5.

But if the six elements in the string are grouped into three pairs of two, then 
it would obviously be less work if it were stored as

Label1|url1||label2Explorer|url2||label3|url3

You could then simply split it on ||.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of thomas_13s
Sent: Friday, October 30, 2009 9:48 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how can I parse this Srting in Flex



Hi All,
Label1|url1|label2Explorer|url2|Label3|url3
how can I parse this string in flex and get the label1|url1 , label2|url2, 
label3|url3 seperately , Please some sample code to do this.
Thanks
Tom



RE: [flexcoders] Re: Performance of associative array or dictionary lookup

2009-10-21 Thread Gordon Smith
O(1) = constant time = independent of the number of items in the hash table

Take a look at http://en.wikipedia.org/wiki/Hash_table :

In a well-dimensioned hash table, the average cost (number of 
instructionshttp://en.wikipedia.org/wiki/Instruction_(computer_science)) for 
each lookup is independent of the number of elements stored in the table. Many 
hash table designs also allow arbitrary insertions and deletions of key-value 
pairs, at constant average (indeed, 
amortizedhttp://en.wikipedia.org/wiki/Amortized_analysis[1]http://en.wikipedia.org/wiki/Hash_table#cite_note-leiser-0)
 cost per 
operation.[2]http://en.wikipedia.org/wiki/Hash_table#cite_note-knuth-1[3]http://en.wikipedia.org/wiki/Hash_table#cite_note-cormen-2
Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of d9_tech
Sent: Wednesday, October 21, 2009 11:46 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Performance of associative array or dictionary lookup



What's the big O of a lookup in the hash table? If I were to use an array and 
just iterate sequentially through the array looking for an item it would be 
O(n) in the worst case scenario (if what I'm looking for happens to be in the 
last position in the array). What's the worst case scenario for the hash table?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 No, they aren't sorted. They use a storage technique called a hash table.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of d9_tech
 Sent: Thursday, October 15, 2009 2:50 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Performance of associative array or dictionary lookup



 I'm curious to know what the algorithm is behind an associative array or 
 dictionary look up. I'm assuming that associative arrays and dictionaries are 
 sorted when they are created and then something like a binary search is used 
 to do the look up. Can anyone confirm that this is true or offer additional 
 information?

 Thanks,

 christian




RE: [flexcoders] cast/convert to a child class?

2009-10-19 Thread Gordon Smith
ArrayCollection does not have any idea what type of elements you put into it. 
You can have an ArrayCollection full of Dog instances, or an ArrayCollection 
full of Cat instances, or an ArrayCollection full of Cats and Dogs (i.e., 
Pets). But all are just ArrayCollections and no casting is required.

You're probably thinking of Vector.Pet vs Vector.Dog. There are indeed 
different types, and one cannot be cast to the other.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of coder3
Sent: Thursday, October 15, 2009 3:54 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] cast/convert to a child class?



Hi All,

I have a arrayCollection of class Pet,
and i have a child class Dog extends Pet,

is there a way to convert the arrayCollection of Pet to arrayCollection of
Dog?
--
View this message in context: 
http://www.nabble.com/cast-convert-to-a-child-class--tp25917283p25917283.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] Performance of associative array or dictionary lookup

2009-10-19 Thread Gordon Smith
No, they aren't sorted. They use a storage technique called a hash table.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of d9_tech
Sent: Thursday, October 15, 2009 2:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Performance of associative array or dictionary lookup



I'm curious to know what the algorithm is behind an associative array or 
dictionary look up. I'm assuming that associative arrays and dictionaries are 
sorted when they are created and then something like a binary search is used to 
do the look up. Can anyone confirm that this is true or offer additional 
information?

Thanks,

christian



RE: [flexcoders] double underline on text

2009-10-19 Thread Gordon Smith
Neither TextField nor TLF support double-underlining, so you'll have to draw it 
yourself. In TLF (and in the new s:Label control in Flex 4) the 
single-underlining is drawn with ActionScript code, so you can see how they do 
it.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Chris Sheffield
Sent: Tuesday, October 13, 2009 8:39 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] double underline on text



Does anyone out there know of a way to apply a double underline to
text in a Flex app? I have need of this in an upcoming project. I've
searched the docs but can't seem to find anything.

Thanks,
Chris

--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com



RE: [flexcoders] 2 strange issues for begginer in action script ref

2009-10-19 Thread Gordon Smith
Issue 1: It looks like you want to create a Flex button. If so, you want 
mx.controls.Button, not mx.core.ButtonAsset. But you can't take a Flex Button 
and have it work inside a plain old Sprite, which is what a pure 
ActionScript-based app is. Flex is an application framework, and Flex controls 
expect to be inside of Flex containers. So you have to start by creating, in 
MXML, an mx:Application or an s:Application. Once you have that, you can do 
everything else in AS rather than MXML if you really don't like MXML. But it's 
a lot easier to just write mx:Button.

Issue 2: Again, it looks like your problem is that you're expecting Flex 
controls to work inside of pure ActionScript apps.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of dennis
Sent: Friday, October 09, 2009 12:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] 2 strange issues for begginer in action script ref


Hello... I am new to action script and I am (pretty) confused... so any help is 
valuable!!!

--- issue 1 
-
I have the follow code... and I get blank page... nothing is appeared on the 
stage at all!!! For god's sake, what is wrong?

package
{
  import flash.display.Sprite;
  import mx.core.ButtonAsset;
  public class ASProject2 extends Sprite
  {
public function ASProject2()
{
  var mb: ButtonAsset = new ButtonAsset();
mb.x=100; mb.y=100; mb.width=200;
addChild(mb);
}
  }
}

--- issue 2 
-
Which button is the more simple button to use?
I found the spark components button is the component that Flash Builder uses if 
you write in mxml language. So I add the folder to my project's libraries 
paths, in precise I added as SWC folder the follow folder:
c:\Program Files\Adobe\Flash Builder 
Beta\sdks\4.0.0\frameworks\projects\flex4\src\spark\components\

Here is the (very simple) code (with compiler's errors):

package
{
  import flash.display.Sprite;
  import spark.components.Button;  // - compile time error: 1172: Definition 
spark.components:Button could not be found.
  public class ASProjectInFB4 extends Sprite
  {
public function ASProjectInFB4()
{
  var ab : Button = new Button();  // - compile time error: 1046: Type was 
not found or was not a compile-time constant: Button.
ab.x=10;
ab.y=10;
ab.width=200;
ab.height=100;
ab.enabled=true;
  addChild(ab);
}
  }
}

The problem (as you see) are the two compiler errors. Now... if get the cursor 
on Button text in my code and I press the F3 the Flash Builder transfers me 
to the declaration of Button class in the proper Button.as file! So I suppose 
that my definition in my preceding code is correct. If I remove the the SWC 
folder from the libraries of my project, the F3 buttons doesn't transfer me 
anywhere, so the SWC folder definition is working too...

What is wrong?

Best regards
Dennis




RE: [flexcoders] Resources for compiling with asc.jar

2009-10-09 Thread Gordon Smith
I don't really know much about using asc directly... I've never had any reason 
to use it. Regardless of whether I'm compiling MXML or AS, I use mxmlc. I 
suppose asc might be faster for special uses, but it is less flexible; it 
doesn't understand MXML, and I'm pretty sure that it requires all of your AS to 
be in a single file, not multiple files that import each other.

So my question is, why is your project using asc?

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of dorkie dork from dorktown
Sent: Thursday, October 08, 2009 9:36 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resources for compiling with asc.jar



Oh. Why would someone use it instead of mxmlc? Can I use mxmlc in it's place? 
One more question, is there any advantage to using mxmlc over asc? Thanks
On Thu, Oct 8, 2009 at 4:18 PM, Gordon Smith 
gosm...@adobe.commailto:gosm...@adobe.com wrote:

asc.jar doesn't just decompile ActionScript... it also compiles it. But one 
normally uses mxmlc to compile ActionScript or MXML. I'm not sure whether we 
even document how to use asc.jar by itself.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of dorkie dork from dorktown
Sent: Thursday, October 08, 2009 11:12 AM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resources for compiling with asc.jar



Thanks
On Thu, Oct 8, 2009 at 8:27 AM, primo411 
primo...@gmail.commailto:primo...@gmail.com wrote:


Looks like this asc.jar is an ActionScript decompiler:
http://www.5etdemi.com/blog/archives/2007/01/as3-decompiler/

To learn how to compile/run, you should read tutorials for Java beginners.
2009/10/8 dorkie dork from dorktown 
dorkiedorkfromdorkt...@gmail.commailto:dorkiedorkfromdorkt...@gmail.com



I'm working on a project that is compiled using asc.jar. I know zero
about asc.jar. I don't even know how to compile / setup or run
asc.jar. I'm a Flex developer. Can someone send me links to resources
or advice on where to go to learn more? Thanks,

DDFD






RE: [flexcoders] Resources for compiling with asc.jar

2009-10-08 Thread Gordon Smith
asc.jar doesn't just decompile ActionScript... it also compiles it. But one 
normally uses mxmlc to compile ActionScript or MXML. I'm not sure whether we 
even document how to use asc.jar by itself.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of dorkie dork from dorktown
Sent: Thursday, October 08, 2009 11:12 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resources for compiling with asc.jar



Thanks
On Thu, Oct 8, 2009 at 8:27 AM, primo411 
primo...@gmail.commailto:primo...@gmail.com wrote:


Looks like this asc.jar is an ActionScript decompiler:
http://www.5etdemi.com/blog/archives/2007/01/as3-decompiler/

To learn how to compile/run, you should read tutorials for Java beginners.
2009/10/8 dorkie dork from dorktown 
dorkiedorkfromdorkt...@gmail.commailto:dorkiedorkfromdorkt...@gmail.com



I'm working on a project that is compiled using asc.jar. I know zero
about asc.jar. I don't even know how to compile / setup or run
asc.jar. I'm a Flex developer. Can someone send me links to resources
or advice on where to go to learn more? Thanks,

DDFD





RE: [flexcoders] Re: Hot news! Adobe Opens iPhone to Flash Developers

2009-10-05 Thread Gordon Smith
There will be a MAX session on the Flex SDK and mobile devices. I don't think 
we're supposed to say more before that.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of oneworld95
Sent: Monday, October 05, 2009 1:38 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Hot news! Adobe Opens iPhone to Flash Developers



I'm very curious as to how this applies to Flex. The article didn't mention 
that, but like you said, maybe someone from Adobe will add something to the 
discussion and stop keeping us in suspense!

It can be a revolution for Flex developers.

-Alex C

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
napearson99 napearso...@... wrote:

 I hope someone from adobe can chime in here.

 Here's my take. Flex is just a framework built on AS3. This middleware 
 compiler should be able to compile Flex AS3 code into native iPhone code no 
 problem.

 The new framework should also help reduce the weight of your app and make it 
 run faster.

 This is really great news. Our skills just got a lot more valuable today.

 --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
 oneworld95 oneworld95@ wrote:
 
  You're welcome. My boss owns an iPhone and wants everything we build to run 
  on it. So I've been hunting high and low for any way to run Flash on the 
  iPhone without a jailbreak.
 
  Some wording from the press release caught my eye: The Apple iPhone SDK 
  license terms do not allow runtime interpreted code, so Adobe is not able 
  to deliver Flash Player in Safari on the iPhone without support from Apple. 
  Applications for the iPhone built with Adobe Flash Professional CS5 do not 
  include any runtime interpreted code.
 
  So the apps built with CS5 will not include any runtime interpreted code. 
  Not sure what that means for Flex developers. Is that good/bad/indifferent?
 
  - Alex C
 
  --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
  Vivian Richard kanpsack@ wrote:
  
   Wow!!! Thanks for sharing the news. I also found this link in
   that news :
  
   http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/
  
  
  
  
   On Mon, Oct 5, 2009 at 12:25 PM, oneworld95 oneworld95@ wrote:
  
   
   
This Adobe press release suggests that developers can build Flash apps
(Flash CS5) for the iPhone:
http://eon.businesswire.com/portal/site/eon/permalink/?ndmViewId=news_viewnewsId=20091005006358newsLang=en
   
Does this mean Flash Builder 4/Flex 4 will support the iPhone at some
point?
   
- Alex C
   
   
   
  
 




RE: [flexcoders] Re: Hot news! Adobe Opens iPhone to Flash Developers

2009-10-05 Thread Gordon Smith
Hmm... it looks like it's safe to say this:

http://labs.adobe.com/technologies/flex/mobile/

Gordon Smith
Adobe Flex SDK Team

From: Gordon Smith
Sent: Monday, October 05, 2009 1:54 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Hot news! Adobe Opens iPhone to Flash Developers

There will be a MAX session on the Flex SDK and mobile devices. I don't think 
we're supposed to say more before that.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of oneworld95
Sent: Monday, October 05, 2009 1:38 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Hot news! Adobe Opens iPhone to Flash Developers



I'm very curious as to how this applies to Flex. The article didn't mention 
that, but like you said, maybe someone from Adobe will add something to the 
discussion and stop keeping us in suspense!

It can be a revolution for Flex developers.

-Alex C

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
napearson99 napearso...@... wrote:

 I hope someone from adobe can chime in here.

 Here's my take. Flex is just a framework built on AS3. This middleware 
 compiler should be able to compile Flex AS3 code into native iPhone code no 
 problem.

 The new framework should also help reduce the weight of your app and make it 
 run faster.

 This is really great news. Our skills just got a lot more valuable today.

 --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
 oneworld95 oneworld95@ wrote:
 
  You're welcome. My boss owns an iPhone and wants everything we build to run 
  on it. So I've been hunting high and low for any way to run Flash on the 
  iPhone without a jailbreak.
 
  Some wording from the press release caught my eye: The Apple iPhone SDK 
  license terms do not allow runtime interpreted code, so Adobe is not able 
  to deliver Flash Player in Safari on the iPhone without support from Apple. 
  Applications for the iPhone built with Adobe Flash Professional CS5 do not 
  include any runtime interpreted code.
 
  So the apps built with CS5 will not include any runtime interpreted code. 
  Not sure what that means for Flex developers. Is that good/bad/indifferent?
 
  - Alex C
 
  --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
  Vivian Richard kanpsack@ wrote:
  
   Wow!!! Thanks for sharing the news. I also found this link in
   that news :
  
   http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/
  
  
  
  
   On Mon, Oct 5, 2009 at 12:25 PM, oneworld95 oneworld95@ wrote:
  
   
   
This Adobe press release suggests that developers can build Flash apps
(Flash CS5) for the iPhone:
http://eon.businesswire.com/portal/site/eon/permalink/?ndmViewId=news_viewnewsId=20091005006358newsLang=en
   
Does this mean Flash Builder 4/Flex 4 will support the iPhone at some
point?
   
- Alex C
   
   
   
  
 




RE: [flexcoders] ToolTipManager problem

2009-09-24 Thread Gordon Smith
 Is there any other way I can get the tooltip to die after 2 seconds 
 regardless of what mouse movements take place...?

Use a Timer to call destroyToolTip(). I believe that hideDelay only affects 
tooltips that are automatically shown, not ones that you show with 
createToolTip().

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Thursday, September 24, 2009 4:03 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ToolTipManager problem


I think if the tooltip shows up under the mouse you may not get an itemRollOut 
and clean up the old one.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of luketvanderfluit
Sent: Thursday, September 24, 2009 3:26 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ToolTipManager problem



Hi.

Here I have a component.

Problem is that itemRollOver, itemRollout and change doesnt always close the 
tooltip. Then Im stuck with an open tooltip that can only be removed by 
reloading the application...

I want to use ToolTipManager.hideDelay to automatically hide the tooltip after 
2 seconds but
Putting ToolTipManager.hideDelay = 2000 in an init method doesnt do it...

Is there any other way I can get the tooltip to die after 2 seconds regardless 
of what mouse movements take place...?

Thanks for any help...

Kr.
Luke Vanderfluit

?xml version=1.0 encoding=utf-8?
mx:ComboBox xmlns:mx=http://www.adobe.com/2006/mxml;
openDuration=250
closeDuration=250
selectionDuration=250
fontSize=8
prompt=Risk Consequence
dataProvider={rcAC} itemRollOver=toolTipIn(event)
itemRollOut=toolTipOut(event) change=toolTipOut(event)

mx:Script
![CDATA[
import mx.core.IToolTip;
import mx.controls.ToolTip;
import mx.managers.ToolTipManager;
import mx.events.ListEvent

private var itt:ToolTip;
private function toolTipIn(evt:ListEvent):void {
var pnt:Point = evt.currentTarget.localToGlobal(new Point(0,0));
pnt.y -= 30; pnt.x -= 10;

if (evt.rowIndex == 0) {
itt = ToolTip(ToolTipManager.createToolTip(
Insignificant\nNo injury, little or no physical damage, low financial 
loss.,pnt.x,pnt.y));
}
if (evt.rowIndex == 1) {
itt = ToolTip(ToolTipManager.createToolTip(
Minor\nFirst aid treatment controlled on-site with no outside assistance, 
immediately contained, medium/high financial loss.,pnt.x,pnt.y));
}
if (evt.rowIndex == 2) {
itt = ToolTip(ToolTipManager.createToolTip(
Moderate\nMedical Treatment required, controlled on-site with outside 
assistance, high financial loss.,pnt.x,pnt.y));
}
if (evt.rowIndex == 3) {
itt = ToolTip(ToolTipManager.createToolTip(
Major\nDeath and extensive injuries, loss of some capabilities, major 
financial loss.,pnt.x,pnt.y));
}
if (evt.rowIndex == 4) {
itt = ToolTip(ToolTipManager.createToolTip(
Catastrophic\nDeath, loss of majority capabilities, huge financial 
loss.,pnt.x,pnt.y));
}
}
private function toolTipOut(evt:ListEvent):void {
if (itt != null) {
ToolTipManager.destroyToolTip(itt);
}
}
]]
/mx:Script
mx:ArrayCollection id=rcAC
mx:Object label=Insignificant data=1/
mx:Object label=Minor data=2/
mx:Object label=Moderate data=3/
mx:Object label=Major data=4/
mx:Object label=Catastrophic data=5/
/mx:ArrayCollection

/mx:ComboBox



RE: [flexcoders] truncateToFit() and concatenated Strings

2009-09-16 Thread Gordon Smith
I don't think it has a problem with concatenated Strings... that would be very 
surprising if it did. But I don't think it works properly with htmlText.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Matthew
Sent: Wednesday, September 16, 2009 3:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] truncateToFit() and concatenated Strings



Hi -

I have a Label with truncateToFit set to true and a maxWidth. However, the 
htmlText I assign is concatenated a la:

ipText = 'b' +endPointData.ipLabel+ '/b: ' + endPointData.ipValue;

I've researched online and found that truncateToFit() has problems dealing with 
concatenated Strings; my text does not get truncated.

Has anyone found a solution?

Thank you for any tips.



RE: [flexcoders] Hover Event over Text

2009-09-14 Thread Gordon Smith
With TextField-based text in MX components, I don't think this is easy. You'd 
probably have to use mouseMove to track the mouse within a TextField and 
low-level TextFIeld APIs to discover what range of characters the mouse is over.

With TLF in Spark components, I think it is easier because a hyperlink is 
represented by a LinkElement instance, and it dispatches rollOver and rollOut 
events.

 - Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of stldvd
Sent: Monday, September 14, 2009 1:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Hover Event over Text



Hi All,

Is there some way in Flex to have an event fire when the cursor hovers over a 
hyperlink?

I don't want to use the TextEvent because that is only relevant to the click 
event. I need to make something happen when the mouse just hovers over text.

Thanks in advance...

David



RE: [flexcoders] HTML in text control

2009-09-14 Thread Gordon Smith
When you inspect dreamText.htmlText and dreamText.text, are they what you 
expect or are they empty Strings?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of janjohannes...@rocketmail.com
Sent: Monday, September 14, 2009 10:02 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] HTML in text control



I have made two applications:
1. Stores text in a MySQL database. I use RichTextEditor to make the text, and 
then stores the text in the database vith all the HTML tags.
2. The other application is a private homepage that loads the text from the 
database. I use mx:text controls to display the text.

When I bind the receiving input variable from the database to the text control 
using the text-property, the text control fills up nicely... but with 
html-coded text. When I bind the input variable from the database to the Text 
control using the htmlText-property, the text control is empty... or no visable 
text.
I have tried using both mx-tags and actionscript, but with the same result.

Have anybody a clue how to resolve this issue?

Here are my text control:
mx:Text id=dreamText
width=100% height=100%
htmlText={FinalText} 
/mx:Text

Thanks




RE: [flexcoders] How to display bullet insted asterisk in textinput controll

2009-09-10 Thread Gordon Smith
If you are talking about mx:TextInput, you can't change the password 
character... mx:TextInput uses the TextField class in Flash Player, which 
only is capable of displaying asterisks. The new s:TextInput in Flex 4, which 
is based on TLF, has an mx_internal var for the password character.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of vladakg85
Sent: Thursday, September 10, 2009 1:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display bullet insted asterisk in textinput 
controll



I added displayAsPassword but I want bullets instead of asterisks. How to 
achieve this? I can't change type of fonts in controll.



RE: [flexcoders] Re: Race conditions when event handlers triggered from different targets

2009-08-28 Thread Gordon Smith
Yes, the Player has multiple threads. But the ActionScript Virtual Machine 
executes in only one of them. And the AVM executes one event handler before 
starting another event handler. You're not actually claiming to have proof to 
the contrary, are you?

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of mike_slinn
Sent: Friday, August 28, 2009 9:04 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Race conditions when event handlers triggered from 
different targets



 Because actionscript is single-threaded, your scenario cannot happen.

Alex,

That statement is often repeated, but I believe that it is incorrect. The main 
thread is responsible for rendering and AMF deserialization. URLLoader runs in 
its own thread. Pixel Bender runs in its own thread 
(http://www.jamesward.com/blog/2009/04/29/announcing-pbjas-an-actionscript-3-pixel-bender-shader-library/)

I have asked for AMF deserialization be moved to another thread 
(http://bugs.adobe.com/jira/browse/FP-2398)

It would be great if better documentation on the Flash player's threads was 
available.

Mike



RE: [flexcoders] Race conditions when event handlers triggered from different targets

2009-08-27 Thread Gordon Smith
 Are there any resources that describe the internals of the Flash player?
 Is there a spec like there is for the Java runtime?

Unfortunately, no. About the closest thing is a spec for the SWF file format. 
But that spec doesn't really explain how the Player loads and executes a SWF 
file.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Thursday, August 27, 2009 3:55 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Race conditions when event handlers triggered from 
different targets



Because actionscript is single-threaded, your scenario cannot happen.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

-Original Message-
From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
Behalf Of Jon Gunnip
Sent: Thursday, August 27, 2009 1:49 PM
To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
Subject: Re: [flexcoders] Race conditions when event handlers triggered from 
different targets

Thanks, Tracy. I'm not principally concerned with knowing when two
operations have completed. I'm more concerned about checking the
status of a global variable in event handler A' and then having that
variable's value changed by event handler B' before A' is finished
executing. In Java you might use a synchronized block for this. I
was hoping the flash player might make some guarantees that make a
concern like this unnecessary, especially since it executes in a
single thread.

Are there any resources that describe the internals of the Flash
player? Is there a spec like there is for the Java runtime?

Thanks,
Jon

On Thu, Aug 27, 2009 at 12:44 PM, Tracy 
Spratttr...@nts3rd.commailto:tracy%40nts3rd.com wrote:


 You can't predict order, but you can be assured that there is no parallel
 processing of actionscript code.  I don't know the internals of the flash
 player well enough to say in detail but there are rules that control what
 code is processed when.



 If you need to know that two async processes have completed, use a flag or
 dictionary, set a flag value in each handler, and check it in each handler.



 Tracy Spratt,

 Lariat Services, development services available

 

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On
 Behalf Of Jon Gunnip
 Sent: Thursday, August 27, 2009 10:04 AM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Race conditions when event handlers triggered from
 different targets





 Hi,

 I have a concern about possible race conditions in our Flex
 application. I've read in Essential ActionScript 3.0 that the Flash
 runtime will not interrupt the execution of an event handler to update
 the screen. I'm wondering if there are any similar guarantees about
 the order in which two event handlers registered with different
 targets are executed. Consider the following:

 User presses button A triggering event handler A'
 In same frame, result returned from HTTPService B, triggering event handler
 B'

 If A' starts executing before B', will it run to completion before B'
 starts executing, or could their execution be interleaved?

 Thanks,
 Jon





--
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



RE: [flexcoders] Race conditions when event handlers triggered from different targets

2009-08-27 Thread Gordon Smith
Yes, that is what Alex is saying. Handler B will not begin before handler A 
finishes. Event handlers don't get paused. Furthermore, when you (or the 
Player) calls dispatchEvent(), all the event handlers listening for that event 
execute before dispatchEvent() returns.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Jon Gunnip
Sent: Thursday, August 27, 2009 5:21 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Race conditions when event handlers triggered from 
different targets



Alex,

Thanks. Just to be clear, are you saying that once event handler A'
begins executing, another event handler B' will not begin executing
until A' finishes?

Even in a single-threaded environment, not knowing how the flash
player works, it is possible that the player could decide to pause
an executing event handler to allow another to progress. That would
create the scenario I am describing.

Jon

On Thu, Aug 27, 2009 at 6:54 PM, Alex 
Haruiaha...@adobe.commailto:aharui%40adobe.com wrote:
 Because actionscript is single-threaded, your scenario cannot happen.

 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.
 Blog: http://blogs.adobe.com/aharui


 -Original Message-
 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of Jon Gunnip
 Sent: Thursday, August 27, 2009 1:49 PM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: Re: [flexcoders] Race conditions when event handlers triggered from 
 different targets

 Thanks, Tracy. I'm not principally concerned with knowing when two
 operations have completed. I'm more concerned about checking the
 status of a global variable in event handler A' and then having that
 variable's value changed by event handler B' before A' is finished
 executing.  In Java you might use a synchronized block for this.  I
 was hoping the flash player might make some guarantees that make a
 concern like this unnecessary, especially since it executes in a
 single thread.

 Are there any resources that describe the internals of the Flash
 player?  Is there a spec like there is for the Java runtime?

 Thanks,
 Jon

 On Thu, Aug 27, 2009 at 12:44 PM, Tracy 
 Spratttr...@nts3rd.commailto:tracy%40nts3rd.com wrote:


 You can't predict order, but you can be assured that there is no parallel
 processing of actionscript code.  I don't know the internals of the flash
 player well enough to say in detail but there are rules that control what
 code is processed when.



 If you need to know that two async processes have completed, use a flag or
 dictionary, set a flag value in each handler, and check it in each handler.



 Tracy Spratt,

 Lariat Services, development services available

 

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On
 Behalf Of Jon Gunnip
 Sent: Thursday, August 27, 2009 10:04 AM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Race conditions when event handlers triggered from
 different targets





 Hi,

 I have a concern about possible race conditions in our Flex
 application. I've read in Essential ActionScript 3.0 that the Flash
 runtime will not interrupt the execution of an event handler to update
 the screen. I'm wondering if there are any similar guarantees about
 the order in which two event handlers registered with different
 targets are executed. Consider the following:

 User presses button A triggering event handler A'
 In same frame, result returned from HTTPService B, triggering event handler
 B'

 If A' starts executing before B', will it run to completion before B'
 starts executing, or could their execution be interleaved?

 Thanks,
 Jon




 

 --
 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 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







RE: [flexcoders] An Array of Class Objects???

2009-08-26 Thread Gordon Smith
Array and ArrayCollection do not enforce any kind of type checking on their 
elements… each element can be anything.

If you need strongly-typed elements, use Vector:

macList:Vector.deviceClass

BTW, the convention is to start class names with a capital letter.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Eric Dunn
Sent: Wednesday, August 26, 2009 8:49 AM
To: flexcoders
Subject: [flexcoders] An Array of Class Objects???


Hello peeps,

I am need of some assistance.. I am trying to define a complex object within a 
couple of classes. I am trying to build a data structure like:
   devices
  deviceType
  MAC
   port
   port
   port
  / MAC
  MAC
   port
 / MAC
  MAC
   port
   port
 / MAC
  /deviceType
  deviceType
  MAC
   port
  / MAC
  MAC
   port
   port
 / MAC
  MAC
   port
   port
 / MAC
  /deviceType
  /devices

I have 3 classes defined:

deviceClass
modelName:string
macList: ArrayCollection = new ArrayCollection

macClass
  macID:string
  portList:portClass

portClass
  portList:array

Question: How do I define the macList in the deviceClass to be an array of 
macClass Objects.

I know how to add the objects into the array as I am building the collection, 
but have no clue on how restrict them to deviceClass objects..

thanks,

Eric W Dunn
Adaption Technologies
281-465-3326
ed...@adpt-tech.com



RE: [flexcoders] Re: Event Best Practices

2009-08-17 Thread Gordon Smith
 mx:app - event never gets here
 mx:customComponent - this tabcontainer handles it just fine
 mx:customComponent / - this is a popup titlewindow which dispatches the 
 event
 /mx:customComponent
 /mx:app

 I dispatch the event from the popped-up titlewindow.

If you are really using PopUpManager, then the hierarchy you show isn't 
correct. A popped-up titlewindow is a child of the SystemManager, not a child 
of the TabContainer or a grandchild of the Application, and neither the 
TabContainer nor the Application should get a bubbled-up event from a popup.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Magnus Lassi
Sent: Sunday, August 16, 2009 6:18 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Event Best Practices



that may be why you doesn't fire:

http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html

You are required to override the Event.clone() method in your subclass. The 
clone() method returns a cloned copy of the event object by setting the type 
property and any new properties in the clone. Typically, you define the clone() 
method to return an event instance created with the new operator.
On Sun, Aug 16, 2009 at 2:15 AM, jdizowat 
jasonharr...@gmail.commailto:jasonharr...@gmail.com wrote:


It is a custom event and I did not override clone().


--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Magnus 
Lassi magnus.la...@... wrote:

 I don't see the event mentioned, is it a custom event you created or an
 event in the framework? If it's a custom event, did you override the clone
 function?

 On Fri, Aug 14, 2009 at 3:15 PM, jdizowat jasonharr...@... wrote:

 
 
  Thanks for all the help. I have exactly what you said, Jake. A little more
  info -
 
  I have the following:
 
  mx:app - event never gets here
  mx:customComponent - this tabcontainer handles it just fine
  mx:customComponent / - this is a popup titlewindow which dispatches the
  event
  /mx:customComponent
  /mx:app
 
  I dispatch the event from the popped-up titlewindow. I have bubbles=true.
  I'm sorry, I'm not understanding why the event isn't making it up to the
  application level. I even tried taking out the event listener on the next
  level up. What now? I know what I'm reading up on this weekend :)
 
 
 





RE: [flexcoders] Re: Event Best Practices

2009-08-17 Thread Gordon Smith
Sorry... I didn't see that Valdhor had already explained this.

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Gordon Smith
Sent: Monday, August 17, 2009 2:15 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Event Best Practices


 mx:app - event never gets here
 mx:customComponent - this tabcontainer handles it just fine
 mx:customComponent / - this is a popup titlewindow which dispatches the 
 event
 /mx:customComponent
 /mx:app

 I dispatch the event from the popped-up titlewindow.

If you are really using PopUpManager, then the hierarchy you show isn't 
correct. A popped-up titlewindow is a child of the SystemManager, not a child 
of the TabContainer or a grandchild of the Application, and neither the 
TabContainer nor the Application should get a bubbled-up event from a popup.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Magnus Lassi
Sent: Sunday, August 16, 2009 6:18 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Event Best Practices



that may be why you doesn't fire:

http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html

You are required to override the Event.clone() method in your subclass. The 
clone() method returns a cloned copy of the event object by setting the type 
property and any new properties in the clone. Typically, you define the clone() 
method to return an event instance created with the new operator.
On Sun, Aug 16, 2009 at 2:15 AM, jdizowat 
jasonharr...@gmail.commailto:jasonharr...@gmail.com wrote:


It is a custom event and I did not override clone().


--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Magnus 
Lassi magnus.la...@... wrote:

 I don't see the event mentioned, is it a custom event you created or an
 event in the framework? If it's a custom event, did you override the clone
 function?

 On Fri, Aug 14, 2009 at 3:15 PM, jdizowat jasonharr...@... wrote:

 
 
  Thanks for all the help. I have exactly what you said, Jake. A little more
  info -
 
  I have the following:
 
  mx:app - event never gets here
  mx:customComponent - this tabcontainer handles it just fine
  mx:customComponent / - this is a popup titlewindow which dispatches the
  event
  /mx:customComponent
  /mx:app
 
  I dispatch the event from the popped-up titlewindow. I have bubbles=true.
  I'm sorry, I'm not understanding why the event isn't making it up to the
  application level. I even tried taking out the event listener on the next
  level up. What now? I know what I'm reading up on this weekend :)
 
 
 





RE: [flexcoders] Flex Sprite Double click not working

2009-08-13 Thread Gordon Smith
You have to opt in to doubleclicks. An InteractiveObject doesn't dispatch a 
DOUBLE_CLICK event when it is double-clicked unless its doubleClickEnabled 
property is true.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Sajid Hussain
Sent: Thursday, August 13, 2009 5:46 AM
To: Code
Subject: [flexcoders] Flex Sprite Double click not working


very strange and annoying issue I m facing

I have one sprite with drawing api I have one circle init ,where I m trying to 
call double click but its not working where as mouseup or down and click 
function working

Sajid

_,___


RE: [flexcoders] Re: *** So you think you know ActionScript? (Read original post first) ***

2009-08-13 Thread Gordon Smith
Does anybody want to try to figure out what the E4X spec says it should do? 
It's certainly possible that the Player implementation of E4X is doing it wrong.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Tracy Spratt
Sent: Thursday, August 13, 2009 3:10 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***


Ok, if you say so.  What is the result of your investigation?

It gets kind of complicated because AS does implicit toString() sometimes which 
can hide what is really happening.
Do:
trace(xmlList == null);
and
trace(xmlList == null);
return the same result?

Tracy Spratt,
Lariat Services, development services available

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dave Glasser
Sent: Thursday, August 13, 2009 5:22 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***


Actually, no. It would interpret it as null if it were enclosed in curly braces 
like this:

var xml:XML = outerinner{null}/inner/outer;

And even then, null might be converted to its String value, null, as the 
content of the element. I'd have to try it to know for sure.

In the example I gave, the content of the element is a String consisting of the 
letters n, u, l and l, in that order.

In any case, the xmlList variable would reference a non-null XMLList object. 
That's easily proven by dereferencing it:

trace(The length is  + xmlList.length());

That would output The length is 1.

--- On Thu, 8/13/09, Tracy Spratt tr...@nts3rd.com wrote:

From: Tracy Spratt tr...@nts3rd.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***
To: flexcoders@yahoogroups.com
Date: Thursday, August 13, 2009, 3:49 PM

Ah, I see something I missed at first.  This example is using literal xml, so 
the null IS getting interpreted by AS as null and not as a string.  I bet it 
would be different if you did:
var xml:XML = XML(outerinner null/inner /outer);

Even so I am still surprised because the null should be the text node and the 
expression should return an XMLList with zero length.  Very interesting.

Tracy Spratt,
Lariat Services, development services available

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of jaywood58
Sent: Thursday, August 13, 2009 12:48 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***



--- In flexcod...@yahoogro 
ups.com/mc/compose?to=flexcoders%40yahoogroups.com, Tracy Spratt  tracy 
@... wrote:

 _

 From: flexcod...@yahoogro 
 ups.com/mc/compose?to=flexcoders%40yahoogroups.com 
 [mailto:flexcod...@yahoogro 
 ups.com/mc/compose?to=flexcoders%40yahoogroups.com] On
 Behalf Of Paul Andrews
 Sent: Wednesday, August 12, 2009 9:33 PM
 To: flexcod...@yahoogro ups.com/mc/compose?to=flexcoders%40yahoogroups.com
 Subject: Re: [flexcoders] *** So you think you know ActionScript? (Read
 original post first) ***





 Dave Glasser wrote:
  Consider this code snippet:
 
  var xml:XML = outerinner null/inner /outer;
  var xmlList:XMLList = xml.inner;
  trace(xmlList == null);
 
  What does the trace statement output, true or false, and why?
 
  Please provide an answer without running the code (of course) and, better
 yet, without consulting any documentation, or any of the other answers that
 may have been posted already (if you read the list in chronological order.)
 Pretend it's a job interview question and you have to give it your best shot
 off the top of your head.
 
  And also, if you don't mind, don't top-post your answer, so that if
 someone does read your answer before the original post, they might get a
 chance to answer without having seen yours first.
 

 xmlList is set to point at somthing which isn't a list, so I think the
 trace statement will not be reached. That's my 02:31AM thought..



 All e4x expressions return an XMLList. It can be empty but is never a null.
 Besides, the characters. null in a text node are just a string. null in
 an AS comparison is a special value. The trace will display false.
 Trace(xmllist. text() ==null ); //would return true.



 Tracy Spratt,

 Lariat Services, development services available


Like Tracy , I thought it would return false, for the same reason -- that 
innernull /inner would be interpreted as a string. Was surprised when I ran 
the code and saw true. What's going on? It seems like the AS decoder recognizes 
null as a special case.




RE: [flexcoders] Re: *** So you think you know ActionScript? (Read original post first) ***

2009-08-13 Thread Gordon Smith
Well, the == operator produces a lot of interesting behavior. That's why 
there's a === operator. ☺

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dave Glasser
Sent: Thursday, August 13, 2009 4:39 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***


By my reading, everything seems to be working how it's supposed to work. But 
how it's supposed to work is very surprising to me. And it's not really E4X 
that's producing the odd behavior, it's the == operator. I'll go ahead and post 
the answer and explanation in my next message.

--- On Thu, 8/13/09, Gordon Smith gosm...@adobe.com wrote:

From: Gordon Smith gosm...@adobe.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Date: Thursday, August 13, 2009, 6:54 PM

Does anybody want to try to figure out what the E4X spec says it should do? 
It's certainly possible that the Player implementation of E4X is doing it wrong.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Tracy Spratt
Sent: Thursday, August 13, 2009 3:10 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***


Ok, if you say so.  What is the result of your investigation?

It gets kind of complicated because AS does implicit toString() sometimes which 
can hide what is really happening.
Do:
trace(xmlList == null);
and
trace(xmlList == “null”);
return the same result?

Tracy Spratt,
Lariat Services, development services available

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dave Glasser
Sent: Thursday, August 13, 2009 5:22 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***


Actually, no. It would interpret it as null if it were enclosed in curly braces 
like this:

var xml:XML = outerinner{null}/inner/outer;

And even then, null might be converted to its String value, null, as the 
content of the element. I'd have to try it to know for sure.

In the example I gave, the content of the element is a String consisting of the 
letters n, u, l and l, in that order.

In any case, the xmlList variable would reference a non-null XMLList object. 
That's easily proven by dereferencing it:

trace(The length is  + xmlList.length());

That would output The length is 1.

--- On Thu, 8/13/09, Tracy Spratt tr...@nts3rd.com wrote:

From: Tracy Spratt tr...@nts3rd.com
Subject: RE: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***
To: flexcoders@yahoogroups.com
Date: Thursday, August 13, 2009, 3:49 PM

Ah, I see something I missed at first.  This example is using “literal” xml, so 
the null IS getting interpreted by AS as null and not as a string.  I bet it 
would be different if you did:
var xml:XML = XML(“outerinner null/inner /outer”);

Even so I am still surprised because the null should be the text node and the 
expression should return an XMLList with zero length.  Very interesting.

Tracy Spratt,
Lariat Services, development services available

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of jaywood58
Sent: Thursday, August 13, 2009 12:48 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Re: *** So you think you know ActionScript? (Read 
original post first) ***



--- In flexcod...@yahoogro ups.com, Tracy Spratt  tracy @... wrote:

 _

 From: flexcod...@yahoogro ups.com [mailto:flexcod...@yahoogro ups.com] On
 Behalf Of Paul Andrews
 Sent: Wednesday, August 12, 2009 9:33 PM
 To: flexcod...@yahoogro ups.com
 Subject: Re: [flexcoders] *** So you think you know ActionScript? (Read
 original post first) ***





 Dave Glasser wrote:
  Consider this code snippet:
 
  var xml:XML = outerinner null/inner /outer;
  var xmlList:XMLList = xml.inner;
  trace(xmlList == null);
 
  What does the trace statement output, true or false, and why?
 
  Please provide an answer without running the code (of course) and, better
 yet, without consulting any documentation, or any of the other answers that
 may have been posted already (if you read the list in chronological order.)
 Pretend it's a job interview question and you have to give it your best shot
 off the top of your head.
 
  And also, if you don't mind, don't top-post your answer, so that if
 someone does read your answer before the original post, they might get a
 chance to answer without having seen yours first.
 

 xmlList is set to point at somthing which isn't a list, so I think the
 trace statement will not be reached. That's my 02:31AM thought..



 All e4x expressions return

RE: [flexcoders] Re: How to make variables persist across application

2009-08-07 Thread Gordon Smith
The simplest way to use custom events is to use the mx.events.DynamicEvent 
class.

When the application creates the LoginPopup component, have it listen for 
login events like this:

var loginPopup:LoginPopup = new LoginPopup();
loginPopup.addEventListener(login, loginHandler);
PopUpManager.showPopup(loginPopup);

Have your LoginPopup class dispatch a login event when it closes:

var loginEvent:DynamicEvent = new DynamicEvent(login);
loginEvent.username = usernameTextInput.text;
loginEvent.passwrod = passwordTextInput.text;
dispatchEvent(loginEvent);

Have you application handle the login event like this:

private function loginHandler(event:DynamicEvent):void
{
// do something with event.username and event.password
}

If you want to be more formal and type-safe, you would declare an AS subclass 
of Event instead of using DynamicEvent, but that's another lesson.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of spuy...@ymail.com
Sent: Friday, August 07, 2009 11:36 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How to make variables persist across application



Thanks. I am not even certain what you mean by dispatching a custom event. I 
have heard of Shared Objects though. Can you point me to a goo resource on how 
to do this?

Thanks,
Lee

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

 Or you could dispatch a custom event to your application that contains a user 
 info object.

 Or you could save the user info data to a shared object.


 --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
 Gordon Smith gosmith@ wrote:
 
  You have several options. Perhaps the simplest is to declare
 
  public var userid:String;
 
  in your Application. The login popup can then access this var as 
  Application.application.userid and set it.
 
  Other possibilities include a LoginInfo class with static vars (so that any 
  code can just access LoginInfo.userid) or a LoginInfo instance attached to 
  your application (so that any code can reference 
  Application.application.loginInfo.userid).
 
  Gordon Smith
  Adobe Flex SDK Team
 
  From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
  Behalf Of spuyear@
  Sent: Wednesday, August 05, 2009 8:19 AM
  To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] How to make variables persist across application
 
 
 
  Is there a way to have the variables I set in a pop-up window (think 
  login), persist and be accessible even when that pop-up is closed?
 
  For example, I have an application that uses a pop-up login window to 
  control access to the application. The user supplies userid, password and 
  role. When the user is authenticated, the pop-up closes and a viewstack is 
  displayed based on the results of the role selected in the pop-up.
 
  All that works just fine. Now, I want to display the userid in the 
  components within the viewstack. For example I want to display a welcome 
  message based on the userid.
 
  I cant seem to figure out how to do this. Any help would be appreciated.
 
  lee
 




RE: [flexcoders] Re: How to make variables persist across application

2009-08-07 Thread Gordon Smith
Write a data storage class like this:

LoginInfo.as
---

public class LoginInfo
{
public static var username:String;
public static var password:String;
}

In your LoginPopup component, import LoginInfo and do something like like

LoginInfo.username = usernameTextInput.text;

when the popup is closed.

Static vars simply live in the class itself, not in an instance of the class. 
You can reference them from anywhere.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of spuy...@ymail.com
Sent: Friday, August 07, 2009 11:31 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How to make variables persist across application



Thanks Gordan. Using the first option worked. I am also interested in the 
second option but am not certain where to start. Could you provide a little 
more detail?

Thanks,
Lee

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 You have several options. Perhaps the simplest is to declare

 public var userid:String;

 in your Application. The login popup can then access this var as 
 Application.application.userid and set it.

 Other possibilities include a LoginInfo class with static vars (so that any 
 code can just access LoginInfo.userid) or a LoginInfo instance attached to 
 your application (so that any code can reference 
 Application.application.loginInfo.userid).

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of spuy...@...
 Sent: Wednesday, August 05, 2009 8:19 AM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] How to make variables persist across application



 Is there a way to have the variables I set in a pop-up window (think login), 
 persist and be accessible even when that pop-up is closed?

 For example, I have an application that uses a pop-up login window to control 
 access to the application. The user supplies userid, password and role. When 
 the user is authenticated, the pop-up closes and a viewstack is displayed 
 based on the results of the role selected in the pop-up.

 All that works just fine. Now, I want to display the userid in the components 
 within the viewstack. For example I want to display a welcome message based 
 on the userid.

 I cant seem to figure out how to do this. Any help would be appreciated.

 lee




RE: [flexcoders] how to find a dynamic object in a function?

2009-08-06 Thread Gordon Smith
One way is to use .parent, because the RadioButton is a child of VBox so that 
VBox is its parent.

Another way is to use the fact that if you give the VBox tag an id like 
id=vb, then you can refer to the ith VBox as vb[i]. And you can determine 
what value of i to use by using the .instanceIndex property of the RadioButton 
that you're processing.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of coder3
Sent: Wednesday, August 05, 2009 5:46 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to find a dynamic object in a function?



Hi All,

This might be a simple question, but I have no clue:

For example, I use mx:Repeater to create a list of radioButton, each inside
a vBox, so the code is like this:

mx:RadioButtonGroup id=myRG itemClick=selectMyRadio(event)/
mx:Repeater id=myRP dataProvider={myList}
mx:VBox name={myRP.currentItem.value}VB 
mx:RadioButton value={myRP.currentItem.value}
label={myRP.currentItem.label} groupName=myRG /
/mx:VBox
/mx:Repeater

what i want to do is, when user selects one radio button, i want to use its
VBox to do something, how to i get the vBoxobject in the function?

private function selectMyRadio(event:Event):void
{
// so i can get the selected radio button value:
event.currentTarget.selectedValue
// now how to get the vbox object from the application by using that
value? the vBox name is: value+VB
}

thanks!

C

--
View this message in context: 
http://www.nabble.com/how-to-find-a-dynamic-object-in-a-function--tp24838597p24838597.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] Instantiation of State Objects

2009-08-06 Thread Gordon Smith
In the Flex 3 states model, if you start in state A, go to state B which 
creates and adds a child, and return to state A, the child is removed from the 
display list but kept around. When you return to state B, it doesn't have to be 
recreated and can just be re-added.

In the Flex 4 states model, the default behavior is the same, but you can use 
destructon policies to say that the child should not only be removed from the 
display list but also freed for garbage collection.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Geoffrey
Sent: Thursday, August 06, 2009 2:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Instantiation of State Objects



Are the objects for a state recreated every time a state is entered, or if the 
object was created once, is it reused?

Basically, I want to know if I swap between states, are the objects defined by 
AddChild new instances every time I enter that state.



RE: [flexcoders] How to make variables persist across application

2009-08-05 Thread Gordon Smith
You have several options. Perhaps the simplest is to declare

public var userid:String;

in your Application. The login popup can then access this var as 
Application.application.userid and set it.

Other possibilities include a LoginInfo class with static vars (so that any 
code can just access LoginInfo.userid) or a LoginInfo instance attached to your 
application (so that any code can reference 
Application.application.loginInfo.userid).

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of spuy...@ymail.com
Sent: Wednesday, August 05, 2009 8:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to make variables persist across application



Is there a way to have the variables I set in a pop-up window (think login), 
persist and be accessible even when that pop-up is closed?

For example, I have an application that uses a pop-up login window to control 
access to the application. The user supplies userid, password and role. When 
the user is authenticated, the pop-up closes and a viewstack is displayed based 
on the results of the role selected in the pop-up.

All that works just fine. Now, I want to display the userid in the components 
within the viewstack. For example I want to display a welcome message based on 
the userid.

I cant seem to figure out how to do this. Any help would be appreciated.

lee



RE: [flexcoders] Re: Question about a flex component

2009-08-04 Thread Gordon Smith
UIComponents have a visible:Boolean property which you can set to true or false.

You can tell whether a Container is scrollable by checking whether its 
maxHorizontalScrollPosition is greater than 0.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Tuesday, August 04, 2009 10:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



how do i make visible invisible the icons for previous/next?

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, veena 
pandit v.kri...@... wrote:

 Hi,

 I am new to Flex. I am looking for help on designing a custom component
 that will
 hold a lot of items. When the items exceed the number that are visible in
 the ui
 of this horizontal component on the webpage an icon appears, which if you
 click
 will show a list of the other components you can click again and restore the
 ui with
 that item. Hope you understand what I am talking about. If not please post
 for clarification.

 Thanks in advance,

 Veena




RE: [flexcoders] Re: How to customize ThousandSeparator to display price in INR format

2009-07-28 Thread Gordon Smith
That's correct. Improved locale-aware formatting capabilities that will handle 
this case are being built for a future version of the Flash Player. But the 
current Flex formatters only know how to insert a thousandsSeparator every 
three digits.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of ursprakash6
Sent: Tuesday, July 28, 2009 12:59 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How to customize ThousandSeparator to display price 
in INR format



Hi Dhanasekar

as far as i know there is no way to achieve this directly,there is no properies 
are provided,so you need to derive mx.formatters.NumberFormatter and 
mx.formatters.NumberBase.

Gnanz.../
a href='http://gnanz-flexworld.blogspot.com'Flex Samples/a

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
dhansekarank dhansekar...@... wrote:

 All,


 I need to format the below amount in indian rupee(INR) format.


 Amount: 1000.00


 When i use the default ThousandSeparator it return the amount as follows:

 mx:NumberFormatter id=numberFormatter precision=2 
 useThousandsSeparator=true
 thousandsSeparatorFrom=, thousandsSeparatorTo=,/


 numberFormatter.format(Amount) --- 1,000,000,000.00  it's in US 
 dollar format


 i want it as,


 numberFormatter.format(Amount) --- 1,00,00,00,000.00  it's in 
 INR rupee format


 Please some one tell me how to do this,


 by,

 Dhanasekaran




RE: [flexcoders] Re: Question about a flex component

2009-07-28 Thread Gordon Smith
Use any program that can produce a GIF or PNG and draw a left-pointing and a 
right-pointing triangle.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of veena_kris2003
Sent: Tuesday, July 28, 2009 5:43 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question about a flex component



Does anyone know of icons or images I can use in my buttons instead of labeling 
them Previous and Next. I tried to google it and I did not find anything.

Thanks.

--- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gordon 
Smith gosm...@... wrote:

 Why not just allow scrolling instead of paging? Scrolling components can 
 scroll through thousands of items quickly.

 Suppose there are 100 items and you can only see 10 at a time. So first you 
 see 0-9. When you click the icon you see 10-19. When you click it again you'd 
 see 20-29. So you'd need another icon (previous page instead of next 
 page) to go back to 10-19 and then 0-9.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On 
 Behalf Of veena pandit
 Sent: Thursday, July 23, 2009 10:22 AM
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Question about a flex component


 Hi,

 I am new to Flex. I am looking for help on designing a custom component that 
 will
 hold a lot of items. When the items exceed the number that are visible in the 
 ui
 of this horizontal component on the webpage an icon appears, which if you 
 click
 will show a list of the other components you can click again and restore the 
 ui with
 that item. Hope you understand what I am talking about. If not please post 
 for clarification.

 Thanks in advance,

 Veena




  1   2   3   4   5   6   7   8   9   10   >