Flex :: Add Custom Configuration Variables?
May 19, 2010
We have to deploy a flex app through a series of development tiers. We are not using Blaze_DS or LCDS. My data/service urls are tier specific and are currently embedded in AS files. We'll be building the project on each tier. I'd like to make them environment variables, but am not sure what the best way to do at compile/build.
Is there a compiler option to read in a custom-config.xml? or -myCustomVariable = value? or should we just setup the build to select a config.as file?ted.
View 1 Replies
Similar Posts:
Feb 9, 2011
I'm trying to build a flex project, linking it to some RLSs. When setting up the project in Flex Builder, the corresponding "build configuration" (that I got by adding -dump-config to the compiler options) generates (among other things) a tag like this :
<runtime-shared-libraries>
<url>some-lib.swf</url>
<url>some-other-lib.swf</url>
[Code]....
View 2 Replies
Jul 23, 2010
I'm looking at a tutorial to display placemarks using a KML file on a flex application. I'm using IGN API (openscales) in flex project. The example works perfectly (http:/[url].......
<os:KML url="http://www.parisavelo.net/velib.kml"
proxy="http://openscales.org/proxy.php?url="
numZoomLevels="20"
style="{Style.getDefaultCircleStyle()}"/>
But when I'm hosting the same kml file on my server like that :
<os:KML url="http://www.cycom.org/velib.kml"
proxy="http://openscales.org/proxy.php?url="
numZoomLevels="20"
style="{Style.getDefaultCircleStyle()}"/>
Placemarks don't show up on the map. I tried to host the kml file on different hosts but that doesn't change.
View 1 Replies
May 3, 2011
I installed Adobe FlexBuilder 3 Pro Eclipse Plug-in 3.0.2, but when i want to configure weblogic inside widows->preferences->server then server link button won't be appeared inside flex builder. can anyone help me out how i have to configure weblogic inside adobe flex builder.
View 2 Replies
Aug 30, 2011
I need to read the URL that the browser shows when a Flex application is called because I would to reference it in a mxml configuring Cairngorm remote objects. The goal I would reach is to automatically configure Cairngorm services from environment to environment (dev,test,qa,prod) without statically set the value in the mxml or other ActionScript. Since the Flex client is deployed in the root of the war of the webapp, it's enough to read where the browser is pointing.
I have written a class that is doing so:
public class ConfigServer {
public function ConfigServer() {
var loaderUrl:String = FlexGlobals.topLevelApplication.loaderInfo.loaderURL;
var urlToSet:String = <loaderURL-string-manipulation>;
_serverUrl = urlToSet;
[Code] .....
But whenever I call the ConfigServer constructor and for every (known to me) technique I applied (statics or singletons or public ro so on), I have always had the same error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at org.fao.fapda.util::ConfigServer()[C:devworkspacesFAPDA runkFAPDA-clientsrcorgfaofapdautilConfigServer.as:8]
Cairngorm services initialization is done as follow:
<fx:Declarations><cut/>
<services:FAPDAServices id="services"/>
<cut/></fx:Declarations>
And the problem is that FAPDAServices.mxml is read runs before FlexGlobals is valid. Is there a point in the Flex Application lifecycle where such loaderURL is defined so that I can construct ConfigServer? When in startup events that initialization in done?
View 1 Replies
Apr 19, 2010
We are using an XML file as an external configuration file for several parameters in our application (including default values for UI components and properties values of some service layer objects). The idea is to be able to load the XML configuration file before the flex application initializes any of its components. This is crucial because XML loading is processed a-synchronously in flex, which can potentially cause race-conditions in the application.
For example: the configuration file holds the endpoint URL of a web service used to obtain data from the server. The URL resides in the XML because we want to allow our users to alter the endpoint URL according to their environment. Now because the endpoint URL is retrieved only after the XML has been completely loaded, some of the application's components might be invoking operations on this web service before it is initialized with the correctendpoint.The trivial solution would have been to suspend the initialization of the application until the complete event is dispatched by the loader. But it appears that this solution is far from being trivial. I haven't found a single solution that allows me to load the XML before any other object in the application.
View 1 Replies
Jul 20, 2010
I am trying to use a custom html wrapper for my application, but when I browse to choose my file it defaults to an absolute path to my custom-wrapper.html file. I want to be able to pass off this project via SVN without any necessary configuration changes, but I'm not sure how to input a relative URL into this configuration dialog. I tried standard back referencing from where my main actionscript application file is in the src directory (i.e. ../../bin-debug/custom-wrapper.html), but that does not work.
I think that I need to use properties like ${DOCUMENT} or ${FLEX_HOME}, but I'm not sure where these properties get defined and which ones come by default in the environment.
View 1 Replies
Dec 10, 2010
I am looking for an approach that will allow me to (somehow) dynamically pass the server name, server port, and web context to my Flex client so it can create a ChannelSet for it's RemoteObjects to use. These three properties are, of course, readily available to my Java server-side code so I just need a way to get them to the client.
By default, Adobe says you should compile your Flex application against the server configuration file "services-config.xml". This is a highly inflexible practice that Spring says should be avoided (I agree).
One popular approach is to use Flex's http service to download an XML configuration file. I like this idea, but I don't want to hard-code an XML file and keep it inside my WAR file. Is there a way to dynamically generate this from Java code?somehow use flashvars to pass the properties in from the containing HTML page to the SWF file. But again, I don't want to hard code them into the HTML page. Is there a way (maybe with Javascript?) to dynamically set the value of these when the page loads?
View 1 Replies
May 17, 2010
I'm using:
- Flex SDK 3.5.0
- Parsley 2.2.2.
- Flash Builder 4
Down in my src folder (which is configured as part of the source path in the Flash Builder), I have a logging.xml which I configure via Parsley:
[Code]....
View 1 Replies
Aug 20, 2008
How do variables true/false custom variables work in flash?
For example, what I want to do is create a simple true=false variable that I can call on an if statement later.
For example:
Code:
Var1 = true;
if (!Var1)
{
[Code]....
I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.
View 4 Replies
Mar 2, 2012
This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component
TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent.
dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));
Note: The error in my earlier post is giving below error message
Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent
The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.
This is my custome event
package events
{
import flash.events.Event;
import ui.map.MapElement;
[code]...
View 1 Replies
Dec 14, 2011
i want to use XML to save some configuration for elements in my app. in my example i want to add 6 additional configuration sets to one "main" XML. each set can be config1 or config2. In this case i added 3x config1 and 3x config2. if i trace my results i do not only get the wrong order of elements but also some "strange" binding behavior. Of course this is a simplified example. my configuration sets are more complex (this is why i use seperate xml-objects for each config).
[CODE]...
View 2 Replies
May 12, 2010
The spark panel component for example can be written like this
<Panel title="Skinny">
<child components ... />
<controlBarGroup>
<child control bar components ... />
</controlBarGroup>
[Code]...
The motivation here is that I can now create a couple different skin files to change the look and layout of those subgroups. Reading source of the spark panel, there are some calls within the mx_internal namespace such as getMXMLContent() which is a method of the spark group component, but which I have no access to.
Does the description above make sense? How can I create custom 'contentGroups' in my custom Flex4 component that can use nested mxml child components? Should I approach this a different way?
View 2 Replies
Nov 4, 2011
I have the following situation:I have an event handler, that displays small messages in my application's statusbar.These messages get passes through by dispatching events from custom components.A simple message could be like "HTTP Error" or so.Now, the main event listener, in the main application file, listens to the event dispatched by any custom component,but seems to refuse listening to events dispatched by custom AS classes.Here is my code for the custom event:
package main.events
{
import flash.events.Event;[code]..
So to sum it all up:
- The event listener listens to the custom event dispatched by any custom component.
- The event listener does not listen to the custom event duspatched by an AS class.
Those who wonder, the event really gets dispatched, that's why I added a trace call.
View 2 Replies
Dec 11, 2010
In the main file, I would write[code]...
But if I want the component to have that behaviour innately, where do I write it in the mybutton mxml file to have it reference itself?[code]...
View 2 Replies
Jan 25, 2010
I couldn't work it out yet...
package components {
public class templateSelection extends VBox {
static public var tempSelectionBag:Dictionary;
[Code]....
I want to have a custom class tempSelection with a Dictionary as a public accessable property of that class. If I use this code, the compiler tells me:
1046: Typ wurde nicht gefunden oder war keine Kompilierungszeit- onstante:Dictionary
Which translates to:
Type was not found or was not a compile-time constant: Dictionary
View 1 Replies
Sep 8, 2011
I have a custom Flex 4.5 component (to be used in a List) -
Game.mxml (represents a clickable playing table in a card game):
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer [code].......
But I never see the "game clicked: " trace. Does anybody please know why? I'm probably missing something minor, because I can see the "Clicked: 8946" trace.
View 3 Replies
Feb 16, 2012
This is similar to the question asked here. I am dispatching custom event "ShopEvent" but i am getting error "Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent"Note: Error is thrown from the parent custom component (3rd code snippet), I have added more details thereThis is my custom event. See the first constant, I copy pasted the event name in custom components.
package com.events
{
import flash.events.Event;
[code]......
View 3 Replies
Nov 3, 2009
Having a bunch of dynamically-created MC's, what is the best way to store custom variables for each MC?Do I just make a hidden textfield inside each MC to hold the data?For example I have MC's called:-Apple1-Apple2-Apple3-etc...And inside each MC I have a variable appleEaten = X.And eventually I could use the data in an IF statement like:
View 4 Replies
Jun 22, 2010
Having a bunch of dynamically-created MC's, what is the best way to store custom variables for each MC? Do I just make a hidden textfield inside each MC to hold the data? For example I have MC's called:
[Code]...
And inside each MC I have a variable appleEaten = X. And eventually I could use the data in an IF statement like: if appleY.appleEaten == X then do something. What is the best method, or generally common way of doing this? Maybe I'm already doing it,
View 2 Replies
Nov 29, 2004
I'm using Flash MX 2004.
PHP Code:
// function to automate the hit tests
function hitClip (aCPlaceNum, loopNum, loopName, aCButtonNum) {
[code]....
View 2 Replies
Apr 30, 2009
trying to learn Custom Events so that I can pass a variable through to a function that's fired when a Fade Out has been completed.
i.e.
Code: Select allvar tm:TransitionManager = new TransitionManager(movieclipname_mc);
tm.addEventListener ( "allTransitionsOutDone", TriggerThis );
tm.startTransition({type:Fade, direction:Transition.OUT, duration:2, easing:Strong.easeOut});
When the Fade Out is completed, the TriggerThis function is fired...
Code: Select allfunction TriggerThis(e:Event):void {
trace('triggered');
}
I want to pass a variable to TriggerThis though and I know that I need to use a Custom Event to do this. I tried creating a .as file containing the following:
Code: Select allpackage
{
import flash.events.Event;
[code]....
But this results in errors. Can anyone shed any light on how to pass the variables after a Transition has completed?
View 2 Replies
Apr 30, 2009
I've spent most of this afternoon trying to learn Custom Events so that I can pass a variable through to a function that's fired when a Fade Out has been completed.
i.e.
[Code]....
So I'm not sure that I'm even close to getting this right.
how I can pass variables to a function called when a Transition has completed?
View 3 Replies
Nov 29, 2004
I'm using Flash MX 2004.
[Code]...
Can you please tell me why this isn't working? It takes me 10 minutes to test the movie every time and it's taking me forever to fix things. Do I have to do something else with the variable names I'm using or something?
View 2 Replies
Jun 12, 2009
This is my first custom class and I'm having a few problems. I just want it to draw a line (for now) using variables from Flash. The .as file is attached. My Flash AS3 script is: var newLine:Myline = new Myline(20,210); I don't know why it won't just draw a line from 20 to 210? Here is the error I get:
[Code]...
View 16 Replies
Sep 28, 2011
does one protect this? I mean, Flash Cs5 ide has this little "protect from import" option but I don't think that's enough.I mean, the only thing I can think of is a scrambler.Something that would rename all variables, functions, and custom classes to some random hash. So something like myVar would be renamed to x41dDefh5kjFCe. It would be like a big "lol have fun" to someone who might manage to go that far.Still, that isn't enough. I mean, anyone else know of any good ideas or programs? Just trying to protect my work
View 9 Replies
May 7, 2009
An observation about the configuration files (XML) of FMS. When we roll out new versions or upgrades, it almost always involves updating or modifying the files in the conf/ directory. If it's within a certain revision, we generally copy them over from the previous install and it's fine. In the case of FMS 3.5, new configuration directives were added which necessitated our doing a fresh reconfigure to ensure everything was accounted for.
What I believe would make for an easier configuration process is to utilize the inheretance aspect of XML, allowing for a LocalSettings.xml file which would be read in by FMS last, overriding any default settings thus eliminating the need to alter the default *.xml files. Any new settings introduced that require changes can be imported as needed.
Overwriting the stock conf/*.xml files with new information would not interfere with your custom settings as they would remain intact in LocalSettings.xml. Any conflicts could be reported to the logs or stdout. One exception being fms.ini -- which could easily be revamped into XML and used in the above model.
View 2 Replies
Jul 28, 2011
I had installed a FMS 3.5.6R6003 in a Cent.O.S linux with an Edge configuration... and i have found the following error in the /var/log/messages...!!!
Configuration[19756]: Invalid value set for configuration key : Application/Process/Distribute = Instances, using default to be compatible with inst..Configuration[19756]: Invalid value set for configuration key : Application/Process/Scope.numprocs = 5, using 1, to prevent app inst getting split among multiple processes.
But, even with this warning, the FMS is running apparently normal...
View 1 Replies
Dec 19, 2010
I couldn't find an up to date example of how to create a socket (I prefer in php or c++) and how to make the connection with AS 3.
View 1 Replies
Aug 26, 2009
We're in process of trying to purchase a new server. Our server unit wanted to provide a VM instance, which I told them would not work (according to the documentation). So, their next suggestion is to provide a blade server. Is this an acceptable configuration (assuming they meet recommended CPU/RAM requirements) to install FMS?
View 1 Replies