OK, attached is a 15 minute crack at an update.  Consider this a contribution and the rest of you can hash out exactly what you want in there for everyone J

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steven Webster
Sent: Sunday, July 30, 2006 2:26 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] File - flexcodersFAQ.txt

 

So before half of the flexcoders mailing list mails me and tells me the
FAQ is out of date (and they told me last month) I know, and I'll do my
best to update it before it comes out again.

Volunteers from the community, welcomed :) Fame and fortune is yours
(and I may even buy you a beer at MAX) if you take on board this task
... Mr Chotin.

Steven

> -----Original Message-----
> From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com]
> Sent: 30 July 2006 22:22
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] File - flexcodersFAQ.txt
>
>
> Flexcoders Frequently Asked Questions
> Last Updated: 30th May 2005
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___
                 Flexcoders Frequently Asked Questions
                      Last Updated: 31st July 2006
    ------------------------------------------------------------------------
                             Contributors:

Matt Chotin, Steven Webster, Alistair McLeod, Tariq Ahmed, Jeff Tapper,
 Peter Farland, Abdul Qabiz, Tracy Spratt, Jesse Warden, Dan Harfleet,
                  Manish Jethani, Dimitrios Gianninas


1. What is Flexcoders?
2. How does Flexcoders relate to the Adobe Flex Forum on
   www.adobe.com?
3. Who posts to Flexcoders?
4. Resources to check before asking a question
5. Guidelines for effective question-asking
6. FAQ


1. What is Flexcoders?

Flexcoders is a forum where developers can ask questions about Flex,
FlexBuilder, and Flex-related technologies (like Cairngorm and FlexUnit).  
The community is made up of everyday Flex developers as
well as Adobe employees. However, this is not an official
Adobe-sponsored forum, it is moderated by the community.  However the original
moderators who are still actively involved are folks from iteration::two, now 
members of Adobe Consulting.


2. How does Flexcoders relate to the Adobe Flex Forum on
   www.adobe.com?

Both the Adobe Flex Forum and Flexcoders provide help on issues
related to Flex, and neither is an official support mechanism.  Some
people monitor both forums, some only one.  It is up to you to decide
where you might have a better experience getting a question answered and
being able to subsequently help others.


3. Who posts to Flexcoders?

Everyone who has a question or an answer.  Many members of the Flex
development team read and respond to Flexcoders as well as other
Adobe folks who monitor the community.

Some recurring Adobe folks are:

David Mendels: EVP and GM, highest-level executive in charge of Flex.
Phil Costa: Group Product Manager, Flex. Matt Chotin, Product Manager Flex.
Manish Jethani, Roger Gonzalez, Cathy Murphy, Gordon Smith, 
Peter Farland and many more: Engineers on Flex.

Active community members include:

Steven Webster (Adobe Consulting RIA Practice Lead and co-author of
Developing Rich Clients with Macromedia Flex), Alistair McLeod
(Adobe Consulting RIA Practice Manager and co-author of Developing Rich
Clients with Macromedia Flex), Jesse Warden (JesterXL - Flash and Flex badass), 
Tracy Spratt (long-time member, holder of all knowledge related to Flex 1.5 32K 
limits), 
Jeff Steiner (maintainer of www.flexauthority.com), 
Tariq Ahmed (maintainer of www.cflex.net), Jimmy
Gianninas (long-time member, developer at Optimal Payments).

And so many more with Flex 2 that it's impossible to keep track!


4. Resources to check before asking a question

The Flexcoders Mail Archive (better searching than YahooGroups):
http://www.mail-archive.com/flexcoders%40yahoogroups.com

http://www.adobe.com/cfusion/webforums/forum/index.cfm?forumid=60

http://www.adobe.com/cfusion/knowledgebase/index.cfm

http://www.cflex.net/showfaq.cfm
http://www.cflex.net 
http://www.flexauthority.com
http://www.adobe.com/devnet/flex
http://weblogs.macromedia.com/mxna
http://www.google.com

Flex 1.5 specific
http://livedocs.macromedia.com/flex/15/asdocs_en/index.html
http://www.adobe.com/go/flex15_java_livedocs
The Book "Developing Rich Clients with Macromedia Flex" (check your
favorite bookstore)

Flex 2.0 specific
http://livedocs.macromedia.com/flex/2/
http://www.onflex.org/code/

More resources can be found at http://www.flex.org as well.


5. Guidelines to effective question-asking

Include a useful subject; this will help people find their own questions
and answers later.

Explain what you are trying to accomplish.

Explain the error (include compilation errors or a description of the
runtime behavior).

Be prepared to break your problem down into a simpler scenario in case
someone wants to try to debug the code themselves.  Remember, private
web services are inaccessible; you may need to create some dummy data to
emulate problems.

Phrases to avoid:

"URGENT" (we all have deadlines, no one is intentionally delaying a
response to you)

"Please send code" (this is very frustrating to read as it implies you
aren't interested in learning anything on your own.  Where code is
appropriate you can expect someone to provide it, but in many cases you
will learn more by doing it on your own with appropriate guidance.  It
may be that you're on a deadline and just want to finish, but many of
those who respond regularly would prefer to "teach you to fish" so that
you can answer your own questions next time and even help out others).


6. Mini-FAQ



Q: Can I mail Matt, Manish, Pete, Gordon, Steven, Ali, or
anyone else for that matter off-line with my question?

A: Please don't!  If someone is capable of answering your question on-
list please believe that it will be done.  Everyone on the list has
full-time jobs doing their own work and often answer flexcoders on their
own time; mailing them off- list doesn’t endear you to them.  If no one
answers on-list in a reasonable amount of time (24 hours) you can try to
rephrase the question and perhaps include more detail (including a
version of the problem that someone can run without doing any setup on
their own machine).

------------------------------------------------------------------------

Q: When is the next version of Flex coming out, what will be in that version?

A: The Flex team will list any public info at 
http://weblogs.macromedia.com/flexteam

------------------------------------------------------------------------

Q: Flex 1.5: What does "Branch between ... and ... around line ... exceeds 32K
span" mean and how do I get rid of it?

A: Don't panic.  Your app is NOT too big for Flex to handle. True, the
32k limit is a real Flash Player limitation to the size of certain
structures like if blocks and for loops.  But you don't really care
about that right now, because you don't have any direct control over
those things.  Here is some information that will help you get back to
coding:

There are two main reasons you might the 32k issue.  The primary cause,
and the one to address first, is the architecture of your application
code.  The 32k error message asks you to "refactor" your code.
Refactoring is essentially the process of modifying the structure of
your source code while keeping the same functionality.  In the Flex
world, this means moving some parts of the code  out of a main file and
into separate components.  One way to do this is to use custom mxml
components.  So instead of, say, having several hundred lines of mxml in
a child container of a ViewStack, you put that mxml code into its own
component file, and have a single line in the ViewStack to reference it.
Do that for all the ViewStack children and 1000 lines of code can become
30. Decreasing the total number of visually rendered mxml tags in a
single file will help avoid the 32k limit. Another type of refactoring
is to move ActionScript code into its own class. Important note! Just
putting the AS code into a file and then using the #include directive or
the <mx:Script source="filename"> to include the code will NOT help with
the 32k problem.  You MUST create a true AS class that contains the
functionality.  Around two thousand lines of mixed mxml and AS code and
you are in danger of the 32k error.  I have not found an upper limit
whatsoever to  code length in a class.

The second cause of the 32k error is not your fault.  During compile,
Flex generates AS code out of your mxml source.  Then it compiles that
into the Flash swf.  In that process it makes decisions on how to break
up your source and generate the AS class code.  In Flex version 1.5, it
doesn't always make the right decision, and the result is the 32k error.
IF you are confident that you app is already efficiently "refactored",
and you suspect you might be at one of these boundary conditions, first
try compiling the app with ?debug="true" in the url.  If the app
compiles, then you are surely at a boundary condition.  What is
happening is that debug adds code to your source during
generate/compile.  This additional code causes Flex to change the
structure of the AS classes so that the 32k limit is not hit.  Hmm, more
code?  Yeah.  Try just adding 50 or so lines of code, even if it is
bogus.  Usually, this will get you working.  Now, when you add more real
code go on and remove the bogus stuff, you don't want it in your
production code!

A final hint.  After hitting a 32k error, and trying one of the above
solutions, if you still get the error, delete the temporary generated as
code.  It is located in ..\MyAppServer\flex(flexroot or contextroot)
\WEB- INF\flex\generated\*.  You can delete all the folders safely (make
sure to restart your Flex server).

This can be an aggravating and somewhat scary problem, and it always
seems to happen just before an important demo.  Just use good, modular
design, and remember the bogus code trick.  Macromedia has stated a
committment to improving this situation in the next release.

------------------------------------------------------------------------

Q: Flex 1.5: What does "Warning: Changes to unknown property, ..., will not be
detected" mean and how do I get rid of it?

A: Generally speaking, binding needs type information to set up its
change detection functionality, and anything that hides this info can
cause this problem.  Don't use
mx.core.application.application.myVariable in binding.  If you are
passing a reference to some component into another component via public
properties, type the property variable definition as specifically as
possible. When using "dot.down" notation to specify a property in an
object or model, cast it to a type:
text="{String(myObject.whatever.firstName)}"

------------------------------------------------------------------------

Q: Flex 1.5: How to run Flex as a Service?

A: Flex is not a server that you deploy and run, it is simply deployed
as part of your web application. So whatever web container you are
using, either Tomcat, JRun 4, WebLogic, etc... so long as you can run
any of those as services, then it will work. To learn how to deploy
Tomcat, JRun 4 or any other Java server as a service, please refer to
the appropriate documentation for the server you are using.

------------------------------------------------------------------------

Q: Does Flex work on my platform?

A: Probably, search the archives if you have a specific question about
your platform before posting to the list.

------------------------------------------------------------------------

Q: How do I get Flex to query my database?

A: Flex does not have any native database integration functionality. you
will require some server-side tier that will do the database access and
send the data back to Flex via one of three protocols:

* RemoteObjects: Fastest. communicates with server side EJB's or POJOs using
  AMF, a binary, compressed format.
* HTTPService: uses HTTP protocol. Sources can be JSP, ASPx,.NET, files, any url
  that returns HTTP.
* WebService: Slowest. Uses SOAP protocol. Sources can be .Net, or any
  WebService.
  
------------------------------------------------------------------------

Q: I'm sending my request, and I see the data traffic in the command
window, but the result is always empty.

A: You are probably trying to read the result immediately after the
send(), right, expecting synchronous behavior?  You can't do this. See
"How do I make synchronous data calls?"

------------------------------------------------------------------------

Q: How do I make synchronous data calls?

A: You CANNOT do synchronous calls. You MUST use the result event. No,
you can't use a loop, or setInterval or even callLater.  This paradigm is
quite aggravating at first. Take a deep breath, surrender to the
inevitable, resistance is futile.

There is a generic way to handle the asynchronous nature of data service
calls called ACT (Asynchronous Call Token). Search for this in
Developing Flex Apps doc for a full description, but here it is in a
nutshell. This example uses HTTPService but will be similar for
RemoteObject and WebService:

Flex 1.5:

* First, create a function to handle the data return, like "onResult()"
* In the HTTPService tag, put this function name in the "result" property,
  passing in event. <mx:HTTPService id="mxdsGetData" result="onResult(event)"
  ...>
* Invoke the call in script:
  //invokes the call to the HTTP data service
  var oRequestCallbject = app.mxdsGetData.send(oRequest);
  //we will use this string value in the result handler.
  //Yes, you CAN set this AFTER you invoke send()
  oRequestCall.MyQueryId = "WhateverIWanttoUseToIdentifyThisCall" ;
* In the result handler, which will be called every time the data service call
  returns, you identify what the returned data contains like this:
  var callResponse = oEvent.call; //get the call object
  //gets the value of this property you set in the call
  var sQueryId = callResponse.MyQueryId;
  //will be "WhateverIWanttoUseToIdentifyThisCall";
  trace(sQueryId);

  You can use this sQueryId value in a switch to do the correct
  processing. Alternatively, you can pass reference to a handler
  function directly.
  
Flex 2: see the docs for more including IResponder

------------------------------------------------------------------------

Q: When I have only a single record, it does not display in my DataGrid

A: Flex 2: set resultFormat="array".

Flex 1.5: This is a known issue for that is caused by Flex's inability to
differentiate between an object and an array with a single row. the
solution is to ALWAYS use "toArray()". Here are some examples:

In MXML:
        <mx:DataProvider>
{mx.utils.ArrayUtil.toArray(modelAccidents1.accidents.accident)}
        </mx:DataProvider>

And the inline format:

dataProvider={mx.utils.ArrayUtil.toArray(testSrv.result.result.error)}

And in ActionScript:
        myControl.dataProvider =
mx.utils.ArrayUtil.toArray(testSrv.result.result.error)

------------------------------------------------------------------------

Q: I have two alerts in my code, but they are displaying in reverse!

A: Actually, it is worse that that.  Alerts, and "Modal" pop-up windows
are not truly modal.  They prevent user interaction with the interface,
but they do NOT block code execution.  What is happening is that both
alerts are displaying, and the second one is on top of the first.  The
way to get the behavior you want is to use events and handlers.  Your
code must display the alert or modal pop-up, the end.  When the user
dismisses the prompt, you then complete the processing. You should be
able to find some examples if this on one of the sites listed in
"Resources"

------------------------------------------------------------------------

Q: The columns in my DataGrid are in some strange order!

A: The order is typically the reverse of the order in which they were
added.  If you need a specific order, specify that and many other good
things by using DataGridColumn tags.  See the docs.

------------------------------------------------------------------------

Q: Can I embed HTML in my Flex application?

A: Flex supports a limited subset of HTML in its TextArea and some other
text- related classes.  There is also a new article by Christophe on his
blog discussing how to fake HTML with an IFRAME (
http://coenraets.com/viewarticle.jsp?articleId=95).

------------------------------------------------------------------------

Q: Are there frameworks available for Flex?

A: Yep!
Cairngorm: http://labs.adobe.com/wiki/index.php/Cairngorm
FlexUnit: 
http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries#FlexUnit


// END

Reply via email to