RE: [flexcoders] 32k problem

2005-08-10 Thread Tracy Spratt










Mika, I have been wrestling with the 32k
issue for about 18 months, including banging on the MM folks on this list
mercilessly.  If there was ever anything posted on this list (or anywhere
that is googlable), that would help find WHERE the problem is I probably would
have seen it.  And it really mattered in the early days when I was still
working with architecture issues.  I think the problem is that those
branch numbers refer to structures to far removed from the code we have written
to do us any good.

 

If adding the bogus code worked for you
then you probably don’t really have any problem code and are just a
victim of the Flex compiler’s decisions.  I agree, it is both funny
and stupid!  By the way, next time you hit the 32k, just delete your bogus
code!

 

Tracy

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mika Kiljunen
Sent: Wednesday, August 10, 2005
6:59 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] 32k
problem



 

I don’t mean the ways to get around
it but a way to locate the actual problematic part in code so I can fix it!!

 

But since no one can remember the solution
to that, I got around it by adding bogus code (which is funny and stupid at the
same time…).

 

-Mika

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Steven Webster
Sent: 10. elokuuta 2005 13:31
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] 32k
problem



 

There was a solution how you can find the branch in code
that caused this, but unfortunately I can’t remember what it was and
where I found it. 

 

 

The solution is in the FAQ ;-)

 

http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt

 

"Q: 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  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).

RE: [flexcoders] 32k problem

2005-08-10 Thread Steven Webster





Lucas,
 
That *might* remove the 32k error, but not by design.  
Anything you do that alters the way the compiler chooses to compile your code is 
likely to have the side-effect of removing the 32k span error.  However, 
just because you have the FrameProfilingEnable flag enabled, doesn't mean you're 
going to remove the possibility of the 32k span error happening again at some 
future point in time.
 
Hope that clarifies,
 
Steven
 


--
Steven WebsterTechnical 
Director
iteration::two[EMAIL PROTECTED]
 
Office:  +44 (0)131 338 
6108Mobile: +44 (0)7977 216 223
 
This e-mail and any associated attachments 
transmitted with it may contain confidential information and must not be copied, 
or disclosed, or used by anyone other than the intended recipient(s). If you are 
not the intended recipient(s) please destroy this e-mail, and any copies of it, 
immediately. Please also note that while software systems have been 
used to try to ensure that this e-mail has been swept for viruses, 
iteration::two do not accept responsibility for any damage or loss caused in 
respect of any viruses transmitted by the e-mail. Please ensure your own checks 
are carried out before any attachments are 
opened.
 


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Lucas 
AlfaroSent: 10 August 2005 11:40To: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] 32k 
problem


 
 Wouldn’t add this 
parameter FrameProfilingEnable=0 into your mm.cfg bypass this 
error?
 
L.
 





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

Computer software testing
  
  
Macromedia flex
  
  
Development
  
  


Software developer
  

   
  







  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] 32k problem

2005-08-10 Thread Mika Kiljunen










I don’t mean the ways to get around
it but a way to locate the actual problematic part in code so I can fix it!!

 

But since no one can remember the solution
to that, I got around it by adding bogus code (which is funny and stupid at the
same time…).

 

-Mika

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Steven Webster
Sent: 10. elokuuta 2005 13:31
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] 32k
problem



 

There was a solution how you can find the branch in code
that caused this, but unfortunately I can’t remember what it was and
where I found it. 

 

 

The solution is in the FAQ ;-)

 

http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt

 

"Q: 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  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."

 

Best,

 

Steven 









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





  




  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











RE: [flexcoders] 32k problem

2005-08-10 Thread Lucas Alfaro










 

 Wouldn’t add this parameter FrameProfilingEnable=0
into your mm.cfg bypass this error?

 

L.

 

 

 









From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steven Webster
Sent: 10 August 2005 11:31
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] 32k
problem



 

There was a solution how you can find the branch in code
that caused this, but unfortunately I can’t remember what it was and
where I found it. 

 

 

The solution is in the FAQ ;-)

 

http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt

 

"Q: 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  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."

 

Best,

 

Steven 









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





  




  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











RE: [flexcoders] 32k problem

2005-08-10 Thread Steven Webster





There was a solution how you can 
find the branch in code that caused this, but unfortunately I can’t remember 
what it was and where I found it. 

 
 
The solution is in the FAQ 
;-)
 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 
"Q: What 
does "Branch between ... and ... around line ... exceeds 32Kspan" mean and 
how do I get rid of it?A: Don't panic.  Your app is NOT too big for 
Flex to handle. True, the32k limit is a real Flash Player limitation to the 
size of certainstructures like if blocks and for loops.  But you don't 
really careabout that right now, because you don't have any direct control 
overthose things.  Here is some information that will help you get back 
tocoding:There are two main reasons you might the 32k issue.  
The primary cause,and the one to address first, is the architecture of your 
applicationcode.  The 32k error message asks you to "refactor" your 
code.Refactoring is essentially the process of modifying the structure 
ofyour source code while keeping the same functionality.  In the 
Flexworld, this means moving some parts of the code  out of a main file 
andinto separate components.  One way to do this is to use custom 
mxmlcomponents.  So instead of, say, having several hundred lines of 
mxml ina child container of a ViewStack, you put that mxml code into its 
owncomponent 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 
become30. Decreasing the total number of visually rendered mxml tags in 
asingle file will help avoid the 32k limit. Another type of 
refactoringis to move ActionScript code into its own class. Important note! 
Justputting the AS code into a file and then using the #include directive 
orthe  to include the code will NOT help 
withthe 32k problem.  You MUST create a true AS class that contains 
thefunctionality.  Around two thousand lines of mixed mxml and AS code 
andyou are in danger of the 32k error.  I have not found an upper 
limitwhatsoever 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 thatinto the Flash 
swf.  In that process it makes decisions on how to breakup your source 
and generate the AS class code.  In Flex version 1.5, itdoesn'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, firsttry compiling the app 
with ?debug="true" in the url.  If the appcompiles, then you are surely 
at a boundary condition.  What ishappening is that debug adds code to 
your source duringgenerate/compile.  This additional code causes Flex 
to change thestructure of the AS classes so that the 32k limit is not 
hit.  Hmm, morecode?  Yeah.  Try just adding 50 or so lines 
of code, even if it isbogus.  Usually, this will get you working.  
Now, when you add more realcode go on and remove the bogus stuff, you don't 
want it in yourproduction code!A final hint.  After hitting a 
32k error, and trying one of the abovesolutions, if you still get the error, 
delete the temporary generated ascode.  It is located in 
..\MyAppServer\flex(flexroot or contextroot)\WEB- 
INF\flex\generated\*.  You can delete all the folders safely (makesure 
to restart your Flex server).This can be an aggravating and somewhat 
scary problem, and it alwaysseems to happen just before an important 
demo.  Just use good, modulardesign, and remember the bogus code 
trick.  Macromedia has stated acommittment to improving this situation 
in the next release."
 
Best,
 
Steven 





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





  




  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.