Flex app not working without debug version of Flash Player - apache-flex

Recently, when I tried to show the results of my work (some Flex app) to my boss, i was quite suprised that application which run perfectly well on my pc, on my boss' pc wasn't displayed properly (the only thing visible was a default grey background). After 3h of trying absolutely everything, finally the app showed up when I changed his Flash Player version from standard one to debug (both was v. 10.0.22.87). Does anyone know what can be the reason of this (any compiler flag or sth). Forcing my boss to installing debug FP was quite ok, but forcing final user of the app to do so is unacceptable.
Thanks
PS: By showing I mean deploying to Tomcat on my pc and giving my boss a link to the app. We both use Win XP. Also when I installed debug FP for Netscape browsers and standard FP for IE (on my pc) the result is the same - working in Firefox, Opera, Chrome and grey background in IE. I've compiled both as a Debug and as a Release. I'm using Flash Develop 3.0.2 RTM
After stripping my app to sth like this - it still works only in debug FP
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:ca="components.*"
xmlns:ea="components.editAreas.*"
layout="vertical"
backgroundColor="black">
<mx:Canvas id="header"
verticalScrollPolicy="off"
horizontalScrollPolicy="off"
styleName="header"
width="100%"></mx:Canvas>
<mx:Canvas id="mainContent"
width="100%" height="100%"
verticalScrollPolicy="off">
</mx:Canvas>
</mx:Application>

The same kind of issue i faced few days back.
I was using following code
//Call To The Function
traceDetails(new Error())
private function traceDetails(err:Error):void
{
err.getStackTrace()
}
On My part i was using the method "getStackTrace()" Here the thing to remember is that getStackTrace() method is only available with Flash Debugger and Not With Flash player. So Wherever i do not have Flash Debugger installed my application stops running.
So Things to do
1. Check if Your using any API call that are only available in Flash Debugger and Not in Flash player(If You found Try commenting that line Application will start running).
2. Work around Install Flash Debugger Version wherever you are running your application or Simply before your Flash Debugger API calls Check if(Capabilities.isDebugger) only then use those API or Skip those lines.
I am sure this will solve your problem
Happy Coding :)

Just some suggestions...
Ensure you're deploying the release
build.
After doing that you may want to
delete the browser cache - I
oftentimes have our users do that
after a release since it will
occasionally load the old version
after a release is put out there.
Are you using Modules? Are you maybe
referencing a debug module?
Check your paths defined in the
compiler arguments of the project, as
well as the paths of any Modules you
may be using. Can you provide us with your compiler args?
Are you and your boss using the same version of I.E.?
Did you change the index.html file to reference another swf?

This smells like a security issue to me; the debugger enforces fewer security policies than the standard player, and your mention of Tomcat and those namespace references suggest there's something security-related going on here.
What are components.* and components.editAreas.* used for? Are you attempting to load and access any binary data in your application? Could you maybe post a little more code? Because what you've posted here is pretty innocuous. Might be easier to help with a bit more detail, but again, you're most likely running up against a security restriction somewhere.

I agree with Christian. It has to do with the security policies of the standard flash player. After removing/patching the FlexSprite class, which called the getStackTrace() function, the app is now working fine. Thank you for your help.
surfined

Related

Flash Builder 4.6 always shows blank html page on debug or release run

I'm having a problem with Flash Builder 4.6 premium. I'm using the 4.6 flex sdk and creating a web application. To test my development environment I simply add:
<s:Label text="TEST" x="10" y="10"/>
between the Application tags of the mxml file. When I switch to design mode I can see my TEST label. However, if a run a debug or a release test ( as web application ) I always wind up with a blank page. I have even tried importing sample code from books that I know to be good code. This is so weird because I have been using the program with no problem for so long then sudenly this. I have blow a whole development day over this.
Please HELP!
Thanks,
Marc
right click project name->Properties->select "Flex Compiler"->
there is a label "Additional compiler arguments", input "-use-network=false" in the textbox below this label.
->OK.
Project -> Clean
and check if you are running debug version of Flash Player on the default browser.
Ran into the same issue, the problem being Chrome was my default browser. In the flash builder preferences you can define which browser to use when debuging.

Flash Builder 4.5 won't run my application

I was running my application from Flash Builder 4.5.1 without any issues. (It is a Flex application that connects to .Net Web Services). However, something has changed recently in my configuration or project, because when I try to run the app with the play or debug button, I just get a grey screen. I can't even stop on any breakpoints.
Eventually (maybe 30 seconds), a message pops up like so: 'The Flash Builer failed to connect to the running application. Please make sure that you are running the debug version of Flash Player...'
I definitely have latest version of Flash Debug Player installed (11.1.102.55). I have tried uninstalling it and re-installing it.
I have tried cleaning and rebuilding my project.
I have tried switching to a different workspace and back again.
I have tried restarting the PC.
I am using the latest version of IE for testing.
I'm really stumped - has anybody got any ideas on how to solve this?
Thanks
Have you tried deleting the html-template folder? This has caused issues for me in the past.
After it's deleted, when you try to build you will have a compiler error/warning about the missing folder. Right click and 'rebuild'.
There are some issues with compatability between 64 bit IE9, the 64-bit flash player, and 32-bit debugger. It seems like flash builder gets confused on which to use. I haven't seen any decent resolution yet in the Adobe forums for this particular issue other than use a different browser for testing.
To switch browsers, go to Window > Preferences... > General > Web Browser in Flash Builder. Select Firefox or Chrome.
In order to use Firefox, you need the Flash Debugger for Netscape compatable browsers installed. You can get that from Adobe here.
To use Chrome, you need to replace the built in flash player that is installed with Chrome with the debug player. Instructions from Adobe are here.

Debugging AIR: ADL fails to launch

I've hit a snag when trying to debug an AIR app using adl.
Although adl successfully launches, the application never appears on screen / starts up.
eg:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="400" height="400"
preinitialize="trace('hello')">
<s:Label text="Hello, world" />
</s:WindowedApplication>
When launching this, the trace is never executed, and the application never appears on-screen.
Other points of interest:
The adl debugger does start (ie., I see it's icon in my dock)
I've tried this with adt from AIR 2.6 and AIR 2.7
This used to work on my machine, and has suddenly stopped (see below)
It makes no difference if I launch from Flash Builder, or by invoking the adt command line directly
I'm on a mac, running OSX 10.6.7
After this stopped working, I tried installing the FB 4.5.1 upgrade patch, in the hope that this would also update any local framework / SDK files to the latest version. This had no effect.
As I mentioned above, This used to work fine, and appears to have stopped.
Around the time that things stopped working, I was doing debugging on another app, which involved installing a firewall to block specific ports. I suspect it may be related to this.
However, I've since uninstalled all firewalls, and it still doesn't work. I'm not sure which port adt uses, but I don't see it attempting to connect when running lsof -i -n -P.
Any suggestions?
Update: I've also since uninstalled and reinstalled Flash Builder (and therefore, the AIR SDK), and it still doesn't work. I think this adds weight to the port conflict, but still leaves me unsure of where / how to proceed
Further update Compiling exactly the same codebase to a AIR installer, installing, and running the application works fine. (Ie., a production release). However, the codebase fails to launch with adl. This pretty much confirms the issue as a local machine config problem somewhere with adl, and not an issue with the codebase.
I have finally (7 weeks later) solved this problem.
In my mm.cfg file, the following line had been placed there by a Firefox extension:
PreloadSWF=/Users/martypitt/Library/Application Support/Firefox/Profiles/vxtpdg3i.default/extensions/flashfirebug#o-minds.com/chrome/content/flashfirebug/flashfirebug.swf
Deleting this made things work again.
I had a similar issue when debugging which was resolved by changing the encode settings from utf-8 to iso-8859-1 in the Debug Configuration Panel -> Common tab.
since it still doesn't work after you've uninstalled and reinstalled, the only thing that make sense to me is that the ADL preferences file is what is persisting the issue. this preference file doesn't get uninstalled when uninstalling Flash Builder as it's not apart of Flash Builder. i would try deleting the preference file and then restarting Flash Builder.
on Mac OS X, you can find the preference file here:
Marty Pitt > Library > Preferences > com.adobe.air.ADL.plist
I had the exact same issue. Tried everything above, and a few other items. What finally made it display was changing the command line arguments. Wow, who'da thunk it.
./adl -profile mobileDevice -screensize iPhoneRetina
webapp/Main-app.xml
I have the same Problem, but in fdt not flash builder. It works when launching with -nodebug parameter, but not when debugging. It seems to have to do something with flex 4.5.1, because when compiling with flex 4, everything works as expected!
edit: it is fixed in the latest flex sdk 4.6.0

How to debug in AS3 only project in Flex...?

I am trying to build a AS3 only project in Flex....I have tried debug mode, but seems like it takes so long to compile....I can't use trace or check variables...Are there anyway to do debug?? Thanks for the help..
Which version of Flash Player have you installed, you need the debugger version. Check your browser , some browsers like Chrome for instance , come with Flash Player bundled in , but this isn't the version you need. You can also check your application properties, particularly the Run/Debug Settings.
Last but not least, you could also watch this Lee Brimelow tutorial, about using MonsterDebugger
http://gotoandlearn.com/play.php?id=109

remoteObject Fails After Recompiling Using CF8

I've been handed a Flex project that was originally built and compiled using Flex3 and CF7. My setup is Flex3 with CF8. Everything works fine when I initially pull the project over but as soon as I recompile, remote calls to the CFCs begin to fail. I used Charles Web Proxy debugger and discovered that the failure appears to begin with the flex2gateway. I double checked to make sure the flex2gateway is accessible and it's working fine on my CF8 install from both my project root and localhost. I also double checked to make sure that my project settings directed the Flex Compiler to reference my CF8 wwwroot for the services-config.xml. As far as I can tell, all of my settings are correct. So, needless to say, I'm at a complete loss. Has anyone else encountered this problem before?
Thanks,
--Anne
Actually no errors are getting thrown which is really weird. However, after some further testing and experimentation, I did find something rather interesting. I went ahead and created a new project where the bin-debug files were all output to the web root. When attempting to call a CFC with that setup, it worked fine which is kind of strange. As soon as I started to set it up in the same file structure as the project, it stopped connecting. The file structure of the project is as follows:
_flash
main
bin-debug
libs
src
com
Test
Test.cfc
index.cfm (this is the same as the html wrapper that's usually generated in bin-debug. We have it in the root so that we can pull either the release or debug versions depending on which server we're using at the time.)
Based on this, my thought is that for some reason it's not looking to the server root for com.Test.Test and is instead just looking within bin-debug. Does that make sense? What's maddening is the utter lack of errors.
--Anne
After toying with this for considerably longer than I ever should have, I've decided to use JSON for remoting instead. This is mainly because JSON makes it considerably easier to find out what's going on under the covers when debugging. Thanks for your help everyone.
--Anne

Resources