[flexcoders] Re: Capturing a browser-refresh event...

2010-02-21 Thread Laurence
That works perfectly.  They can't hit refresh/back/close without triggering 
that pop-up window.  Exactly what I needed.

Thanks,
L.


--- In flexcoders@yahoogroups.com, Peeyush Tuli  wrote:
>
> window.onbeforeunload = function() {
> return "It is not recommended to use the browser
> close/refresh/close buttons unless you have saved your data and logged out";
> }
> 
> Add the above code to a javascript section on the html wrapper which loads
> your application. This will raise a javascript alert on all browser actions
> which cause a redirect away from the current page. I dont think there is a
> foolproof way to listen to this event directly in your swf.
> 
> ~Peeyush
>  http://www.mds.asia
> 
> 
> On Sun, Feb 21, 2010 at 12:40 PM, Laurence  wrote:
> 
> >
> >
> > In my app, if you click the browser's refresh button, it re-loads the app
> > and starts it over from the beginning (as you'd expect.)
> >
> > I want my app to be able to capture this refresh event (or perhaps just
> > block it completely?) so that users won't lose all the data they've entered
> > if they accidentally click the browser's refresh button. Ideally it would
> > give them a pop-up window telling them that they're about to lose all their
> > data, and allow them to cancel the refresh if they desire.
> >
> > Is this possible? How can I do that from my Flex app?
> >
> > Thanks,
> > Laurence MacNeill
> > Mableton, Georgia, USA
> >
> >  
> >
>




Re: [flexcoders] Capturing a browser-refresh event...

2010-02-21 Thread Peeyush Tuli
window.onbeforeunload = function() {
return "It is not recommended to use the browser
close/refresh/close buttons unless you have saved your data and logged out";
}

Add the above code to a javascript section on the html wrapper which loads
your application. This will raise a javascript alert on all browser actions
which cause a redirect away from the current page. I dont think there is a
foolproof way to listen to this event directly in your swf.

~Peeyush
 http://www.mds.asia


On Sun, Feb 21, 2010 at 12:40 PM, Laurence  wrote:

>
>
> In my app, if you click the browser's refresh button, it re-loads the app
> and starts it over from the beginning (as you'd expect.)
>
> I want my app to be able to capture this refresh event (or perhaps just
> block it completely?) so that users won't lose all the data they've entered
> if they accidentally click the browser's refresh button. Ideally it would
> give them a pop-up window telling them that they're about to lose all their
> data, and allow them to cancel the refresh if they desire.
>
> Is this possible? How can I do that from my Flex app?
>
> Thanks,
> Laurence MacNeill
> Mableton, Georgia, USA
>
>  
>


[flexcoders] Re: Compile Error Under 3.5a but not 3.4

2010-02-21 Thread mitek17
Seems like Adobe screwed up namespaces in 3.5

Here is the bug I filed in regards to DesignView not understanding mx namespace 
for components.
https://bugs.adobe.com/jira/browse/FB-25994


I wonder if *anyone* uses 3.5 SDK. I did 3 attempts to migrate from 3.4 and 
they all failed.

PS Probably Adobe needs more spanking from Steve Jobs :)

Cheers,
Dmitri.


--- In flexcoders@yahoogroups.com, "mcaplan_labnet"  wrote:
>
> Hi There,
> 
> I'm unsure what is going on, but I can't compile my project under 3.5.  Works 
> fine under 3.4.  I get the following errors in 3.5:
> 
> Encountered errors or warnings while building project Alloys.mxml.
> Alloys.mxml: Invalid component name 'modules.Alloys': component name must 
> be legal ActionScript class name.
> Encountered errors or warnings while building project Case.mxml.
> Case.mxml: Invalid component name 'modules.Case': component name must be 
> legal ActionScript class name.
> 
> 
> Any ideas?
> 
> Thanks,
> 
> Mike
>




[flexcoders] Generating panels dynamically? How?

2010-02-21 Thread flexnewbie999
I have a ArrayCollection of objects that contain an image and other fields. I 
need to dynamically created a panel for each image in succession as the 
collection is iterated over (at least that's the idea I've come up with). I can 
hard code each individual image via mxml into a panel but that doesn' suit my 
purposes as I never know how many items are in the collection. I've looked at 
itemRenderers but that doesn't seem to go since they only appear to work with 
grids and lists etc. I'm relatively new at this; is coding this type of thing 
the only solution to this problem or are there components I'm missing?

Thanks!



[flexcoders] Strategies for switching between testing and deployment addresses

2010-02-21 Thread David Adams
I've been writing some small programs that use HTTPService calls to
fetch data from a back-end. During testing, I'm using 127.0.0.1 or an
IP address on my subnet. When I deploy, I update the IP address in
service definitions to the right external address and build the app.
Or at least I mean to. It's all too easy to accidentally change the
addresses for internal testing and then forget to switch them back
before building.

Is there a best practice or simple strategy for putting the IP address
somewhere outside of the source code that it can easily be edited
without a rebuild?

Thanks for any advice.


Re: [flexcoders] A framework to help with busines apps?

2010-02-21 Thread David Adams
On Fri, Feb 12, 2010 at 5:23 AM, Nick Middleweek wrote:

>  My background is 4D DB (www.4d.com) and there are great ways to work and
> certain events are good for loading data, related data in sub screens. I'm
> not trying to replacte 4D within Flex because architectural it's different
> but I guess every developer is faced with similar issues and to overcome the
> same hurdles and was hoping there are some good practices out there I can
> follow..
>
Hey again Nick!  For any other 4D programmers following this list, there's a
special-topic list for 4D-Flex development that may also be of interest:

http://groups.google.com/group/4d-flex

The 4D-Flex list is no substitute for FlexCoders, but the special-purpose
list is a nice place for those of us that already know 4D.


[flexcoders] Compile Error Under 3.5a but not 3.4

2010-02-21 Thread mcaplan_labnet
Hi There,

I'm unsure what is going on, but I can't compile my project under 3.5.  Works 
fine under 3.4.  I get the following errors in 3.5:

Encountered errors or warnings while building project Alloys.mxml.
Alloys.mxml: Invalid component name 'modules.Alloys': component name must 
be legal ActionScript class name.
Encountered errors or warnings while building project Case.mxml.
Case.mxml: Invalid component name 'modules.Case': component name must be 
legal ActionScript class name.


Any ideas?

Thanks,

Mike




Re: [flexcoders] Mapping Java Generics to an AS3 Vector through BlazeDS remoting?

2010-02-21 Thread Jochem van Dieten
On Sun, Feb 21, 2010 at 2:41 PM, Roman Protsiuk wrote:
> You won't be able to get generic element type information during runtime so 
> what's the point?

That is why Remoting can't distinguish between receiving a generified
collection and a regular collection from the Java backend and has to
fall back to casting to an arraycollection. But what if I just happen
to know and want to force it?


> The only likely approach I guess is generic serializer/deserializer.

That was my idea too. It helps that I am (for now) only looking at a
way to do this from Java to ActionScript, but I am still not sure it
is worth the effort. Which is why I am hoping somebody else has
already tried this.

Jochem


-- 
Jochem van Dieten
http://jochem.vandieten.net/


Re: [flexcoders] how to implement bread crumbs in flex application

2010-02-21 Thread talluri venkat
Hi Satish,
Do you have for flex breadcrumb. Please send me the code.
If any one have flex breadcrumb working application. please let me know.
Regards,Venkat

--- On Mon, 16/11/09, Satish Chowdary  wrote:

From: Satish Chowdary 
Subject: [flexcoders] how to implement bread crumbs in flex application
To: "flexcoders" 
Date: Monday, 16 November, 2009, 7:12 AM















 
 



  



  
  
  
Hey Coders,
 
give me a idea about how  to implement breadcrumbs in flex application
 
Thanks inAdvanceసతీష్





   
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.


 





 



  











  Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
http://downloads.yahoo.com/in/internetexplorer/

[flexcoders] Re: A framework to help with busines apps?

2010-02-21 Thread Jukka


Hi Nick,

you might want to start by looking at 
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions. These are 
the conventions that Adobe recommends, although I don't really agree with all 
of them. When you have finished reading, I suggest taking a trip to the 
livedocs 
http://livedocs.adobe.com/flex/3/html/help.html?content=introbd_1.html#202015. 
The Livedocs are really one of the best places to go when you want to get to 
know Flex.

It's really hard to give any general tips of building a whole business 
architecture, as the requirements can be very different depending of the type 
of the application, as you probably understand. These are things I'm not so 
keen to give forward, as building good architecture is always about balancing 
things, and the decisions are based usually on some mannerisms and personal 
opinions. Remember that these are only my own opinions and I've been developing 
and architecting Flex and Flash for only three or four years.

- I really urge you to give try to the Asfusion's Mate. Swiz might be also good 
possibility, although I haven't tried it. I have used Cairngorm in few projects 
and advice you to stay away from it, as it uses some questionable patterns, is 
very verbose and your project cannot be easily converted into other frameworks. 
In contrast Mate is nothing like Cairngorm (DI MVC with only one framework 
dependent class per miniatyre sub-application).

- use the event-driven behaviour of Flex and get to know it well, as it is 
probably the single most powerful feature of the whole Flash environment. Also, 
I haven't had the time to look it up, but there seems to be a whole lot of buzz 
at Robert Penners new signal system, which seems to be easier to use and 
possible faster than the traditional event system of Flex. 
http://robertpenner.com/flashblog/2009/09/my-new-as3-event-system-signals.html

- do not use Flex modules for pagination if your application pages aren't going 
to be huge. The modules give you the possibility to download part of your 
application only when the user really requires it, but on the downside they 
seem to be (or at least were) little buggy and irritating to use. Instead use 
normal AS classes or MXML components inside some navigation container, for 
example viewstack.

- the first thing to do when you start your development process is to make a 
external Flex library project where to write your reusable components and 
classes. Try to learn to make generic custom components from the start as they 
really help the development when you get further. Try to write your custom 
components in actionscript, as it is more versatile compared to the 
MXML-components.

- business application usually requires back-end technology to fetch the data. 
For this I'd recommend using the AMF. It is hands down the fastest way to 
transfer data from and to the back-end. The middleware used depends of course 
of the back-end technology: there are at least BlazeDS for Java and AMFPHP for 
PHP.

- for quality assurance you might use FlexMonkey, Fluint, FlexPMD and Flex 
cover.

I know these are pretty high-level tips, but it is very hard to go any lower 
not knowing which kind of project you have.

Hope this was helpful at least in some degree,

Jukka Hämäläinen
RIA architect
Ecore Ltd

--- In flexcoders@yahoogroups.com, Nick Middleweek  wrote:
>
> Hi,
> 
> Are there any frameworks/ methods of working/ general thoughts on how to
> design business applications.
> 
> By this I mean best practices to load a flex app, show a login screen,
> display a search screen, get data, show results, double click to view detail
> form, etc...
> 
> I realise we can use Cairngorm, MATE, etc for the overall event mamagement
> but what about defining those events or having a naming convention or
> approach to follow? Does one exist?
> 
> My background is 4D DB (www.4d.com) and there are great ways to work and
> certain events are good for loading data, related data in sub screens. I'm
> not trying to replacte 4D within Flex because architectural it's different
> but I guess every developer is faced with similar issues and to overcome the
> same hurdles and was hoping there are some good practices out there I can
> follow...
> 
> 
> Thanks for reading...
> 
> Nick
>



Re: [flexcoders] Mapping Java Generics to an AS3 Vector through BlazeDS remoting?

2010-02-21 Thread Roman Protsiuk
You won't be able to get generic element type information during runtime so
what's the point?
The only likely approach I guess is generic serializer/deserializer. And
still I'm not sure whether vector element type information is
serialized/deserialized with vector or is it just a compile time information
unreachable during runtime.

Roman

On Sun, Feb 21, 2010 at 11:37 AM, Jochem van Dieten wrote:

>
>
> ISTM the natural match between Java Generics and ActionScript is the
> Vector since it allows one to declare a type for the collection
> members. And apparently there are some performance gains to be had
> when using a Vector instead of an Array:
>
> http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3a0f5f19124318fc87b-7fff.html
>
> Does anybody have any tips on getting a Vector of objects out of a
> BlazeDS remoting call? I know I can convert an ArrayCollection to a
> Vector manually, but that does not seem like a terrible attractive
> option to me.
>
> Jochem
>
> --
> Jochem van Dieten
> http://jochem.vandieten.net/
>  
>


Re: [flexcoders] How to get a value

2010-02-21 Thread Wally Kolcz
Here is a small sample of my code. The Page Class is created in a module 
called Journal. The function to update the text of the TextArea is in 
the Journal so I dont think 'this' will work.


...
public function updateText(e:FocusEvent):void {
var uj:JournalEvent = new 
JournalEvent(JournalEvent.UPDATE);

uj.body = e.currentTarget.text;
uj.entryID = ; // *Here is my Problem*
dispatchEvent(uj);
}
]]>





width="800" height="500"

openAt="0" autoFlipDuration="600" easing="0.7" regionSize="150"
sideFlip="true" hardCover="true" hover="true" snap="false" 
flipOnClick="true" dropShadowEnabled="true" dropShadowColor="0x00" 
borderColor="0x00" shadowDirection="right" shadowDistance="5" 
borderStyle="solid" borderThickness="1">






fontFamily="Georgia"/>
color="#00" textAlign="center" text="By 
{UserDataModel.getInstance().firstName}" />




On 2/21/2010 1:01 AM, Alex Harui wrote:


If you have:

Public class Page
{
private var myTextArea:TextArea;

private var journalID:String;

override protected function createChildren():void
{
myTextArea = new TextArea();
myTextArea.addEventListener(FocusEvent.FOCUS_OUT, 
myFocusOutHandler);

}

private function myFocusOutHandler(event:FocusEvent):void
{
// the ‘this’ pointer is the instance of Page
// event.currentTarget is the TextArea
journalID = TextArea(event.currentTarget.text);
}
}


On 2/20/10 8:25 PM, "Wally Kolcz" > wrote:







I have an instance of a Class (Page) which has a textarea on it
which is
editable. I added an eventlistener to the TextArea for
FocusEvent.FOCUS_OUT. When the FocusEvent (e) gets to the hander,
I can
use e.currentTarget to get the value of the TextArea, but I need a
value
in a variable in the same instance of the Page Class (journalID).
I have
been looking through the debugger but I cannot figure out how to get
that value.

Long story short I need the variable journalID on the same Class that
contains the TextArea.

Thanks.






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


I in


[flexcoders] Using HTTP Basic Authentication with BlazeDS Remoting

2010-02-21 Thread Jochem van Dieten
Is it possible to use HTTP Basic Authentication in combination with
BlazeDS Remoting?

The scenario is that I have BlazeDS running on a container that is
behind an IIS server that forwards all requests intended for BlazeDS.
To make the security people happy we want to enable ACLs on the IIS
server so we can piggyback n all of the existing authentication
infrastructure. When IIS is configured for HTTP Basic Authentication
over SSL this works fine for HTTPServices and URLLoaders (we are
running an AIR application). But we can not figure out how to add the
required HTTP headers to a Remoting call.

Jochem


-- 
Jochem van Dieten
http://jochem.vandieten.net/


Re: [flexcoders] SQL Question

2010-02-21 Thread Jochem van Dieten
On Sun, Feb 21, 2010 at 12:04 AM, Wally Kolcz wrote:
> I have a record where 'ageGroups' is '0, 1, 2, 3, 4, 5, 6, 7, 8' and the
> 'accountType' is 'kids, siblings, parents'

As other have said, your schema is all wrong. But for this simple
scenario it is doable to fix it with string manipulation:

Select *
FROM chatrooms
WHERE
',' || accountType || ',' LIKE 
AND
',' || ageGroups || ',' LIKE 
ORDER BY roomDisplay ASC

You need to fix the || operator if you are not running MySQL in
standard compliance mode.

Jochem

-- 
Jochem van Dieten
http://jochem.vandieten.net/


[flexcoders] Mapping Java Generics to an AS3 Vector through BlazeDS remoting?

2010-02-21 Thread Jochem van Dieten
ISTM the natural match between Java Generics and ActionScript is the
Vector since it allows one to declare a type for the collection
members. And apparently there are some performance gains to be had
when using a Vector instead of an Array:
http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3a0f5f19124318fc87b-7fff.html

Does anybody have any tips on getting a Vector of objects out of a
BlazeDS remoting call? I know I can convert an ArrayCollection to a
Vector manually, but that does not seem like a terrible attractive
option to me.

Jochem


-- 
Jochem van Dieten
http://jochem.vandieten.net/