ActionScript class being run by mistake in Flex project

I have a Flex project where my main MXML file is set as the
one and only application file and is also set as the default file.
I also have an ActionScript class in the project that extends
Sprite. It is _not_ set as an Application file.
When I have the ActionScript class selected, if I hit run or
debug, FB3 creates a new launch configuration for it and tries to
run the AS file instead of the default application MXML file.
Needless to say, this is really annoying as it means I have
to select the main MXML file before hitting debug/run every time.
Is this a bug or feature? (Feels like a bug).
Thanks,
Aral

Hi Aral,
Can you please log it in our public bug system:
http://bugs.adobe.com/flex?
It'd be great if you can provide more info to the bug e.g.
reproducible steps, platform, FB version (Plugin or Standalone).
thanks,
Sharon

Similar Messages

  • PMD View empty after running PMD on a flex project

    I tried with flexpmd 1.1 and 1.2 with no spaces in the workspace path , project name and flexpmd path.But when i say run flex pmd,all I see is "flexpmd.running" for a couple of seconds and then i am getting an empty pmd view.In the preferences i have set the paths correctly,but did not give any rulesets.

    I have tried FlexPMD with almost all possible combinations - with Flex 3, with Flex 4 Standalone, with Flex 4 Plugin, using workspace with space, without space, using my C: partition, my D partition, etc. Without being able to see anything at all on the FlexPMD view.
    After finding this forum, I have tried running eclipse with -debug, and got this stack trace:
    Application Started: 16427
    Jan 14, 2010 7:38:24 PM com.adobe.ac.pmd.eclipse.flexpmd.cmd.FlexPMD process
    INFO: java -Xmx256m -jar D:\bin\FlexPMD\flex-pmd-command-line-1.0.jar -s C:\test
    e\fdaga -o C:\Users\JOOSAL~1\AppData\Local\Temp\flexpmd3892770551481749445dir
    Jan 14, 2010 7:38:29 PM com.adobe.ac.pmd.eclipse.utils.cli.ErrorLogDevice log
    WARNING: 14/Jan/2010 19:38:29 com.adobe.ac.pmd.engines.AbstractFlexPmdEngine <in
    it>
    Jan 14, 2010 7:38:29 PM com.adobe.ac.pmd.eclipse.utils.cli.ErrorLogDevice log
    WARNING: WARNING: Access is denied at java.io.WinNTFileSystem.createFileExclusiv
    ely(Native Method)
    Jan 14, 2010 7:38:29 PM com.adobe.ac.pmd.eclipse.utils.cli.ErrorLogDevice log
    WARNING: java.io.File.checkAndCreate(Unknown Source)
    Jan 14, 2010 7:38:29 PM com.adobe.ac.pmd.eclipse.utils.cli.ErrorLogDevice log
    WARNING: java.io.File.createTempFile(Unknown Source)
    Jan 14, 2010 7:38:29 PM com.adobe.ac.pmd.eclipse.flexpmd.cmd.FlexPMD process
    SEVERE: C:\Users\JOOSAL~1\AppData\Local\Temp\flexpmd3892770551481749445dir\pmd.x
    ml (The system cannot find the file specified)
    It seems the problem might be due to my User Account in Windows, which have spaces and special characters (João Saleiro) - but I might be wrong. I can't change my user account name, which makes FlexPMD useless for now. And I was hoping to show it on a presentation I will be giving for the community next saturday (day 16). Is there any workaround that allows me to use FlexPMD inside eclipse, so I can use it for now? Isn't there an easy way to set the output directory to a different one?
    Thank you,
    João Saleiro

  • Help with project/folder setup for new flex project??

    Hello all,
      I need help deciding how to set up my projects for a new flex application we're developing.
    We have an in-house custom java/jsp "framework". This framework has JSP pages for administering applications that are built using this framework. One part of the framework generates all java base and model objects from our database tables to be used in the new application.
    The new application will have a back-office part (Adobe AIR) and a web facing part (Adobe Flex).  Both the AIR and Flex parts of the application need to access the java model objects via AS3 classes (I believe I'll do this using remoteobject).
    My questions are as follows:
    After I create the base and model AS3 classes that remoteobject with the java classes can I put these in a common library project so both my AIR and Flex app can access common AS3 code.  I feel I should do this to keep from duplicating code by copying the AS3 classes in both my AIR and Flex projects.  Can you give my any examples or links to information on how to do this??
    I plan to also create a common java project for all base and model objects generated from my db tables so that the common library project with AS3 classes could remoteobject interface with the java classes in the java project. I would like to keep all of my business logic in the java model classes.  Does this seem appropriate for the projects/setup listed above?
    Here are the projects I think I need in Flex Builder.
    FlexWebApp
    AIRBackOfficeApp
    JavaApp - Common
    AS3FlexLibraryApp - Common
    The FlexWebApp and AIRBackOfficeApp will reference the AS3FlexLibraryApp and the AS3FlexLibraryApp will remoteobject to the java classes in JavaApp.
    Any help or direction with this is greatly appreciated.
    Thanks,
    Whitney

    Hi,
    Please post only once (do not post same thread across multiple forums).
    help with Financials setup from very basics...
    Re: help with Financials setup from very basics...
    Regards,
    Hussein

  • Actionscript code in a swf dont run when impoterd in flex

    Hi,
    I have an actionscrip flex project.
    I embed a movieclip from a swf like this:
    [Embed(source="../../content/testmenu.swf",
    symbol="MenuOne")]
    public static var MenuOne:Class;
    The movieclip has a frame with this code:
    dispatchEvent( new Event( "InCompleted", true ) );
    stop();
    running in flash everything works properly but in flex the
    movieclip dont stop play and i dont get the event
    Any help on this?
    Thanks

    Go to Project -> Properties -> Flex Library Build Path -> Classes (Tab)
    Uncheck any of the actionscript files that are not actually classes, but rather an external import into a class (your MXML).
    Also, FYI, it is common practice to use lowercase for actionscript files that are includes, and not actual classes. Camel case file names should be reserved for class files..

  • How to call setter Method of ActionScript class with in a Flex Application

    Hi
    I have Action class as shown :
    public class MyClass
    private var name:String 
    public function get name():String {
        return _initialCount;
    public function set name(name:String):void {
        name = name;
    Now please let me know how can i access this Action class under my Flex Application and call the setter Method of it to set the value for the name .
    For example on entering some data in a TextInput and  click of a submit Button , on to the Event Listener , i want to call the set name method of my ActionScript class .
    Please share your ideas on this .

    Thanks  Gordon for your resonse .
    Say for example my Action class is like this :
    public class MyClass
    private var name:String 
    public function get name():String {
        return name;
    public function set name(name:String):void {
        name = name;
    This is inside the MXML
    I know this way we can do it
    public var myclass:MyClass = new MyClass();
    myclass.name="Kiran";
    Now my query is can we do in this way also ??
    myclass.set name(SomeTextInput.text);
    Please share your views on this , waiting for your replies .
    Thanks in advance .

  • Flex RPC mapping Java nested classes to ActionScript classes

    We are calling a Java method in our project using
    RemoteObject the value returned by the java method is a ArrayList
    containing instances of a class say ParentClass with some nested
    classes.
    The structure of ParentClass(Java) is something like this
    class ParentClass {
    //some primitives
    private ChildClassA childAInstance;
    private ChildClassB childBInstance;
    //getters setters
    We have created similar class structure on the ActionScript
    side, the ActionScript classes(ParentClass,ChildClassA
    ,ChildClassB) have been properly annotated with the [RemoteClass]
    metadata tag,
    The problem is that though i'm getting the primitive data
    members of the ParentClass through RPC in my corresponding AS
    ParentClass class i'm getting an runtime exception trying to access
    ChildClassA,ChildClassB members.
    Am i missing something, exactly the same scenario is
    mentioned in this article
    http://www.adobe.com/devnet/flex/articles/complex_data.html
    But the Object.registerClass method mentioned in the tutorial
    is giving me compilation error, the sample code attached with the
    article is corrupt zip too.
    Please help me out on this

    JAXB will create classes from an XML schema, SAX is a parser library and JAXP is a library of XML a bunch of XML tools.
    I don't care for JAXB too much. I would skip it and go right to the JAX-RPC spec (WebServices).

  • Flex Builder stops compile new ActionScript classes

    Hello,
    Does anyone knows what could cause Flex Builder 3.4 stops compiling NEW ActionScript classes? I have been working on Flex project for a while, we have some MXML and .as files (less than 200). This morning Flex Builder suddenly stopped detecting errors in new as classes, but not so for older classes. Thanks and appreciate your help.
    - Weiping

    Are your new classes referenced from the old code? Mxmlc employs a questionable form of "as-needed" linking, so classes that are not referenced from the main application are not even compiled. This referencing requirement is recursive; that is, any classes that are to be included have to be referenced from the main application, or from classes referenced by the main application, or from classes referenced by classes referenced by the main application, and so on. But if your new classes are not referenced at all from the old code, they will be ignored.

  • ActionScript Class wont work ?

    Hi all,
    Probbally being stupid but only Just started Flex, If I
    create a ActionScript project my class runs fine and draws a red
    circle on screen. If I try creating a MXML project, create a
    separate file for the ActionScript and then call it from the main
    file it doesnt draw the circle ?
    code for circle is :>
    quote:
    package {
    import flash.display.Sprite;
    public class animation2 extends Sprite
    public function animation2()
    graphics.beginFill(0xff0000);
    graphics.drawEllipse(100, 100, 100, 100);
    graphics.endFill();
    Can anyone tell me what I have to do to be able to call/run
    this through a MXML project ?
    Cheers

    This code seems to work, but for some reason the circle is
    smaller than if it is drawn in an AS app. I hope someone can shed
    light on this:
    package components {
    import mx.core.UIComponent;
    import flash.display.Sprite;
    public class ASCircle1 extends UIComponent
    public function ASCircle1()
    graphics.beginFill(0xff0000);
    graphics.drawEllipse(100, 100, 100, 100);
    graphics.endFill();
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    initialize="init()">
    <mx:Script>
    <![CDATA[
    import components.ASCircle1;
    private var myCircle:ASCircle1;
    private function init():void {
    myCircle = new ASCircle1();
    addChild(myCircle);
    ]]>
    </mx:Script>
    </mx:Application>

  • Testing ActionScript classes with native methods?

    Hi,
    I have an ActionScript class that I'm writing and would like to test using FlexUnit.
    The only issue is that the ActionScript class has a member in it that is a class with native methods.
    So, I get the following error when trying to run a test of that ActionScript class:
    VerifyError: Error #1079: Native methods are not allowed in loaded code.
    Does anyone know of a way to get around this?  FlexUnit seems not to like native methods being present.
    Thanks,
    Matt

    Hi casdvm,
    by definition, you only own objects that you created using one of the alloc* methods, copy: or new:. All other objects (IIRC with a few noted exceptions) are autoreleased.
    If you create convenience methods in your own class, you should follow the same rule. For example, if you have a class Pet and want to implement the method +petWithName, your code might look something like that:
    + petWithName: (NSString *)name
    return [[[Pet alloc] initWithName: name] autorelease];
    Alex

  • How to set an actionscript class runnable + some question?

    Dear all,
      i am new to actionscript (Flex 3).
      i am from java camp and i want to achive some java-style functionality in actionscript,and hope you can help me:
      1. how to set an actionscript class runnable??
          in java, i just add a "public static void main(String[] args)" method which will be the program entry point. (IDE, right click the class and click run)
          i can't set a plain, ordinary actionscript runnable in flex builder.
          To test the class, i have to create an mxml (which in turn invoke the testing class) and it be runnable in the flex builder 3.
          any other way to ease the testing?
       2. it there any good 3rd party library for datatype conversion ? (e.g. string <> date, the build-in DateFormatter don't accept milliseconds)...
           it seems actionscript come with limited such kind of utility function
       3. in a custom mxml component, which contains several controls (say testboxes, comboboxes)...etc,
           for information hiding/prevent others to change the child controls in the custom component, how can i hide the child control, not allow
           other code to access the child by  "Component.textbox1"....any scope modifier, e.g. protected, private...etc in mxml?
       thank you.
    ppk luk

    Hi Alex,
      for question 3:
      i just wondering if it is ok or not for better code/validation.....(and it follow the good
    information hiding principle?)
      if i write the component in actionscript only, i can set the child control with scope modifier
    'private' or 'protected'..so that the component user can't just use the dot syntax to gain
    access to the child control,
    e.g. MyComponent.childControlTextInputBox.value = "A";...
    i want to force user to use MyComponent.setInputBoxValue("A")...
    (e.g. in this method, i can do some checking/validate before passing to the textbox)
      this can enforce the data consistency in my custom UI component...
      there is no way to achieve the same effect in MXML?
    (e..g <mx:TextInput id="privateChildControl" accessScope="private" .../>)
      thank you..

  • Is it possible to use mx.controls in ActionScript class?

    I am very new to Flex, with a very small amount of experience in ActionScript so forgive me if the answer to this is obvious. I've tried searching and haven't found a conclusive solution to my problem.
    I have a Flex project that I am building in Flex Builder 3. The main application is in mxml, but most of the classes I'm using are in ActionScript.
    The general purpose of the application is to create a flowchart that accepts certain inputs on the elements in the charts. The chart components are all ActionScript classes. I am attempting to add a combobox to a component, but despite not getting any errors or warnings I can't get the combobox to show up.
    Here's a simplified version of the code within the class (I've left out the stuff that doesn't directly relate to my issue):
        import mx.controls.ComboBox;
              newComboBox = new ComboBox();
              newComboBox.initialized = true;
              newComboBox.alpha = 1;
              newComboBox.dataProvider = valueArray;
              newComboBox.x = 5;
              newComboBox.y = -5;
              newComboBox.height = 20;
              newComboBox.width = width - 60;
              newComboBox.visible = true;
              addChild(newComboBox);

    Just realized I hadn't thanked anyone for the suggestions yet. I appreciate it.
    Srirangan wrote:
    Few points I can think of:
    1. Try without the ".initialized = true;" property being set
    2. Check if the x & y property values for the ComboBox are valid
    3. Check if any styles are being applied that set the top, right, bottom or left properties thru CSS
    Removing (or alternately adding) the ".initialized = true" doesn't make a difference. It was actually a last ditch effort to try to make it draw it and wasn't meant to stay in the code.
    The x and y property values are valid as far as I know. The code for the positioning and sizing of the combobox was taken from the textfield below which I ended up moving down when I decided to add the combobox. The textfield has always drawn correctly.
    I looked through the CSS and it doesn't appear to set top, right, bottom or left anywhere. The only CSS in the project is from the Degrafa library that I'm using to draw components.
    Michael Borbor wrote:
    What's the val of the variable  width?
    Width is set to 150, which is the width of the Constant component.
    ATIF FAROOQ wrote:
    can you show the hierarchy of your flowchart component
    I'm not 100% sure this is what you mean, but it's:
    Sprite > Graphic (Degrafa class) > GeometryGroup (Degrafa class) > ComponentGroup > Constant
    and just for reference the component's being drawn onto:
    UIComponent > Surface (Degrafa class) > SurfaceComponent

  • Mapping existing actionscript class (mx.collections.SortField) to java

    Hi,
    I would like to map the existing SortField actionscript class on a SortField class on my java backend.
    Is it possible to map an actionscript class from standard flex API to a java class? If so, how?
    Thanks

    Yeah, there is something awry with your mapped classes.  You don't use the java source files to map your classes, you use AS3
    classes that are designated to which classes they map to on the backend.  Observe..
    package shared.servicevos
       import flash.events.EventDispatcher;
       import flash.events.IEventDispatcher;
       [Bindable]
       [RemoteClass(alias="amf.ShopperVO")]
       public class ShopperVO
           public var shopperId:int;
           public var shopperLocation:String;
           public var shopDate:Date;
           public var shopperAddress:Address
    If you notice the the metadata beginning with "RemoteClass", I am telling Flex "when you see an object that comes in with this type "alias" it is should be made into a ShopperVO".  On the backend, I have a folder with a directory structure of /amf and it contains a ShopperVO.java class.
    P.S This isn't exactly the setup I am working with cause I am using php, but the ideas are the same.

  • Converting MXML Components to ActionScript Classes

    I'm in the process of converting most (if not all) of my MXML
    components to Action Script classes. I've found this is easy, and
    doesn't require a lot of extra code when extending a simple
    container or control. However, several of my MXML components have
    several nested containers and controls - i.e. a component that
    contains several Labels, a ComboBox, a TextInput, a Button, and a
    DataGrid, plus several other containers needed for layout. To code
    the layout of all these containers and controls using MXML, it uses
    about 16 lines of code. To code the layout in ActionScript, it
    takes about 50+ lines of code (see attached).
    I'm just wondering if there are any best practices for
    creating ActionScript classes that include several (or even A LOT
    OF) containers and controls. It's very easy to layout in MXML, and
    is more visibly pleasing to look at and understand, but I feel it
    is best practice to code components as ActionScript classes. I know
    I should be using MVC, but it's a little late to rewrite the entire
    application now.
    Any thoughts?

    I can't specifically speak to how to write layout code in
    ActionScript, but you can look at the generated code that Flex
    creates to get an idea of how Flex does it. When you compile an
    app, the Flex compiler takes your MXML input and converts it to
    ActionScript classes before compiling the entire set of classes
    into a SWF. Because of this, you can look at the interim
    ActionScript code.
    You do this by setting the keep-generated-actionscript
    compiler option to true and looking in the /generated directory.
    hth,
    matt horn
    flex docs

  • My .as class not working in flex project

    I have a .as file that extends Sprite and renders visual elements on the screen
    package actions {
         import flash.display.Sprite;
         public class MyAction extends Sprite {
              public function MyAction () {
    I'm trying to include it as part of a Flex project, to add those shapes to my stage.
    I've created a package called actions under src and saved the .as file there.
    Because it renders visual elements, I thought I could wrap it as a UI component and add that to the stage.So I created a new .as file MyUIComp.as that basically looks like this:
    package actions {
         import actionscript.MyAction; 
         import mx.core.UIComponent;
         public class MyUIComp extends UIComponent {
               private var myAction:MyAction;
              public function MyUIComp() {
                   myAction = new MyAction();
    then in my main mxml, I'm adding it to a UIComponent like this
    <mx:UIComponent      id ="actionLocation" />
    and in the script section, wiring it:
    private function init():void {    
         var actionToStage:MyUIComp = new MyUIComp();
         actionLocation.addChild(actionToStage);
    I don't get any errors, but nothing shows up on the stage either.
    Can someone be kind enought to tell me what I maybe doing wrong. I'm a bit new, so maybe I'm missing something obvious.
    Thanks,
    David
    P.S. Ideally I wouldn't create a wrapper MyUIComp class to make my class extend  UIComponent. I would use the original class like this:
         import flash.display.Sprite;
         import mx.core.UIComponent;
         public class MyAction extends Sprite UIComponent {
    but this double extends doesn't seem to work

    In your custom UIComponent class, your never added your myAction instance. Try this for the MyUIComp constructor:
    public function MyUIComp() {
        myAction = new MyAction();
        this.addChild(myAction);
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • How many users and how often a particular discoverer report is being run?

    Hi there,
    We run discoverer(4i) reports from portal. The question is:
    How to find out the number of users and how often a particular discoverer report is being run?
    Many Thanks in advance.
    Naren

    I know in the 9 versions of discoverer is there is a Discoverer v5 Business Area that is included out of the box. You have to have the stats turned on inside of the pref.txt. But that BA has all of the information to create queries about who, what, parameters, etc. You'll have to check and see if its part of 4i.
    Matt Topper
    Senior Consultant
    TUSC, The Oracle Experts.

Maybe you are looking for

  • Recently wiped HD and reinstalled everything; cannot find my apps in iTunes

    After a terribly unpleasant mishap with my old OS; I was forced to wipe my harddrive and start from scratch. So, I repartitioned my drive, set up a dual-boot system with Ubuntu Linux and XP (XP pretty much purely to use iTunes to manage my iPhone 3G)

  • Flex Photoshop Panel won't read local XML file

    I've created a panel for Photoshop which reads an XML file to populate some controls. When run from Flash Builder 4 through the web browser it works just fine, but when run from within Photoshop the XML file is not being read. Uploading the XML file

  • Ipad Crashes with blue screen and now wont turn on

    After updating the ios 8.2.1 any app I would use, a blue screen would come up covering the whole screen then crash, I would have to restart, and do the whole thing all over again. I then thought to try to reset all settings but as soon as I opened th

  • Cascading LOV and submit page

    Hi, I have a series of LOVS on a page each using the 'Select list with submit' attribute and 'Source Used' set to 'Only when current value in session state is null'. The cascade feature works ok once I branch back to the same page. However when I set

  • Actual assessment cykles - How to transport Tranport?

    Hi there, I have created a couple of cost center assessment cycles (KSU1) in my development system. Is there any possibility in the system to TRANSPORT my new cycles into quality assurance system ( test system ), afterwards follow them to production