[flexcoders] Re: OOP and Work for Hire

2008-06-11 Thread Amy
--- In flexcoders@yahoogroups.com, <[EMAIL PROTECTED]> wrote:
>
> Amy - that would be a breach of confidentiality in the legal and 
business world. You can not share information like that when a 
company is paying you to develop/code that information, unless it is 
specifically called out in any agreements. I suspect that the company 
looking to hire you for this project is also looking to obtain a 
competitive advantage, soyour sharing of information outside of 
the employing company would be counter to their desired end game

eLearning isn't usually about competitive advantages.  I suspect that 
the whole work for hire thing is because they also _do_ have some 
business critical code that they contract out.  But in general the 
only reason businesses care _how_ eLearning is coded is based on how 
that affects code.

The eLearning community, however, is waiting with bated breath for 
Flex example code that will allow people to get their heads around 
how, for instance, they can present pages of data driven content with 
a coherent navigational structure.  It's been almost a year since 
Authorware's EOD was announced, and people need something else they 
can do to with this type of content.  And if I retain the freedom to 
post generic code that doesn't reveal the specific business practices 
of the client, I'm in a better position to help people move forward.

The ideal would be for Adobe to step forward and provide some example 
code or assist community leaders in doing so, but so far we've gotten 
loads of lip service from various parties but no actual help.  So the 
ownership of the code isn't so much an issue for me personally, but 
more for the eLearning community that would like to use this tool but 
so far has been stymied by lack of a clearly documented path on how 
to do so.  

-Amy



[flexcoders] Re: Finding the last day of the month

2008-06-11 Thread Amy
--- In flexcoders@yahoogroups.com, Indra Prastha <[EMAIL PROTECTED]> 
wrote:
>
> Hi,
> 
> I used to work with Coldfusion where they have this function like
> DaysInMonth(date), to obtain the last day of the month (31 / 30, or 
28 /
> 29 for feb / leap year)
> ,and it's very handy, is there anyway I could achieve the same 
function
> in Flex?

You might find this useful

http://flexdiary.blogspot.com/2008/05/working-with-dates-in-as3.html



[flexcoders] Re: OOP and Work for Hire

2008-06-11 Thread Amy
--- In flexcoders@yahoogroups.com, <[EMAIL PROTECTED]> wrote:
>
> Maybe. If said tools and techniques are uncovered while being paid to 
accomplish this "floor re-finishing", then No they do not have any 
legal right to re-use it. In reality, will folks re-use/re-purpose what 
they've done? Absolutely but they have no legal right to it and by 
taking such actions they are placing themselves (albeit how greatly 
some people like to argue about) in peril of legal proceedings against 
them. How often would that happen? More often then people might 
realize. 

Then if that is the case experienced coders (and laborers) should make 
the same as new coders, since you wouldn't be able to ever grow and 
progress.  Oddly, companies that have these sorts of agreements are 
usually very willing to pay pretty well for expertise ;-).



[flexcoders] Re: OOP and Work for Hire

2008-06-11 Thread Amy
--- In flexcoders@yahoogroups.com, "Doug McCune" <[EMAIL PROTECTED]> wrote:
>
> Typed code is what you are paid to deliver. That is what the client 
is
> buying. When the client pays you you are selling those digital 
lines of
> code.
> 
> I just wrote a book for wiley. I cannot copy and paste any of the 
prose that
> I wrote and post it on my blog. It belongs to wiley. I sold it to 
them (for
> almost nothing, but that's beside the point). Yes, I can take the 
knowledge
> I gained while writing that book and write completely new tutorials 
that I
> post on my blog (although a non-compete prohibits me from writing a
> competitive book). But the instant I copy and paste something I am 
breaking
> the legal contract that I signed.
> 
> The original question was about taking the exact code that was 
created for
> one client and using it in another project (either for a client or 
as open
> source code for the community). I don't think there's much of a 
legal gray
> area here. Yes, everyone agrees that the knowledge and techniques 
that you
> gain while writing code are yours and can often be used in other 
projects.
> But that is not at all the same as saying it's ok to copy a class 
or chunks
> of code verbatim.

Actually, the question was about signing a work for hire agreement 
and what other options there might be.  It looks like the client is 
open to negotiation on this issue.  After all, the client has already 
benefitted from code that I've shared with the community.  

Interestingly, the code I shared was created specifically for the 
presentation they attended.  The client I have done most of my Flex 
work for doesn't really care about sharing snippits so long as I 
don't hand over his whole system. But the code I did for him was too 
detailed and specific for the top level view I was giving in 70 
minutes.

It may be that I never share, for instance, the exact VO that I use 
for driving a multiple choice question.  But I'd like to know that if 
I want to base example code on stuff I do for this client that I 
don't put myself in legal jeopardy.

-Amy



[flexcoders] Re: OOP and Work for Hire

2008-06-11 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> --- In flexcoders@yahoogroups.com,  wrote:
> >
> > Amy - that would be a breach of confidentiality in the legal and 
> business world. You can not share information like that when a 
> company is paying you to develop/code that information, unless it 
is 
> specifically called out in any agreements. I suspect that the 
company 
> looking to hire you for this project is also looking to obtain a 
> competitive advantage, soyour sharing of information outside of 
> the employing company would be counter to their desired end game
> 
> eLearning isn't usually about competitive advantages.  I suspect 
that 
> the whole work for hire thing is because they also _do_ have some 
> business critical code that they contract out.  But in general the 
> only reason businesses care _how_ eLearning is coded is based on 
how 
> that affects code.

Oops, I meant how that affects COST.  :-)



[flexcoders] Re: OOP and Work for Hire

2008-06-11 Thread Amy
--- In flexcoders@yahoogroups.com, "Doug McCune" <[EMAIL PROTECTED]> wrote:
>
> What if you spin it as a PR opportunity for the company, and ask to 
be able
> to use the code you write as the basis for explanatory tutorials, 
without
> giving away any company-specific trade secrets, and give credit to 
the
> company for contributing the code? Could be a win-win for everyone 
involved.
> You get to blaze the path for other eLearning developers, the 
client company
> gets to be seen as open and contributing back to the community, 
they get
> their name out in the blogopshere a bit with a positive spin.
> 
> But get that in writing, otherwise I'd say you'll have to do the 
project,
> then write whatever tutorials you want to do from scratch. Depends 
on the
> company of course and how willing they'd be to do something like 
that, most
> large companies I've dealt with are simply too beuracratic to ever 
deviate
> from the standard agreements the lawyers drafted up. It often 
doesn't matter
> what your argument is, the lawyers wrote an agreement and that's 
the only
> one they'll ever get you to sign.

My fear is that if I were to sign the agreement as is even if I write 
tutorials from scratch the techniques might be inspired by things I 
did for them and they might decide to sue me.  That could be a 
problem, as it is a big company ;-).

But it looks like they're willing to negotiate on this, and so I 
think we're ok.

-Amy



[flexcoders] Extra pixels on right side of TileList.

2008-06-12 Thread Amy
Hi, all;

I have the following MXML code













For some reason, the TileList has about 5 pixels on the right hand 
side of the last column of item renderers.  I've uploaded a picture 
of the result here 
http://www.magnoliamultimedia.com/flexissue/TileListCapture.jpg.

Note that I gave everything a garish color so it was clear what 
container was where.  If anyone has any ideas of how to get rid of 
those pixels, I'd be grateful.

TIA;

Amy



[flexcoders] Re: Extra pixels on right side of TileList.

2008-06-12 Thread Amy
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> How are you trying to get the size to be an integer number of tiles?

I'm letting Flex handle that, just as I would if I were working in HTML 
and using a table.  It's sizing the TileList, and my expectation was 
that it would size it snugly around the content.

> You might need paddingRight=0 on VBox or HBox?

I tried that already.  The padding is inside the TileList.  The 
TileList is the only thing that is that purple color.  If I add padding 
to the vbox, you can see that there are empty pixels to the right of 
the TileList AND the TabBar.
 
> If you break in SystemManager.mouseDownHandler, the event.target 
should
> be the container or control that owns the pixels you clicked on.

I added a click handler on the TileList as a shortcut to this.  The 
target is the ListBaseContentHolder with the parent id = "calendarDays".



[flexcoders] Re: Extra pixels on right side of TileList.

2008-06-13 Thread Amy
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> MXML is not HTML.  I don't remember seeing a specification of
> columnCount or width of the TileList in pixels.  You could be seeing
> round-off error or simply that the computed width of the tile doesn't
> fully cover the TL.

The columncount is 7.  Would tweaking the size of the itemrenderer help?



[flexcoders] Re: Using Flex as a Flash IDE

2008-06-13 Thread Amy
--- In flexcoders@yahoogroups.com, "aphexyuri" <[EMAIL PROTECTED]> wrote:
>
> With all due respect, even the guys at Adobe should look long and hard
> at FlashDevelop.
> I've been using it to code flash projects for a while, and it's
> amazing how it boosts productivity. Code hinting, class inspection and
> great code completion...enjoy ;)

Is there any documentation on how to use it with Flex?  I couldn't find 
any.

Thanks;

Amy



[flexcoders] Re: tilelist and transitions

2008-06-13 Thread Amy
--- In flexcoders@yahoogroups.com, "giopaia" <[EMAIL PROTECTED]> wrote:
>
> I have created a series of states
> with a simple move transition between them...
> 
> All worked fine until I added a tilelist as child 
> of one of the states. Now the move transition 
> doesn't start until the tilelist is initialized...
> 
> Tried also to separate the addchildaction of the tilelist
> using a sequence and trying to trigger the addchild action
> before or after the move...
> 
> 
>  target="{the_tileList}" />
> 
> 
> 
> 
> 
> 
> BUT clearly the only thing that
> it's moved backward or forward in time it's the actual
> action of adding the child, not the initialization of it...
> So... the freezing still occurs... 
> 
> Any idea how to avoid the freezing problem?

Have you tried setting includeInLayout to false on the TileList until 
after the transition is finished?

HTH;

Amy



[flexcoders] Re: Extra pixels on right side of TileList.

2008-06-13 Thread Amy
--- In flexcoders@yahoogroups.com, "Troy Gilbert" <[EMAIL PROTECTED]> 
wrote:
>
> I'm not sure if it applies in this case, but TileList definitely has
> some bugs in its measuring and layout code (or at least did in Flex 2
> -- not sure if they fixed it). In particular, when calculating its
> preferred width it basically does (itemRenderer.width + horizontalGap)
> * numColumns. That's one extra horizontalGap in there... possible the
> extra space you're seeing on the end?
> 
> In several pixel-perfect layouts I've had to actually *not* use
> TileList because of the bug... though at the time I wasn't aware of
> the technique of monkey-patching (where if you create a class in the
> project that matches a class in the SDK the project class overwrites
> it), which would eliminate the need to modify the SDK source (which I
> generally avoid).

I couldn't find a horizontalGap property on TileList, and trying to 
manually add a tag when the code hinting said no just resulted in a 
compiler error.

Could you tell me a bit more about monkey patching?  Where does the 
file need to be, and how do you get it to be picked up as if it were in 
the mx namespace?

Thanks;

Amy



[flexcoders] Re: Extra pixels on right side of TileList.

2008-06-13 Thread Amy
--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Hi Amy,
> 
> Just a thought, but what happens if you take width="100%" off of the
> tile list, or set the width and columnWidth to explicit values?  Does
> the extra space still show up?  And, did you try Alex's suggestion to
> add paddingRight="0" to the tile list?  Because of the bindings and
> itemRenderers, its not possible to fiddle with your example directly. 
> Oh, and you might want to take out the extra period on the right side 
of
> the screenshot link. :)

paddingLeft and paddingRight are ignored.  I tried setting them to some 
really high number just to see, and nothing happened.

When I take off the 100%, it is a lot smaller on the left hand side of 
the screen (not using the full width of the tabBar).  But one of the 
reasons I like Flex is because it has the capability of liquid layouts 
similar to HTML.  I guess I should be thankful that Flex automatically 
got that close, even though the native size of the itemRenderer is 
smaller...

How do most people handle this sort of problem?

-Amy



[flexcoders] Re: Trying to call a function in a Flex object from JavaScript before it's ready.

2008-06-13 Thread Amy
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The JS should be ready before Flash, so I'd make sure there's a 
function
> in JS that Flash will call via EI when it is ready.  
ApplicationComplete
> event would be a good time to call out to JS.
> 

More specifically, he should have a function that looks something 
like this:

handleCreationComplete():void{
ExternalInterface.call('yourStartedJSFunction', true);
}

The Application's creationComplete event should be set to call this.

HTH;

Amy



[flexcoders] Re: Extra pixels on right side of TileList.

2008-06-14 Thread Amy
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> By debugging a simple test case.  Can you make one and post it?

I managed to managed to get an acceptable look by setting the TileList 
to 99% and putting a 1 px spacer on the bottom of the Vbox so it has 
the same visual space all the way around.

-Amy



[flexcoders] Re: tilelist and transitions

2008-06-14 Thread Amy
--- In flexcoders@yahoogroups.com, "giopaia" <[EMAIL PROTECTED]> wrote:
>
> --- In flexcoders@yahoogroups.com, "Amy"  wrote:

> > > Any idea how to avoid the freezing problem?
> > 
> > Have you tried setting includeInLayout to false on the TileList 
until 
> > after the transition is finished?
> > 
> > HTH;
> > 
> > Amy
> >
> 
> 
> In this way I'm obliged to create all instances of the tilelists
> before entering the states they are part of...
> and it is a bit too much in terms of things to download...
> but for now it works... and really well, the movement now it's 
smooth.
> When I have time I'll try to dive into it to optimize it.

I would think if you don't specify the dataProvider or itemRenderer 
of the TileList until you're ready to use the TileList, it shouldn't 
be that expensive to create.

HTH;

Amy



[flexcoders] Re: 'Pointer' in actionscript?

2008-06-16 Thread Amy
--- In flexcoders@yahoogroups.com, "fb6668" <[EMAIL PROTECTED]> wrote:
>
> Hi.
> I have a custom component which uses data from my modellocator.
> Depending on the way this component is called depends where abouts
> this data comes from,
> 
> ie:
> 
> private var _itemLocation:Object;
> [Bindable]
> protected function get itemLocation():Object
> {
>   if(isAssets)
>   _itemLocation = model.factfind.assets;
>   else
>   _itemLocation = model.factfind.liabilities;
>   
>   return _itemLocation;
> }
> 
> protected function set itemLocation(value:Object):void
> {
>   _itemLocation = value;
> }

You may want to try some combination of the following:

1) Do the setting in the setter tather than the getter
2) Type itemLocation as ArrayCollection rather than Object
3) Use BindingUtils to set up a binding as shown in this example 
http://www.returnundefined.com/2006/11/creating-truly-reusable-
renderers-with-classfactory

HTH;

Amy



[flexcoders] Re: Splitting FlexCoders in smaller, focused groups

2008-06-17 Thread Amy
--- In flexcoders@yahoogroups.com, "Michael Schmalle" 
<[EMAIL PROTECTED]> wrote:
>
> > no matter how hopeless rudely the question is put.
> 
> Subject :: NED helllp plzz
> 
> I didn't even talk to my mom like that. ;-)
> 
> I know there are hundreds of cultures out there but common, isn't 
this about
> simple and respectful language protocol?

How bout people starting to trim their messages...?



[flexcoders] Re: Example of HTTPService.

2008-06-17 Thread Amy
--- In flexcoders@yahoogroups.com, "Fidel Viegas" <[EMAIL PROTECTED]> 
wrote:
>
> Hi Harshal,
> 
> Have a look at the documenation. You have some examples. Or just
> search on google. There are plenty of examples on the net.

I found this in a quick search at Adobe.com

http://www.adobe.com/devnet/flex/quickstart/httpservice/



[flexcoders] Re: Splitting FlexCoders in smaller, focused groups

2008-06-17 Thread Amy
--- In flexcoders@yahoogroups.com, "Michael Schmalle" 
<[EMAIL PROTECTED]> wrote:
>
> > How bout people starting to trim their messages...?
> 
> heh, yeah well that one has been asked before, I'm guilty due to 
trying to
> get other things done in the day.
> 
> Gmail doesn't make it easy since the 'hide quoted text' is always 
collapsed.
> 
> But really, I could care less about trimmed messages, it's what we are
> talking about that matters.

Why complain about the netiquette of others if you're not actually 
interested in following netiquette yourself?  You don't care about 
trimming netiquette, some users don't care about using ridiculous 
subjects, some users don't know where to search before asking seemingly 
stupid questions.  What do you see as being the difference?



[flexcoders] Oversized label

2008-06-17 Thread Amy
I have a label (inside an itemRenderer being used for a List) whose 
styling and text are set dynamically.  For some reason, the label 
reports itself as being over 700 px wide, even though its textWidth is 
only 60 px or so.  Any idea what could cause such a huge disparity 
between these two numbers?

Thanks;

Amy



[flexcoders] Re: Oversized label

2008-06-17 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> I have a label (inside an itemRenderer being used for a List) whose 
> styling and text are set dynamically.  For some reason, the label 
> reports itself as being over 700 px wide, even though its textWidth 
is 
> only 60 px or so.  Any idea what could cause such a huge disparity 
> between these two numbers?

Nevermind.  Sorted.



[flexcoders] Re: Restrict the number of records viewable in a managed arraycollection

2008-06-18 Thread Amy
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> In the result handler, just select the desired items, and assign them 
to
> the DG.dataProvider.

You could also use a filterFunction on the ArrayCollection if you have 
anything in the record object that identifies the row number.

HTH;

Amy



[flexcoders] Re: Splitting FlexCoders in smaller, focused groups

2008-06-18 Thread Amy
--- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> That's a really useful thing, why isn't it pimped here more often? 
I've been
> here 10 months, and I'd never heard of it before that Brazilian fellow
> (sorry I forgot your name dude) mentioned it in the original thread 
earlier
> today...

Because some people find that this makes the results less useful rather 
than more useful.  If you're trying to search within LiveDocs and you 
get the whole world, it's a pain.



[flexcoders] Re: string to actual actionscript code?

2008-06-19 Thread Amy
--- In flexcoders@yahoogroups.com, David Pariente <[EMAIL PROTECTED]> 
wrote:
>
> Wow, that answer will really help me! :)
> 
> What if it's not movies, but some other object that i wanna create 
20 times?
> I thought it should get inside some kind of Array, but not sure if 
its this way too.
> 
> i.e. 
> 
> var MyTextBox:TextBox=new textBox();
> 
> what if i need N instances of that MyTextBox? Should i create an 
Array before that? What's the right way to put those  textBoxes into 
the  Array?
> 
> I'm sorry for the basic of my questionbut im quite new to AS3 
and OOP, and i did use and misuse of evals a lot in AS1 and AS2.
> 
> Thanx a lot for the help :)

If you use a repeater, this will happen automatically:




will give you an array of TextBoxes that you can access with

MyTextBox[0] - MyTextbox[n], where n is the number of items in your 
data source.

You can also do this manually

var MyTextBox:Array;

for (i=0;i<=numLoops;i++){
   MyTextBox.push(new TextBox());
}

You'd refer to them the same as above.

HTH;

Amy



[flexcoders] Re: Need Source code for Character Limit for TextArea....

2008-06-20 Thread Amy
--- In flexcoders@yahoogroups.com, "Doug McCune" <[EMAIL PROTECTED]> wrote:
>
> Posting twice, demanding source code for a solution, and telling us
> you need it ASAP isn't going to do much besides piss people off. We're
> not here to do your work. If you're in over your head and are going to
> miss your deadline because you committed to developing with a
> technology you haven't learned then this is the wrong place to look
> for someone to bail you out.
> 
> Sorry for the rant, as we've been discussing on this list lately there
> have been more and more questions like this. I certainly don't want to
> come off as being condescending or arrogant, but saying "give me
> source code, I need it now for my deadline" gets me a little riled up
> :)

I interpreted it that he wanted to know where in the Framework to look 
for this functionality so he can learn from the example...



[flexcoders] Re: Repeater items with two states and dataProvider binding resetting state

2008-06-20 Thread Amy
--- In flexcoders@yahoogroups.com, "dave_defusion" <[EMAIL PROTECTED]> 
wrote:
>
> I have a Repeater which is repeating an item with two states (an open
> state and a closed state), when I open one one of the items I then
> load some extra data in.
> 
> When the extra data is loaded the item in the data provider (an array
> collection) is replaced - that way everything is updated via the 
bindings.
> 
> The problem I have is that when the array collection binding fires the
> Repeater recreates/refreshes each of the items so any that were open
> close, which is, of course, not what I want.
> 
> I'll probably have to code this all up myself without using the
> Repeater, but I wondered if anyone else had any thoughts before I
> start down that path.

One thing that can help in this kind of situation is not to bind, but 
to explicitly set the dataProvider.



[flexcoders] Re: Repeater items with two states and dataProvider binding resetting state

2008-06-22 Thread Amy
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> So, within a repeated component, you are modifying the underlying
> dataProvider item?
> 
>  
> 
> You can probably find a way to update the DP without triggering the
> update events.
> 
>  
> 
> If the DP is an ArrayCollection, then just setting a property value 
on
> the item should not cause the repeater to re-render.  (This is the 
case
> where you need to call itemUpdated() to force the refresh.)
> 
>  
> 
> Amy's suggestion is sound.  If you do not bind to the dataProvider, 
but
> rather assign the Repeater.dataProvider explicitly, then no changes 
to
> the DP will automatically cause the Repeater to re-render.

My experience is that whenever the ArrayCollection's source changes, 
the repeater will update, but there doesn't seem to be so much of a 
cascading ripple effect--when you bind it seems to me like it 
refreshes way more times.  So if you don't bind, the refresh might 
not be as visible.

HTH;

Amy



[flexcoders] Re: Is an event dispatched when an AIR app is closing?

2008-06-22 Thread Amy
--- In flexcoders@yahoogroups.com, "Daniel Gold" <[EMAIL PROTECTED]> 
wrote:
>
> Nevermind. Didn't find it right away because my AIR app is based off
> mx:Application and is chromeless, but I can listen for 
the "closing" event
> on the main Window I spawn and cache the data there.
> 
> On Sun, Jun 22, 2008 at 12:31 AM, Daniel Gold <[EMAIL PROTECTED]> 
wrote:
> 
> > I'm working on an online/offline AIR app and was wondering if 
there was any
> > way to detect that an AIR app is closing so I can cache my data 
models? If
> > the user closes the app while online and then opens it later 
offline, I'd
> > like them to have access to the last data set. I could achieve 
this by
> > constantly mirroring the remote data but was hoping to avoid that 
since the
> > majority of the time the users will be online and it won't be 
necessary.

Even though it is tempting to use Application instead of 
WindowedApplication because of the lack of documentation on how to 
make WindowedApplication chromeless 
(http://flexdiary.blogspot.com/2007/07/application-vs-
windowedapplication.html), if you read the first comment to this post 
http://technoracle.blogspot.com/2007/07/air-apple-shaped-
application.html, you will see that it is actually possible to use 
WindowedApplication with this in AIR as was intended.  I thing you're 
probably better off using AIR as Adobe designed it if a workaround is 
avaialable instead of using a hack like the wrong tag.

HTH;

Amy



[flexcoders] Re: Here's a great idea for flex 4 - simple color pallette utility

2008-06-24 Thread Amy
--- In flexcoders@yahoogroups.com, "Doug McCune" <[EMAIL PROTECTED]> wrote:
>
> I'd vote for this too, especially if it was something that came up in 
the
> IDE as part of the code hinting for color style tags.

I'd like to see a color picker with swatches like you see in other 
tools.  The continuous tone color picker Flex has means you wind up 
with colors like #ACF2C1.

-Amy



[flexcoders] Re: - CDATA without the whitespace mangling?

2008-06-24 Thread Amy
--- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
> 
> Is it possible to do use
> 
> 

[flexcoders] Re: Here's a great idea for flex 4 - simple color pallette utility

2008-06-24 Thread Amy
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]> 
wrote:
>
> On Tuesday 24 Jun 2008, Amy wrote:
> > I'd like to see a color picker with swatches like you see in other
> > tools.  The continuous tone color picker Flex has means you wind up
> > with colors like #ACF2C1.
> 
> I just use the Style Explorer web site.

You're right, Tom.  How could I not see how user friendly it is to need 
to go out to other tools for basic functionality?  

;-)



[flexcoders] Re: - CDATA without the whitespace mangling?

2008-06-24 Thread Amy
--- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> Ah, what I was looking for was condenseWhite="true" :)
> 
> Cheers!

Glad you found it :-)



[flexcoders] ViewStack sizing problem

2008-06-24 Thread Amy
I have a ViewStack that contains a TileList and some other components 
that have a variable number of children and thus a variable height.  
It seems that the ViewStack decides how big it will be before all the 
children are finished sizing.

I've tried adding logic in my override to commitProperties, 
updateDisplayList, and measure that set the height of the ViewStack 
directly based on the height (and I've also tried measuredHeight) of 
the VBox I have in the first child of the ViewStack.  I've also tried 
setting a bindable variable in these places that sets the height and 
binding to that.

My results are this:

commitProperties--never gets to the full height
updateDisplayList--stalls out (infinite loop?)
measure--stalls out (infinite loop?) with bound variable, never 
reaches full height with setting the property directly

Is there any way to use a ViewStack to simply change out the view 
without _having_ any height?  Alternatively, is there a way to 
persuade it to wait until the children are sized to decide how big it 
is or to look at the size again when the children are done sizing?

Thanks;

Amy





[flexcoders] Re: ViewStack sizing problem

2008-06-24 Thread Amy
--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Hi Amy,
> 
> Try setting resizeToContent="true" on the ViewStack tag.

ever have one of those "duh" moments?



[flexcoders] Re: help me

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, Kumaran Raj <[EMAIL PROTECTED]> wrote:
>
> in my project remote java object return xml as string than i convert 
it into xml than bind it to the datagrid  it didn't loaded.any one can 
help me plzz
>

Did you ever notice that the word "please" actually needs fewer 
keystrokes than the letters "plzz", which don't form a 
word?  Granted, most of them are the same key, but still...



[flexcoders] uint unset value

2008-06-25 Thread Amy
I am working on styling a component, and I need to react to something 
where a color isn't set or is set to null.  I get a compiler error when 
I check for

if (!(_myColor==null)){
  //do something
}else{
  //do another thing
}

I can't be the first person to need to do this, but I don't see 
anything in the docs about it.

Thanks;

Amy



[flexcoders] Styling AdvancedDataGridItemRenderer

2008-06-25 Thread Amy
I'm trying to extend AdvancedDataGridItemRenderer to allow the 
styleFunction to set both the backgroundColor and the alpha of the 
item in.  I've used a combination of the custom style example in the 
docs and the example here http://flexpearls.blogspot.com/2008/02/row-
background-color-in.html.  The problem I'm having is that it doesn't 
matter what you set the alpha property to, it doesn't affect the 
visual appearance of the component.

I tried using the graphics object to draw the box, but it seems like 
the base component doesn't support this.  If anyone has any ideas, 
please share.

Does anyone else have the problem where if you want to do anything 
whatsoever in Flex you wind up having to roll your own version, and 
then none of the pieces work exactly the way they're documented?  
Some days I feel like even the simplest task is amazingly hard in 
Flex.


Thanks;

-Amy



[flexcoders] Re: uint unset value

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, "Michael Schmalle" 
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> try using isNaN()
> 
> if (isNaN(_myColor)){
> //do something when NaN
> }else{
> //do another thing when is a color
> }

I actually wound up just comparing straight to the getStyle() result 
and comparing that to undefined, since that's what it is when it 
isn't set.  I haven't been able to find any examples that show 
different ways of dealing with keywords, etc., so I figured that was 
the safest way.

And thanks :-)

-Amy



[flexcoders] Re: Dynamically creating instances of custom components

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, "Michael Schmalle" 
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> If I am understanding you correctly, an MXML component is a class 
in itself.
> 
> So if you have a mxml component named MyCustomComponent.mxml, you 
would do
> this when create the dynamic UI;
> 
> var child:MyCustomComponent = new MyCustomComponent();
> .. initialize
> 
> container.addChild(child);
> 
> You can expand greatly on this but, you might be missing that the 
mxml file
> is converted into a actionscript class when it gets compiled.


You might also be able to use a repeater.

HTH;

Amy



[flexcoders] Re: uint unset value

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> If you've typed _myColor as uint, it can't store either null or NaN. 
If
> it needs to store null, make it Object. If it needs to store NaN, make
> it Number.

So when I see examples that show using uint for color data, that's 
wrong if I need to distinguish between black and not set, because uint 
isn't capable of making that distinction.  Correct?

Thanks;

Amy



[flexcoders] Re: uint unset value

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> That's correct.
> 
>  
> 
> Gordon Smith
> 
> Adobe Flex SDK Team
...
> So when I see examples that show using uint for color data, that's 
> wrong if I need to distinguish between black and not set, because 
uint 
> isn't capable of making that distinction. Correct?
> 
> Thanks;
> 
> Amy

I'm going through the UITextField code, looking to see why the f* 
AdvancedDataGridItemRenderer is so hard to style in the normal ways, 
and it looks like in that, they check it against 
StyleManager.NOT_A_COLOR, but use the uint type.  I'm not sure how 
they account for keywords, but presumably StyleManager works it 
out...?

Thanks;

Amy



[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to extend AdvancedDataGridItemRenderer to allow the 
> styleFunction to set both the backgroundColor and the alpha of the 
> item in.  I've used a combination of the custom style example in 
the 
> docs and the example here 
http://flexpearls.blogspot.com/2008/02/row-
> background-color-in.html.  The problem I'm having is that it 
doesn't 
> matter what you set the alpha property to, it doesn't affect the 
> visual appearance of the component.
> 
> I tried using the graphics object to draw the box, but it seems 
like 
> the base component doesn't support this.  If anyone has any ideas, 
> please share.

OK, I think if I could somehow add a sprite to the component, I could 
make this work, but instead of addChild, it has AddChild, which shows 
three arguments in code hinting but throws a compiler error if I give 
it more than one.  If I give it a sprite as the one argument, it 
gives me a runtime error.

I can't look to see where it is drawing the background in, because 
that's in one of the Flash classes.  It doesn't look like those are 
included in the source that comes with FB3.

Anyone?  Anyone?  Buehler?



[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-25 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> --- In flexcoders@yahoogroups.com, "Amy"  wrote:
> >
> > I'm trying to extend AdvancedDataGridItemRenderer to allow the 
> > styleFunction to set both the backgroundColor and the alpha of 
the 
> > item in.  I've used a combination of the custom style example in 
> the 
> > docs and the example here 
> http://flexpearls.blogspot.com/2008/02/row-
> > background-color-in.html.  The problem I'm having is that it 
> doesn't 
> > matter what you set the alpha property to, it doesn't affect the 
> > visual appearance of the component.
> > 
> > I tried using the graphics object to draw the box, but it seems 
> like 
> > the base component doesn't support this.  If anyone has any 
ideas, 
> > please share.
> 
> OK, I think if I could somehow add a sprite to the component, I 
could 
> make this work, but instead of addChild, it has AddChild, which 
shows 
> three arguments in code hinting but throws a compiler error if I 
give 
> it more than one.  If I give it a sprite as the one argument, it 
> gives me a runtime error.
> 
> I can't look to see where it is drawing the background in, because 
> that's in one of the Flash classes.  It doesn't look like those are 
> included in the source that comes with FB3.
> 
> Anyone?  Anyone?  Buehler?
>

OK, I've tried the following code, but despite the fact that the 
alphaMultiplier is set properly, the background transparency isn't 
changing.  That's probably a good thing, since it would probably make 
the text semitransparent as well, but I am not sure how to get hold 
of just the background.

My styleFunction is just setting the background color for now, so 
getStyle is returning the default .5

Here's the code:

1package com.magnoliamultimedia.views
2{
3   import flash.geom.ColorTransform;
4   import flash.geom.Transform;
5   
6   import 
mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer;
7   import mx.styles.CSSStyleDeclaration;
8   import mx.styles.StyleManager;
9
10  [Style(name="backgroundColor", format="Color", inherit="no")] 
11  [Style(name="alpha", type="int", format="Number", 
inherit="yes")] 
12  public class ADGItemRendererPatch extends 
AdvancedDataGridItemRenderer
13  {
14  
15  //this gets the styles ready to go for any instance 
of this class
16  private static var hasTypeSelector:Boolean = 
classConstruct();
17  
18  //Define the flag to indicate that a style property 
changed.
19private var _StylePropChanged:Boolean = true;
20  
21  private var 
_backgroundColor:uint=StyleManager.NOT_A_COLOR;
22  
23  //construtor
24  public function ADGItemRendererPatch()
25  {
26  super();
27  }
28  
29  
30  
31// Define a static method.
32private static function classConstruct():Boolean {
33if (!StyleManager.getStyleDeclaration
('ADGItemRendererPatch'))
34{
35// If there is no CSS definition for 
StyledRectangle, 
36// then create one and set the default value.
37var myStyles:CSSStyleDeclaration = new 
CSSStyleDeclaration();
38myStyles.defaultFactory = function():void
39{
40  //default green background
41this.backGroundColor = 0x33FF33;
42this.alpha = .5;
43}
44StyleManager.setStyleDeclaration
("ADGItemRendererPatch", myStyles, true);
45return false; 
46}
47  return true;
48}
49/* ###
50 OVERRIDDEN INHERITED FUNCTIONALITY
51 ## */
52  //detect changes in the new style.
53override public function styleChanged
(styleProp:String):void {
54
55super.styleChanged(styleProp);
56
57// Check to see if style changed. 
58if (styleProp=="backgroundColor" || styleProp=="alpha") 
59{
60_StylePropChanged=true; 
61invalidateDisplayList();
62return;
63}
64}
65override public function validateProperties():void{
66  super.validateProperties();
67  //use any typeSelector that might be defined
68  if (hasTypeSelector){
69  this.styleName = th

[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-26 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to extend AdvancedDataGridItemRenderer to allow the 
> styleFunction to set both the backgroundColor and the alpha of the 
> item in.  I've used a combination of the custom style example in 
the 
> docs and the example here 
http://flexpearls.blogspot.com/2008/02/row-
> background-color-in.html.  The problem I'm having is that it 
doesn't 
> matter what you set the alpha property to, it doesn't affect the 
> visual appearance of the component.
> 
> I tried using the graphics object to draw the box, but it seems 
like 
> the base component doesn't support this.  If anyone has any ideas, 
> please share.

I suppose I should feel flattered that I've asked a question that is 
so hard that no one here can answer it.  Let me try again...maybe 
someone knows the answer to just this piece of it and if I know that 
I can perhaps find a fix:  Why is it that setting the alpha property 
on the component does not modify the visual appearance of this class?

I've really tried to figure this out myself, but the inheritance 
trail disappears into the Flash classes, and I haven't been able to 
find the source of those.

Thanks!

Amy



[flexcoders] Re: Repeater not repeating

2008-06-26 Thread Amy
--- In flexcoders@yahoogroups.com, "Tom McNeer" <[EMAIL PROTECTED]> wrote:
>
> I need to have a repeater iterate over an array, displaying an 
instance of a
> custom component for each iteration.
> 
> However, for testing, I am simply attempting to output a button 
with a
> static label within the repeater.
> 
> Here's the basic code on the repeater:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Setting a breakpoint after the array is populated, I can see that:
> 
> a) the original array (estimate.configArray) is populated with a 
single
> member, a custom ActionScript object. Length is 1, there is an 
object of the
> correct type at position 0.
> b) the array collection with the original array as source 
(configAC) shows
> the same contents.
> c) the dataprovider on the repeater, which is the array collection, 
shows
> the correction contents, an AC with a length of 1.
> d) the currentItem in the repeater shows the correct object from 
the AC.
> 
> Yet the contents of the repeater, which should just be a simple 
button, do
> not display.
> 
> I'm mystified. So I must be missing something simple.

If I were in your place, I'd make a temporary event handler for 
repeatStart, then put a breakpoint there and step through the code, 
inspecting every variable that seems relevant.

HTH;

Amy



[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-26 Thread Amy
--- In flexcoders@yahoogroups.com, "Jonathan Branam" 
<[EMAIL PROTECTED]> wrote:
>
> Hi Amy,
> 
> I'm trying to follow along, but you've asked several questions now!
> 
> Setting the alpha property should work based on a simple test that 
I did. As
> I look at your code, though, I think you have some confusion 
between the
> alpha *property* and an alpha *style*. The alpha property is from 
Flash and
> indeed you cannot see the source to it. It does appear to apply 
correctly to
> Flex components and their skins. However, if you have a style 
called "alpha"
> that does not affect the alpha property (unless you have coded this
> connection).

Which I did.  Just to back up a bit, the goal was to allow the 
styleFunction to set the color and the amount that you could see the 
rollover or selection indicator when the row was colored.  

But nothing I tried actually affected the alpha, until finally I 
changed the blendMode, which allowed the change to be visible, but 
both the text and the background, which wasn't the effect I was 
looking for, especially since it didn't match the 
AdvancedDataGridGroupItemRenderer, which descends from UIComponent 
and behaves sensibly.

> 
> OK. I think I see the problem. ADGItemRenderer extends UITextField 
which is
> not a rendering component. The flexpearls post notes this, but 
doesn't
> really get into the implications. The inheritance tree is: 
UITextField <
> FlexTextField < TextField < InteractiveObject < DisplayObject. 
Therefore, a
> UITextField doesn't have a graphics property (only descendants of 
Shape and
> Sprite do), nor is it a DisplayObjectContainer. This means you 
cannot use
> the drawing API or addChild(). Looking at the livedocs for 
TextField, it
> doesn't appear to support alpha for background, so this is probably 
just not
> possible. 

It actually does, which is why it has an alpha property.  The secret 
is that you either have to embed the font or change the blend mode, 
otherwise it stubbornly refuses to show any changes you make to the 
property.

>If you set the Flash alpha property, it might fade the background,
> but it will also fade the text (if you have it embedded). The alpha 
property
> is almost never used in Flex components. Although I don't know why, 
I would
> steer away from it for that reason.
> 
> I would recommend forgetting about ADGItemRenderer. It is a very 
optimized
> class that only displays text.

And also icons...

> Subclass something else and do your background manipulation there. 
You can
> make a fairly simple subclass of Label that is still pretty 
lightweight and
> supports rowColor and rowAlpha (if you add the drawing yourself).
> 
> This is about as simple as I could get. You should keep all the 
nice code
> you have about initializing styles and all that, of course!
> 
> [Style(name="rowColor")]
> [Style(name="rowAlpha")]
> public class ADGItemRendererBackgroundAlpha extends Label
> {
> override protected function updateDisplayList
(unscaledWidth:Number,
> unscaledHeight:Number):void
> {
> super.updateDisplayList(unscaledWidth, unscaledHeight);
> 
> // Don't get styles this way in real code!
> graphics.beginFill(getStyle("rowColor"), getStyle
("rowAlpha"));
> graphics.drawRect(0,0,unscaledWidth, unscaledHeight);
> 
> textField.setActualSize(unscaledWidth, unscaledHeight);
> }
> 
> }

The problem is that I don't properly understand how it draws the leaf 
icon, so I am reluctant to mess with it too much.  My explorations in 
the source code didn't leave me any the wiser about this.

Ultimately, I abandoned my attempts to gain control over the alpha of 
the background and opted for something that allowed me to see the 
rollover in a reasonably attractive manner--setting blendMode on both 
itemRenderer classes to DARKEN.  I may have to change the mode on 
that once I get the real styleFunction working rather than just a 
placeholder that returns back yellow to everything.  I'll probably 
just add a style that sets the blendMode, so I can adjust it based on 
the color needed.

I wish the docs would point out these limitations so that people can 
estimate time needed to accomplish tasks better.  If you read the 
docs, it sounds like this task should be a walk in the park.

-Amy



[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-26 Thread Amy
--- In flexcoders@yahoogroups.com, "Jonathan Branam" 
<[EMAIL PROTECTED]> wrote:
>
> There are a bunch of comments below, but to sum up, it seems like 
extending
> AdvancedDataGridGroupItemRenderer and drawing a background with the 
graphics
> property will meet all of your needs. I missed the requirement to 
preserve
> leaf icons and such. Is there a reason this doesn't meet your 
needs, because
> you seem to have known this already?

I didn't know that I could use my patched 
AdvancedDataGridGroupItemRenderer as the regular itemRenderer as well 
and have it just work.  I assumed that there are two distinctly and 
yes irritatingly different classes for a reason.

It turns out I am having a problem dynamically setting the icon on 
leaf nodes... when I use an iconFunction, the function returns the 
right thing but it is never drawn (even with changing out the 
itemRenderer).  When I use a groupIconFunction, it only runs for the 
items that are parents.

> 
> [Style(name="rowColor")]
> [Style(name="rowAlpha")]
> public class ADGGroupItemRendererBackgroundAlpha extends
> AdvancedDataGridGroupItemRenderer
> {
> override protected function updateDisplayList
(unscaledWidth:Number,
> unscaledHeight:Number):void
> {
> super.updateDisplayList(unscaledWidth, unscaledHeight);
> 
> graphics.clear();
> // Don't get styles this way in real code!
> //graphics.beginFill(getStyle("rowColor"), getStyle
("rowAlpha"));
> graphics.beginFill(0x5566FF, 0.3);
> graphics.drawRect(0,0,unscaledWidth, unscaledHeight);
> }
> }

That's sort of similar to what I have, I just wasn't using it for the 
regular itemRenderer.
 
> > Which I did. Just to back up a bit, the goal was to allow the
> > styleFunction to set the color and the amount that you could see 
the
> > rollover or selection indicator when the row was colored.
> 
> I guess I missed this. You can set the color already, from the 
flexpearls
> article. Adjusting the rollover or selection indicator is a 
different matter
> altogether.

I didn't want to adjust it, just *see* it :-).

> > But nothing I tried actually affected the alpha, until finally I
> > changed the blendMode, which allowed the change to be visible, but
> > both the text and the background, which wasn't the effect I was
> > looking for, especially since it didn't match the
> > AdvancedDataGridGroupItemRenderer, which descends from UIComponent
> > and behaves sensibly.
> 
> Right. Changing the blendMode alters the way that Flash decides to 
render
> the component. You should find that setting cacheAsBitmap to true 
will have
> the same effect. When you apply a blend to a DisplayObject Flash 
renders it
> to a bitmap internally and then applies the blend to the bitmap. 
Because the
> component is now rendered as a bitmap it will honor the alpha 
property on
> its contents in a way that it would not previously. Actually, I 
couldn't get
> cacheAsBitmap or blendMode to do this to the 
AdvancedDataGridItemRenderer. I
> had to add a filter, which did it immediately. Maybe 
another "feature" of
> TextFields.

It worked fine for me.  Here's a snippet:
if (_StylePropChanged) 
{
_backgroundColor=getStyle('backgroundColor')
if (_backgroundColor!=StyleManager.NOT_A_COLOR){
this.background=true;

this.backgroundColor=_backgroundColor;

this.blendMode=BlendMode.DARKEN
}else{
this.background=false;
this.blendMode=BlendMode.NORMAL;
}
_StylePropChanged=false;
}

> > It actually does, which is why it has an alpha property. The 
secret
> > is that you either have to embed the font or change the blend 
mode,
> > otherwise it stubbornly refuses to show any changes you make to 
the
> > property.
> >
> 
> As explained above, when you cause the component to be rendered as 
a bitmap
> then it will begin to behave differently, such as honoring the alpha
> property when it normally would not, because it is using a non-
embedded
> font. Of course, embedding the font also allows the alpha to be 
set. But, as
> I understood your question, you wanted to change the alpha of just 
the
> background. What I said was that the component does not appear to 
support
> that operation. All DisplayObjects have an alpha property, but text
> components don't honor its setting in the same way.

Sure, but there was no way for me to know what the default behavior 
would be until I could get the alpha working.

> > > I would recommend forgetting about ADGItemRenderer. It is a very
> > optimized
> > > class that only displays text.
> >
> > And also icons...
> >
> > The problem is that I don't properly understand how it draws the 
leaf
> > icon, so I am reluctant to mess with it too much. My explorations 
in
> > the source code didn't l

[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-26 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> --- In flexcoders@yahoogroups.com, "Jonathan Branam" 
>  wrote:
> >
> > There are a bunch of comments below, but to sum up, it seems like 
> extending
> > AdvancedDataGridGroupItemRenderer and drawing a background with 
the 
> graphics
> > property will meet all of your needs. I missed the requirement to 
> preserve
> > leaf icons and such. Is there a reason this doesn't meet your 
> needs, because
> > you seem to have known this already?
> 
> I didn't know that I could use my patched 
> AdvancedDataGridGroupItemRenderer as the regular itemRenderer as 
well 
> and have it just work.  I assumed that there are two distinctly and 
> yes irritatingly different classes for a reason.
> 
> It turns out I am having a problem dynamically setting the icon on 
> leaf nodes... when I use an iconFunction, the function returns the 
> right thing but it is never drawn (even with changing out the 
> itemRenderer).  When I use a groupIconFunction, it only runs for 
the 
> items that are parents.

That, at least, was solved relatively painlessly.  Before I realized 
there were two different classes handling the rendering, I forced the 
first column to my patched regular ADGItemRenderer (because that put 
the color in more rows in that column).  So the only time it used my 
GroupItemRenderer was when it actually was displaying a group, which 
seems to override the hardcoded itemRenderer.



[flexcoders] Re: Styling AdvancedDataGridItemRenderer

2008-06-26 Thread Amy
--- In flexcoders@yahoogroups.com, "Doug McCune" <[EMAIL PROTECTED]> wrote:
>
> As a very general word of warning, I'd advise you to be more 
careful and
> expect more pain when working with the following classes (and all 
associated
> base classes, etc): AdvancedDataGrid, OLAPDataGrid, 
GroupingCollection.
> 
> I'll try to be extremely politically correct here, but I assume 
you'll catch
> my drift... These classes were written by a different part of the 
Flex team,
> in a different part of the world, and they are quite different than 
the
> standard Flex framework code base. They often don't follow the same 
coding
> standards, and in my opinion they are not up to the same quality 
level that
> I have come to expect from the Flex framework. I'll stop at that 
before I
> make too many Adobeans mad at me, but just know that I've learned 
to expect
> a whole new kind of pain when working with those classes.

:-)

But they LOOK like they should be amazingly easy.  And so in she 
sinks .



[flexcoders] Re: Setting unique ID with repeater and custom component

2008-06-27 Thread Amy
--- In flexcoders@yahoogroups.com, "sdl1326" <[EMAIL PROTECTED]> wrote:
>
> I am using the Tile Component along with a repeater and then a custom
> component (image control). Is it possible to give the custom component
> a unique id/name? I have tried to use a variable associated with the
> current repeater item ({repeater.currentItem.name}), however, it does
> not seem that this is possible as I am getting an error that the ID is
> not a valid identifier.
> 
> Thanks for any and all replies.
>

If you have something like this:


   


then you can refer to any repeated component by its index within foo.  
i.e. foo[0] is the first component.  This is pretty thoroughly 
documented in the help for Repeater.

HTH;

Amy



[flexcoders] Getting parent information from AdvancedDataGrid

2008-06-27 Thread Amy
Hi, all;

I have been using AdvancedDataGrid to display information in a 
HierarchicalCollection.  The parent (container) items contain 
information on how the child items should be viewed.  So the same child 
might be in the tree three different types under different parents.  I 
left the view information in the container, since it has nothing to do 
with the actual data contained in the child object.

The problem I am having is that I don't seem to be able to find a way 
to get at that data from the parent data when a user clicks on a child.

Thanks :-)

-Amy



[flexcoders] Re: One custom component referring to another

2008-06-27 Thread Amy
--- In flexcoders@yahoogroups.com, "Jason" <[EMAIL PROTECTED]> wrote:
>
> Thanks Alex and Mike, I was kinda starting to suspect I needed to 
do 
> it that way, even as I was writing the e-mail.  Makes perfect 
sense, 
> I'll do that. Thanks!

It's not best practice, but you absolutely can pass references to 
things outside an object's scope into the object.  I did this with a 
component I wanted to "reparent," i.e. I had a series of components 
duplicated in a Repeater, and when you clicked on one of them, it 
would grab the component I'd passed a reference to and add it to 
itself.  I was doing this to make something that looked like an 
Accordion but could take a dataprovider and recycle the same object 
rather than having multiple copies.

Essentially, you just put a property on the component with type 
UIComponent and push it in through the ClassFactory if it is an 
itemRenderer or you can set it directly if it is not.

If you set up an interface that the component you are referring to 
has to adhere to, you can actually do this without requiring tight 
coupling.  I didn't need to worry about that, because the only thing 
I did was addChild().  However, you may want to consider just having 
the components bound to the same data and have the data push the 
changes.

HTH;

Amy





[flexcoders] Re: Repeater not repeating

2008-06-27 Thread Amy
--- In flexcoders@yahoogroups.com, "Jonathan Branam" 
<[EMAIL PROTECTED]> wrote:
>
> How would you do that, exactly? How could your extended 
ArrayCollection know
> the Array had changed? It's just not possible.

Extend Array as well...?



[flexcoders] Re: Getting parent information from AdvancedDataGrid

2008-06-27 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> Hi, all;
> 
> I have been using AdvancedDataGrid to display information in a 
> HierarchicalCollection.  The parent (container) items contain 
> information on how the child items should be viewed.  So the same 
child 
> might be in the tree three different types under different parents.  
I 
> left the view information in the container, since it has nothing to 
do 
> with the actual data contained in the child object.
> 
> The problem I am having is that I don't seem to be able to find a way 
> to get at that data from the parent data when a user clicks on a 
child.

OK, I got the bright idea that I would composite the existing class 
with a new class that has a uid.  The class looks like this:

package com.magnoliamultimedia.vo
{
import mx.core.IUID;
import mx.utils.UIDUtil;

public class TaskUID implements IUID
{
private var _task:Task;
private var _uid:String;

public function TaskUID(task:Task)
{
_task=task;
_uid:UIDUtil.createUID();
}

public function get uid():String
{
return _uid;
}

public function set uid(value:String):void
{
throw new Error("Can't directly set UID");
}
public function get task():Task{
return _task;
}
}
}

The problem is that as soon as the ADG loads, I get a ton of "Can't 
directly set UID" errors.  I thought Flex was _not supposed_ to set 
UID's on classes that implement IUID?  Note that this is not a visual 
clas, these are typed objects in an ArrayCollection of typed objects 
that have ArrayCollections in them named children 
(HierarchicalCollection).

If Flex is adding a UID to my objects, is there any way I can tease it 
out to use it to determine the parent?

Thanks;

Amy



[flexcoders] Re: Getting parent information from AdvancedDataGrid

2008-06-27 Thread Amy
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Amy, I have a request.  Please consider placing your response above 
the
> history?  You have good stuff to say, but always having to scroll
> through the history is aggravating, and provides no value.

Funny, I find top posting aggravating, as the answer is before the 
question, and then I have to scroll down to find out what it was about, 
then back up to reread what was said in light of the question.

BTW, did you have any insight to my issue?

;-)

Thanks;

Amy



[flexcoders] Re: How to enable the enter key for all buttons onFocus

2008-06-28 Thread Amy
--- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> First a caveat: I's a bad idea. Pressing enter to submit an entire 
form and
> spacebar to click a specific button is a fairly standard UI practice, 
and
> something you shouldn't change without a good reason.

Not sure about what happens in other OS's, but in the vast majority of 
Windows Applications, it is _very_ standard behavior for the button 
that is in focus to activate when the user presses the  key.  
The exception is for checkboxes and radio buttons.



[flexcoders] Re: Getting parent information from AdvancedDataGrid

2008-06-28 Thread Amy
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
 
> Sorry, this thread is one of the ones I am following for my own
> education.  It is beyond my current experience.

I found that my code wasn't adding the UID where I thought it was.  
When the HierarchicalCollection called the UIDUtil class, the UIDUtil 
class saw that my component was an IUID but had a null UID and set a 
UID on it.

This suggests that it should have also been adding a mx_internal_uid 
to my old class that did not implement IUID, but I could never get at 
it.  In retrospect, I'm not really sure how much good it would have 
done for it to do that, since it was always the _same_ instance that 
it would have been added to.  Somewhere in the asdoc comments of one 
of the classes I stepped through to find this was a comment to the 
effect that two references to the identical object shouldn't have 
worked in the first place.

So, in summary, I think that the HierarchicalCollection _can't_ 
handle this situation, because to do so it would have to make the 
same instance different, which is why I needed to do something to 
wrap the same instance in different instances of another class.

Live and learn.  At this rate my head will explode by mid July.

-Amy



[flexcoders] Re: Create border for inner subgrids within a grid - How?

2008-06-29 Thread Amy
--- In flexcoders@yahoogroups.com, "pbrendanc" <[EMAIL PROTECTED]> wrote:
>
> Alex,
> Thanks - I think that approach will require me to build multiple
> subgrids and treat each of these subgrid as a separate griditem - 
thus
> creating additional nesting, rather than 1 large grid. I was hoping 
for 
> to avoid that - is there any other way to accomplish this (I suspect
> not).

Hi, Patrick;

You don't say what your component is, but I'm going to assume it's an 
extended button.  If you extend instead from a component that 
supports 
borderSides as a style (any container), you could try something like 
this:


.topLeft{
borderColor:#00;
borderSides: 'top left';
}
.topRight{
borderColor:#00;
borderSides: 'top right';
}
.bottomLeft{
borderColor:#00;
borderSides: 'bottom left';
}
.bottomRight{
borderColor:#00;
borderSides: 'bottom right';
}


Then, in your script block:

for (var i:Number = 0; i

[flexcoders] Re: A very simple component in AS :(

2008-06-30 Thread Amy
--- In flexcoders@yahoogroups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> It might work, but you really should look into reading some 
tutorials on the
> lifecycle of Flex components. Here's a few brief things:
> 
> * You want to create child components in the createChildren() 
method, not in
> your constructor. Your component may be instantiated long before it 
needs to
> have its children created.
> * Override the measure() function to set measuredWidth and 
measuredHeight,
> but the actual size will be set by your container
> * Override updateDisplaylist() to size and move your child 
components. Get
> their preferred sizes using child.getExplicitOrMeasuredWidth / 
Height in
> measure(), but set them using setActualSize(), not by setting the 
width and
> height. Position them with move()
> * There's a lot of good tutorials out there, google is your 
friend :)

I found it very difficult to find a tutorial that took me from the 
level of understanding where I was asking the kinds of questions the 
OP asked to where I was able to write my own components extending 
UIComponent.  The best one that I have found is this one 
http://weblogs.macromedia.com/pent/archives/2006/07/writing_flex_2.htm
l.

HTH;

Amy



[flexcoders] Re: display text input values in datagrid

2008-07-02 Thread Amy
--- In flexcoders@yahoogroups.com, Santhosh Garlapad 
<[EMAIL PROTECTED]> wrote:
>
> Hi Sean,
> I m working on Shopping cart application.
> I have Button called ADD another Item.If i click on that button the 
all the shopping cart item details shold be displayed in the datagrid.
> Your solution is perfect if i have only one row item in the 
datagrid.If i click Add another items multiple times and alll the 
text input values should be displayed in the datagrid.
> Say i clicked the add another item 20 times ,,the datagrid should 
contains 20 items in that(with textinput values)
> The sample datagrid as follows:

Flex N Training From the Source (where N is the version of Flex you 
are using) walks you through making a shopping cart app.  You might 
find it is a valuable shortcut.

HTH;

Amy



[flexcoders] Re: List displaying wrong information

2008-07-02 Thread Amy
--- In flexcoders@yahoogroups.com, "nathanpdaniel" <[EMAIL PROTECTED]> wrote:
>
> BTW - If I don't use an itemRenderer, it works fine and displays how 
> it should.

Sounds like you're not updating the properties on your itemRenderer 
when the data is changed:

http://blogs.adobe.com/aharui/item_renderers/

http://weblogs.macromedia.com/pent/archives/2008/03/itemrenderers_p.html



[flexcoders] Re: Question about ContextMenu and dataGrid

2008-07-02 Thread Amy
--- In flexcoders@yahoogroups.com, "markgoldin_2000" 
<[EMAIL PROTECTED]> wrote:
>
> I wasn't right, the grid is enabled.
> I have added this to the grid:
> addEventListener("itemFocusIn", itemFocusInHandler);
> 
> itemFocusInHandler does not fire.

How bout itemClick?



[flexcoders] Re: remover water mark from Trial version

2008-07-03 Thread Amy
--- In flexcoders@yahoogroups.com, "Vivian Richard" <[EMAIL PROTECTED]> 
wrote:
>
>Thanks Rick, that would be too much to ask for. I guess
>only JESUS would do that for some one. :-)))

I have a goat named Jesus.  I don't think he knows how to work a 
computer...



[flexcoders] Re: MXML component with multiple controls as an itemRenderer

2008-07-03 Thread Amy
--- In flexcoders@yahoogroups.com, Keith <[EMAIL PROTECTED]> wrote:
>
> *QUESTION:
> Can anyone send a good link explaining how to build a MXML 
component 
> with mulitple input controls
> using it as an itemRenderer in a List?
> 
> **My controls of the list items reset and do not update when I 
scroll  
> them outside the length of the List.*
> *
> 
> 
> EXAMPLE:
> Here is my failed attempt but it shows what I'm trying to do:
> http://tinyurl.com/46rjmk

First you need to understand itemRenderers in general

http://weblogs.macromedia.com/pent/archives/2008/03/itemrenderers_p.ht
ml
http://blogs.adobe.com/aharui/item_renderers/



[flexcoders] Re: override updateDisplayList

2008-07-04 Thread Amy
--- In flexcoders@yahoogroups.com, "markgoldin_2000" 
<[EMAIL PROTECTED]> wrote:
>
> Not sure I understand. Clear() as a function of what? And how do I 
> tell it what's to clear? Sorry, if I am missing something obvious.

The graphics object.  Essentially, that would remove the whole row 
indicator.  Have you ever considered just changing the blend mode on 
the object that is being drawn more recently?



[flexcoders] Re: override updateDisplayList

2008-07-06 Thread Amy
--- In flexcoders@yahoogroups.com, "markgoldin_2000" 
<[EMAIL PROTECTED]> wrote:
>
> Yes, I would prefer doing that, but not sure how. I use this to 
change 
> row color:
> color = 0xFF;
> super.drawRowBackground(s,rowIndex,y,height,color,dataIndex);
> So, how can I blend the color?

This example shows a more complete override of the functionality 
http://infinitearray.com/blog/2007/11/flex-labs-customizing-the-
flex.html

Once you have a direct reference to the graphics object, you can set 
its blend mode.

HTH;

Amy



[flexcoders] Re: Data binding in item renderers

2008-07-06 Thread Amy
--- In flexcoders@yahoogroups.com, "michal.sustr" <[EMAIL PROTECTED]> 
wrote:
>
> Hi,
> 
> I use custom item renderer in hierarchical advanced datagrid. In the
> item renderer, I need some data from the parent node, so in children
> property of dataprovider I set an attribute "id" which refers to the
> "id" of parent node. In the item renderer I just loop the original
> dataprovider and find the node with specified "id" (given through
> children property).
> 
> Now the question is, how to resolve data binding? When I change some
> data in original dataprovider, the item renderer does not show
> immediately the changes, only after parent node is collapsed and
> expanded again.
>

You can cast HierarchicalData to HierarchicalCollectionView for the 
purposes of being able to use getParentIteem().

What are you doing in the itemRenderer that is supposed to be showing 
the change?



[flexcoders] Re: Item renderers cause processor to max out

2008-07-07 Thread Amy
--- In flexcoders@yahoogroups.com, "Tom McNeer" <[EMAIL PROTECTED]> wrote:
>
> Hi Tim,
> 
> Thanks again for your help. But ...
> 
> On Mon, Jul 7, 2008 at 12:03 PM, Tim Hoff <[EMAIL PROTECTED]> wrote:
> 
> >   Ok, that makes sense.  One other thing that might be 
contributing is:
> >>
> >> updateComplete="setGridHeight(event)"
> >>
> >> You might want to try:
> >>
> >> valueCommit="setGridHeight(event)"
> >>
> >
> 
> 
> 
> 
> 
> 
> 
> 
> I removed any call to "setGridHeight" completely, but the loop 
persists.
> 
> Any other thoughts? Anyone?


I know this isn't going to be popular advice, but my experience is 
that the List Base controls do a lot of stuff under the covers that 
is only documented in about 4 peoples' heads.  Unless you're dealing 
with huge data sets, you may find that switching to a repeater saves 
you a lot of headaches.  I have a rule that if I ask on here for 3 
days with no solution, I switch to a repeater, since I am typically 
not working with large data sets.

I think that some of the extra calls you're getting to your function 
are the "invisible" controls that get built for scrolling purposes.

HTH;

Amy



[flexcoders] AdvancedDataGrid rowCount

2008-07-07 Thread Amy
Hi, all;

I open all the nodes on my ADG when it is created.  I'd like to make 
sure there are enough rows to show all the items without scroll bars.  
If I bind rowCount to myADG.dataProvider.length, it gives me enough 
rows to show the _closed_ nodes.  I also tried 
myADG.dataProvideropenNodes().length, but that wasn't anywhere close.  
Is there a simple way to do this, or do I have to write a function that 
goes through and counts?

TIA;

Amy



[flexcoders] Re: AdvancedDataGrid rowCount

2008-07-08 Thread Amy
Bump :-)

--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> Hi, all;
> 
> I open all the nodes on my ADG when it is created.  I'd like to 
make 
> sure there are enough rows to show all the items without scroll 
bars.  
> If I bind rowCount to myADG.dataProvider.length, it gives me enough 
> rows to show the _closed_ nodes.  I also tried 
> myADG.dataProvideropenNodes().length, but that wasn't anywhere 
close.  
> Is there a simple way to do this, or do I have to write a function 
that 
> goes through and counts?
> 
> TIA;
> 
> Amy
>




[flexcoders] Re: Undefined Method Error

2008-07-08 Thread Amy
--- In flexcoders@yahoogroups.com, Adrian Williams <[EMAIL PROTECTED]> 
wrote:
>
> Y'all,
> 
> Here's a frustrating oneI have this function defined:
> 
> public function convertEmailToMailto
(emailAddy:String):String
> {
> var mailtoEmailAddy:String ;
> mailtoEmailAddy = '' 
> + emailAddy + '';
> return mailtoEmailAddy;
> }
> 
> And am referencing it like this:
> 
> 
> 
>  htmlText="{convertEmailToMailto(data.emailAddress)}"/>
> 
> 
> And am getting the error "Call to a possibly undefined method 
> convertEmailToMailto".  It's probably something stupidly simple, 
but I 
> can't seem to see the forest for the trees.  Help anyone?

Why not make this a method on the VO that you're using for your data 
property?

HTH;

Amy



[flexcoders] Re: Undefined Method Error

2008-07-08 Thread Amy
--- In flexcoders@yahoogroups.com, Adrian Williams <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> Thanks for the info!  The outerDocument.methodName worked 
perfectly 
> and the link that was provided was excellent.
> 
> Quick question Amy, forgive my nubeness, what do you mean by "Why 
> not make this a method on the VO that you're using for your data 
property?"

Let's assume your dataProvider is an ArrayCollection, and you're using 
custom Value Objects (VO's) that are strongly typed.  Then you can set 
up something like this:

public function get emailHref():String{
   return '

[flexcoders] Re: AdvancedDataGrid rowCount

2008-07-08 Thread Amy
--- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote:
>
> Hi, all;
> 
> I open all the nodes on my ADG when it is created.  I'd like to 
make 
> sure there are enough rows to show all the items without scroll 
bars.  
> If I bind rowCount to myADG.dataProvider.length, it gives me enough 
> rows to show the _closed_ nodes.  I also tried 
> myADG.dataProvideropenNodes().length, but that wasn't anywhere 
close.  
> Is there a simple way to do this, or do I have to write a function 
that 
> goes through and counts?

It seems that the length DOES reflect the total number of nodes, but 
for some reason I was not able to bind directly to the length of the 
dataprovider.  When I used a separate variable set to the length, it 
worked perfectly.

Thanks all who helped ;-)



[flexcoders] Re: Starting Builder problem

2008-07-08 Thread Amy
--- In flexcoders@yahoogroups.com, "markgoldin_2000" 
<[EMAIL PROTECTED]> wrote:
>
> No, this is not a warning. The release version is not created and 
> here is from the Log:...

> > > I am starting Flex Bulder 3 and it's not going. It says: "Loading 
> > > project ." and a progress bar is not moving. I have waitind 
> for 
> > a 
> > > very long time. Anything I can do to rcover from that?

Did you ever get this solved?  I had a similar problem today and it 
turns out I had a filter on the errors because of some third-party code 
I was using that threw up duplicate variable definition warnings.  
Check to see if you did what I did--set a filter on your errors and 
forget it.

HTH;

Amy



[flexcoders] Re: Starting Builder problem

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "markgoldin_2000" 
<[EMAIL PROTECTED]> wrote:
>
> It started working.
> Filter on errors? What's that?

On the problems pane there's a button that looks like a yellow arrow 
with a smaller blue one above and below it.  If you click that, you can 
set filters on the compiler errors that FB will show you.  Nice when 
you get someone else's code that generates (hopefully harmless) errors, 
but it can make it harder to remove those errors in your own.

I make a habit of looking at the bar down the right side of the FB3 
window for yellow blobs that will at least alert me to errors in the 
focused document.

HTH;

Amy



[flexcoders] Re: DataGrid

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Damn Niraj, this is an old thread. :-)
> 
> Rob said the right things.  To do what you want, will take more than
> just over-riding a method or two.  This is more in the area of
> flexcomponents 
 .  
> Not for the faint of heart, but if you really want to get into that
> level of component development, there's a good place to start.

Couldn't you make something that _looks_ like what he wants with a pair 
of nested repeaters?



[flexcoders] Re: Background Color of AdvancedDataGrid

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "mvbaffa" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> I am trying to change the background color of a row in response to 
a 
> keyboard action. What I am doing is to drive the keyboard event and 
> doing this:
> 
>  adgDatagrid.dataProvider[adgDatagrid.selectedIndex].verified = 
true;
>  adgDatagrid.invalidateList();
> 
> When I call invalidateList the styleFunction defined in my 
> AdvancedDataGrid is activated. This is working OK.
> 
> The styleFunction changes the foreground, because of another 
> condition, perfectly. The problem is when I try to return a 
> background style in the same styleFunction it does not change the 
> backgroundColor. Below is my styleFunction code:
> 
> 
> public function customStyleFunctionstyle(data:Object, 
> col:AdvancedDataGridColumn):Object {
>  try {
>if (data["source"]) return {color:0x008000};
>if (data["verified"]) return {backgroundColor:0x008000};
>  }
>  catch (err:Error) {}
> return null;  
> }
> 
> 
> Can you help me !!!
> 
> Thanks in advance
>
http://flexdiary.blogspot.com/2008/06/musings-on-advanceddatagrid-
part-1.html



[flexcoders] Re: Trouble passing values to a child window

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Andrew Wetmore" <[EMAIL PROTECTED]> 
wrote:
>
> sorry, I should have said below if I DO comment out the two lines 
that are
> currently commented out, the code runs fine

What happens if you use an event listener to detect that the window is 
fully open (maybe creationComplete, possibly update, possibly something 
you dispatch yourself in commitProperties or somewhere), then put those 
two lines in there?

HTH;

Amy



[flexcoders] Re: Background Color of AdvancedDataGrid

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "mvbaffa" <[EMAIL PROTECTED]> wrote:
>
> It worked !!!
> 
> Thank you very much

You're welcome :-)



[flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> OK, I tried this but I get a compiler error - owner (which is a
> DisplayObjectContainer) doesn't have a property owner.

I've used code like this in the past

var myParent:*=owner

while (myParent.className!='ComboBox'){
  //pretty much everything will have either a parent or an owner
  if (!(myParent.owner==null)){
  myParent=myParent.owner;
  }else{
 myParent=myParent.parent;
  }
}

//myParent is a ComboBox if you get to this point

Note that you need to be REALLY sure this will eventually hit a 
ComboBox, or it will result in an endless loop.  You can add in a 
loop counter for safety, and exit after, say, 100 loops in case of a 
failure to find a combobox.

Possibly you could also extend ComboBox to listen to SystemManager 
and redispatch events.  

HTH;

Amy



[flexcoders] Re: Stump the Flex Nerd: Getting reference to the set method of a property

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Charlie Hubbard" 
<[EMAIL PROTECTED]> wrote:
>
> Ok, I think I've got a pretty difficult question here.  I want to 
the setter
> method given a string containing the name of a property.  With 
normal
> methods I can always do something like obj.myFunction to get a 
reference to
> that function, then I can invoke that function with a func.call().  
However,
> if you do obj.someProperty that calls the get method.   I already 
tried obj[
> propertyName ] which returned null so that's out.
> 
> It's almost like you need another language feature.  obj->property= 
and
> obj->property for ( reference to setter and getter of this 
property).

obj['property']= 'foo'

should do it.  Since all setter methods are actually setting 
something, you can't just call the method without providing a value.

HTH;

Amy



[flexcoders] Re: AdvancedDataGridRendererProvider.renderer

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, Brandon Krakowsky <[EMAIL PROTECTED]> 
wrote:
>
> I'm trying to set the "renderer" property of an 
AdvancedDataGridRendererProvider in AS.
> 
> var iconRendererProvider:AdvancedDataGridRendererProvider = new 
AdvancedDataGridRendererProvider;
> iconRendererProvider.columnIndex = 0;
> iconRendererProvider.columnSpan = 1;
> iconRendererProvider.dataField = "icon";
> iconRendererProvider.renderer = myClass;
> 
> myClass extends AdvancedDataGridItemRenderer and overrides the data 
function.
> 
> Here's the error I get:
> 1067: Implicit coercion of a value of type Class to an unrelated 
type mx.core:IFactory.
> 
> I can't seem to figure out how to specify the class.

>From the error, you probably need something more like this:

var iconRendererProvider = new ClassFactory
(AdvancedDataGridRendererProvider);

iconRendererProvider.properties = {columnIndex:0, columnSpan:1, 
dataField:'icon', renderer:com.yourorg.views.myClass}

The help for AdvanceDataGridItemRenderer doesn't appear to exist on 
my system, so sorry if this misses the mark.

HTH;

Amy



[flexcoders] Re: AdvancedDataGridRendererProvider.renderer

2008-07-10 Thread Amy
--- In flexcoders@yahoogroups.com, Brandon Krakowsky <[EMAIL PROTECTED]> 
wrote:
>
> Thanks Amy.  This helped.  It actually ends up looking like this:
> iconRendererProvider.renderer = new ClassFactory(myClass);
> 
> The other issue I'm having is displaying images since 
AdvancedDataGridItemRenderer extends UITextField.  Do I have to extend 
AdvancedDataGridGroupItemRenderer in order to display images?  The 
DataGrid component doesn't seem to have this option at all.

This may help:

http://flexdiary.blogspot.com/2008/06/musings-on-advanceddatagrid-part-
2.html

HTH;

Amy



[flexcoders] Launching Flex Builder Help

2008-07-10 Thread Amy
Is there any way to launch the Help for Flex Builder without opening 
Flex Builder itself?

TIA;

Amy



[flexcoders] Re: Tilelist, ItemRenderer not refreshing when updating dataProvider

2008-07-10 Thread Amy
--- In flexcoders@yahoogroups.com, "calisza" <[EMAIL PROTECTED]> wrote:
>
> The dataProvider is a property of a Cairngorm VO.
> So, I have a productVO, of which images is a property (Array), so the
> dataProvider is product.VO - the thing is, the dataProvider IS being
> updated, its just the display that's not being displayed. As soon as I
> select another product, and then switch back to the product in
> question, or if I scroll up and then down in the TileList itself, the
> newly uploaded image appears.

Did you refresh it?



[flexcoders] Re: Component ClickEvent weirdness

2008-07-10 Thread Amy
--- In flexcoders@yahoogroups.com, "Jason" <[EMAIL PROTECTED]> wrote:
>
> and if it helps any, this is what the custom event class looks like:
> 
> package com.venice.event 
> {
>   import flash.events.Event;
>   
>   /**
>   * ...
>   * @author Jason Merrill
>   */
>   public class HelpEvent extends Event
>   {
>   
>   public static var HELP_INITIALIZED:String 
> = "help_initialized";
>   public static var HELP_TERMINATED:String 
> = "help_terminated";
>   public static var HELP_TOPIC_CHANGED:String 
> = "help_topic_changed";
>   
>   public function HelpEvent(type:String, 
> bubbles:Boolean=false, cancelable:Boolean=false) 
>   {
>   super(type, bubbles, cancelable);
>   }
>   
>   }
>   
> }
>
Hi, Jason;

Not sure if this relates to your error, but I think you have to 
override the clone() method for custom events.

HTH;

Amy



[flexcoders] Re: Launching Flex Builder Help

2008-07-10 Thread Amy
--- In flexcoders@yahoogroups.com, "Stephen Gilson" <[EMAIL PROTECTED]> 
wrote:
>
> Not really - the help requires an internal web server that is part of
> Eclipse.
>  
> However, all of the help content is available online on livedocs at:
> http://livedocs.adobe.com/flex/3/html/

Yes, but with the built in help I can limit my search results to zoom 
in on what I am looking for.  The LiveDocs search searches the world.  
A lot of the time I go through the built-in help to get to the LiveDocs 
page I am looking for if I want to post a link to something, because it 
is MUCH faster even counting the time it takes to launch FB3.

Thanks, though.

-Amy



[flexcoders] Re: Getting at itemRenderers from list

2008-07-10 Thread Amy
--- In flexcoders@yahoogroups.com, "djhatrick" <[EMAIL PROTECTED]> wrote:
>
> what trick is there, other than an event to get at the itemRenderers
> in a list?  I need them... I thought of dispatching events back, but
> man, that seems really cheesy..
> 
> Any suggestions?
>
What are you trying to accomplish?  If you're debugging, you can look 
at the list's rendererArray property.

HTH;

Amy



[flexcoders] Re: Flex & SEO

2008-07-11 Thread Amy
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]> 
wrote:
>
> On Thursday 10 Jul 2008, litesh_b321 wrote:
> > can get index of google  for a web site which is developed in
> > adobe flex?
> 
> Yes.
> 
> > Is there any special technique to optimise the search engine for 
flex
> > developed web site?
> 
> No.
> The Google spider Just Works with your Flex application.

Google is able to get to the content of a swf and spider it?  Neat, but 
at the same time a little scary...



[flexcoders] Re: Launching Flex Builder Help

2008-07-11 Thread Amy
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]> 
wrote:
>
> On Friday 11 Jul 2008, Amy wrote:
> > in on what I am looking for.  The LiveDocs search searches the 
world.
> 
> Have you tried using either Google, or Adobe's Community Search @ 
> http://community.adobe.com/help ?

I don't think limiting it to adobe.com is very helpful, since depending 
on what you're asking, you could get FB 1.5, Flash, or even something 
completely unrelated.  My filters in the built in help are VERY 
specific, and I can put my fingers on what I need in seconds.

While I saw Randy's posts on how to limit the search using the google 
site keywords to get it just down to the LiveDocs for the version of 
Flex you're interested in, to me that's a bigger PIA than just going 
through the help.  And of course, it doesn't provide the specificity of 
the search context in the help.  My main concern about going through 
the help is that FB3 running with the help open will use more and more 
memory until my laptop is burning my legs.  If it weren't for that I'd 
have Flex open all the time and it wouldn't matter.

-Amy

Thanks, though
-Amy



[flexcoders] Re: Passing objects to components

2008-07-14 Thread Amy
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> "Object" is dynamic and you can't bind to it. (I would expect 
binding
> warnings from the compiler) Create your own bindable class.  Or 
wrap the
> Object in ObjectProxy, if I recall correctly.

Couldn't he also do something like this in the component:

private var _obj:Object;
private var _objChanged:Boolean;

public function set obj(obj:Object):void{
  _obj=obj;
  _objChanged=true;
  invalidateProperties;
}

public function get obj():Object{
   return _obj;
}

override protected function commitProperties():void{
   super.commitPropertis();
   theButton.label = obj.str;
}

I personally would also pass in the property name to bind to to make 
it loosely coupled, but that's JMO.

HTH;

Amy



[flexcoders] Re: Application Design

2008-07-14 Thread Amy
--- In flexcoders@yahoogroups.com, "Dan Vega" <[EMAIL PROTECTED]> wrote:
>
> I changed it so it get instantiated on the main init.

I think your problem is that when ou are calling lblClientName, etc., 
those objects haven't been instantiated yet.  What event or function is 
calling your init() function?  Make sure it is not being called prior 
to commitProperties().

HTH;

Amy



[flexcoders] Re: XML is NULL immediatelly following service call, but does appear valid in textarea

2008-07-14 Thread Amy
--- In flexcoders@yahoogroups.com, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> 
wrote:
>
> Josh McDonald wrote:
> Yes I ended up doing that, but I was originally looking for was 
some 
> MXML that would do something like this:
> urlLoader.addEventListener(Event.COMPLETE, onComplete);
> as in "completelistener="myResultHandler()"
> 
> but i realize now that I was wrong.
> 
> I looked at that page many many times but had no idea what 
the "result" 
> tag attribute was  supposed to do, and no idea how to go about 
finding 
> out  I think "result" is the wrong word. "oncomplete"  would make a 
lot 
> more sense.

The problem with having only one onComplete event is that there is 
not just one thing that can happen.  There is a result event for when 
the service returns successfully and a fault event for when it fails.

HTH;

Amy



[flexcoders] Re: advanceddatagrid itemrenderer refering current column's data

2008-07-14 Thread Amy
--- In flexcoders@yahoogroups.com, "hworke" <[EMAIL PROTECTED]> wrote:
>
> 
> 
>   Hi, in a advanceddatagrid I need to put same
>   background color if the the cell value is
>   not empty string. In the itemrenderer all I
>   need to check is if the current column value
>   is null or not. I know how to refer a value
>   of the data object in the itemrenderer like:
>   data.whateverParameter. But in this case I
>   need to refer the current column value not
>   a fixed parameter of the data object. How do
>   I refer to the current column vale in the
>   itemrenderer?
>

If you implement IDropInListRenderer, you can get access to the 
DataGridListData properties.  Also, AdvancedDataGrid supports a style 
function, that you can use from outside the ADG to set styles.  For 
more on that http://flexdiary.blogspot.com/2008/06/musings-on-
advanceddatagrid-part-1.html

HTH;

Amy



[flexcoders] Re: advanceddatagrid itemrenderer refering current column's data

2008-07-14 Thread Amy
--- In flexcoders@yahoogroups.com, "Vivian Richard" <[EMAIL PROTECTED]> 
wrote:
>
>Hey Amy great getting an email from you. Man I guess you
>paid google : every time I search anything regarding ADG you
>blog pops up. :-) Thanks for taking time to share that with us.
> 
>As I found all your examples are addressing the whole row,
>I needed something for individual cells. I tried to work
>with your code and put the itemrenderer in ADGColumn but
>did not work accordingly. My requirement is very simple: all
>my ADGColumn will have the same itemrenderer and if the
>Column source has a nonempty string it will put the background
>color else leave it as is.

I actually didn't provide any examples, just talked about the general 
principles, unless you're talking about the posts that I linked to 
that didn't quite do what I wanted.

The styleFunction will do whatever you tell it to, so you can very 
easily use that to style the columns based on the dataField that is a 
property of the object you get in the second parameter.

So you could use something like this:

private function styleMyRenderers(data:Object, 
col:AdvancedDataGridColumn){
if (data[col.dataField]=='foo'){
return {backgroundColor:0xFF};//red
}
return {backgroundColor:0x00FF00};//green
}

HTH;

Amy



[flexcoders] Re: advanceddatagrid itemrenderer refering current column's data

2008-07-14 Thread Amy
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Has anyone tried the background item renderers from my blog in ADG?

No, but I wound up subclassing from AdvancedDatagridGroupItemRenderer 
because the AdvancedDataGridItemRenderer couldn't be made to support 
alpha in the background but not the text.  I suspect anyone wanting 
aplha transparency might have the same problem with the renderers on 
your site.

Thanks;

Amy



[flexcoders] Re: Advanced Data grid question

2008-07-15 Thread Amy
--- In flexcoders@yahoogroups.com, "Pratima Rao" <[EMAIL PROTECTED]> wrote:
>
> Hi Marcelo,
> 
>  
> 
> Thanks for your response. When you extend
> AdvancedDAtaGridGroupItemRenderer did you just override the
> createChildren and updateDisplayList, setData methods?
> 
> I dabbled with that a bit today but wasn't able to make it work but I
> feel like I'm close to getting this to work.

Why not just do whatever you need to do in the itemClick event for the 
ADG?  This fires no matter what kind of node it is.



[flexcoders] Re: Issue with AdvancedDataGridGroupItemRenderer

2008-07-15 Thread Amy
--- In flexcoders@yahoogroups.com, Nievtha NagaRaj <[EMAIL PROTECTED]> 
wrote:
>
> Hi All,
>  
>     In Advanced Data Grid ,I have set the image Icon 
using  "renderer" property of an AdvancedDataGridGroupItemRenderer in 
AS.myClass extends AdvancedDataGridGroupItemRenderer  and overrides the 
data function.
>   
> Issue:
> In some scenarios, AdvancedDataGird table shows no Icons .
> Help me to come out from this Problem..

Have you tried just using an iconFunction?

The AdvancedDataGridGroupItemRenderer doesn't have a renderer property, 
so could you be more specific about what you're doing?

What are the scenarios that result in the problem?



[flexcoders] Re: Changing Header Text Color on ADG

2008-07-15 Thread Amy
--- In flexcoders@yahoogroups.com, Adrian Williams <[EMAIL PROTECTED]> 
wrote:
>
> Hi Folks,
> 
> Have an infuriating one here. I am using color pickers to allow 
the 
> user to change the colors on the headers of an ADG. The background 
> picker works beautifully using:
> 
> 
AdvancedDataGrid.headerColors="{[columnHeaderBackPckr.selectedColor, 
> '#FF']}"
> 
> However I am about shove a fork in my eye trying to get the 
header 
> text color changer working.  It's set (how I haven't been able to 
> discover) to an off-sea green color and no matter what I do to 
change 
> the color of the text, it's not working.  I have tried:
> 
> AdvancedDataGrid.color="{columnHeaderTextPckr.selectedColor}"
> 
> and on the color picker itself:
>
> ColorPicker.change="setReportHeaderTextColor(event)"
> 
> which uses a simple method of:
> 
> private function 
> setReportHeaderTextColor(evt:ColorPickerEvent):void
> {
> memberRptConfig.setStyle("color",evt.color);
> memberRpt.setStyle("color",evt.color);
> }
> 
> Ironically, both the color= and the change= works perfectly on 
a 
> standard dataGrid but the ADG is just ignoring it.  Any ideas??  I 
have 
> googled about everything I can find without much success.

What happens if you create a style object and use headerStyleName?



  1   2   3   4   5   6   7   8   9   10   >