Html wrapper issue - apache-flex

My Flex application is built using ant. The html wrapper task is as follows:
<target name="wrapper">
<html-wrapper
title="{$title}"
file="login.htm"
height="300"
width="400"
application="app"
swf="Main.swf"
version-major="9"
version-minor="0"
version-revision="0"
history="true"
template="express-installation"
output="${APP_ROOT}"/>
</target>
My purpose is to display a message to the user in case their browser has JavaScript disabled.
I modified the index.template.html file within the express-installation folder to include the following in the tag:
<noscript><my message here/></noscript>
The message does not get displayed. Is there a way I could find out which index.template.html file is used by ant task or is the file being overridden somehow?
Can anyone resolve this? Any help would be appreciated. :)

It should be coming from the SDK that you are using to build the wrapper. It'll be somewhere like...
${FLEX_HOME}/templates/express-installation/index.template.html

As of Flex SDK 4.5:
The template file used when building your project via html-wrapper ant task unfortunately does NOT come from ${FLEX_SDK_HOME}/templates/swfobject.
The template file used by the ant task is actually baked into the flexTasks.jar file found in ${FLEX_SDK_HOME}/ant/lib. As you know, there is no convenient option you can apply on the task to use a different template.
Because my needed changes were minor (and presumably useful on all of my projects) I simply unzipped flexTasks.jar and re-zipped it with my modified template.

Since you did use the history="true" you need change the template inside
P:\ath\to\sdks\X.Y.Z\templates\express-installation-with-history
as documented here.

Related

How to implement SASS in an asp.net project

I am searching for a solution on how to implement SASS into an asp.net project. I have searched a lot but have found no example on the web. As far as I know some kind of JavaScript file will be needed in project in order for it to work.
Can anybody please share a sample aspx page with one or two textboxes with SASS applied to it?
Sass is written in Ruby, not JavaScript. There are a few JS compilers, but none of them are official, and none of them should ever be considered for use outside of development.
Outside of Ruby on Rails, there is no integration. You put your source files where appropriate and use the Sass compiler to compile it and place the CSS file into your public directory. Whether you use the command line or an application like Scout is up to you.
I personally use the command line to continuously watch my Sass files as I am working on them, and it only takes a second or 2 to compile (just slightly longer than it takes to alt-tab so I can refresh and see how it looks).

Can't find compiled resource bundles

I am using Adobe Flash Builder 4.
I've run into this issue with my latest project, but I was able to re-create it with an almost empty project.
Here is what I've done.
Created a new Flex Project
Created a locale/en_US folder within this project.
Added a class that extends SparkDownloadProgressBar. All this class does is attempt to create a Label.
When I try to debug this application, I get the following error.
Error: Could not find compiled resource bundle 'components' for locale 'en_US'.
at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:340]
at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:269]
at mx.resources::ResourceManagerImpl/processInfo()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:387]
at mx.resources::ResourceManagerImpl()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:122]
at mx.resources::ResourceManager$/getInstance()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManager.as:111]
at mx.core::UIComponent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:3728]
at spark.components.supportClasses::TextBase()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\supportClasses\TextBase.as:154]
at spark.components::Label()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Label.as:384]
at Preloader()[C:\SVN\Games\Social\Test\src\Preloader.as:21]
at mx.preloaders::Preloader/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:253]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1925]
at mx.managers::SystemManager/initHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2419]
The Flex Compiler/Additional Compiler Arguments section does contain "-locale en_US", but I do not want to just remove this as I am planning to have this load different property files based on the localization region at run-time and how I understand it, I will need to add each locale that I am planning to use on the compile argument line.
I am at a loss as to how to attack this problem. If you need anymore information from me to help with this, I will be more than happy to provide it. Thanks ahead of time for the help!
This might be caused by the fact, that Preloader loads the actual framework, so you can't use the Flex's classes until it loads. Use standard TextField for it and it should work fine.

Building a SWC from IntelliJ Idea without resorting to ant?

First, here's what I want to do:
* Compile my library code into a SWC
* Do not staticly link the Flex framework
At first, I tried just setting up a Flex module, clicking the "library" and "use framework as an RSL" buttons. This however doesn't compile any of my code into the SWC, and it basically just compiles a new SWC of the entire Flex framework, all resources and classes included.
Then, I managed to get my classes into the build using a custom compiler config, but it still includes the few Flex classes that I reference in my library code.
Finally, I figured I could use the custom flex-config.xml file, remove the parent reference to the library using <library-path append="false"></library-path> and then using a custom command line parameter (and also from ant), add -compiler.external-library-path references to the SDK and PlayerGlobal.swc. This should probably work, but Idea won't let me set command line parameters when I'm using a custom config file :'(
Any suggestions are greatly appreciated!
OK, Through help on the Idea forums, much googling, and random experimentation, here's what worked. Take careful note that some parameters are specified like "{name}" and some are "${name}". No, I don't know why :-/
<!-- Specifies the minimum player version that will run the compiled SWF. -->
<!-- 9.0.124 is the April 2008 security release -->
<target-player>9.0.124</target-player>
<compiler>
<source-path>
<path-element>src</path-element>
</source-path>
<incremental>true</incremental>
<keep-as3-metadata append="true">
<name>Inject</name>
<name>InjectInto</name>
<name>InjectIntoContents</name>
<name>Singleton</name>
<name>PostConstruct</name>
</keep-as3-metadata>
<!-- Remove the "include" library path. -->
<library-path append="false"></library-path>
<!-- Set up an "external library" path that is compiled against but not linked. -->
<!-- SWCs not used for SP are left in but commented out to make it easier to copy this script -->
<external-library-path>
<path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
<path-element>${flexlib}/libs/framework.swc</path-element>
<!--<path-element>${flexlib}/libs/flex.swc</path-element>-->
<!--<path-element>${flexlib}/libs/rpc.swc</path-element>-->
<!--<path-element>${flexlib}/libs/utilities.swc</path-element>-->
<!--<path-element>${flexlib}/libs/datavisualization.swc</path-element>-->
</external-library-path>
</compiler>
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
<include-classes>
<class>net.expantra.smartypants.impl.InjectorImpl</class>
</include-classes>
<output>./build/SmartyPants-IOC.swc</output>

Is there any way to 'hide' a JavaScript file from IntelliSense in Visual Studio 2008?

I have a third party JavaScript plug-in but including the file breaks IntelliSense for jQuery amongst other things. The only way I can get IntelliSense back working with jQuery is by commenting out the plug-in. Is there a way I can hide the plug-in file from the IntelliSense parser?
Service Pack 1 added the following feature:
If you "anyfile.js" and "anyfile-vsdoc.js" in the same directory, then any references to "anyfile.js" will automagically be converted to a reference to "anyfile-vsdoc.js" behind the scenes.
Add an empty file next to your plugin with "-vsdoc" appended to the filename. That should "hide" the plug-in from the external javascript processor.
You could always load it from your code-behind instead of the scriptmanager in
your aspx/master. That way the IntelliSense doesn't know it's there. Using ScriptManager.RegisterClientScriptInclude(..).
It could be that third party JavaScript plugin you're using has some errors in it.
I would check the code in JSLint and directed this question to the author of the plugin.
As for the question itself: I don't think you can exclude it if it's a part of the project, but go over the MSDN: Using IntelliSense to prove it.
Since you mentioned jQuery, you could also load the troublesome script during runtime.
$.getScript("XXX.js");

Trouble linking SWC file

I am trying to link the as3corelib library to use their JSON functionality following this tutorial. But am having trouble compiling it. My command looks like:
mxmlc --strict=true -library-path+=as3corelib.swc --file-specs myapp.mxml
But I am getting this error:
_divided_mx_managers_SystemManager.as(13): col: 14 Error: Interface method getVisibleApplicationRect in namespace mx.managers:ISystemManager not implemented by
class _divided_mx_managers_SystemManager.
public class _divided_mx_managers_SystemManager
What is the problem?
Update: Is this because I am using Flex 3? The tutorial seems to be for Flex 2. If so, what do I need to do for Flex 3?
I found an older version of the library bundled with some tutorial which worked. Submitted a bug report to as3corelib, of course I am not entirely sure how valid the bug is.
If you are using Flex Builder 3 you can actually just take the swc file and put it in the libs directory. This will automatically add it to your classpath and you should be able to use it from then on. You may need to subsequently do a clean on the project to make sure it takes it in though.
I faced a similar issue in Flex builder 4. I had to put the as3corelib sources into my source code for it to work alright.
Are you using the flex Gubmo sdk?
Looks like the method it's complaining about is in an interface that's part of Gumbo.
If so, then as3corelib probably won't work with it.

Resources