[flexcoders] Re: Flex validator in action script

2010-08-31 Thread valdhor
Untested but how about...

[Bindable] private var textInput:TextInput = new TextInput();
private var val:Validator = new Validator();

textInput.id = "myText"; //Don't know why you need this as you can refer
to the TextInput by its variable name (textInput)
val.source = textInput.text;
val.required = true;


--- In flexcoders@yahoogroups.com, "Adnan"  wrote:
>
> Hello,
>
> How can I represent the following validator in action script;
>
>  required="true"
> source="{myText}"
> />
> 
>
> I am starting with this;
>
> var textInput:TextInput = new TextInput();
> textInput.id = "myText";
>
> var val:Validator = new Validator();
> val.source = ;// problem how to define it to be bindable ?
> val.required = true;
>
> Any ideas?
>




[flexcoders] Re: Flex application with Microsoft Azure

2010-08-31 Thread valdhor
Take a look at http://phpazure.codeplex.com/

--- In flexcoders@yahoogroups.com, "Christophe"  
wrote:
>
> Hello, 
> 
> Which library to use to talk with a Microsoft Azure database in the cloud 
> from a flex application. 
> 
> My application use AmfPhp, does its work ? 
> 
> Thank you,
> Christophe,
>




[flexcoders] Re: Switching Item Renderers

2010-08-31 Thread valdhor
That seems overly complicated to me. What I would try is create two custom 
components then instantiate the appropriate one based on the data and add it in 
the updateDisplayList method.

--- In flexcoders@yahoogroups.com, Wesley Acheson  wrote:
>
> Since nobody has replied I'm continueing to try this. I currently think I
> may need to override all methods in UI component.
> 
> 
> Is it clear what I'm trying to do?
> 
> Is this the wrong way of doing it?
> 
> I think its probably lighter than wrapping to components in a fully fledged
> UI component?
> *
> Some Thoughts*
> 
> Also a comment on ListItemRenderer, theres an awful lot of methods that need
> to be implemented to make this work.  I doubt all of them are used in a List
> Senario. Even implementing them all theres still a dependency on
> DisplayObject (who's methods seem to be implemented). It does feel to me
> like the architecture seems a bit off.  I mean if all of those methods are
> implemented why is there still a dependency on DisplayObject.
> 
> Its not just enough to implement IListRenderer which seems to defeat the
> purpose of an interace
> 
> On Wed, Aug 18, 2010 at 11:42 PM, Wesley Acheson
> wrote:
> 
> > *Disclaimer:* This is a cross post with Stack Overflow. I know at least
> > one person on this list saw it there.
> > http://stackoverflow.com/questions/3507313/flex-switch-item-renderer
> >
> > Hi
> >
> > I was wondering if anyone had any luck with the following senario in flex.
> >
> > I'd like to be able to have a custom item renderer which delegates to
> > another renderer inside.
> >
> > The reason for this would be in a datagrid for instance displaying a
> > checkbox if the dataprovider for the row had a boolean value. Using the
> > default item renderer when the value was a non boolean.
> >
> > Basically I was hoping to use a proxy object (though not necessarily the
> > proxy class) so that I could a renderer which delegated all of its
> > responsibilties to a sub renderer.
> >
> > Hard to explain.
> >
> > *Edit 1*
> >
> > I think the following gives a clearer idea of what I had in mind. This is
> > only knocked up quickly for the purpose of showing the idea.
> >
> > *SwitchingRenderer.as*
> >
> > package com.example
> > {
> > import mx.controls.CheckBox;
> >
> > import mx.controls.dataGridClasses.DataGridItemRenderer;
> >
> > import mx.controls.listClasses.BaseListData;
> >
> > import mx.controls.listClasses.IDropInListItemRenderer;
> >
> > import mx.core.IDataRenderer;
> >
> > import mx.core.UIComponent;
> >
> > public class SwitchingRenderer extends UIComponent implements 
> > IDataRenderer, IDropInListItemRenderer
> >
> > {
> > private var checkboxRenderer:CheckBox;
> >
> > private var defaultRenderer:DataGridItemRenderer;
> >
> > private var currentRenderer:IDataRenderer;
> >
> > public function SwitchingRenderer()
> >
> > {
> > this.checkboxRenderer = new CheckBox();
> >
> > this.defaultRenderer = new DataGridItemRenderer();
> >
> > this.currentRenderer = defaultRenderer();
> >
> > super();
> > }
> >
> > public function get data():Object
> >
> > {
> > //If the data for this cell is a boolean
> > //  currentRender = checkBoxRenderer
> >
> > // otherwise
> > //  currentRenderer = defaultRenderer
> > }
> >
> > public function set data(value:Object):void
> >
> > {
> > currentRenderer.data = value;
> >
> > }
> >
> > public function get listData():BaseListData
> >
> > {
> > return currentRenderer.listData;
> >
> > }
> >
> > public function set listData(value:BaseListData):void
> >
> > {
> > currentRenderer.listData = value;
> >
> > }
> >
> >
> >
> > }
> > }
> >
> >
> >
>




[flexcoders] Re: Announcement: Flextras Flex Calendar Component

2010-08-31 Thread valdhor
Any chance you could turn off auto connect to twitter? I am at work and can't 
use Twitter. It is a real pain in the @ss to have to click the cancel button on 
every page of the site. I finally got disgusted and closed the tab.

--- In flexcoders@yahoogroups.com, Jeffry Houser  wrote:
>
> 
> 
> Hi Everyone,
> 
>   I'm pleased to announce the release of the Flextras Calendar 
> Component.  This was a big undertaking for us and we can't wait to have 
> a few people take a look and tell us what we did wrong (or right).
> 
>   The Calendar is a great way for you to deal with date based data in a 
> Flex Application and it allows you to build Calendar or scheduling 
> applications. The component features:
> 
> * Views for a Month, Week, and Day.
> * Extensive renderers so that you can make the component suit your
>   needs.
> * Standard Flex APIs for drag and drop, itemEditors, and localization.
> 
> 
> 
>   You can download our no cost developer edition along with samples and 
> documentation at http://www.flextras.com/?c=217 .
> 
> Here are some links to find out more:
> 
> Product Page: http://www.flextras.com/?event=ProductHome&productID=15&c=217
> Documentation: 
> http://www.flextras.com/?event=ProductDocumentation&ProductID=15&c=217
> Demos: http://www.flextras.com/?event=ProductSamples&ProductID=15&c-217
> 
> Register and Download: 
> http://www.flextras.com/index.cfm?event=loginForm&c=217
> 
> Flextras Home: http://www.flextras.com/?c=217
> 
> We are here to help and would love to hear your feedback.  What can we 
> do for you today?
> 
> -- 
> Jeffry Houser, Technical Entrepreneur
> Adobe Community Professional: http://tinyurl.com/27h53fl
> Phone: 203-379-0773
> --
> UI Flex Components: Tested! Supported! Ready!
> http://www.flextras.com?c=104
> --
> http://www.twitter.com/reboog711
> http://www.twitter.com/flextras
> http://www.twitter.com/theflexshow
> --
> http://www.theflexshow.com
> http://www.jeffryhouser.com
> http://www.asktheflexpert.com
> --
> Part of the DotComIt Brain Trust
>




[flexcoders] Re: enterState exitState frustrations

2010-08-31 Thread valdhor
The creationComplete handler will only fire once upon initial creation. I would 
try calling the same initialization code on the show event as well.

--- In flexcoders@yahoogroups.com, "striton_ca"  wrote:
>
> I am a new Flex coder. So far I'm enjoying the flexibility of the framework, 
> but I am having a heck of a time with state changes. I'm using Flex 4.1. I'm 
> working on a basic GUI. You start with a welcome screen, followed by a state 
> change to a login screen, and a state change to a chat lobby. When the lobby 
> is displayed, there's a bunch of initialization that needs to happen. If the 
> user navigates away from this state/view, then they should be automatically 
> disconnected from the chat server and be brought back to the beginning. The 
> problem is, I cannot for the life of me get anything to trigger using 
> enterState and exitState. Even currentStateChanging appears to not be 
> triggered. I can make the init happen the first time using creationComplete, 
> but that's it. I am wondering if my using a custom event handler is causing 
> trouble.
> 
> Each of the different views are a custom component. Each component has the 
> following declaration in the Metadata:
> [Event(name="stateChangeEvent", type="events.MyStateChangeEvent")]
> 
> MyStateChangeEvent allows the components to pass the desired state to the 
> main application which then initiates the switch. The individual components 
> are called as follows in the main application:
> 
>stateChangeEvent="stateChangeEventHandler(event)">
> 
> 
> The event handler is pretty basic:
> 
> protected function stateChangeEventHandler(event:MyStateChangeEvent):void
> {
> this.currentState = event.stateChangeData.newState.toString();
> }
> 
> Is the custom handler what's causing the trouble? If so, how do I pass data 
> between components via events yet still take advantage of the enterState and 
> exitState triggers?
> 
> I sincerely appreciate your time and patience.
> Aaron
>




Re: [flexcoders] Re: Announcement: Flextras Flex Calendar Component

2010-08-31 Thread Jeffry Houser


 The twitter pod is disabled.  Sorry about that.  I have no idea when 
twitter started prompting for a username / password.  They are probably 
have outages or random server changes.  I've seen that before, but never 
on our site and not in quite a long time.


On 8/31/2010 2:29 PM, valdhor wrote:


Any chance you could turn off auto connect to twitter? I am at work 
and can't use Twitter. It is a real pain in the @ss to have to click 
the cancel button on every page of the site. I finally got disgusted 
and closed the tab.


--- In flexcoders@yahoogroups.com 
, Jeffry Houser  wrote:

>
>
>
> Hi Everyone,
>
> I'm pleased to announce the release of the Flextras Calendar
> Component. This was a big undertaking for us and we can't wait to have
> a few people take a look and tell us what we did wrong (or right).
>
> The Calendar is a great way for you to deal with date based data in a
> Flex Application and it allows you to build Calendar or scheduling
> applications. The component features:
>
> * Views for a Month, Week, and Day.
> * Extensive renderers so that you can make the component suit your
> needs.
> * Standard Flex APIs for drag and drop, itemEditors, and localization.
>
>
>
> You can download our no cost developer edition along with samples and
> documentation at http://www.flextras.com/?c=217 .
>
> Here are some links to find out more:
>
> Product Page: 
http://www.flextras.com/?event=ProductHome&productID=15&c=217 


> Documentation:
> 
http://www.flextras.com/?event=ProductDocumentation&ProductID=15&c=217 

> Demos: 
http://www.flextras.com/?event=ProductSamples&ProductID=15&c-217 


>
> Register and Download:
> http://www.flextras.com/index.cfm?event=loginForm&c=217 


>
> Flextras Home: http://www.flextras.com/?c=217
>
> We are here to help and would love to hear your feedback. What can we
> do for you today?
>
> --
> Jeffry Houser, Technical Entrepreneur
> Adobe Community Professional: http://tinyurl.com/27h53fl
> Phone: 203-379-0773
> --
> UI Flex Components: Tested! Supported! Ready!
> http://www.flextras.com?c=104
> --
> http://www.twitter.com/reboog711
> http://www.twitter.com/flextras
> http://www.twitter.com/theflexshow
> --
> http://www.theflexshow.com
> http://www.jeffryhouser.com
> http://www.asktheflexpert.com
> --
> Part of the DotComIt Brain Trust
>





--
Jeffry Houser, Technical Entrepreneur
Adobe Community Professional: http://tinyurl.com/27h53fl
Phone: 203-379-0773
--
UI Flex Components: Tested! Supported! Ready!
http://www.flextras.com?c=104
--
http://www.twitter.com/reboog711
http://www.twitter.com/flextras
http://www.twitter.com/theflexshow
--
http://www.theflexshow.com
http://www.jeffryhouser.com
http://www.asktheflexpert.com
--
Part of the DotComIt Brain Trust



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

2010-08-31 Thread Laurence
I wasn't clear before -- I don't know the width of the VBox beforehand.  I was 
trying to figure out the minimum width I could make the VBox before I actually 
make it.

But the measureText() method worked perfectly for me, thanks.

L.


--- In flexcoders@yahoogroups.com, dorkie dork from dorktown 
 wrote:
>
> Example code,
> 
> 
> 
> 
> If you need to truncateToFit the text you can use the truncateToFit
> property, more info...
> http://blog.flexexamples.com/2008/01/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/
> 
> On Mon, Aug 30, 2010 at 12:06 AM, Alex Harui  wrote:
> 
> >
> >
> > For mx:Label, you can try using measureText() on the parent unless the
> > label will have different styles that will affect measurement.  Then you'll
> > have to add it and call validateNow() and call getExplicitOrMeasuredWidth().
> >
> > But why not use mx:Text?  Why do you have to get the width exactly?  If you
> > stretch an mx:Text to the width of the Vbox it sounds like it would suit
> > your needs.
> >
> >
> >
> > On 8/29/10 2:06 PM, "Laurence"  wrote:
> >
> >
> >
> >
> >
> >
> > Using ActionScript, I want to add a Label to a VBox.  I know what text I
> > want to put into the label (said text is read from an XML file), but of
> > course, the program cannot know what the width of the label should be until
> > after the text is read from that XML file.  I want the label to be as wide
> > as it needs to be, but not wider than the vBox I'm adding it to -- if that
> > label will need to be wider than the given amount to display all the text,
> > then I want to add a TextArea (with word-wrap turned on) so I can display
> > all the text in that given width.
> >
> > My question is, how do I calculate the width of a label I'll need, when
> > given a string of text?  I do know the font-family and font-size the label
> > will have.  Is there an easy way to go from a string of text to the width
> > that a label will need to be to display that text?
> >
> > Thanks,
> > Laurence MacNeill
> > Mableton, Georgia, USA
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> >  
> >
>




[flexcoders] Re: Problem getting compiler to recognize a custom class

2010-08-31 Thread valdhor
Try adding a script block and importing the class there.

--- In flexcoders@yahoogroups.com, "colin.ashe"  wrote:
>
> The class in question is a UI Component, which is being instantiated in MXML. 
>  I've included the necessary xmlns entry in the application tag.  As I 
> understand it, this is the only "importing" that needs to happen.  And, as I 
> said, the IDE knows about the class and can provide me with lots of info 
> about the class when I hover over parts of the code.  However, when the 
> compiler is run, I keep getting the error (1046).
> 
> Am I missing something?
>




[flexcoders] AIR and Printing...

2010-08-31 Thread Laurence
I could really use some major advice here.  We're so close to the finishing 
point on this project, and we're being held back by stupid printing problems...

We have to be able to print with no pop-up dialog boxes, and the choice of 
which printer to send the job to will be affected by the data (i.e. a client 
with reg-code X gets printed on printer-1 and a client with reg-code Y gets 
printed on printer-2.)

We have to automate this, because the temp-workers we hire can't be counted on 
to remember how do it correctly.

So...  Any ideas on how I can deal with this?  Should I dump Flash Player and 
switch to AIR?  Would that give me better control over the printing?  Can AIR 
actually do all that I'm asking for here?  What will switching to AIR mean for 
accessing our data from our ColdFusion/SQL server through https:, if anything?

Thanks,
Laurence MacNeill
Mableton, Georgia, USA





[flexcoders] Flash Builder unable to debug (missing flash player)

2010-08-31 Thread Oleg Sivokon
When I hit F11 I'm getting this message: "File not found: flashplayer". No
more explanations given. Any ideas of what went wrong? (I'm on Linux, and of
course I have flash player...)


Re: [flexcoders] AIR and Printing...

2010-08-31 Thread Alex Harui
AIR does give more control over printing.   AIR requires installation, a 
web-hosted app does not.  I don’t know the security rules that well, but it 
isn’t clear how you prevent someone from installing the app and accessing your 
server unless you require authentication first.


On 8/31/10 1:10 PM, "Laurence"  wrote:






I could really use some major advice here.  We're so close to the finishing 
point on this project, and we're being held back by stupid printing problems...

We have to be able to print with no pop-up dialog boxes, and the choice of 
which printer to send the job to will be affected by the data (i.e. a client 
with reg-code X gets printed on printer-1 and a client with reg-code Y gets 
printed on printer-2.)

We have to automate this, because the temp-workers we hire can't be counted on 
to remember how do it correctly.

So...  Any ideas on how I can deal with this?  Should I dump Flash Player and 
switch to AIR?  Would that give me better control over the printing?  Can AIR 
actually do all that I'm asking for here?  What will switching to AIR mean for 
accessing our data from our ColdFusion/SQL server through https:, if anything?

Thanks,
Laurence MacNeill
Mableton, Georgia, USA






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


Re: [flexcoders] Flash Builder unable to debug (missing flash player)

2010-08-31 Thread Oleg Sivokon
Ah, sorry, it seems like the problem is I'm on x86_64, and there is no
standalone debugger for that... how strange... Anyways, does anyone have an
idea on how to make 32-bit standalone debugger work on 64 bit Linux?


[flexcoders] Flex chart DataTimeAxis Interpolation/Extrapolation

2010-08-31 Thread fayaz140284
I have a question regarding the implementation of a Time Series chart in Flex. 
These charts are used for reporting purposes.

Does flex charting do any of interpolation, extrapolation or smoothening of 
plotted series based on the data?
Or the data provided for chart should take care of this. 

So far what I have observed in Flex is that all points provided are considered 
for plotting and we could no way control the Line Series.

 
We have data collected with interval in minutes 
So if we plot a graph for a day then the x-axis should show data on a per hour 
basis. If the data contains all the points for a week then the above graph 
should be re-calibrated to days in x-axis

Does Flex charting provide this kind of facility? If so how? 

Any pointers are much appreciated.





[flexcoders] Re: memory leaks and activation-objects

2010-08-31 Thread lew.miller


Yes.  That's precisely what I'm doing.  Only, looking at the code now I realize 
most of the time I'm using nested functions (with names) rather than anonymous 
functions.  I'm not sure what the implications are of using one over another 
are but, regardless, I gather you're suggesting this is a potential problem?  

A typical example of what I'm doing would be something like:

private function showDialog(x,y,z):void
{
  var dialog:SomeDialog = new SomeDialog();
  dialog.addEventListener("ok", function doSomething(e:DialogEvent):void 
{
  someMethod(x,y,z);
}
  dialog.show();
}

I'm using the nested function because I need some way to get the x,y,z values 
into someMethod.  Does this code look problematic?

Thanks much for your help!

Lew


--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> Could you be registering anonymous functions as event listeners and other 
> callbacks?
> 
> 
> On 8/30/10 12:52 PM, "lew.miller"  wrote:
> 
> 
> 
> 
> 
> 
> Thanks Alex.  I don't have any simple test case indicating that they leak, 
> I'm just struggling to understand what is causing certain leaks in a large 
> application where the profiler points me to activation objects.
> 
> So when tracking memory leaks with the FB4 profiler you're saying one 
> can/should simply ignore any object reference paths that start with 
> activation objects?  (If so, it would be nice if they weren't reported--but 
> that's a separate issue.)  Can you tell me what it means when the profiler 
> lists activation objects?  Does that imply some corresponding function is 
> executing at the time the memory snapshot was taken?  If I understood why I'm 
> getting all these references from activation objects I'd feel a bit more 
> comfortable about ignoring them. :-)
> 
> My application makes use of anonymous functions in places and I read an old 
> Adobe Developer Connection article that says:
> 
> "Defining functions on the fly causes an arcane memory leak in Flash Player 
> because the activation object sent to the function can never be recovered by 
> the garbage collector. So the bottom line is to avoid dynamic classes and 
> explicitly define all the properties and functions used in your classes."
> 
> It doesn't elaborate and was written in 2006 so it may be irrelevant but 
> makes me wonder.
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > AFAIK, they do not cause leaks.  If you show some data or a simple test 
> > case that indicates that they are, I will try to take a look.
> >
> >
> > On 8/30/10 8:36 AM, "lew.miller"  wrote:
> >
> >
> >
> >
> >
> >
> > I've been wrestling with memory leaks and the FB4 profiler and lately have 
> > been trying to understand activation-objects and their relationship to GC 
> > because the vast majority (often all) of the references the profiler tells 
> > me an object has keeping it in memory come from activation objects.
> >
> > While researching this I came across a note from Alex Harui saying "I've 
> > never seen an activation object cause a leak" but other things I've read 
> > seem to suggest they can.  (Certainly the profiler would lead me to believe 
> > it.)  Can anybody enlighten me?  Or just point me to the place to read 
> > documentation on the subject that is up-to-date?  Half of what I've read 
> > about activation objects appears to be from earlier versions of 
> > ActionScript so I'm not sure what to believe.
> >
> > If an activation object can cause a memory leak, I'd like to understand 
> > how.  I may not have a firm grasp of the lifecycle of an activation object 
> > but I thought it would no longer be accessible from the GC root after the 
> > function it's created for finishes executing.
> >
> > Any help or pointers would be greatly appreciated.
> >
> > Lew
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




Re: [flexcoders] 360Flex DC is coming up soon! Don't miss it!

2010-08-31 Thread Tyler Wright
Anyone want to meet up at 360|Flex DC sometime? I'll be there presenting on
Reflex the last hour of the last day, so I'll be there for the *whole*thing.

See you all there!
Tyler


On Tue, Aug 17, 2010 at 8:25 PM, John Wilker  wrote:

>
>
> Hey Flexcoders list!
>
> I just wanted to pop in and make sure everyone knew that 360|Flex was
> coming up fast in Washington DC. September 19-22
>
> The full session details have been posted as a PDF here.
> http://360flex.com/downloads/sessions.pdf
>
> and you can check out the schedule here:
> http://360flex.com/downloads/schedule.pdf
>
> This past spring in San Jose we had close to 400 attendees, we're hoping to
> meet or better yet, BEAT that number in DC! It's gonna be a great time, with
> content that will blow you mind. There's several on this list that can back
> me up on that :)
>
> At any rate, hope you all can make it, here's a special discount just for
> Flexcoders members! "flexcodersrocks" saves you 10% off the $699
> registration price.
>
> By the way, $699 is for 4 days of content. 40+ sessions, from over 30
> speakers, many from this list even! Check out the line up.
>
> See you in DC!
>
> John Wilker
> Co-Founder, 360|Conferences
> twitter: jwilker 
> johnwilker.com | Ignite Denver | 
> Denwhere|
> 360|Flex  | 360|iDev 
>
> “A goal is not always meant to be reached, it often serves simply as
> something to aim at.”
> ~ Bruce Lee
>
>  
>


[flexcoders] Re: Weird Problem with the PopupButton Display!

2010-08-31 Thread saurabh_1guru
Has no one ever experienced such distorted or inappropriately rendered
components?
Please Help me out!!

Thanks,
Saurabh
=

--- In flexcoders@yahoogroups.com, "saurabh_1guru" 
wrote:
>
>
> Hi,
>
>   I have a simple Popup Button that displays a list  of options. Very
> weirdly many times (At least the first time for sure)  when I open the
> menu, all the options do not appear and the list seems  to be broken.
> But when I start to scroll my mouse over the options, they  start
> appearing.
>
>   Here is what it looks like (I have blurred the text for security
> purposes):
>
>
http://forums.adobe.com/servlet/JiveServlet/downloadImage/2-3083241-3925\
\
> 7/199-337/%24207E618DC98A35CE.jpg
>
 57/199-337/%24207E618DC98A35CE.jpg>
>
> I do not have any Itemrenderers assigned to it, not sure what's
causing
> this issue. Any help would be appreciated.
>
>
>
> Thanks,
>
> Saurabh
>




[flexcoders] Re: AIR and Printing...

2010-08-31 Thread Laurence
The installation/authorization stuff I can deal with...  Not being able to 
control my print jobs properly, I can't deal with.

I can find surprisingly little information about printing in AIR -- it's almost 
like printing was an afterthought for Flex and AIR.

Exactly how much more control over printing does AIR give me?  Can it print 
everything without pop-ups?  Can it control which printer the app sends the 
print-job to -- again, without pop-ups?  Those are the two main things I need.

Thanks,
L.


--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> AIR does give more control over printing.   AIR requires installation, a 
> web-hosted app does not.  I don't know the security rules that well, but it 
> isn't clear how you prevent someone from installing the app and accessing 
> your server unless you require authentication first.
> 
> 
> On 8/31/10 1:10 PM, "Laurence"  wrote:
> 
> 
> 
> 
> 
> 
> I could really use some major advice here.  We're so close to the finishing 
> point on this project, and we're being held back by stupid printing 
> problems...
> 
> We have to be able to print with no pop-up dialog boxes, and the choice of 
> which printer to send the job to will be affected by the data (i.e. a client 
> with reg-code X gets printed on printer-1 and a client with reg-code Y gets 
> printed on printer-2.)
> 
> We have to automate this, because the temp-workers we hire can't be counted 
> on to remember how do it correctly.
> 
> So...  Any ideas on how I can deal with this?  Should I dump Flash Player and 
> switch to AIR?  Would that give me better control over the printing?  Can AIR 
> actually do all that I'm asking for here?  What will switching to AIR mean 
> for accessing our data from our ColdFusion/SQL server through https:, if 
> anything?
> 
> Thanks,
> Laurence MacNeill
> Mableton, Georgia, USA
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




Re: [flexcoders] Re: memory leaks and activation-objects

2010-08-31 Thread Alex Harui
I don’t like anonymous functions, nested functions or whatever you want to call 
function instances.  Everything on the callstack is referenced by the 
scope-chain/activation object until the function instance can be GC’d.  Once 
you call removeEventLIstener, then the scope-chain goes away, but until then, 
lots of things are kept around.

It is generallyl more efficient to make doSomething a member method on the 
class.  Or create a helper class that handles the dialog and stores the x,y,z 
values.

When you originally posted I thought you were saying that an activation object 
that should go away wasn’t or was blocking other things from going away.  
AFAIK, that isn’t true, but activation objects are kept around by references to 
function instances and can lead to unexpected memory usage.

On 8/31/10 7:53 AM, "lew.miller"  wrote:








Yes.  That's precisely what I'm doing.  Only, looking at the code now I realize 
most of the time I'm using nested functions (with names) rather than anonymous 
functions.  I'm not sure what the implications are of using one over another 
are but, regardless, I gather you're suggesting this is a potential problem?

A typical example of what I'm doing would be something like:

private function showDialog(x,y,z):void
{
 var dialog:SomeDialog = new SomeDialog();
 dialog.addEventListener("ok", function doSomething(e:DialogEvent):void
 {
 someMethod(x,y,z);
 }
 dialog.show();
}

I'm using the nested function because I need some way to get the x,y,z values 
into someMethod.  Does this code look problematic?

Thanks much for your help!

Lew

--- In flexcoders@yahoogroups.com  , Alex 
Harui  wrote:
>
> Could you be registering anonymous functions as event listeners and other 
> callbacks?
>
>
> On 8/30/10 12:52 PM, "lew.miller"  wrote:
>
>
>
>
>
>
> Thanks Alex.  I don't have any simple test case indicating that they leak, 
> I'm just struggling to understand what is causing certain leaks in a large 
> application where the profiler points me to activation objects.
>
> So when tracking memory leaks with the FB4 profiler you're saying one 
> can/should simply ignore any object reference paths that start with 
> activation objects?  (If so, it would be nice if they weren't reported--but 
> that's a separate issue.)  Can you tell me what it means when the profiler 
> lists activation objects?  Does that imply some corresponding function is 
> executing at the time the memory snapshot was taken?  If I understood why I'm 
> getting all these references from activation objects I'd feel a bit more 
> comfortable about ignoring them. :-)
>
> My application makes use of anonymous functions in places and I read an old 
> Adobe Developer Connection article that says:
>
> "Defining functions on the fly causes an arcane memory leak in Flash Player 
> because the activation object sent to the function can never be recovered by 
> the garbage collector. So the bottom line is to avoid dynamic classes and 
> explicitly define all the properties and functions used in your classes."
>
> It doesn't elaborate and was written in 2006 so it may be irrelevant but 
> makes me wonder.
>
> --- In flexcoders@yahoogroups.com   
>  , Alex Harui  wrote:
> >
> > AFAIK, they do not cause leaks.  If you show some data or a simple test 
> > case that indicates that they are, I will try to take a look.
> >
> >
> > On 8/30/10 8:36 AM, "lew.miller"  wrote:
> >
> >
> >
> >
> >
> >
> > I've been wrestling with memory leaks and the FB4 profiler and lately have 
> > been trying to understand activation-objects and their relationship to GC 
> > because the vast majority (often all) of the references the profiler tells 
> > me an object has keeping it in memory come from activation objects.
> >
> > While researching this I came across a note from Alex Harui saying "I've 
> > never seen an activation object cause a leak" but other things I've read 
> > seem to suggest they can.  (Certainly the profiler would lead me to believe 
> > it.)  Can anybody enlighten me?  Or just point me to the place to read 
> > documentation on the subject that is up-to-date?  Half of what I've read 
> > about activation objects appears to be from earlier versions of 
> > ActionScript so I'm not sure what to believe.
> >
> > If an activation object can cause a memory leak, I'd like to understand 
> > how.  I may not have a firm grasp of the lifecycle of an activation object 
> > but I thought it would no longer be accessible from the GC root after the 
> > function it's created for finishes executing.
> >
> > Any help or pointers would be greatly appreciated.
> >
> > Lew
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>






--
Alex Harui
Flex SDK Team
Adobe Sys

Re: [flexcoders] Re: AIR and Printing...

2010-08-31 Thread Alex Harui
I use this version of the doc: 
http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/printing/PrintJob.html

There are lots of new printing features in AIR2.0 which may be why there isn’t 
a lot of searchable info.  The link I supplied implies that in AIR 2.0, you set 
the PrintJob.printer property to a printer and call PrintJob.start2() to skip 
the dialogs.  Not sure how it will work on all platforms so give it a try.

Plan B, I think, is to generate a bitmap of the page and upload it to a server 
than can access the printer.  Can work for shared printers but not local ones.


On 8/31/10 3:05 PM, "Laurence"  wrote:






The installation/authorization stuff I can deal with...  Not being able to 
control my print jobs properly, I can't deal with.

I can find surprisingly little information about printing in AIR -- it's almost 
like printing was an afterthought for Flex and AIR.

Exactly how much more control over printing does AIR give me?  Can it print 
everything without pop-ups?  Can it control which printer the app sends the 
print-job to -- again, without pop-ups?  Those are the two main things I need.

Thanks,
L.

--- In flexcoders@yahoogroups.com  , Alex 
Harui  wrote:
>
> AIR does give more control over printing.   AIR requires installation, a 
> web-hosted app does not.  I don't know the security rules that well, but it 
> isn't clear how you prevent someone from installing the app and accessing 
> your server unless you require authentication first.
>
>
> On 8/31/10 1:10 PM, "Laurence"  wrote:
>
>
>
>
>
>
> I could really use some major advice here.  We're so close to the finishing 
> point on this project, and we're being held back by stupid printing 
> problems...
>
> We have to be able to print with no pop-up dialog boxes, and the choice of 
> which printer to send the job to will be affected by the data (i.e. a client 
> with reg-code X gets printed on printer-1 and a client with reg-code Y gets 
> printed on printer-2.)
>
> We have to automate this, because the temp-workers we hire can't be counted 
> on to remember how do it correctly.
>
> So...  Any ideas on how I can deal with this?  Should I dump Flash Player and 
> switch to AIR?  Would that give me better control over the printing?  Can AIR 
> actually do all that I'm asking for here?  What will switching to AIR mean 
> for accessing our data from our ColdFusion/SQL server through https:, if 
> anything?
>
> Thanks,
> Laurence MacNeill
> Mableton, Georgia, USA
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>






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


[flexcoders] Re: AIR and Printing...

2010-08-31 Thread Laurence
It does seem, from reading that document, that you can choose the printer to 
send the print-job to, and set the parameters for that printer, and skip all 
the dialog boxes...  I'll have to play with that...  Thanks!

My next question, then, is accessing remote data -- my Flex app using the Flash 
Player has no problem calling a remote ColdFusion function to grab data from 
the SQL server, and send data back there...  How much does that change in AIR?  
Or is it pretty much the same thing?

L.

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I use this version of the doc: 
> http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/printing/PrintJob.html
> 
> There are lots of new printing features in AIR2.0 which may be why there 
> isn't a lot of searchable info.  The link I supplied implies that in AIR 2.0, 
> you set the PrintJob.printer property to a printer and call PrintJob.start2() 
> to skip the dialogs.  Not sure how it will work on all platforms so give it a 
> try.
> 
> Plan B, I think, is to generate a bitmap of the page and upload it to a 
> server than can access the printer.  Can work for shared printers but not 
> local ones.
> 
> 
> On 8/31/10 3:05 PM, "Laurence"  wrote:
> 
> 
> 
> 
> 
> 
> The installation/authorization stuff I can deal with...  Not being able to 
> control my print jobs properly, I can't deal with.
> 
> I can find surprisingly little information about printing in AIR -- it's 
> almost like printing was an afterthought for Flex and AIR.
> 
> Exactly how much more control over printing does AIR give me?  Can it print 
> everything without pop-ups?  Can it control which printer the app sends the 
> print-job to -- again, without pop-ups?  Those are the two main things I need.
> 
> Thanks,
> L.
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > AIR does give more control over printing.   AIR requires installation, a 
> > web-hosted app does not.  I don't know the security rules that well, but it 
> > isn't clear how you prevent someone from installing the app and accessing 
> > your server unless you require authentication first.
> >
> >
> > On 8/31/10 1:10 PM, "Laurence"  wrote:
> >
> >
> >
> >
> >
> >
> > I could really use some major advice here.  We're so close to the finishing 
> > point on this project, and we're being held back by stupid printing 
> > problems...
> >
> > We have to be able to print with no pop-up dialog boxes, and the choice of 
> > which printer to send the job to will be affected by the data (i.e. a 
> > client with reg-code X gets printed on printer-1 and a client with reg-code 
> > Y gets printed on printer-2.)
> >
> > We have to automate this, because the temp-workers we hire can't be counted 
> > on to remember how do it correctly.
> >
> > So...  Any ideas on how I can deal with this?  Should I dump Flash Player 
> > and switch to AIR?  Would that give me better control over the printing?  
> > Can AIR actually do all that I'm asking for here?  What will switching to 
> > AIR mean for accessing our data from our ColdFusion/SQL server through 
> > https:, if anything?
> >
> > Thanks,
> > Laurence MacNeill
> > Mableton, Georgia, USA
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




Re: [flexcoders] Re: AIR and Printing...

2010-08-31 Thread Alex Harui
I don’t know if there are any differences.  I did a quick search and didn’t see 
any links to articles complaining about it or explaining how to do it so I’m 
going to guess that it works as expected.  There are Security WhitePapers on 
the Adobe site if you want to read more about AIR security.


On 8/31/10 4:41 PM, "Laurence"  wrote:






It does seem, from reading that document, that you can choose the printer to 
send the print-job to, and set the parameters for that printer, and skip all 
the dialog boxes...  I'll have to play with that...  Thanks!

My next question, then, is accessing remote data -- my Flex app using the Flash 
Player has no problem calling a remote ColdFusion function to grab data from 
the SQL server, and send data back there...  How much does that change in AIR?  
Or is it pretty much the same thing?

L.

--- In flexcoders@yahoogroups.com  , Alex 
Harui  wrote:
>
> I use this version of the doc: 
> http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/printing/PrintJob.html
>
> There are lots of new printing features in AIR2.0 which may be why there 
> isn't a lot of searchable info.  The link I supplied implies that in AIR 2.0, 
> you set the PrintJob.printer property to a printer and call PrintJob.start2() 
> to skip the dialogs.  Not sure how it will work on all platforms so give it a 
> try.
>
> Plan B, I think, is to generate a bitmap of the page and upload it to a 
> server than can access the printer.  Can work for shared printers but not 
> local ones.
>
>
> On 8/31/10 3:05 PM, "Laurence"  wrote:
>
>
>
>
>
>
> The installation/authorization stuff I can deal with...  Not being able to 
> control my print jobs properly, I can't deal with.
>
> I can find surprisingly little information about printing in AIR -- it's 
> almost like printing was an afterthought for Flex and AIR.
>
> Exactly how much more control over printing does AIR give me?  Can it print 
> everything without pop-ups?  Can it control which printer the app sends the 
> print-job to -- again, without pop-ups?  Those are the two main things I need.
>
> Thanks,
> L.
>
> --- In flexcoders@yahoogroups.com   
>  , Alex Harui  wrote:
> >
> > AIR does give more control over printing.   AIR requires installation, a 
> > web-hosted app does not.  I don't know the security rules that well, but it 
> > isn't clear how you prevent someone from installing the app and accessing 
> > your server unless you require authentication first.
> >
> >
> > On 8/31/10 1:10 PM, "Laurence"  wrote:
> >
> >
> >
> >
> >
> >
> > I could really use some major advice here.  We're so close to the finishing 
> > point on this project, and we're being held back by stupid printing 
> > problems...
> >
> > We have to be able to print with no pop-up dialog boxes, and the choice of 
> > which printer to send the job to will be affected by the data (i.e. a 
> > client with reg-code X gets printed on printer-1 and a client with reg-code 
> > Y gets printed on printer-2.)
> >
> > We have to automate this, because the temp-workers we hire can't be counted 
> > on to remember how do it correctly.
> >
> > So...  Any ideas on how I can deal with this?  Should I dump Flash Player 
> > and switch to AIR?  Would that give me better control over the printing?  
> > Can AIR actually do all that I'm asking for here?  What will switching to 
> > AIR mean for accessing our data from our ColdFusion/SQL server through 
> > https:, if anything?
> >
> > Thanks,
> > Laurence MacNeill
> > Mableton, Georgia, USA
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>






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


Re: [flexcoders] Re: Switching Item Renderers

2010-08-31 Thread Wesley Acheson
Yeah thats the way I've done it previously. I thought that this way would
cut out on some additional computation.



On Tue, Aug 31, 2010 at 6:04 PM, valdhor wrote:

>
>
> That seems overly complicated to me. What I would try is create two custom
> components then instantiate the appropriate one based on the data and add it
> in the updateDisplayList method.
>
>
> --- In flexcoders@yahoogroups.com , Wesley
> Acheson  wrote:
> >
> > Since nobody has replied I'm continueing to try this. I currently think I
> > may need to override all methods in UI component.
> >
> >
> > Is it clear what I'm trying to do?
> >
> > Is this the wrong way of doing it?
> >
> > I think its probably lighter than wrapping to components in a fully
> fledged
> > UI component?
> > *
> > Some Thoughts*
> >
> > Also a comment on ListItemRenderer, theres an awful lot of methods that
> need
> > to be implemented to make this work. I doubt all of them are used in a
> List
> > Senario. Even implementing them all theres still a dependency on
> > DisplayObject (who's methods seem to be implemented). It does feel to me
> > like the architecture seems a bit off. I mean if all of those methods are
> > implemented why is there still a dependency on DisplayObject.
> >
> > Its not just enough to implement IListRenderer which seems to defeat the
> > purpose of an interace
> >
> > On Wed, Aug 18, 2010 at 11:42 PM, Wesley Acheson
> > wrote:
>
> >
> > > *Disclaimer:* This is a cross post with Stack Overflow. I know at least
> > > one person on this list saw it there.
> > > http://stackoverflow.com/questions/3507313/flex-switch-item-renderer
> > >
> > > Hi
> > >
> > > I was wondering if anyone had any luck with the following senario in
> flex.
> > >
> > > I'd like to be able to have a custom item renderer which delegates to
> > > another renderer inside.
> > >
> > > The reason for this would be in a datagrid for instance displaying a
> > > checkbox if the dataprovider for the row had a boolean value. Using the
> > > default item renderer when the value was a non boolean.
> > >
> > > Basically I was hoping to use a proxy object (though not necessarily
> the
> > > proxy class) so that I could a renderer which delegated all of its
> > > responsibilties to a sub renderer.
> > >
> > > Hard to explain.
> > >
> > > *Edit 1*
> > >
> > > I think the following gives a clearer idea of what I had in mind. This
> is
> > > only knocked up quickly for the purpose of showing the idea.
> > >
> > > *SwitchingRenderer.as*
> > >
> > > package com.example
> > > {
> > > import mx.controls.CheckBox;
> > >
> > > import mx.controls.dataGridClasses.DataGridItemRenderer;
> > >
> > > import mx.controls.listClasses.BaseListData;
> > >
> > > import mx.controls.listClasses.IDropInListItemRenderer;
> > >
> > > import mx.core.IDataRenderer;
> > >
> > > import mx.core.UIComponent;
> > >
> > > public class SwitchingRenderer extends UIComponent implements
> IDataRenderer, IDropInListItemRenderer
> > >
> > > {
> > > private var checkboxRenderer:CheckBox;
> > >
> > > private var defaultRenderer:DataGridItemRenderer;
> > >
> > > private var currentRenderer:IDataRenderer;
> > >
> > > public function SwitchingRenderer()
> > >
> > > {
> > > this.checkboxRenderer = new CheckBox();
> > >
> > > this.defaultRenderer = new DataGridItemRenderer();
> > >
> > > this.currentRenderer = defaultRenderer();
> > >
> > > super();
> > > }
> > >
> > > public function get data():Object
> > >
> > > {
> > > //If the data for this cell is a boolean
> > > // currentRender = checkBoxRenderer
> > >
> > > // otherwise
> > > // currentRenderer = defaultRenderer
> > > }
> > >
> > > public function set data(value:Object):void
> > >
> > > {
> > > currentRenderer.data = value;
> > >
> > > }
> > >
> > > public function get listData():BaseListData
> > >
> > > {
> > > return currentRenderer.listData;
> > >
> > > }
> > >
> > > public function set listData(value:BaseListData):void
> > >
> > > {
> > > currentRenderer.listData = value;
> > >
> > > }
> > >
> > >
> > >
> > > }
> > > }
> > >
> > >
> > >
> >
>
>  
>


Re: [flexcoders] separate flex apps in same webroot folder

2010-08-31 Thread Pr@vin Uttarwar
Hi ,
Is there any RSL setting for this app?
if yes what is it?

Thanks & Regards,

Pravin Uttarwar | Perennial Systems
pravin.uttar...@perennialsys.com | Cell: +91 9371288080 | Tel: +91 (020)
2421 1286 Ext:2007


On 1 September 2010 11:31, ZIONIST  wrote:

>
>
> Hi guys i recently developed a website flex for a client and was asked to
> make it editable. so i developed a content management system in flex so that
> my client could be able to edit the content on the site. i uploaded the main
> site onto a shared server of my hosting company in the wwwroot folder and i
> created another folder within the wwwroot folder called admin where i put
> the administrative site. here is the problem, the main site can be accessed
> using this url http://www.afriquesuites.com and when i try accessing the
> admin site i use
> http://www.afriquesuites.com/admin/afriquesuitesAdmin.html which does not
> load the page. My question is how to access the admin site.
>
>  
>


[flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread ZIONIST
am not sure i understand your question... all i did is develop the two apps 
separately and deployed the release build version of the site to the wwwroot 
folder on the host server and the release build version of the admin site to 
the admin folder in the wwwroot folder.




Re: [flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread Pr@vin Uttarwar
As I have seen your swf it is not loading completely and its size is less
than 200 kb,
so it must be loading framework as RSL.
Also it might load if you out it in same folder ,if it is so,then problem is
that the framework setting is wrong,

try putting framework_.xx in admin folder and try again.

Thanks & Regards,

Pravin Uttarwar | Perennial Systems
pravin.uttar...@perennialsys.com | Cell: +91 9371288080 | Tel: +91 (020)
2421 1286 Ext:2007


On 1 September 2010 11:57, ZIONIST  wrote:

>
>
> am not sure i understand your question... all i did is develop the two apps
> separately and deployed the release build version of the site to the wwwroot
> folder on the host server and the release build version of the admin site to
> the admin folder in the wwwroot folder.
>
>  
>


[flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread ZIONIST
i already have framework_.xx in the admin folder.




Re: [flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread Pr@vin Uttarwar
ok
As i have seen your main site i saw firebug that it is loading framework swf
of 500+ kb.

So i thought it is might not loading the same for admin.
Also is it working if putted in main folder?


Thanks & Regards,

Pravin Uttarwar | Perennial Systems
pravin.uttar...@perennialsys.com | Cell: +91 9371288080 | Tel: +91 (020)
2421 1286 Ext:2007


On 1 September 2010 12:04, ZIONIST  wrote:

>
>
> i already have framework_.xx in the admin folder.
>
>  
>


[flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread ZIONIST
when i put the afriquesuitesAdmin.swf and afriquesuitesAdmin.html in the main 
folder, it still doesn't work. 




Re: [flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread Pr@vin Uttarwar
:(
is it working on locally?

Thanks & Regards,

Pravin Uttarwar | Perennial Systems
pravin.uttar...@perennialsys.com | Cell: +91 9371288080 | Tel: +91 (020)
2421 1286 Ext:2007


On 1 September 2010 12:11, ZIONIST  wrote:

>
>
> when i put the afriquesuitesAdmin.swf and afriquesuitesAdmin.html in the
> main folder, it still doesn't work.
>
>  
>


Re: [flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread Pr@vin Uttarwar
Its working now.


Thanks & Regards,

Pravin Uttarwar | Perennial Systems
pravin.uttar...@perennialsys.com | Cell: +91 9371288080 | Tel: +91 (020)
2421 1286 Ext:2007


On 1 September 2010 12:13, p...@vin Uttarwar  wrote:

> :(
> is it working on locally?
>
> Thanks & Regards,
>
> Pravin Uttarwar | Perennial Systems
> pravin.uttar...@perennialsys.com | Cell: +91 9371288080 | Tel: +91 (020)
> 2421 1286 Ext:2007
>
>
> On 1 September 2010 12:11, ZIONIST  wrote:
>
>>
>>
>> when i put the afriquesuitesAdmin.swf and afriquesuitesAdmin.html in the
>> main folder, it still doesn't work.
>>
>>  
>>
>
>


[flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread ZIONIST
on my development pc the two apps work perfectly.



[flexcoders] Re: separate flex apps in same webroot folder

2010-08-31 Thread ZIONIST
NO its still not working on mine.