I came across a problem recently when trying to debug my application after upgrading from Flash Player 9 (Debug version) to 10.2 (Debug version). As soon as I upgraded my application stopped logging. I searched everywhere and whilst I found a lot of people with the same problem never really found an answer.
After a lot of digging it appears to be the way you target the flash player version. My application was targetting Flash Player 9 (in my flex-config.xml):
[code language="xml"]<target-player>9.0.124</target-player>[/code]
Changing this to 10 started the trace logging again. As I wanted to maintain the v9 target I've ended up reverting back to Flash Player 9 to get the logging working again.
Showing posts with label Adobe Flex. Show all posts
Showing posts with label Adobe Flex. Show all posts
Thursday, April 7, 2011
Tuesday, March 29, 2011
ASDoc - wading through the errors
ASDoc is a nightmare. What should have been a simple task turned into a day of trawling the net trying to find the cause of the seemingly endless errors preventing me from running it. Eventually I got it working so here's a short post explaining the pitfalls I faced.
For reference here is my very simple ANT script for generating my ASDocs:
[code language="xml"]
<project name="ASDoc Build Script" default="main" >
<!--
Read in the properties file which contains the locations
for all paths referred to here
-->
<property file="asdoc.properties" />
<!--
Main Target:
Cleans and compiles ASDocs with a log
-->
<target name="main" depends="clean, log, create-docs" />
<!--
Delete and recreate the asdoc output directory
-->
<target name="clean" >
<delete dir="${output.dir}" />
<mkdir dir="${output.dir}" />
</target>
<!--
Run asdoc.exe on the source documents passing all required
parameters to asdoc
-->
<target name="create-docs" >
<exec executable="${asdoc.exe}" failonerror="true" >
<arg line="-source-path '${root_src}' " />
<arg line="-doc-sources '${framework_src}' '${actionscripts_src}' " />
<arg line="-library-path '${irmds_library.dir}' '${flex_library.dir}'" />
<arg line="-main-title '${main.title}'" />
<arg line="-window-title '${window.title}'" />
<arg line="-output '${output.dir}'" />
</exec>
</target>
<!--
Write out a log file
-->
<target name="log" >
<record name="${output.dir}/asdoc-log.txt" action="start" append="true" />
</target>
</project>
[/code]
- Include the Flex libraries in your -library-path argument (i.e. flex.swc, rpc.swc, framework.swc, utilities.swc). Without this I was getting errors from asdoc not being able to find some of the standard classes.
- Check your code! Some of the errors I was getting were actually problems that just weren't throwing errors (some of my event dispatching classes were not extending EventDispatcher, this threw lots of errors whenever asdoc encountered dispatchEvent )
- Give your -source-path as the root of your application but use -doc-sources to list only those folders you actually want documenting
For reference here is my very simple ANT script for generating my ASDocs:
[code language="xml"]
<project name="ASDoc Build Script" default="main" >
<!--
Read in the properties file which contains the locations
for all paths referred to here
-->
<property file="asdoc.properties" />
<!--
Main Target:
Cleans and compiles ASDocs with a log
-->
<target name="main" depends="clean, log, create-docs" />
<!--
Delete and recreate the asdoc output directory
-->
<target name="clean" >
<delete dir="${output.dir}" />
<mkdir dir="${output.dir}" />
</target>
<!--
Run asdoc.exe on the source documents passing all required
parameters to asdoc
-->
<target name="create-docs" >
<exec executable="${asdoc.exe}" failonerror="true" >
<arg line="-source-path '${root_src}' " />
<arg line="-doc-sources '${framework_src}' '${actionscripts_src}' " />
<arg line="-library-path '${irmds_library.dir}' '${flex_library.dir}'" />
<arg line="-main-title '${main.title}'" />
<arg line="-window-title '${window.title}'" />
<arg line="-output '${output.dir}'" />
</exec>
</target>
<!--
Write out a log file
-->
<target name="log" >
<record name="${output.dir}/asdoc-log.txt" action="start" append="true" />
</target>
</project>
[/code]
Monday, March 28, 2011
Flex AutoScroll to component with focus
Really useful library for ensuring that the active component (i.e. the one which has focus) is currently viewable: Flex AutoScroll Library
Particularly useful for users who can only use the keyboard. To setup I added an event listener to my main MXML component:
[code language="as3"]
this.addEventListener(FocusEvent.FOCUS_IN, AutoScroll.autoScroll);
[/code]
Particularly useful for users who can only use the keyboard. To setup I added an event listener to my main MXML component:
[code language="as3"]
this.addEventListener(FocusEvent.FOCUS_IN, AutoScroll.autoScroll);
[/code]
Thursday, March 10, 2011
Applying focus to Flex application on startup
On a recent project we carried out some accessibility testing and one of the problems faced was with keyboard users who couldn't use a mouse. After loading the application (by typing in the URL in the address bar) the users couldn't tab to the input fields on the application, focus would never reach the flex app at all. After searching around I eventually found a little code snippet in a comment on Flex Examples.
[code language="as3"]
private function setApplicationFocus():void{
navigateToURL(new URLRequest("javascript: document.getElementById(<DOM_ID>).focus();"), "_self");
focusManager.setFocus();
}
[/code]
The above is called in the Application object on creationComplete.
[code language="as3"]
private function setApplicationFocus():void{
navigateToURL(new URLRequest("javascript: document.getElementById(<DOM_ID>).focus();"), "_self");
focusManager.setFocus();
}
[/code]
The above is called in the Application object on creationComplete.
Subscribe to:
Posts (Atom)